From 31abd9af5b1b370cc84099e88c6c21b97f196d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Thu, 4 Mar 2021 18:31:38 -0300 Subject: [PATCH 1/6] gettext: reorganize so gettext-libs only ships versioned libintl.so. Move unrelated libraries to gettext package, since they are only used by it and by gtranslator, which will for the most part be installed alongside gtranslator already. The main purpose with this PR is to stop shipping unversioned libintl.so in gettext-libs. What happens in this case is that packages built natively for musl with localization support will have gettext in hostmakedepends, which will lead to gettext-libs being in the host, and, consequently, /usr/lib/libintl.so being available. Due to CMake's FindIntl being bad, CMake projects will assume they should use libintl.so instead of the gettext support from libc, and link against it unnecessarily (and sometimes innefectively: CMake points the compiler at /usr/include/libintl.h instead of our /usr/include/gettext/libintl.h, which means the musl header will be used instead, and unless the main executable is linked against libintl, the library's functions won't even be used). Leaving only the essential libraries in gettext-libs (versioned libintl.so files) and guaranteeing gettext doesn't pull in the unversioned one means many packages won't depend on libintl unnecessarily any more. As a matter of fact, this is a case where our cross builds were more "correct" than native ones, since libintl.so in the host won't be found for the target. Furthermore, some packages require autopoint(1) in order to run autoreconf; to avoid depending on gettext-devel for it, and ending up linking in libintl into the final binary, we split it into the gettext-devel-tools subpackage as well. --- common/shlibs | 9 ++++--- srcpkgs/gettext-devel-tools | 1 + srcpkgs/gettext/template | 47 ++++++++++++++++++++++++++++--------- 3 files changed, 41 insertions(+), 16 deletions(-) create mode 120000 srcpkgs/gettext-devel-tools diff --git a/common/shlibs b/common/shlibs index 4b82c3ced654..7319cc8d20cb 100644 --- a/common/shlibs +++ b/common/shlibs @@ -176,11 +176,10 @@ libxfce4panel-2.0.so.4 libxfce4panel-4.12.0_1 libgdbm.so.6 gdbm-1.16_1 libgdbm_compat.so.4 gdbm-1.10_1_1 libintl.so.8 gettext-libs-0.19.2_1 -libgnuintl.so.8 gettext-libs-0.19.2_1 -libgettextlib-0.21.so gettext-libs-0.21_1 -libgettextsrc-0.21.so gettext-libs-0.21_1 -libgettextpo.so.0 gettext-libs-0.17_1 -libtextstyle.so.0 gettext-libs-0.20.1_1 +libgettextlib-0.21.so gettext-0.21_3 +libgettextsrc-0.21.so gettext-0.21_3 +libtextstyle.so.0 gettext-0.21_3 +libgettextpo.so.0 gettext-0.21_3 libattr.so.1 attr-2.4.43_1 libacl.so.1 acl-2.2.47_1 libpython2.7.so.1.0 python-2.7.18_3 diff --git a/srcpkgs/gettext-devel-tools b/srcpkgs/gettext-devel-tools new file mode 120000 index 000000000000..d3a6700489c5 --- /dev/null +++ b/srcpkgs/gettext-devel-tools @@ -0,0 +1 @@ +gettext \ No newline at end of file diff --git a/srcpkgs/gettext/template b/srcpkgs/gettext/template index 06079609ba0f..70696921b4cd 100644 --- a/srcpkgs/gettext/template +++ b/srcpkgs/gettext/template @@ -1,7 +1,7 @@ # Template file for 'gettext' pkgname=gettext version=0.21 -revision=2 +revision=3 build_style=gnu-configure configure_args="--disable-java --disable-native-java --disable-csharp --disable-libasprintf --enable-threads=posix --disable-rpath --without-emacs @@ -23,10 +23,18 @@ changelog="https://git.savannah.gnu.org/cgit/gettext.git/plain/NEWS" distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.gz" checksum=c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12 -case "$XBPS_TARGET_MACHINE" in +subpackages="gettext-devel-examples gettext-devel gettext-devel-tools" +unset _intl_lib +if [ "$XBPS_TARGET_LIBC" = musl ]; then # force libintl - *-musl) configure_args+=" --with-included-gettext";; -esac + configure_args+=" --with-included-gettext" + subpackages+=" gettext-libs" + _intl_lib=intl +else + # on glibc, old gettext-libs conflicts with new one + replaces="gettext-libs>=0" + conflicts="gettext-libs>=0" +fi if [ "$CROSS_BUILD" ]; then hostmakedepends+=" automake libtool" @@ -35,10 +43,9 @@ if [ "$CROSS_BUILD" ]; then } fi - post_install() { - # Fix conflict with musl. - if [ -e ${DESTDIR}/usr/include/libintl.h ]; then + # don't overwrite musl's header + if [ "$XBPS_TARGET_LIBC" = musl ]; then vmkdir usr/include/gettext mv ${DESTDIR}/usr/include/libintl.h ${DESTDIR}/usr/include/gettext/libintl.h fi @@ -50,22 +57,40 @@ gettext-devel-examples_package() { vmove usr/share/doc/gettext } } + gettext-devel_package() { - depends="gettext-libs>=${version}_${revision} xz tar" + depends="gettext-devel-tools>=${version}_${revision} xz tar" + if [ -n "${_intl_lib}" ]; then + depends+=" gettext-libs>=${version}_${revision}" + fi short_desc+=" - development files" pkg_install() { vmove usr/include - vmove usr/lib/*.a - vmove usr/share/aclocal + vmove "usr/lib/*.a" + # libgettext{lib,src}-$version.so need to be in the main package + for _lib in ${_intl_lib} gettextlib gettextpo gettextsrc textstyle + do + vmove "usr/lib/lib${_lib}.so" + done vmove usr/share/gettext vmove usr/share/man/man3 + } +} + +gettext-devel-tools_package() { + short_desc+=" - development tools" + pkg_install() { + vmove usr/share/aclocal vmove usr/bin/autopoint vmove usr/bin/gettextize + vmove usr/share/man/man1/autopoint.1 + vmove usr/share/man/man1/gettextize.1 } } + gettext-libs_package() { short_desc+=" - shared libraries" pkg_install() { - vmove usr/lib/*.so* + vmove "usr/lib/libintl.so.*" } } From 8231a2d0761e529285c4556eccf7090817648782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Thu, 4 Mar 2021 18:46:28 -0300 Subject: [PATCH 2/6] gtranslator: revbump for gettext re-org. --- srcpkgs/gtranslator/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/gtranslator/template b/srcpkgs/gtranslator/template index d0c49d1d778b..f9f9d0e3bc13 100644 --- a/srcpkgs/gtranslator/template +++ b/srcpkgs/gtranslator/template @@ -1,7 +1,7 @@ # Template file for 'gtranslator' pkgname=gtranslator version=3.38.0 -revision=1 +revision=2 build_style=meson hostmakedepends="gettext pkg-config glib-devel itstool" makedepends="gettext-devel libglib-devel libdazzle-devel libsoup-devel From 88967a2ddac4276f2312860d89c1dea5cdc61e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Thu, 4 Mar 2021 18:53:22 -0300 Subject: [PATCH 3/6] fish: don't link against libintl. --- srcpkgs/fish-shell/template | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/srcpkgs/fish-shell/template b/srcpkgs/fish-shell/template index c39fd784c423..800a781f214e 100644 --- a/srcpkgs/fish-shell/template +++ b/srcpkgs/fish-shell/template @@ -1,11 +1,11 @@ # Template file for 'fish-shell' pkgname=fish-shell version=3.2.1 -revision=1 +revision=2 wrksrc="fish-${version}" build_style=cmake hostmakedepends="gettext" -makedepends="ncurses-devel pcre2-devel gettext-devel" +makedepends="ncurses-devel pcre2-devel" depends="groff" checkdepends="python3-pexpect procps-ng" short_desc="User friendly shell intended mostly for interactive use" @@ -15,6 +15,8 @@ homepage="https://fishshell.com/" distfiles="https://github.com/fish-shell/fish-shell/releases/download/${version}/fish-${version}.tar.xz" checksum=d8e49f4090d3778df17dd825e4a2a80192015682423cd9dd02b6675d65c3af5b register_shell="/bin/fish /usr/bin/fish" +# tests don't work as root +make_check=extended if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then makedepends+=" libatomic-devel" From a2f1909bf8972dbf9112862dd8e4fb7dad628ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Thu, 4 Mar 2021 22:40:16 -0300 Subject: [PATCH 4/6] inkscape: don't link against libintl for native builds. --- srcpkgs/inkscape/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template index dd549fae36c6..364f229dba30 100644 --- a/srcpkgs/inkscape/template +++ b/srcpkgs/inkscape/template @@ -1,13 +1,13 @@ # Template file for 'inkscape' pkgname=inkscape version=1.0.2 -revision=1 +revision=2 wrksrc="inkscape-${version}_2021-01-15_e86c870879" build_style=cmake # builds executables then runs checks # FIXME: some tests still fail on musl make_check_target=check -hostmakedepends="automake pkg-config libtool intltool gettext-devel +hostmakedepends="automake pkg-config libtool intltool gettext glib-devel perl-XML-Parser tar which xz" makedepends="harfbuzz-devel libsoup-devel gsl-devel pango-devel double-conversion-devel gc-devel libwpd-devel libcdr-devel libvisio-devel From d6260e47998bf35ca5d2878e0c670413c4cc9875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Thu, 4 Mar 2021 23:07:39 -0300 Subject: [PATCH 5/6] gnutls: don't link against libintl in native builds. Also remove autoreconf, not necessary for now when configure.ac isn't being patched. --- srcpkgs/gnutls/template | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/srcpkgs/gnutls/template b/srcpkgs/gnutls/template index 681f6c7ca8cf..69c6ebecc7d3 100644 --- a/srcpkgs/gnutls/template +++ b/srcpkgs/gnutls/template @@ -1,13 +1,15 @@ # Template file for 'gnutls' pkgname=gnutls version=3.6.15 -revision=1 +revision=2 build_style=gnu-configure configure_args="--with-zlib --disable-guile --disable-static --disable-valgrind-tests --disable-rpath --with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt --with-trousers-lib=${XBPS_CROSS_BASE}/usr/lib" -hostmakedepends="automake gettext-devel libtool pkg-config which" +hostmakedepends="gettext libtool pkg-config which" +# for autoreconf +#hostmakedepends+=" gettext-devel-tools automake" makedepends="zlib-devel lzo-devel readline-devel libgpg-error-devel libtasn1-devel libgcrypt-devel p11-kit-devel nettle-devel libidn2-devel libunistring-devel unbound-devel trousers-devel" @@ -19,10 +21,6 @@ homepage="https://gnutls.org" distfiles="https://www.gnupg.org/ftp/gcrypt/gnutls/v${version%.*}/gnutls-${version}.tar.xz" checksum=0ea8c3283de8d8335d7ae338ef27c53a916f15f382753b174c18b45ffd481558 -pre_configure() { - autoreconf -vfi -} - pre_check() { # same as $PASS in tests/cert-tests/certtool export GNUTLS_PIN=1234 From be374ede73f3be911dd185446fa962be610f40e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Thu, 4 Mar 2021 22:42:05 -0300 Subject: [PATCH 6/6] weechat: generate translations and don't link against libintl. The gnutls-devels -> gnutls -> gettext-libs chain pulled in libintl.so, which ended up unnecessarily linked into the binary. Ironically, no localization files were generated, because gettext wasn't in hostmakedepends. --- srcpkgs/weechat/template | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/srcpkgs/weechat/template b/srcpkgs/weechat/template index eaa22c6a06d4..ce42c986b260 100644 --- a/srcpkgs/weechat/template +++ b/srcpkgs/weechat/template @@ -1,12 +1,13 @@ # Template file for 'weechat' pkgname=weechat version=3.1 -revision=1 +revision=2 build_style=cmake configure_args="-DENABLE_MAN=ON -DENABLE_PERL=ON -DENABLE_LUA=ON -DENABLE_RUBY=ON -DENABLE_SPELL=ON -DENABLE_GUILE=OFF -DENABLE_PHP=OFF -DENABLE_JAVASCRIPT=OFF" -hostmakedepends="ruby-asciidoctor libgcrypt-devel pkg-config python3 tcl-devel" +hostmakedepends="ruby-asciidoctor libgcrypt-devel pkg-config python3 tcl-devel + gettext" makedepends="aspell-devel gnutls-devel libcurl-devel lua53-devel ncurses-devel perl python3-devel ruby-devel tcl-devel" depends="ca-certificates"