Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/e3: new package
@ 2022-02-13 13:03 Bernd Kuhls
  2022-07-27  9:51 ` Thomas Petazzoni via buildroot
       [not found] ` <20220727115113.0d06fb96__9944.83321426145$1658915496$gmane$org@windsurf>
  0 siblings, 2 replies; 5+ messages in thread
From: Bernd Kuhls @ 2022-02-13 13:03 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
Build was successful:

[...]
                    bootlin-x86-64-glibc [24/45]: OK
                     bootlin-x86-64-musl [25/45]: OK
                   bootlin-x86-64-uclibc [26/45]: OK
[...]
                   br-i386-pentium4-full [31/45]: OK
                br-i386-pentium-mmx-musl [32/45]: OK
[...]

45 builds, 40 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed

 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 package/e3/0001-makefile.patch                | 42 +++++++++++++++
 .../e3/0002-Align-header-to-avoid-crash.patch | 26 +++++++++
 package/e3/0003-format-1.0.patch              | 54 +++++++++++++++++++
 package/e3/0004-e3-gnu-stack.patch            | 50 +++++++++++++++++
 package/e3/Config.in                          |  9 ++++
 package/e3/e3.hash                            |  3 ++
 package/e3/e3.mk                              | 24 +++++++++
 9 files changed, 210 insertions(+)
 create mode 100644 package/e3/0001-makefile.patch
 create mode 100644 package/e3/0002-Align-header-to-avoid-crash.patch
 create mode 100644 package/e3/0003-format-1.0.patch
 create mode 100644 package/e3/0004-e3-gnu-stack.patch
 create mode 100644 package/e3/Config.in
 create mode 100644 package/e3/e3.hash
 create mode 100644 package/e3/e3.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 7b5f4d992c..f8aab505ed 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -326,6 +326,7 @@ F:	package/dht/
 F:	package/dovecot/
 F:	package/dovecot-pigeonhole/
 F:	package/dtv-scan-tables/
+F:	package/e3/
 F:	package/eudev/
 F:	package/exim/
 F:	package/fetchmail/
diff --git a/package/Config.in b/package/Config.in
index c004228759..f47f003a00 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2612,6 +2612,7 @@ endmenu
 
 menu "Text editors and viewers"
 	source "package/bat/Config.in"
+	source "package/e3/Config.in"
 	source "package/ed/Config.in"
 	source "package/joe/Config.in"
 	source "package/less/Config.in"
diff --git a/package/e3/0001-makefile.patch b/package/e3/0001-makefile.patch
new file mode 100644
index 0000000000..62b2b3a94b
--- /dev/null
+++ b/package/e3/0001-makefile.patch
@@ -0,0 +1,42 @@
+Add build fixes from Gentoo
+
+Downloaded from
+https://gitweb.gentoo.org/repo/gentoo.git/tree/app-editors/e3/files/e3-2.8.2-makefile.patch
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+--- e3-2.82-orig/Makefile
++++ e3-2.82/Makefile
+@@ -17,6 +17,8 @@
+ NASM_OR_YASM=nasm
+ #NASM_OR_YASM=yasm
+ 
++LD=ld
++
+ EXMODE=SED
+ 
+ #----------------------do not edit below line-------------------------------
+@@ -41,12 +43,12 @@
+ 
+ 32:	$(ASOURCES) Makefile
+ ifeq	($(OS),LINUX)
+-	nasm -O2 -f bin -l e3.lst -o e3 e3.asm -DCRIPLED_ELF=1 -D$(OS) -D$(EXMODE) 
++	nasm -O2 -f bin -l e3.lst -o e3 e3.asm -DCRIPLED_ELF=1 -D$(OS)
+ 	chmod +x e3
+ else
+ 	echo $(ASVER)
+-	nasm -O2 $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS) -D$(EXMODE)
+-	ld -s -o e3 e3.o
++	nasm -O2 $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS)
++	$(LD) -s -o e3 e3.o
+ 	strip --remove-section .comment e3
+ endif
+ 	ln -sf e3 e3ws
+@@ -60,7 +62,7 @@
+ 64:	$(ASOURCES) Makefile
+ 	cat e3.asm | sed -f e3_32to64.sed  >e3.tmp
+ 	$(ASSEMBLER64)
+-	ld -b elf64-x86-64 --oformat elf64-x86-64 -o e3 e3.o
++	$(LD) -o e3 e3.o
+ ifneq	($(DEBUG),true)
+ 	strip e3
+ endif
diff --git a/package/e3/0002-Align-header-to-avoid-crash.patch b/package/e3/0002-Align-header-to-avoid-crash.patch
new file mode 100644
index 0000000000..f24f180b0c
--- /dev/null
+++ b/package/e3/0002-Align-header-to-avoid-crash.patch
@@ -0,0 +1,26 @@
+From: =?utf-8?q?Bernhard_=C3=9Cbelacker?= <bernhardu@mailbox.org>
+Date: Tue, 6 Nov 2018 18:52:41 +0100
+Subject: [PATCH] Align header to avoid crash.
+
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913014
+
+Downloaded from
+https://sources.debian.org/src/e3/1%3A2.82%2Bdfsg-2/debian/patches/0001-Align-header-to-avoid-crash.patch/
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ e3.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/e3.h b/e3.h
+index 96f8dc7..6508e9b 100644
+--- a/e3.h
++++ b/e3.h
+@@ -861,6 +861,7 @@ phdr2:					;another Elf32_Phdr starts here
+ %else
+ 	org 0x8048000
+ 	ELFheader
++	times 0xBF2 db 0
+ %endif
+ %else
+ 	;nothing
diff --git a/package/e3/0003-format-1.0.patch b/package/e3/0003-format-1.0.patch
new file mode 100644
index 0000000000..c7ace235c4
--- /dev/null
+++ b/package/e3/0003-format-1.0.patch
@@ -0,0 +1,54 @@
+From: Debian QA Group <packages@qa.debian.org>
+Date: Sun, 12 May 2019 04:36:49 +0000
+Subject: format-1.0
+
+Downloaded from
+https://sources.debian.org/src/e3/1%3A2.82%2Bdfsg-2/debian/patches/format-1.0.patch/
+
+and removed Makefile patch.
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+ e3.asm   | 26 ++++++++++++++++++++++++++
+ 2 files changed, 40 insertions(+), 12 deletions(-)
+---
+ e3.asm   | 26 ++++++++++++++++++++++++++
+ 2 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/e3.asm b/e3.asm
+index b0a17ca..7d99f17 100644
+--- a/e3.asm
++++ b/e3.asm
+@@ -3653,6 +3653,32 @@ NoPi:	cmp ecx,'e3vi'
+ 	mov byte [eax],VI
+ 	ret
+ NoVi:	cmp ecx,'e3ws'
++	jnz NoWs
++	mov byte [eax],WS
++	ret
++NoWs:	cmp ecx,'edit'
++	jnz NoNe2
++	mov byte [eax],NE
++	ret
++NoNe2:	cmp ecx,'macs'
++	jnz NoEm2
++	mov byte [eax],EM
++	ret
++NoEm2:	cmp ecx,'pico'
++	jnz NoPi2
++	mov byte [eax],PI
++	ret
++NoPi2:  push cx
++	mov cx,'__'
++	cmp ecx,'__vi'
++	pop cx
++	jnz NoVi2
++	mov byte [eax],VI
++	ret
++NoVi2:	push cx
++	mov cx,'__'
++	cmp ecx,'__ws'
++	pop cx
+ 	jnz modeOK
+ 	mov byte [eax],WS
+ modeOK:	ret
diff --git a/package/e3/0004-e3-gnu-stack.patch b/package/e3/0004-e3-gnu-stack.patch
new file mode 100644
index 0000000000..81eb6b14bb
--- /dev/null
+++ b/package/e3/0004-e3-gnu-stack.patch
@@ -0,0 +1,50 @@
+Fix GNU stack
+
+Quoted from https://src.fedoraproject.org/rpms/e3/blob/f30/f/e3.spec
+
+# mark the stack as non-executable and disable tiny/crippled elf on 32
+# bit linux so that stack can be marked as non-executable on it too
+
+Downloaded from
+https://src.fedoraproject.org/rpms/e3/blob/f30/f/e3-gnu-stack.patch
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+Common subdirectories: e3-2.8.orig/bin and e3-2.8/bin
+diff -u e3-2.8.orig/e3.asm e3-2.8/e3.asm
+--- e3-2.8.orig/e3.asm	2010-05-09 12:16:47.000000000 -0400
++++ e3-2.8/e3.asm	2013-02-22 14:24:46.884384131 -0500
+@@ -6553,3 +6553,13 @@
+ %ifdef CRIPLED_ELF
+  bsssize equ $-bssstart
+ %endif
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf32
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++%ifidn __OUTPUT_FORMAT__,elf64
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
+Only in e3-2.8: e3.asm~
+diff -u e3-2.8.orig/Makefile e3-2.8/Makefile
+--- e3-2.8.orig/Makefile	2010-05-27 14:58:59.000000000 -0400
++++ e3-2.8/Makefile	2013-02-22 15:38:57.729605772 -0500
+@@ -42,15 +42,10 @@
+ #---------------- 32 bit LINUX (and perhaps BSD) --
+ 
+ 32:	$(ASOURCES) Makefile
+-ifeq	($(OS),LINUX)
+-	nasm -O2 -f bin -l e3.lst -o e3 e3.asm -DCRIPLED_ELF=1 -D$(OS)
+-	chmod +x e3
+-else
+ 	echo $(ASVER)
+ 	nasm -O2 $(AFLAGS) -o e3.o e3.asm -l e3.lst -D$(OS)
+ 	$(LD) -s -o e3 e3.o
+ 	strip --remove-section .comment e3
+-endif
+ 	ln -sf e3 e3ws
+ 	ln -sf e3 e3em
+ 	ln -sf e3 e3pi
diff --git a/package/e3/Config.in b/package/e3/Config.in
new file mode 100644
index 0000000000..2854ea8ed7
--- /dev/null
+++ b/package/e3/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_E3
+	bool "e3"
+	depends on BR2_i386 || BR2_x86_64
+	help
+	  e3 is a full-screen, user-friendly text editor with an
+	  interface similar to that of either WordStar, Emacs, Pico,
+	  Nedit, or vi written in NASM assembler.
+
+	  https://sites.google.com/site/e3editor
diff --git a/package/e3/e3.hash b/package/e3/e3.hash
new file mode 100644
index 0000000000..5fc794f206
--- /dev/null
+++ b/package/e3/e3.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  53c51d656801fd3ae0179a5b27f028e07eaba328e80c8c55050268359b9a2924  e3-2.82.tgz
+sha256  cc2a6651c315b233ebc110b49ea3c6452eff9a28f8bc051ffd2bb92a8dcfa3d2  COPYING.GPL
diff --git a/package/e3/e3.mk b/package/e3/e3.mk
new file mode 100644
index 0000000000..63c97078ff
--- /dev/null
+++ b/package/e3/e3.mk
@@ -0,0 +1,24 @@
+################################################################################
+#
+# e3
+#
+################################################################################
+
+E3_VERSION = 2.82
+E3_SITE = https://gentoo.osuosl.org/distfiles
+E3_SOURCE = e3-$(E3_VERSION).tgz
+E3_LICENSE = GPL-2.0+
+E3_LICENSE_FILES = COPYING.GPL
+E3_DEPENDENCIES = host-nasm
+
+define E3_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+		$(if $(BR2_ARCH_IS_64),64,32)
+endef
+
+define E3_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+		PREFIX="$(TARGET_DIR)/usr" install
+endef
+
+$(eval $(generic-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-27 12:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-13 13:03 [Buildroot] [PATCH 1/1] package/e3: new package Bernd Kuhls
2022-07-27  9:51 ` Thomas Petazzoni via buildroot
     [not found] ` <20220727115113.0d06fb96__9944.83321426145$1658915496$gmane$org@windsurf>
2022-07-27 10:16   ` Bernd Kuhls
2022-07-27 10:24     ` Arnout Vandecappelle
2022-07-27 12:31       ` Bernd Kuhls

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox