Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gettext: Update to version 0.22.4 #21649

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 34 additions & 89 deletions devel/gettext/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ PortGroup muniversal 1.0
PortGroup clang_dependency 1.0

name gettext
version 0.21.1
checksums rmd160 fbdfec7f0be090da26f9864be03c4565a3dc0d6a \
sha256 e8c3650e1d8cee875c4f355642382c1df83058bd5a11ee8555c0cf276d646d45 \
size 25248473
version 0.22.4
checksums rmd160 4d022f548b14338d0515e82bfd6c66ba2c54c276 \
sha256 c1e0bb2a4427a9024390c662cd532d664c4b36b8ff444ed5e54b115fdb7a1aea \
size 26753319

categories devel
maintainers {ryandesign @ryandesign}
Expand All @@ -21,17 +21,13 @@ use_parallel_build yes
# https://trac.macports.org/ticket/31167
compiler.blacklist-append {clang < 211.10.1}

if {${subport} in "${name} ${name}-tools-libs"} {
# https://savannah.gnu.org/bugs/?63866
compiler.blacklist-append {clang >= 600 < 700}
}

# Also needed by later clangs.
if {${os.platform} eq "darwin" && ${os.major} < 11 && ${cxx_stdlib} eq "libc++"} {
clang_dependency.extra_versions 3.7
}

patch.dir ${worksrcpath}
patchfiles has_attribute.patch

configure.args-append ac_cv_prog_AWK=/usr/bin/awk \
ac_cv_path_GMSGFMT=: \
Expand Down Expand Up @@ -141,76 +137,24 @@ subport ${name}-runtime {
subport ${name}-tools-libs {
revision 0

license GPL-3+

description GNU internationalization (i18n) and \
localization (l10n) tools libraries

long_description ${subport} provides the required libraries \
for tools like msgfmt from gettext

depends_lib-append port:libiconv \
port:libtextstyle \
port:gettext-runtime

# Set configure.dir and build.dir rather than worksrcdir so that the
# muniversal portgroup will copy the entire worksrcdir and not just
# this subdirectory, because the build compiles files outside of this
# directory and we need separate builds of everything for each arch.
configure.dir ${worksrcpath}/${name}-tools
build.dir ${configure.dir}

configure.args-append --disable-openmp \
--with-included-libunistring \
--with-included-libxml \
--with-installed-libtextstyle \
--without-emacs

# Don't use possibly installed cvs or git to create the autopoint
# archive because the archives they create for each architecture
# under muniversal will differ and cannot be merged.
configure.args-append --without-cvs \
--without-git

# Don't use xz because then xz would be required by various ports
# that just want to use gettext.
configure.args-append --without-xz

# Prevent the lang-c++ test from failing.
# TODO: report this to the developers; there's no reason why
# libasprintf should be getting built again. Might be the same as
# https://savannah.gnu.org/bugs/?58669
configure.args-append --disable-libasprintf

post-destroot {
# Remove the executables and the libraries provided
# by the runtime. Just leave the libraries and headers
# for the tools.
delete {*}[glob ${destroot}${prefix}/*/libintl.*] \
{*}[glob ${destroot}${prefix}/bin/*] \
# Remove the executables provided by the gettext subport.
# Just leave the libraries and headers for the tools.
delete {*}[glob ${destroot}${prefix}/bin/*] \
{*}[glob ${destroot}${prefix}/share/*]
}
}

if {${subport} in "${name}-runtime ${name}-tools-libs libasprintf"} {
pre-activate {
# gettext < 0.20 installed files now installed by gettext-runtime and
# libasprintf. This deactivate hack can be removed after 2022-11-29.
if {![catch {set installed [lindex [registry_active gettext] 0]}]} {
set installed_version [lindex ${installed} 1]
if {[vercmp ${installed_version} 0.20] < 0} {
registry_deactivate_composite gettext "" [list ports_nodepcheck 1]
}
}
}
}

if {${subport} eq ${name}} {
epoch 2
revision 0

license GPL-3+

description GNU internationalization (i18n) and \
localization (l10n) tools

Expand All @@ -220,19 +164,32 @@ if {${subport} eq ${name}} {
gettext. The runtime library libintl is in \
the separate gettext-runtime port.

depends_lib-append port:libiconv \
port:libtextstyle \
port:gettext-runtime \
port:gettext-tools-libs
depends_lib-append port:${name}-tools-libs

installs_libs no

# Set configure.dir and build.dir rather than worksrcdir so that the
# muniversal portgroup will copy the entire worksrcdir and not just
# this subdirectory, because the build compiles files outside of this
# directory and we need separate builds of everything for each arch.
configure.dir ${worksrcpath}/${name}-tools
build.dir ${configure.dir}
post-destroot {
# Remove the libraries and headers which are provided
# by gettext-tools-libs
delete {*}[glob ${destroot}${prefix}/lib/*] \
{*}[glob ${destroot}${prefix}/include/*]
}

livecheck.type regex
livecheck.url https://ftp.gnu.org/gnu/gettext/?C=M&O=D
livecheck.regex ${name}-(\[0-9.\]+)\\.tar
} else {
livecheck.type none
}

if {${subport} in [list ${name} ${name}-tools-libs]} {
license GPL-3+

depends_build-append port:ncurses

depends_lib-append port:libiconv \
port:libtextstyle \
port:${name}-runtime

configure.args-append --disable-openmp \
--with-included-libunistring \
Expand All @@ -256,19 +213,7 @@ if {${subport} eq ${name}} {
# https://savannah.gnu.org/bugs/?58669
configure.args-append --disable-libasprintf

post-destroot {
# Remove files already installed by gettext-runtime.
# https://savannah.gnu.org/bugs/?58669
# Remove the libraries and headers which are provided
# by gettext-tools-libs
delete {*}[glob ${destroot}${prefix}/lib/*] \
{*}[glob ${destroot}${prefix}/include/*] \
${destroot}${prefix}/share/locale/locale.alias
}

livecheck.type regex
livecheck.url https://ftp.gnu.org/gnu/gettext/?C=M&O=D
livecheck.regex ${name}-(\[0-9.\]+)\\.tar
} else {
livecheck.type none
# Install from the tools subpackage, so that only its files
# are installed.
destroot.dir ${worksrcpath}/${name}-tools
}
90 changes: 90 additions & 0 deletions devel/gettext/files/has_attribute.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Fix the Apple clang version cutoff point for a working __has_attribute.
https://savannah.gnu.org/bugs/?63866
--- gettext-runtime/config.h.in 2023-11-19 14:22:34.000000000 -0600
+++ gettext-runtime/config.h.in 2024-01-29 02:29:09.000000000 -0600
@@ -1421,7 +1421,7 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 5 <= __clang_major__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
--- gettext-runtime/gnulib-lib/cdefs.h 2023-09-18 15:35:08.000000000 -0500
+++ gettext-runtime/gnulib-lib/cdefs.h 2024-01-29 02:29:09.000000000 -0600
@@ -42,7 +42,7 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))
# define __glibc_has_attribute(attr) __has_attribute (attr)
#else
--- gettext-runtime/intl/config.h.in 2023-11-19 14:22:28.000000000 -0600
+++ gettext-runtime/intl/config.h.in 2024-01-29 02:29:09.000000000 -0600
@@ -1151,7 +1151,7 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 5 <= __clang_major__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
--- gettext-runtime/libasprintf/config.h.in 2023-11-19 14:22:30.000000000 -0600
+++ gettext-runtime/libasprintf/config.h.in 2024-01-29 02:29:09.000000000 -0600
@@ -691,7 +691,7 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 5 <= __clang_major__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
--- gettext-tools/config.h.in 2023-11-19 14:23:03.000000000 -0600
+++ gettext-tools/config.h.in 2024-01-29 02:29:09.000000000 -0600
@@ -2986,7 +2986,7 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 5 <= __clang_major__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
--- gettext-tools/gnulib-lib/cdefs.h 2023-09-18 15:35:52.000000000 -0500
+++ gettext-tools/gnulib-lib/cdefs.h 2024-01-29 02:29:09.000000000 -0600
@@ -42,7 +42,7 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))
# define __glibc_has_attribute(attr) __has_attribute (attr)
#else
--- gettext-tools/libgrep/cdefs.h 2023-09-18 15:36:21.000000000 -0500
+++ gettext-tools/libgrep/cdefs.h 2024-01-29 02:29:09.000000000 -0600
@@ -42,7 +42,7 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))
# define __glibc_has_attribute(attr) __has_attribute (attr)
#else
--- libtextstyle/config.h.in 2023-11-19 14:22:53.000000000 -0600
+++ libtextstyle/config.h.in 2024-01-29 02:29:09.000000000 -0600
@@ -1392,7 +1392,7 @@
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 5 <= __clang_major__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
Loading