From patchwork Wed Mar 27 23:08:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1067500 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="T9crLjL6"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44V3Mm5CYGz9sR4 for ; Thu, 28 Mar 2019 09:59:00 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EB07E869C4; Wed, 27 Mar 2019 22:58:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m0nW35dpl9Fw; Wed, 27 Mar 2019 22:58:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 708B5857D8; Wed, 27 Mar 2019 22:58:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 009C61BF3A7 for ; Wed, 27 Mar 2019 22:58:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F23E587111 for ; Wed, 27 Mar 2019 22:58:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x3kWIajILg72 for ; Wed, 27 Mar 2019 22:58:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 09EDF86F8D for ; Wed, 27 Mar 2019 22:58:44 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id v14so12690855lfi.0 for ; Wed, 27 Mar 2019 15:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jY+nhuW4RAyxptCMo8SWUTSkfOrx5MQAqqlXdYuubkI=; b=T9crLjL6dWdzraOMNQcaFpC+UDr3N2RFFdRY2BS9BaAK7qFR8fHP7VpI8YjY9nVv9W zH4n22YSxuN3yiAGwtLnqdRUWLBwz1xkfVSNUiolw4J3YTh+GjTXOnw8BmESRbjTfkhd 7tTv/DNpnffXlGIhB8w+KPSmy+V4wd11J+AeSz7xre5NWaE9XXT6W02ylb5mdcKb7w6h +LZGj3mPRuI5pZE94QzOCTn99tGwxMr3uAMmEBYvduoDI/TgQ8rCLXCqFajyEFirhehS PcjqfREuoQHv8KTpJAxEYr+up1rjqryHig/6tRTNQPX60y7mK8OZWgMfGWdp5Cpo5Gbo 0HJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jY+nhuW4RAyxptCMo8SWUTSkfOrx5MQAqqlXdYuubkI=; b=iCJtOAxhO/GskmM3DZunf4nmDOGIZPh9wJygvFVzOc/KMMonbEeQ0HkmpxcEkeo85Z GsTnu5ubAWCwCYVQxPEbBdOMHEWmOqZlT8pNovfAJHP20Zd+/MLaBMXYQvzPnRqnVHaS ZP/X+00CxdrnfeOMLkchJcXnsilFKMVoVg1a8lewD6EE/k40LiUGm6xD0BeM0IRU1RRO H/+blcRCB/QNY1/vf1jIz79vywzNh+TXJJAErdJ1huPRHftevbnWK3cJ5t/ZrAKPRtuY lf9BUl5HrJo3EAc/9DX410Lmz7UFitGRSQ+SR9Cn6tYNdkuG4lRwOFr445KVKgNN7LWS t+8Q== X-Gm-Message-State: APjAAAXTWViD6rDAIqwgs6G/CM261pT+ZbPceS9NUc3eklfybP9CHbR4 unQxveBX/yZh6flnQaHlZX3q2Xio X-Google-Smtp-Source: APXvYqxcjvJ/Vv+IZ8wgnBSnzW0nKB6YH6UPEyMwfVwPYQUQAWxSWwYSwjqHibiEzwslIh6zrG+YHA== X-Received: by 2002:a19:4283:: with SMTP id p125mr20206078lfa.3.1553727521756; Wed, 27 Mar 2019 15:58:41 -0700 (PDT) Received: from vkochan-ThinkPad-T470p.lan ([93.75.250.209]) by smtp.gmail.com with ESMTPSA id v11sm3515720ljk.19.2019.03.27.15.58.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 15:58:41 -0700 (PDT) From: Vadim Kochan To: buildroot@buildroot.org Date: Thu, 28 Mar 2019 01:08:30 +0200 Message-Id: <20190327230831.31468-2-vadim4j@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190327230831.31468-1-vadim4j@gmail.com> References: <20190327230831.31468-1-vadim4j@gmail.com> Subject: [Buildroot] [PATCH v4 1/2] package/gettext: turn into virtual package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vadim Kochan , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Re-work gettext to be a virtual package which may allow to use different gettext's providers, and rename the original one into gettext-gnu package. Signed-off-by: Vadim Kochan Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + .../0001-error_print_progname.patch | 0 .../0002-Update-after-gnulib-changed.patch | 0 package/gettext-gnu/Config.in | 24 +++++ .../gettext.hash => gettext-gnu/gettext-gnu.hash} | 0 package/gettext-gnu/gettext-gnu.mk | 103 +++++++++++++++++++++ package/gettext/Config.in | 24 ++--- package/gettext/gettext.mk | 96 +------------------ 8 files changed, 140 insertions(+), 108 deletions(-) rename package/{gettext => gettext-gnu}/0001-error_print_progname.patch (100%) rename package/{gettext => gettext-gnu}/0002-Update-after-gnulib-changed.patch (100%) create mode 100644 package/gettext-gnu/Config.in rename package/{gettext/gettext.hash => gettext-gnu/gettext-gnu.hash} (100%) create mode 100644 package/gettext-gnu/gettext-gnu.mk diff --git a/package/Config.in b/package/Config.in index 09a2b80614..31749a06a9 100644 --- a/package/Config.in +++ b/package/Config.in @@ -153,6 +153,7 @@ menu "Development tools" source "package/flex/Config.in" source "package/gawk/Config.in" source "package/gettext/Config.in" + source "package/gettext-gnu/Config.in" source "package/git/Config.in" source "package/git-crypt/Config.in" source "package/gperf/Config.in" diff --git a/package/gettext/0001-error_print_progname.patch b/package/gettext-gnu/0001-error_print_progname.patch similarity index 100% rename from package/gettext/0001-error_print_progname.patch rename to package/gettext-gnu/0001-error_print_progname.patch diff --git a/package/gettext/0002-Update-after-gnulib-changed.patch b/package/gettext-gnu/0002-Update-after-gnulib-changed.patch similarity index 100% rename from package/gettext/0002-Update-after-gnulib-changed.patch rename to package/gettext-gnu/0002-Update-after-gnulib-changed.patch diff --git a/package/gettext-gnu/Config.in b/package/gettext-gnu/Config.in new file mode 100644 index 0000000000..af5feed14b --- /dev/null +++ b/package/gettext-gnu/Config.in @@ -0,0 +1,24 @@ +config BR2_PACKAGE_GETTEXT_GNU + bool + depends on BR2_USE_WCHAR + select BR2_PACKAGE_HAS_GETTEXT + help + The GNU `gettext' utilities are a set of tools that provide a + framework to help other GNU packages produce multi-lingual + messages. + + Only the libintl library will be installed in the + target. The full gettext suite, including tools, will be + installed in the staging directory. + + http://www.gnu.org/software/gettext/ + +if BR2_PACKAGE_GETTEXT_GNU + +config BR2_PACKAGE_PROVIDES_GETTEXT + default "gettext-gnu" + +endif + +config BR2_PACKAGE_PROVIDES_HOST_GETTEXT + default "host-gettext-gnu" diff --git a/package/gettext/gettext.hash b/package/gettext-gnu/gettext-gnu.hash similarity index 100% rename from package/gettext/gettext.hash rename to package/gettext-gnu/gettext-gnu.hash diff --git a/package/gettext-gnu/gettext-gnu.mk b/package/gettext-gnu/gettext-gnu.mk new file mode 100644 index 0000000000..61adf72738 --- /dev/null +++ b/package/gettext-gnu/gettext-gnu.mk @@ -0,0 +1,103 @@ +################################################################################ +# +# gettext-gnu +# +################################################################################ + +GETTEXT_GNU_VERSION = 0.19.8.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 +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 + +GETTEXT_GNU_CONF_OPTS += \ + --disable-libasprintf \ + --disable-acl \ + --disable-openmp \ + --disable-rpath \ + --disable-java \ + --disable-native-java \ + --disable-csharp \ + --disable-relocatable \ + --without-emacs + +HOST_GETTEXT_GNU_CONF_OPTS = \ + --disable-libasprintf \ + --disable-acl \ + --disable-openmp \ + --disable-rpath \ + --disable-java \ + --disable-native-java \ + --disable-csharp \ + --disable-relocatable \ + --without-emacs + +# Force the build of libintl, even if the C library provides a stub +# gettext implementation +ifeq ($(BR2_PACKAGE_GETTEXT_GNU_PROVIDES_LIBINTL),y) +GETTEXT_GNU_CONF_OPTS += --with-included-gettext +else +GETTEXT_GNU_CONF_OPTS += --without-included-gettext +endif + +# For the target version, we only need the runtime, and for the host +# version, we only need the tools. +GETTEXT_GNU_SUBDIR = gettext-runtime +HOST_GETTEXT_GNU_SUBDIR = gettext-tools + +# Disable the build of documentation and examples of gettext-tools, +# and the build of documentation and tests of gettext-runtime. +define HOST_GETTEXT_GNU_DISABLE_UNNEEDED + $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/examples$$//' $(@D)/gettext-tools/Makefile.in + $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/tests$$//' $(@D)/gettext-runtime/Makefile.in +endef + +GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED +HOST_GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED + +define GETTEXT_GNU_REMOVE_UNNEEDED + $(RM) -rf $(TARGET_DIR)/usr/share/gettext/ABOUT-NLS + rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/gettext +endef + +GETTEXT_GNU_POST_INSTALL_TARGET_HOOKS += GETTEXT_GNU_REMOVE_UNNEEDED + +# Force build with NLS support, otherwise libintl is not built +# This is needed because some packages (eg. libglib2) requires +# locales, but do not properly depend on BR2_ENABLE_LOCALE, and +# instead select BR2_PACKAGE_GETTEXT_GNU. Those packages need to be +# fixed before we can remove the following 3 lines... :-( +ifeq ($(BR2_ENABLE_LOCALE),) +GETTEXT_GNU_CONF_OPTS += --enable-nls +endif + +# Disable interactive confirmation in host gettextize for package fixups +define HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION + $(SED) '/read dummy/d' $(HOST_DIR)/bin/gettextize +endef +HOST_GETTEXT_GNU_POST_INSTALL_HOOKS += HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION + +# autoreconf expects gettextize to install ABOUT-NLS, but it only gets +# installed by gettext-runtime which we don't build/install for the +# host, so do it manually +define HOST_GETTEXT_GNU_ADD_ABOUT_NLS + $(INSTALL) -m 0644 $(@D)/$(HOST_GETTEXT_GNU_SUBDIR)/ABOUT-NLS \ + $(HOST_DIR)/share/gettext/ABOUT-NLS +endef + +HOST_GETTEXT_GNU_POST_INSTALL_HOOKS += HOST_GETTEXT_GNU_ADD_ABOUT_NLS + +ifeq ($(BR2_PACKAGE_GETTEXT_GNU),y) +GETTEXTIZE = $(HOST_CONFIGURE_OPTS) AUTOM4TE=$(HOST_DIR)/bin/autom4te $(HOST_DIR)/bin/gettextize -f +endif + +$(eval $(autotools-package)) +$(eval $(host-autotools-package)) diff --git a/package/gettext/Config.in b/package/gettext/Config.in index e55663b1d7..ba12d816ee 100644 --- a/package/gettext/Config.in +++ b/package/gettext/Config.in @@ -1,25 +1,21 @@ config BR2_PACKAGE_GETTEXT bool "gettext" depends on BR2_USE_WCHAR - help - The GNU `gettext' utilities are a set of tools that provide a - framework to help other GNU packages produce multi-lingual - messages. + select BR2_PACKAGE_GETTEXT_GNU - Only the libintl library will be installed in the - target. The full gettext suite, including tools, will be - installed in the staging directory. - - http://www.gnu.org/software/gettext/ - -if BR2_PACKAGE_GETTEXT +comment "gettext needs a toolchain w/ wchar" + depends on !BR2_USE_WCHAR config BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL bool default y if BR2_SYSTEM_ENABLE_NLS depends on !BR2_TOOLCHAIN_HAS_FULL_GETTEXT -endif +config BR2_PACKAGE_HAS_GETTEXT + bool -comment "gettext needs a toolchain w/ wchar" - depends on !BR2_USE_WCHAR +config BR2_PACKAGE_PROVIDES_GETTEXT + string + +config BR2_PACKAGE_PROVIDES_HOST_GETTEXT + string diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk index ec9588f8ad..a86e26f69e 100644 --- a/package/gettext/gettext.mk +++ b/package/gettext/gettext.mk @@ -4,97 +4,5 @@ # ################################################################################ -GETTEXT_VERSION = 0.19.8.1 -GETTEXT_SITE = $(BR2_GNU_MIRROR)/gettext -GETTEXT_SOURCE = gettext-$(GETTEXT_VERSION).tar.xz -GETTEXT_INSTALL_STAGING = YES -GETTEXT_LICENSE = LGPL-2.1+ (libintl), GPL-3.0+ (the rest) -GETTEXT_LICENSE_FILES = COPYING gettext-runtime/intl/COPYING.LIB -# 0002-Update-after-gnulib-changed.patch -GETTEXT_AUTORECONF = YES -GETTEXT_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv) - -# Avoid using the bundled subset of libxml2 -HOST_GETTEXT_DEPENDENCIES = host-libxml2 - -GETTEXT_CONF_OPTS += \ - --disable-libasprintf \ - --disable-acl \ - --disable-openmp \ - --disable-rpath \ - --disable-java \ - --disable-native-java \ - --disable-csharp \ - --disable-relocatable \ - --without-emacs - -HOST_GETTEXT_CONF_OPTS = \ - --disable-libasprintf \ - --disable-acl \ - --disable-openmp \ - --disable-rpath \ - --disable-java \ - --disable-native-java \ - --disable-csharp \ - --disable-relocatable \ - --without-emacs - -# Force the build of libintl, even if the C library provides a stub -# gettext implementation -ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y) -GETTEXT_CONF_OPTS += --with-included-gettext -else -GETTEXT_CONF_OPTS += --without-included-gettext -endif - -# For the target version, we only need the runtime, and for the host -# version, we only need the tools. -GETTEXT_SUBDIR = gettext-runtime -HOST_GETTEXT_SUBDIR = gettext-tools - -# Disable the build of documentation and examples of gettext-tools, -# and the build of documentation and tests of gettext-runtime. -define HOST_GETTEXT_DISABLE_UNNEEDED - $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/examples$$//' $(@D)/gettext-tools/Makefile.in - $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/tests$$//' $(@D)/gettext-runtime/Makefile.in -endef - -GETTEXT_POST_PATCH_HOOKS += HOST_GETTEXT_DISABLE_UNNEEDED -HOST_GETTEXT_POST_PATCH_HOOKS += HOST_GETTEXT_DISABLE_UNNEEDED - -define GETTEXT_REMOVE_UNNEEDED - $(RM) -rf $(TARGET_DIR)/usr/share/gettext/ABOUT-NLS - rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/gettext -endef - -GETTEXT_POST_INSTALL_TARGET_HOOKS += GETTEXT_REMOVE_UNNEEDED - -# Force build with NLS support, otherwise libintl is not built -# This is needed because some packages (eg. libglib2) requires -# locales, but do not properly depend on BR2_ENABLE_LOCALE, and -# instead select BR2_PACKAGE_GETTEXT. Those packages need to be -# fixed before we can remove the following 3 lines... :-( -ifeq ($(BR2_ENABLE_LOCALE),) -GETTEXT_CONF_OPTS += --enable-nls -endif - -# Disable interactive confirmation in host gettextize for package fixups -define HOST_GETTEXT_GETTEXTIZE_CONFIRMATION - $(SED) '/read dummy/d' $(HOST_DIR)/bin/gettextize -endef -HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION - -# autoreconf expects gettextize to install ABOUT-NLS, but it only gets -# installed by gettext-runtime which we don't build/install for the -# host, so do it manually -define HOST_GETTEXT_ADD_ABOUT_NLS - $(INSTALL) -m 0644 $(@D)/$(HOST_GETTEXT_SUBDIR)/ABOUT-NLS \ - $(HOST_DIR)/share/gettext/ABOUT-NLS -endef - -HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_ADD_ABOUT_NLS - -GETTEXTIZE = $(HOST_CONFIGURE_OPTS) AUTOM4TE=$(HOST_DIR)/bin/autom4te $(HOST_DIR)/bin/gettextize -f - -$(eval $(autotools-package)) -$(eval $(host-autotools-package)) +$(eval $(virtual-package)) +$(eval $(host-virtual-package)) From patchwork Wed Mar 27 23:08:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1067501 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="q2+0nplU"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44V3N04Wxpz9sR0 for ; Thu, 28 Mar 2019 09:59:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 67F8B25B9E; Wed, 27 Mar 2019 22:59:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QmvVCzCGN17r; Wed, 27 Mar 2019 22:58:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 5158A252A8; Wed, 27 Mar 2019 22:58:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 790021BF3A7 for ; Wed, 27 Mar 2019 22:58:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 76E8A86F8D for ; Wed, 27 Mar 2019 22:58:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NfgpA6Oh+pVN for ; Wed, 27 Mar 2019 22:58:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5992287032 for ; Wed, 27 Mar 2019 22:58:45 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id t4so2801829ljc.2 for ; Wed, 27 Mar 2019 15:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1o363Q8I3isyYHxlszzDl8O4zxNELO0TJBS3tbhj3Zw=; b=q2+0nplUbwjf5gDlGDfnuYa8r+pBuTb5tiwvreLjA5FHapDw5B5MiEqo/AT8jOWTZF nAgjkuN5erZt3X8hD/PMU2g6eqHdhmCmHPoLgyyra6WvkFU2m9z4zm2Q4IHXFmhv6caY IRX/ughCqWkbXTx0Ye4DxY0Vi6sve3ZzCg6MFHETPlP56OaUufr6OJWNv+smmBvtvKek oLLJCRbRrWfaZBPknJdwCoIF6+zWNAjOMkZAhSz+QVEeJW+mGqEZ5igF6CxhcNBt/ZUB TJw0srIwhrIfIugEnNUGuphsBPLFdgl3Ml9f0rrLwu7lB9XG3hilNcWwvqZyIliwbhCq tfhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1o363Q8I3isyYHxlszzDl8O4zxNELO0TJBS3tbhj3Zw=; b=tlCA/6OQ3mSHYe4JkM1dFINgpJFmFTamNbElq8uR+Yup3AmDGd57W/aSW6PVPDrVC4 ej4+c5B4fvc2QNaFXUQVK6C1xbv8iVCcjheadqyB85zbf75XThF6zbdI+6Hv6oxAJnq9 7ESOXlBp6H1IDPiIoiEwZZM8sVbEt3sy77HEtluse5BxSct8GOQJ4TNxjb29CHu7cgTm y10d07pls7hYVooDmA5EJsZqj/XQWuuGbnVDNgeK4Doos13UhYWhd8Pm6qR6IpExjlGA HxTvTwhpYC9eqXKHqG4WmSdvJZSpx5zPVUGiQWVoW0SKYvf2SdrVavnya30MtTD6azym 250g== X-Gm-Message-State: APjAAAX/scXPXmkA16XRaZoIZygZcFbC+3We9RD7WerxK/ay4z7E6XQS gTwX6Ts4p98xS2V6VMnEbyiWCK0v X-Google-Smtp-Source: APXvYqxWIWuzY0QPyMvt01tNPfdj2abJaxqeD+0roEZtdSJDXQsZm4gSYaLIcXvcvHcjA6JiShWB8A== X-Received: by 2002:a2e:3512:: with SMTP id z18mr8063579ljz.25.1553727523064; Wed, 27 Mar 2019 15:58:43 -0700 (PDT) Received: from vkochan-ThinkPad-T470p.lan ([93.75.250.209]) by smtp.gmail.com with ESMTPSA id v11sm3515720ljk.19.2019.03.27.15.58.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 15:58:42 -0700 (PDT) From: Vadim Kochan To: buildroot@buildroot.org Date: Thu, 28 Mar 2019 01:08:31 +0200 Message-Id: <20190327230831.31468-3-vadim4j@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190327230831.31468-1-vadim4j@gmail.com> References: <20190327230831.31468-1-vadim4j@gmail.com> Subject: [Buildroot] [PATCH v4 2/2] package/gettext-tiny: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vadim Kochan , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add gettext-tiny package from the sabotage-linux project: gettext-tiny provides lightweight replacements for tools typically used from the GNU gettext suite, which is incredibly bloated and takes a lot of time to build (in the order of an hour on slow devices). the most notable component is msgfmt which is used to create binary translation files in the .mo format out of textual input files in .po format. this is the most important tool for building software from source, because it is used from the build processes of many software packages. Some files were taken from gettext-gnu (some po/* files and gettextize script) to make possible perform gettextizing of packages. The main purpose of gettext-tiny is to replace gettext for the "host" if NLS support is not needed. There is no option to manually select gettext-gnu or gettext-tiny, it is done automatically by virtual gettext package. For the target gettext-tiny only installs gettext tool echo-wrapper which might be called from shell scripts (i.e. ecryptfs-utils). Signed-off-by: Vadim Kochan Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 1 + package/Config.in | 1 + package/gettext-gnu/Config.in | 2 +- ...-format-not-a-string-literal-error-for-gc.patch | 55 ++++++++++ package/gettext-tiny/Config.in | 18 ++++ package/gettext-tiny/gettext-tiny.hash | 5 + package/gettext-tiny/gettext-tiny.mk | 114 +++++++++++++++++++++ package/gettext-tiny/gettext-wrapper | 24 +++++ package/gettext/Config.in | 7 +- 9 files changed, 221 insertions(+), 6 deletions(-) create mode 100644 package/gettext-tiny/0001-libintl-Fix-format-not-a-string-literal-error-for-gc.patch create mode 100644 package/gettext-tiny/Config.in create mode 100644 package/gettext-tiny/gettext-tiny.hash create mode 100644 package/gettext-tiny/gettext-tiny.mk create mode 100644 package/gettext-tiny/gettext-wrapper diff --git a/DEVELOPERS b/DEVELOPERS index 3dfdf894d7..9446dfee3d 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2197,6 +2197,7 @@ F: package/tstools/ N: Vadim Kochan F: package/brcm-patchram-plus/ +F: package/gettext-tiny/ N: Valentin Korenblit F: package/clang/ diff --git a/package/Config.in b/package/Config.in index 31749a06a9..c04c57c643 100644 --- a/package/Config.in +++ b/package/Config.in @@ -154,6 +154,7 @@ menu "Development tools" source "package/gawk/Config.in" source "package/gettext/Config.in" source "package/gettext-gnu/Config.in" + source "package/gettext-tiny/Config.in" source "package/git/Config.in" source "package/git-crypt/Config.in" source "package/gperf/Config.in" diff --git a/package/gettext-gnu/Config.in b/package/gettext-gnu/Config.in index af5feed14b..27e7a3da4c 100644 --- a/package/gettext-gnu/Config.in +++ b/package/gettext-gnu/Config.in @@ -21,4 +21,4 @@ config BR2_PACKAGE_PROVIDES_GETTEXT endif config BR2_PACKAGE_PROVIDES_HOST_GETTEXT - default "host-gettext-gnu" + default "host-gettext-gnu" if BR2_SYSTEM_ENABLE_NLS diff --git a/package/gettext-tiny/0001-libintl-Fix-format-not-a-string-literal-error-for-gc.patch b/package/gettext-tiny/0001-libintl-Fix-format-not-a-string-literal-error-for-gc.patch new file mode 100644 index 0000000000..44cda55998 --- /dev/null +++ b/package/gettext-tiny/0001-libintl-Fix-format-not-a-string-literal-error-for-gc.patch @@ -0,0 +1,55 @@ +From 34f631ce80700aa1eaadc032026f12f86584bd8a Mon Sep 17 00:00:00 2001 +From: Vadim Kochan +Date: Mon, 31 Dec 2018 00:40:29 +0200 +Subject: [PATCH] gettext-tiny: Fix format not a string literal error + +Add 'format_arg' attribute for the functions which may return string +as formatted parameter, otherwise it fails to compile on high versions +of gcc. + +Signed-off-by: Vadim Kochan +--- + include/libintl.h | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +diff --git a/include/libintl.h b/include/libintl.h +index b1af2b4..1883e1b 100644 +--- a/include/libintl.h ++++ b/include/libintl.h +@@ -4,12 +4,27 @@ + #ifdef __cplusplus + extern "C" { + #endif +-char *gettext(const char *msgid); +-char *dgettext(const char *domainname, const char *msgid); +-char *dcgettext(const char *domainname, const char *msgid, int category); +-char *ngettext(const char *msgid1, const char *msgid2, unsigned long n); +-char *dngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long n); +-char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long n, int category); ++/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return ++ * its n-th argument literally. This enables GCC to warn for example about ++ * printf (gettext ("foo %y")). */ ++#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus) ++# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n))) ++#else ++# define _INTL_MAY_RETURN_STRING_ARG(n) ++#endif ++ ++char *gettext(const char *msgid) ++ _INTL_MAY_RETURN_STRING_ARG(1); ++char *dgettext(const char *domainname, const char *msgid) ++ _INTL_MAY_RETURN_STRING_ARG(2); ++char *dcgettext(const char *domainname, const char *msgid, int category) ++ _INTL_MAY_RETURN_STRING_ARG(2); ++char *ngettext(const char *msgid1, const char *msgid2, unsigned long n) ++ _INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2); ++char *dngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long n) ++ _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3); ++char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long n, int category) ++ _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3); + + char *textdomain(const char *domainname); + char *bind_textdomain_codeset(const char *domainname, const char *codeset); +-- +2.14.1 + diff --git a/package/gettext-tiny/Config.in b/package/gettext-tiny/Config.in new file mode 100644 index 0000000000..6f91a00b09 --- /dev/null +++ b/package/gettext-tiny/Config.in @@ -0,0 +1,18 @@ +config BR2_PACKAGE_GETTEXT_TINY + bool + select BR2_PACKAGE_HAS_GETTEXT + help + Stub and/or lightweight replacements of the gnu gettext + suite; because the GNU one takes ages to compile. + + https://github.com/sabotage-linux/gettext-tiny + +if BR2_PACKAGE_GETTEXT_TINY + +config BR2_PACKAGE_PROVIDES_GETTEXT + default "gettext-tiny" + +endif + +config BR2_PACKAGE_PROVIDES_HOST_GETTEXT + default "host-gettext-tiny" if !BR2_SYSTEM_ENABLE_NLS diff --git a/package/gettext-tiny/gettext-tiny.hash b/package/gettext-tiny/gettext-tiny.hash new file mode 100644 index 0000000000..755f7f6ecf --- /dev/null +++ b/package/gettext-tiny/gettext-tiny.hash @@ -0,0 +1,5 @@ +# Locally Computed: +sha256 654dcd52f2650476c8822b60bee89c20a0aa7f6a1bf6001701eeacd71a9e388b gettext-tiny-v0.3.1.tar.gz +# 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 diff --git a/package/gettext-tiny/gettext-tiny.mk b/package/gettext-tiny/gettext-tiny.mk new file mode 100644 index 0000000000..9efd798451 --- /dev/null +++ b/package/gettext-tiny/gettext-tiny.mk @@ -0,0 +1,114 @@ +################################################################################ +# +# gettext-tiny +# +################################################################################ + +GETTEXT_TINY_VERSION = v0.3.1 +GETTEXT_TINY_SITE = $(call github,sabotage-linux,gettext-tiny,$(GETTEXT_TINY_VERSION)) +GETTEXT_TINY_LICENSE = MIT, GPL-3.0+ (extra gettext) +GETTEXT_TINY_INSTALL_STAGING = YES +GETTEXT_TINY_LICENSE_FILES = LICENSE, extra/COPYING +GETTEXT_TINY_OPTS = LIBINTL=NOOP + +GETTEXT_TINY_PROVIDES = gettext + +# needed for gettextize +GETTEXT_TINY_ARCHIVE_VERSION = 0.19.8 + +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@boldquot.header \ + gettext-runtime/po/en@quot.header \ + gettext-runtime/po/insert-header.sin \ + gettext-runtime/po/quot.sed \ + gettext-runtime/po/remove-potcdate.sin \ + gettext-runtime/po/Rules-quot \ + gettext-runtime/po/Makefile.in.in \ + COPYING + +HOST_GETTEXT_TINY_EXTRA_DOWNLOADS = $(GETTEXT_GNU_SITE)/$(GETTEXT_GNU_SOURCE) + +define HOST_GETTEXT_TINY_EXTRACT_GNU_GETTEXT + mkdir -p $(@D)/gettext-gnu + $(call suitable-extractor,$(GETTEXT_GNU_SOURCE)) \ + $(GETTEXT_GNU_DL_DIR)/$(GETTEXT_GNU_SOURCE) | \ + $(TAR) --strip-components=1 -C $(@D)/gettext-gnu $(TAR_OPTIONS) - +endef +HOST_GETTEXT_TINY_POST_EXTRACT_HOOKS += HOST_GETTEXT_TINY_EXTRACT_GNU_GETTEXT + +define HOST_GETTEXT_TINY_COPY_EXTRA_FILES + $(foreach f,$(GETTEXT_TINY_EXTRA_GETTEXT_FILES),\ + $(INSTALL) -D -m 0644 $(@D)/gettext-gnu/$(f) $(@D)/extra/$(notdir $(f)) + ) + $(INSTALL) -D -m 0755 $(@D)/gettext-gnu/build-aux/config.rpath \ + $(@D)/build-aux/config.rpath +endef +HOST_GETTEXT_TINY_POST_PATCH_HOOKS += HOST_GETTEXT_TINY_COPY_EXTRA_FILES + +ifeq ($(BR2_ENABLE_LOCALE),) +HOST_GETTEXT_TINY_DEPENDENCIES = libiconv +endif + +define HOST_GETTEXT_TINY_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) \ + $(HOST_CONFIGURE_OPTS) \ + $(GETTEXT_TINY_OPTS) + + cp $(@D)/extra/gettextize.in $(@D)/gettextize + + $(SED) 's,@PACKAGE@,gettext-tools,g;' $(@D)/gettextize + $(SED) 's,@VERSION@,$(GETTEXT_GNU_VERSION),g;' $(@D)/gettextize + $(SED) 's,@ARCHIVE_VERSION@,$(GETTEXT_TINY_ARCHIVE_VERSION),' $(@D)/gettextize + $(SED) 's,@prefix@,$(HOST_DIR),g;' $(@D)/gettextize + $(SED) 's,@datarootdir@,$${prefix}/share,g;' $(@D)/gettextize + $(SED) 's,@datadir@,$${prefix}/share,g;' $(@D)/gettextize + $(SED) 's,@PATH_SEPARATOR@,:,g;' $(@D)/gettextize + $(SED) 's,@RELOCATABLE@,no,g;' $(@D)/gettextize + $(SED) 's,@exec_prefix@,$${prefix},g;' $(@D)/gettextize + $(SED) 's,@bindir@,$${exec_prefix}/bin,g;' $(@D)/gettextize +endef + +define HOST_GETTEXT_TINY_INSTALL_CMDS + $(Q)mkdir -p $(HOST_DIR)/share/gettext-tiny/po + $(Q)mkdir -p $(HOST_DIR)/share/gettext-tiny/m4 + + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) \ + $(HOST_CONFIGURE_OPTS) \ + prefix=$(HOST_DIR) install + + $(SED) '/read dummy/d' $(@D)/gettextize + + $(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@boldquot.header $(HOST_DIR)/share/gettext-tiny/po/en@boldquot.header + $(INSTALL) -m 0644 -D $(@D)/extra/en@quot.header $(HOST_DIR)/share/gettext-tiny/po/en@quot.header + $(INSTALL) -m 0644 -D $(@D)/extra/insert-header.sin $(HOST_DIR)/share/gettext-tiny/po/insert-header.sin + $(INSTALL) -m 0644 -D $(@D)/extra/quot.sed $(HOST_DIR)/share/gettext-tiny/po/quot.sed + $(INSTALL) -m 0644 -D $(@D)/extra/remove-potcdate.sin $(HOST_DIR)/share/gettext-tiny/po/remove-potcdate.sin + $(INSTALL) -m 0644 -D $(@D)/extra/Rules-quot $(HOST_DIR)/share/gettext-tiny/po/Rules-quot + $(INSTALL) -m 0644 -D $(@D)/extra/Makevars.template $(HOST_DIR)/share/gettext-tiny/po/Makevars.template + + $(Q)touch $(HOST_DIR)/share/gettext-tiny/ABOUT-NLS +endef + +# Install simple echo wrapper for gettext tool +define GETTEXT_TINY_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 -D $(GETTEXT_TINY_PKGDIR)/gettext-wrapper $(TARGET_DIR)/usr/bin/gettext +endef + +ifeq ($(BR2_SYSTEM_ENABLE_NLS),) +GETTEXTIZE = $(HOST_CONFIGURE_OPTS) \ + AUTOM4TE=$(HOST_DIR)/bin/autom4te \ + gettext_datadir=$(HOST_DIR)/usr/share/gettext-tiny \ + $(HOST_DIR)/bin/gettextize -f +endif + +$(eval $(generic-package)) +$(eval $(host-generic-package)) diff --git a/package/gettext-tiny/gettext-wrapper b/package/gettext-tiny/gettext-wrapper new file mode 100644 index 0000000000..3791a3a1aa --- /dev/null +++ b/package/gettext-tiny/gettext-wrapper @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Thanks to "Yann E. MORIN" +# for this gettext replacement. + +while [ ${#} -ne 0 ]; do + case "${1}" in + (-h) printf "no help\n"; return 0;; + (-V) printf "0.0.0\n"; return 0;; + (-d|--domain) shift 2;; + (-d*|--domain=*) shift 1;; + (-e|-E|-n) shift 1;; + (-s) shift 1;; # Ignore? + (-*) printf "invalid option '%s'\n" "${1}" >&2; return 1;; + (*) break;; + esac +done + +case ${#} in + (0) printf "missing arguments\n" >&2; return 1;; + (1) printf "%s" "${1}";; + (2) shift; printf "%s" "${2}";; + (*) printf "too many arguments\n" >&2; return 1;; +esac diff --git a/package/gettext/Config.in b/package/gettext/Config.in index ba12d816ee..6d83388ce7 100644 --- a/package/gettext/Config.in +++ b/package/gettext/Config.in @@ -1,10 +1,7 @@ config BR2_PACKAGE_GETTEXT bool "gettext" - depends on BR2_USE_WCHAR - select BR2_PACKAGE_GETTEXT_GNU - -comment "gettext needs a toolchain w/ wchar" - depends on !BR2_USE_WCHAR + select BR2_PACKAGE_GETTEXT_GNU if BR2_SYSTEM_ENABLE_NLS + select BR2_PACKAGE_GETTEXT_TINY if !BR2_SYSTEM_ENABLE_NLS config BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL bool