Skip to contentSkip to conversation

package/mg: new package

PATCH New Joachim Wiberg 3 participants 5 messages Aug 30, 2020 – Aug 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/mg: new package

Mg is a small Emacs-like editor with no external dependencies except a standard C library. It weighs in at 130 kiB and is one of a select few completely free (public domain) text editors suitable for small and embedded systems.

This version is based on the OpenBSD Mg, but with more features, one of which being the no-ncurses/termcap support, which heavily reduces the impact on a resource constrained system.

Upstream: https://github.com/troglobit/mg/

---
 package/Config.in    |  1 +
 package/mg/Config.in | 18 ++++++++++++++++++
 package/mg/mg.hash   |  5 +++++
 package/mg/mg.mk     | 24 ++++++++++++++++++++++++
 4 files changed, 48 insertions(+)
 create mode 100644 package/mg/Config.in
 create mode 100644 package/mg/mg.hash
 create mode 100644 package/mg/mg.mk
package/Config.in +1 -0
index d7e79f4795..db2563f789 100644
@@ -2431,6 +2431,7 @@ menu "Text editors and viewers"
 	source "package/joe/Config.in"
 	source "package/less/Config.in"
 	source "package/mc/Config.in"
+	source "package/mg/Config.in"
 	source "package/most/Config.in"
 	source "package/nano/Config.in"
 	source "package/uemacs/Config.in"
package/mg/Config.in new file +18 -0
new file mode 100644
index 0000000000..11e5bdb273
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_MG
+	bool "mg"
+	depends on BR2_USE_MMU # fork()
+	help
+	  Emacs-like text editor (130 kiB)
+
+	  Mg is a MicroEMACS clone with the goal of being compatible
+	  with GNU Emacs, because there should never be any reason to
+	  learn more than one Emacs flavor.
+
+	  Unlike many other editors it does not require ncurses, only a
+	  standard C library, making it suitable for really small and
+	  embedded systems.
+
+	  This version is based on mg2a from OpenBSD, with more features
+	  and, in particular, no requirement on ncurses or termcap.
+
+	  https://github.com/troglobit/mg/
package/mg/mg.hash new file +5 -0
new file mode 100644
index 0000000000..6b3c400faa
@@ -0,0 +1,5 @@
+# From https://sourceforge.net/projects/joe-editor/files/JOE%20sources/joe-4.6/
+md5 6b79855d54770bcb23e5457ebde8296c  mg-3.4.tar.gz
+# Locally computed:
+sha256 1a620cf5b2dd4b00006d6c929ac8e2a70eeab5f807a0d6e5334b878aa182b713  mg-3.4.tar.gz
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  UNLICENSE
package/mg/mg.mk new file +24 -0
new file mode 100644
index 0000000000..c8df6eddc6
@@ -0,0 +1,24 @@
+################################################################################
+#
+# mg2a
+#
+################################################################################
+
+MG_VERSION = 3.4
+MG_SITE = https://github.com/troglobit/mg/releases/download/v$(MG_VERSION)
+MG_LICENSE = Public Domain
+MG_LICENSE_FILES = UNLICENSE
+
+ifeq ($(BR2_PACKAGE_NCURSES),y)
+MG_DEPENDENCIES += ncurses
+else
+MG_CONF_OPTS += --without-curses
+endif
+
+define MG_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/tutorial $(TARGET_DIR)/usr/share/doc/tutorial
+	gzip -9 $(TARGET_DIR)/usr/share/doc/tutorial
+	$(INSTALL) -m 0755 -D $(@D)/src/mg $(TARGET_DIR)/usr/bin/mg
+endef
+
+$(eval $(autotools-package))
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 package/mg: new package

Hello Joachim,

thanks for your contribution.
Please find a few comments below.

Le dim. 30 ao?t 2020 ? 11:01, Joachim Wiberg <[email protected]> a ?crit :

Quoted 13 lines

Mg is a small Emacs-like editor with no external dependencies except a standard C library. It weighs in at 130 kiB and is one of a select few completely free (public domain) text editors suitable for small and embedded systems.

This version is based on the OpenBSD Mg, but with more features, one of which being the no-ncurses/termcap support, which heavily reduces the impact on a resource constrained system.

Upstream: https://github.com/troglobit/mg/

Quoted 10 lines
---
 package/Config.in    |  1 +
 package/mg/Config.in | 18 ++++++++++++++++++
 package/mg/mg.hash   |  5 +++++
 package/mg/mg.mk     | 24 ++++++++++++++++++++++++
 4 files changed, 48 insertions(+)
 create mode 100644 package/mg/Config.in
 create mode 100644 package/mg/mg.hash
 create mode 100644 package/mg/mg.mk

You need to add an entry to the DEVELOPERS file with your name and package, so that you are identified as the maintainer for this package. Please take a look at the DEVELOPERS file.

Quoted 42 lines
package/Config.in +1 -0
index d7e79f4795..db2563f789 100644
@@ -2431,6 +2431,7 @@ menu "Text editors and viewers"
        source "package/joe/Config.in"
        source "package/less/Config.in"
        source "package/mc/Config.in"
+       source "package/mg/Config.in"
        source "package/most/Config.in"
        source "package/nano/Config.in"
        source "package/uemacs/Config.in"
package/mg/Config.in new file +18 -0
new file mode 100644
index 0000000000..11e5bdb273
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_MG
+       bool "mg"
+       depends on BR2_USE_MMU # fork()
+       help
+         Emacs-like text editor (130 kiB)
+
+         Mg is a MicroEMACS clone with the goal of being compatible
+         with GNU Emacs, because there should never be any reason to
+         learn more than one Emacs flavor.
+
+         Unlike many other editors it does not require ncurses, only a
+         standard C library, making it suitable for really small and
+         embedded systems.
+
+         This version is based on mg2a from OpenBSD, with more features
+         and, in particular, no requirement on ncurses or termcap.
+
+         https://github.com/troglobit/mg/
package/mg/mg.hash new file +0 -0
new file mode 100644
index 0000000000..6b3c400faa

package/mg/mg.hash line 1

Quoted 1 line
package/mg/mg.hash new file +1 -0
@@ -0,0 +1,5 @@
+# From https://sourceforge.net/projects/joe-editor/files/JOE%20sources/joe-4.6/

I assume you meant: "from:
https://github.com/troglobit/mg/releases/download/v3.4/mg-3.4.tar.gz.md5"

package/mg/mg.hash line 2

Quoted 1 line
package/mg/mg.hash new file +1 -0
+md5 6b79855d54770bcb23e5457ebde8296c  mg-3.4.tar.gz

It should be two spaces after "md5"

package/mg/mg.hash line 5

Quoted 3 lines
package/mg/mg.hash new file +3 -0
+# Locally computed:
+sha256 1a620cf5b2dd4b00006d6c929ac8e2a70eeab5f807a0d6e5334b878aa182b713  mg-3.4.tar.gz
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  UNLICENSE

For the two lines above, it should be two spaces after "sha256"

Quoted 9 lines
package/mg/mg.mk new file +3 -0
new file mode 100644
index 0000000000..c8df6eddc6
@@ -0,0 +1,24 @@
+################################################################################
+#
+# mg2a

package/mg/mg.mk line 13

Quoted 10 lines
package/mg/mg.mk new file +10 -0
+#
+################################################################################
+
+MG_VERSION = 3.4
+MG_SITE = https://github.com/troglobit/mg/releases/download/v$(MG_VERSION)
+MG_LICENSE = Public Domain
+MG_LICENSE_FILES = UNLICENSE
+
+ifeq ($(BR2_PACKAGE_NCURSES),y)
+MG_DEPENDENCIES += ncurses

We prefer to force the options, so you should have a "MG_CONF_OPTS = --with-curses" here

package/mg/mg.mk line 20

Quoted 7 lines
package/mg/mg.mk new file +7 -0
+else
+MG_CONF_OPTS += --without-curses
+endif
+
+define MG_INSTALL_TARGET_CMDS
+       $(INSTALL) -m 0755 -D $(@D)/tutorial $(TARGET_DIR)/usr/share/doc/tutorial
+       gzip -9 $(TARGET_DIR)/usr/share/doc/tutorial

We prefer not to install documentation on the target to keep the footprint small. Can you please remove the two lines above?

Quoted 11 lines
package/mg/mg.mk new file +4 -1
+       $(INSTALL) -m 0755 -D $(@D)/src/mg $(TARGET_DIR)/usr/bin/mg
+endef
+
+$(eval $(autotools-package))
--

2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

One last comment: did you run the the test-pkg script to check for any potential issues with some architectures and build options?

Can you please send a v2 with the fixes proposed above?

thanks
Gilles.

#2 lore raw

PATCH 1/1 package/mg: new package

Quoted 1 line · Gilles Talis

Hello Joachim,

Hi Gilles!

Quoted 2 lines

thanks for your contribution.
Please find a few comments below.

Thank you for taking the time to review :)

Quoted 4 lines

Le dim. 30 ao?t 2020 ? 11:01, Joachim Wiberg <[email protected]> a You need to add an entry to the DEVELOPERS file with your name and package, so that you are identified as the maintainer for this package. Please take a look at the DEVELOPERS file.

Didn't know that was mandatory, fixing

Quoted 3 lines
Quoted 1 line

+# From https://sourceforge.net/projects/joe-editor/files/JOE%20sources/joe-4.6/

I assume you meant: "from:
https://github.com/troglobit/mg/releases/download/v3.4/mg-3.4.tar.gz.md5"

Yeah, copy-paste error. I actually managed to b0rk that whole file, sorry about that.

Quoted 6 lines
Quoted 1 line

+md5 6b79855d54770bcb23e5457ebde8296c mg-3.4.tar.gz

It should be two spaces after "md5"

package/mg/mg.hash line 5

Quoted 3 lines
package/mg/mg.hash new file +3 -0
+# Locally computed:
+sha256 1a620cf5b2dd4b00006d6c929ac8e2a70eeab5f807a0d6e5334b878aa182b713  mg-3.4.tar.gz
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  UNLICENSE

For the two lines above, it should be two spaces after "sha256"

You mean after the hash, right? The joe.hash and busybox.hash files don't have double spaces after the leading keyword (md5/sha256).

Quoted 4 lines

package/mg/mg.mk line 13

Quoted 2 lines
package/mg/mg.mk new file +2 -0
+ifeq ($(BR2_PACKAGE_NCURSES),y)
+MG_DEPENDENCIES += ncurses

We prefer to force the options, so you should have a "MG_CONF_OPTS = --with-curses" here

Odd, but OK, fixing

Quoted 5 lines

package/mg/mg.mk line 20

Quoted 3 lines
package/mg/mg.mk new file +3 -0
+define MG_INSTALL_TARGET_CMDS
+       $(INSTALL) -m 0755 -D $(@D)/tutorial $(TARGET_DIR)/usr/share/doc/tutorial
+       gzip -9 $(TARGET_DIR)/usr/share/doc/tutorial

We prefer not to install documentation on the target to keep the footprint small. Can you please remove the two lines above?

I realized the whole usr/share/doc directory is pruned from the target dir anyway. The intention was to keep the built-in C-h t tutorial, but I guess the *quick* help will have to do.

Thanks, fixing

Quoted 2 lines

One last comment: did you run the the test-pkg script to check for any potential issues with some architectures and build options?

Did not know about that, will try it out, thanks! :)

Quoted 1 line

Can you please send a v2 with the fixes proposed above?

Will do!

Best regards
/Joachim

#3 lore raw

PATCH 1/1 package/mg: new package

In reply to Joachim Wiberg

Hello,

Thanks for your contribution!

package/mg/mg.hash line 1

Quoted 7 lines · On Sun, 30 Aug 2020 11:00:51 +0200 Joachim Wiberg <[email protected]> wrote:
package/mg/mg.hash new file +1 -0
new file mode 100644
index 0000000000..6b3c400faa
@@ -0,0 +1,5 @@
+# From https://sourceforge.net/projects/joe-editor/files/JOE%20sources/joe-4.6/

Is this a bad copy paste ?

package/mg/mg.mk line 3

Quoted 9 lines
package/mg/mg.mk new file +3 -0
new file mode 100644
index 0000000000..c8df6eddc6
@@ -0,0 +1,24 @@
+################################################################################
+#
+# mg2a

Should be just "mg"

package/mg/mg.mk line 13

Quoted 10 lines
package/mg/mg.mk new file +10 -0
+#
+################################################################################
+
+MG_VERSION = 3.4
+MG_SITE = https://github.com/troglobit/mg/releases/download/v$(MG_VERSION)
+MG_LICENSE = Public Domain
+MG_LICENSE_FILES = UNLICENSE
+
+ifeq ($(BR2_PACKAGE_NCURSES),y)
+MG_DEPENDENCIES += ncurses

Could you add:

MG_CONF_OPTS += --with-curses

or whatever is needed to explicitly enable ncurses support ?

package/mg/mg.mk line 20

Quoted 7 lines
package/mg/mg.mk new file +7 -0
+else
+MG_CONF_OPTS += --without-curses
+endif
+
+define MG_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/tutorial $(TARGET_DIR)/usr/share/doc/tutorial
+	gzip -9 $(TARGET_DIR)/usr/share/doc/tutorial

/usr/share/doc gets dropped from $(TARGET_DIR) during the target-finalize step, so installing documentation there is not useful.

package/mg/mg.mk line 24

Quoted 4 lines
package/mg/mg.mk new file +4 -0
+	$(INSTALL) -m 0755 -D $(@D)/src/mg $(TARGET_DIR)/usr/bin/mg
+endef
+
+$(eval $(autotools-package))

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/1 package/mg: new package

Quoted 1 line · Thomas Petazzoni

Thanks for your contribution!

Thanks, and thank you for the review!

Quoted 3 lines · On Sun, 30 Aug 2020 11:00:51 +0200 Joachim Wiberg <[email protected]> wrote:
Quoted 1 line

+# From https://sourceforge.net/projects/joe-editor/files/JOE%20sources/joe-4.6/

Is this a bad copy paste ?

Indeed.

Quoted 2 lines
Quoted 1 line

+# mg2a

Should be just "mg"

OK, fixing

Quoted 5 lines

package/mg/mg.mk line 13

Quoted 2 lines
package/mg/mg.mk new file +2 -0
+ifeq ($(BR2_PACKAGE_NCURSES),y)
+MG_DEPENDENCIES += ncurses

Could you add:
MG_CONF_OPTS += --with-curses
or whatever is needed to explicitly enable ncurses support ?

It's auto-detected, but will do.

Quoted 5 lines

package/mg/mg.mk line 20

Quoted 3 lines
package/mg/mg.mk new file +3 -0
+define MG_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/tutorial $(TARGET_DIR)/usr/share/doc/tutorial
+	gzip -9 $(TARGET_DIR)/usr/share/doc/tutorial

/usr/share/doc gets dropped from $(TARGET_DIR) during the target-finalize step, so installing documentation there is not useful.

Yeah I realized. It's actually referenced from withing Mg using C-h t, should that be patched out then?

Best regards
/Joachim