diff mbox series

[1/1] package/e3: new package

Message ID 20220213130306.3002130-1-bernd.kuhls@t-online.de
State Rejected
Headers show
Series [1/1] package/e3: new package | expand

Commit Message

Bernd Kuhls Feb. 13, 2022, 1:03 p.m. UTC
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

Comments

Thomas Petazzoni July 27, 2022, 9:51 a.m. UTC | #1
Hello Bernd,

On Sun, 13 Feb 2022 14:03:06 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

>  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(+)

Do you really need/use this package? We already have several text
editors packaged, and this one is written in assembly, only usable on
i386/x86-64, requires patches from Gentoo, Fedora and Debian to build,
some of them being many years old, showing a project that is poorly
maintained.

This doesn't seem like a very useful addition to Buildroot to be
honest. Do you have some convincing arguments? :-)

Thanks!

Thomas
Bernd Kuhls July 27, 2022, 10:16 a.m. UTC | #2
Am Wed, 27 Jul 2022 11:51:13 +0200 schrieb Thomas Petazzoni via buildroot:

> This doesn't seem like a very useful addition to Buildroot to be honest.
> Do you have some convincing arguments? :-)

Hi Thomas,

the filesize should be unbeatable small:

# ls -la /usr/bin/e3
-r-xr-xr-x    1 root     root         16880 Jul 17 20:02 /usr/bin/e3

Hm, regarding platforms I found https://docs.huihoo.com/embedded-linux/
embedded-Linux-system-development-training-slides/text113.html which 
states it should also work on arm, so I will have a look at it.

Gentoo also provides it for riscv: https://packages.gentoo.org/packages/
app-editors/e3

Gentoo's description might also be convincing for you:
"It's heavily optimized for size and independent of libc or any other 
libraries, making it useful for mini-Linux distributions and rescue 
disks."

Regards, Bernd
Arnout Vandecappelle July 27, 2022, 10:24 a.m. UTC | #3
On 27/07/2022 12:16, Bernd Kuhls wrote:
> Am Wed, 27 Jul 2022 11:51:13 +0200 schrieb Thomas Petazzoni via buildroot:
> 
>> This doesn't seem like a very useful addition to Buildroot to be honest.
>> Do you have some convincing arguments? :-)

  The main concern really is that it requires lots of patches, some of which are 
very old. This suggests that it will have serious maintenance overhead.

> 
> Hi Thomas,
> 
> the filesize should be unbeatable small:
> 
> # ls -la /usr/bin/e3
> -r-xr-xr-x    1 root     root         16880 Jul 17 20:02 /usr/bin/e3
> 
> Hm, regarding platforms I found https://docs.huihoo.com/embedded-linux/
> embedded-Linux-system-development-training-slides/text113.html which
> states it should also work on arm, so I will have a look at it.
> 
> Gentoo also provides it for riscv: https://packages.gentoo.org/packages/
> app-editors/e3
> 
> Gentoo's description might also be convincing for you:
> "It's heavily optimized for size and independent of libc or any other

  Exactly. This means that there is really no need to build it, you can just use 
the gentoo binary directly.

> libraries, making it useful for mini-Linux distributions and rescue
> disks."

  You're still going to need busybox to have a working system, and busybox vi 
implementation adds way less than 16K to the size. So this argument doesn't 
really fly.

  Regards,
  Arnout


> 
> Regards, Bernd
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Bernd Kuhls July 27, 2022, 12:31 p.m. UTC | #4
Hi Arnout,

Am Wed, 27 Jul 2022 12:24:19 +0200 schrieb Arnout Vandecappelle:

> On 27/07/2022 12:16, Bernd Kuhls wrote:
>> Am Wed, 27 Jul 2022 11:51:13 +0200 schrieb Thomas Petazzoni via
>> buildroot:
>> 
>>> This doesn't seem like a very useful addition to Buildroot to be
>>> honest.
>>> Do you have some convincing arguments? :-)
> 
>   The main concern really is that it requires lots of patches, some of
>   which are
> very old. This suggests that it will have serious maintenance overhead.

ok, I marked the patch as rejected.

>   You're still going to need busybox to have a working system, and
>   busybox vi
> implementation adds way less than 16K to the size. So this argument
> doesn't really fly.

This depends on how familiar you are with the vi syntax ;)

Regards, Bernd
diff mbox series

Patch

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))