Skip to contentSkip to conversation

package/libtextstyle: new package

PATCH New aduskett at gmail.com 2 participants 6 messages Apr 21, 2020 – Apr 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/3 package/libtextstyle: new package

From: Adam Duskett <[email protected]>

This library provides an easy way to add styling to programs that produce output to a console or terminal emulator window.

libtextstyle is for you if your application produces text that is more readable when it is accompanied with styling information, such as color, font attributes (weight, posture), or underlining.

Our gettext-gnu package currently has HOST_GETTEXT_GNU_SUBDIR = gettext-tools so we only configure and build the gettext-tools sub-directory. Version 0.20.1 of gettext-gnu now requires libtextstyle, which the subdirectory gettext-tools does not provide.

We have three options:

1) Add hooks to configure and build libtextstyle as a pre-configure hook in gettext-gnu, and install it in a pre-install hook.

2) Revert to building the whole of gettext.

3) Add a separate package for libtextstyle.

Here are the results of a test with BR2_JLEVEL=4:

- Only gettext-tools:      38.86s user 22.13s system 124% CPU 49.035 total
- gettext + libtextstyle:  40.78s user 14.57s system 146% CPU 37.817 total
- All of gettext:          203.18s user 122.87s system 161% CPU 3:22.39 total

As seen above, compiling the entire gettext package takes 5x longer than building libtextstyle and gettext separately!

As such, the best option is option 3, as the time increase to build libtextstyle is negligible.

Tested with test-pkg -p gettext-tiny in Debian 10 and Centos 7

            br-arm-full [1/6]: OK
 br-arm-cortex-a9-glibc [2/6]: OK
  br-arm-cortex-m4-full [3/6]: OK
         br-x86-64-musl [4/6]: OK
     br-arm-full-static [5/6]: OK
           sourcery-arm [6/6]: OK

---
Changes v2 -> v3:
- Add a much more comprehensive change log (Yann)

Changes v3 -> v4:
- Remove the target variant (Thomas)

 DEVELOPERS                             |  1 +
 package/libtextstyle/libtextstyle.hash |  6 ++++++
 package/libtextstyle/libtextstyle.mk   | 21 +++++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/libtextstyle/libtextstyle.hash
 create mode 100644 package/libtextstyle/libtextstyle.mk
DEVELOPERS +1 -0
index c57bc1c5c9..03ea2d39f2 100644
@@ -48,6 +48,7 @@ F:	package/libressl/
 F:	package/libselinux/
 F:	package/libsemanage/
 F:	package/libsepol/
+F:	package/libtextstyle/
 F:	package/libwebsockets/
 F:	package/mender-grubenv/
 F:	package/nginx-naxsi/
package/libtextstyle/libtextstyle.hash new file +6 -0
new file mode 100644
index 0000000000..5c5aee85bf
@@ -0,0 +1,6 @@
+# From https://lists.gnu.org/archive/html/info-gnu/2019-05/msg00011.html
+sha1  62f4a6a2fd5f80bfd0e66c497a04094fa3e07b90  gettext-0.20.1.tar.xz
+
+# Locally calculated
+sha256  53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800  gettext-0.20.1.tar.xz
+sha256  e79e9c8a0c85d735ff98185918ec94ed7d175efc377012787aebcf3b80f0d90b  COPYING
package/libtextstyle/libtextstyle.mk new file +21 -0
new file mode 100644
index 0000000000..aeefc28e9b
@@ -0,0 +1,21 @@
+################################################################################
+#
+# libtextstyle
+#
+################################################################################
+
+LIBTEXTSTYLE_VERSION = 0.20.1
+LIBTEXTSTYLE_SITE = $(BR2_GNU_MIRROR)/gettext
+LIBTEXTSTYLE_SOURCE = gettext-$(LIBTEXTSTYLE_VERSION).tar.xz
+LIBTEXTSTYLE_INSTALL_STAGING = YES
+LIBTEXTSTYLE_LICENSE = GPL-3.0+
+LIBTEXTSTYLE_LICENSE_FILES = COPYING
+HOST_LIBTEXTSTYLE_SUBDIR = libtextstyle
+
+# gettext-tools require libtextstyle.m4
+define HOST_LIBTEXTSTYLE_INSTALL_M4
+	$(INSTALL) -D -m 0755 $(@D)/libtextstyle/m4/libtextstyle.m4 $(ACLOCAL_HOST_DIR)/libtextstyle.m4
+endef
+HOST_LIBTEXTSTYLE_POST_INSTALL_HOOKS += HOST_LIBTEXTSTYLE_INSTALL_M4
+
+$(eval $(host-autotools-package))
Signature · 1 line
2.25.3
#1 lore raw

PATCH v4 2/3 package/gettext-gnu: bump version to 0.20.1

From: Adam Duskett <[email protected]>

Other changes:
- Update license hash due to http -> https URL changes.
- Depend on host-libtextstyle for host-gettext-gnu.
- Update 0001-error_print_progname.patch to apply cleanly.
- Remove upstream 0002-Update-after-gnulib-changed.patch
- Add 0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch which allows gettext-tools to build with an external libtextstyle.

Tested under Debian 8 with test-pkg -a:
44 builds, 5 skipped, 0 build failed, 0 legal-info failed

---
Changes v2 -> v3:
- Fix comment above GETTEXT_GNU_AUTORECONF = YES (Bernd)

Changes v3 -> v4:
- Removed the dependency on libtextstyle for the target. (Thomas)

 .../0001-error_print_progname.patch           |  14 +-
 .../0002-Update-after-gnulib-changed.patch    |  86 -----------
 ...-buld-gettext-tools-seperately-part1.patch | 142 ++++++++++++++++++
 package/gettext-gnu/Config.in                 |   1 +
 package/gettext-gnu/gettext-gnu.hash          |  11 +-
 package/gettext-gnu/gettext-gnu.mk            |   9 +-
 6 files changed, 164 insertions(+), 99 deletions(-)
 delete mode 100644 package/gettext-gnu/0002-Update-after-gnulib-changed.patch
 create mode 100644 package/gettext-gnu/0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch
package/gettext-gnu/0001-error_print_progname.patch +10 -4
index 189d28b576..7e1d3c55cf 100644
@@ -1,6 +1,11 @@
---- gettext-0.16.1.oorig/gettext-tools/gnulib-lib/error.h	2006-11-27 18:14:50.000000000 +0100
-+++ gettext-0.16.1/gettext-tools/gnulib-lib/error.h	2007-06-20 13:29:32.000000000 +0200
-@@ -50,7 +50,10 @@ extern void error_at_line (int __status,
+[Updated to apply cleanly with 0.20.1]
+Signed-off-by: Adam Duskett <[email protected]>
+---
+diff --git a/gettext-tools/gnulib-lib/error.h b/gettext-tools/gnulib-lib/error.h
+index 61771cc..4221684 100644
+--- a/gettext-tools/gnulib-lib/error.h
++++ b/gettext-tools/gnulib-lib/error.h
+@@ -68,7 +68,10 @@ extern void error_at_line (int __status, int __errnum, const char *__fname,
  /* If NULL, error will flush stdout, then print on stderr the program
     name, a colon and a space.  Otherwise, error will call this
     function without parameters instead.  */
@@ -10,5 +15,6 @@
 +#endif
 +void (*error_print_progname) (void);
  
- /* This variable is incremented each time `error' is called.  */
+ /* This variable is incremented each time 'error' is called.  */
  extern DLL_VARIABLE unsigned int error_message_count;
+--
package/gettext-gnu/0002-Update-after-gnulib-changed.patch deleted +0 -86

86 lines not on this page · raw message

package/gettext-gnu/0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch new file +142 -0

142 lines not on this page · raw message

package/gettext-gnu/Config.in +1 -0
index 27e7a3da4c..85ddb62788 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_GETTEXT_GNU
 	bool
 	depends on BR2_USE_WCHAR
 	select BR2_PACKAGE_HAS_GETTEXT
+	select BR2_PACKAGE_LIBTEXTSTYLE
 	help
 	  The GNU `gettext' utilities are a set of tools that provide a
 	  framework to help other GNU packages produce multi-lingual
package/gettext-gnu/gettext-gnu.hash +6 -5
index 5a621ae2d3..4c17fb3e04 100644
@@ -1,6 +1,7 @@
-# From http://lists.gnu.org/archive/html/bug-gettext/2016-06/msg00008.html
-md5	df3f5690eaa30fd228537b00cb7b7590	gettext-0.19.8.1.tar.xz
-sha1	e0fe90ede22f7f16bbde7bdea791a835f2773fc9	gettext-0.19.8.1.tar.xz
-# License files, locally calculated
-sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
+# From https://lists.gnu.org/archive/html/info-gnu/2019-05/msg00011.html
+sha1  62f4a6a2fd5f80bfd0e66c497a04094fa3e07b90  gettext-0.20.1.tar.xz
+
+# Locally calculated
+sha256  53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800  gettext-0.20.1.tar.xz
+sha256  e79e9c8a0c85d735ff98185918ec94ed7d175efc377012787aebcf3b80f0d90b  COPYING
 sha256  3fe5361f24b7c49ba12911c08f5a33f9cb18871d95d9fb881f5b8a4793e04288  gettext-runtime/intl/COPYING.LIB
package/gettext-gnu/gettext-gnu.mk +5 -4
index 28662e0dec..3759edb9f0 100644
@@ -4,19 +4,19 @@
 #
 ################################################################################
 
-GETTEXT_GNU_VERSION = 0.19.8.1
+GETTEXT_GNU_VERSION = 0.20.1
 GETTEXT_GNU_SITE = $(BR2_GNU_MIRROR)/gettext
 GETTEXT_GNU_SOURCE = gettext-$(GETTEXT_GNU_VERSION).tar.xz
 GETTEXT_GNU_INSTALL_STAGING = YES
 GETTEXT_GNU_LICENSE = LGPL-2.1+ (libintl), GPL-3.0+ (the rest)
 GETTEXT_GNU_LICENSE_FILES = COPYING gettext-runtime/intl/COPYING.LIB
-# 0002-Update-after-gnulib-changed.patch
+# 0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch
 GETTEXT_GNU_AUTORECONF = YES
 GETTEXT_GNU_PROVIDES = gettext
 GETTEXT_GNU_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
 
 # Avoid using the bundled subset of libxml2
-HOST_GETTEXT_GNU_DEPENDENCIES = host-libxml2
+HOST_GETTEXT_GNU_DEPENDENCIES = host-libxml2 host-libtextstyle
 
 GETTEXT_GNU_CONF_OPTS += \
 	--disable-libasprintf \
@@ -38,7 +38,8 @@ HOST_GETTEXT_GNU_CONF_OPTS = \
 	--disable-native-java \
 	--disable-csharp \
 	--disable-relocatable \
-	--without-emacs
+	--without-emacs \
+	--with-installed-libtextstyle
 
 # Force the build of libintl, even if the C library provides a stub
 # gettext implementation
Signature · 1 line
2.25.3
#2 lore raw

PATCH v4 2/3 package/gettext-gnu: bump version to 0.20.1

Hello,

Quoted 10 lines · On Tue, 21 Apr 2020 13:55:03 -0700 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

Other changes:
- Update license hash due to http -> https URL changes.
- Depend on host-libtextstyle for host-gettext-gnu.
- Update 0001-error_print_progname.patch to apply cleanly.
- Remove upstream 0002-Update-after-gnulib-changed.patch
- Add 0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch which allows gettext-tools to build with an external libtextstyle.

Quoted 4 lines

Tested under Debian 8 with test-pkg -a:
44 builds, 5 skipped, 0 build failed, 0 legal-info failed

I've applied, with one change.

package/gettext-gnu/Config.in config BR2_PACKAGE_GETTEXT_GNU · line 5

Quoted 9 lines
package/gettext-gnu/Config.in +1 -0
index 27e7a3da4c..85ddb62788 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_GETTEXT_GNU
 	bool
 	depends on BR2_USE_WCHAR
 	select BR2_PACKAGE_HAS_GETTEXT
+	select BR2_PACKAGE_LIBTEXTSTYLE

This was not needed: the target libtextstyle package does not exist.

Thanks!

Thomas

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

PATCH v4 3/3 package/gettext-tiny: support gettext 0.20.1

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

Other changes:
- Update gettext to 0.20.1 and the respective hashes.
- Remove share/gettext-tiny/m4/lock.m4 from GETTEXT_TINY_EXTRA_GETTEXT_FILES and the install list, as this file was removed in commit 8c2bfdbddb13a480d88ceac4ab0e5886bda957cb.

Tested with test-pkg -p gettext-tiny in Debian 10 and Centos 7

            br-arm-full [1/6]: OK
 br-arm-cortex-a9-glibc [2/6]: OK
  br-arm-cortex-m4-full [3/6]: OK
         br-x86-64-musl [4/6]: OK
     br-arm-full-static [5/6]: OK
           sourcery-arm [6/6]: OK
---
 package/gettext-tiny/gettext-tiny.hash | 7 +++----
 package/gettext-tiny/gettext-tiny.mk   | 4 +---
 2 files changed, 4 insertions(+), 7 deletions(-)
package/gettext-tiny/gettext-tiny.hash +3 -4
index 9232fe8530..201b05c6ff 100644
@@ -1,7 +1,6 @@
 # Locally Computed:
 sha256 efc740007c82a9b3a0d382fb50d212fa7dc0beddb9695409ee79684f9f2124b2  gettext-tiny-adaa9c64921e80f2b8dd3610ffb508618b9204f3.tar.gz
 sha256 b57aa4fdc1c614c28d41c1e2d5c4090935964c5f86291ba7d1c99ffd1d698b34  LICENSE
-sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  extra/COPYING
-# From http://lists.gnu.org/archive/html/bug-gettext/2016-06/msg00008.html
-md5  df3f5690eaa30fd228537b00cb7b7590         gettext-0.19.8.1.tar.xz
-sha1 e0fe90ede22f7f16bbde7bdea791a835f2773fc9 gettext-0.19.8.1.tar.xz
+sha256 e79e9c8a0c85d735ff98185918ec94ed7d175efc377012787aebcf3b80f0d90b  extra/COPYING
+# From https://lists.gnu.org/archive/html/info-gnu/2019-05/msg00011.html
+sha1 62f4a6a2fd5f80bfd0e66c497a04094fa3e07b90 gettext-0.20.1.tar.xz
package/gettext-tiny/gettext-tiny.mk +1 -3
index 09a98f99b4..87813ae5af 100644
@@ -14,12 +14,11 @@ HOST_GETTEXT_TINY_LICENSE_FILES = LICENSE extra/COPYING
 GETTEXT_TINY_PROVIDES = gettext
 
 # needed for gettextize
-GETTEXT_TINY_ARCHIVE_VERSION = 0.19.8
+GETTEXT_TINY_ARCHIVE_VERSION = 0.20.1
 
 GETTEXT_TINY_EXTRA_GETTEXT_FILES = \
 	gettext-tools/misc/gettextize.in \
 	gettext-tools/po/Makevars.template \
-	gettext-runtime/m4/lock.m4 \
 	gettext-runtime/po/boldquot.sed \
 	gettext-runtime/po/en at boldquot.header \
 	gettext-runtime/po/en at quot.header \
@@ -83,7 +82,6 @@ define HOST_GETTEXT_TINY_INSTALL_CMDS
 
 	$(INSTALL) -m 0755 -D $(@D)/gettextize $(HOST_DIR)/bin/gettextize
 	$(INSTALL) -m 0644 -D $(@D)/build-aux/config.rpath $(HOST_DIR)/share/gettext-tiny/config.rpath
-	$(INSTALL) -m 0644 -D $(@D)/extra/lock.m4 $(HOST_DIR)/share/gettext-tiny/m4/lock.m4
 	$(INSTALL) -m 0644 -D $(@D)/extra/Makefile.in.in $(HOST_DIR)/share/gettext-tiny/po/Makefile.in.in
 	$(INSTALL) -m 0644 -D $(@D)/extra/boldquot.sed $(HOST_DIR)/share/gettext-tiny/po/boldquot.sed
 	$(INSTALL) -m 0644 -D $(@D)/extra/en at boldquot.header $(HOST_DIR)/share/gettext-tiny/po/en at boldquot.header
Signature · 1 line
2.25.3
#4 lore raw

PATCH v4 3/3 package/gettext-tiny: support gettext 0.20.1

Quoted 17 lines · On Tue, 21 Apr 2020 13:55:04 -0700 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

Other changes:
- Update gettext to 0.20.1 and the respective hashes.
- Remove share/gettext-tiny/m4/lock.m4 from GETTEXT_TINY_EXTRA_GETTEXT_FILES and the install list, as this file was removed in commit 8c2bfdbddb13a480d88ceac4ab0e5886bda957cb.

Tested with test-pkg -p gettext-tiny in Debian 10 and Centos 7

            br-arm-full [1/6]: OK
 br-arm-cortex-a9-glibc [2/6]: OK
  br-arm-cortex-m4-full [3/6]: OK
         br-x86-64-musl [4/6]: OK
     br-arm-full-static [5/6]: OK
           sourcery-arm [6/6]: OK
Quoted 5 lines
---
 package/gettext-tiny/gettext-tiny.hash | 7 +++----
 package/gettext-tiny/gettext-tiny.mk   | 4 +---
 2 files changed, 4 insertions(+), 7 deletions(-)

Applied to master, thanks.

Thomas

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

PATCH v4 1/3 package/libtextstyle: new package

In reply to aduskett at gmail.com

Hello,

Quoted 1 line · On Tue, 21 Apr 2020 13:55:02 -0700 aduskett at gmail.com wrote:

+LIBTEXTSTYLE_VERSION = 0.20.1

I've added a comment above this to ask this version to be kept in sync with gettext-gnu.

package/libtextstyle/libtextstyle.mk line 12

Quoted 5 lines
package/libtextstyle/libtextstyle.mk new file +5 -0
+LIBTEXTSTYLE_SITE = $(BR2_GNU_MIRROR)/gettext
+LIBTEXTSTYLE_SOURCE = gettext-$(LIBTEXTSTYLE_VERSION).tar.xz
+LIBTEXTSTYLE_INSTALL_STAGING = YES
+LIBTEXTSTYLE_LICENSE = GPL-3.0+
+LIBTEXTSTYLE_LICENSE_FILES = COPYING

I've added:

HOST_LIBTEXTSTYLE_DL_SUBDIR = gettext-gnu

so that the downloaded gettext tarball is shared with gettext-gnu.

Applied with this change. Thanks!

Thomas

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