Skip to content

Commit

Permalink
split gettext and gettext-tools-libs
Browse files Browse the repository at this point in the history
The subport gettext-tools-libs provides the libraries for the
gettext tools like msgfmt which are und GPL+3 license. The
gettext tools port can now be marked "installslibs no".

If a package which has a license not compatible with GPL+3, then
it can still use the gettext tools unless it does not link to
the gettext libraries.
  • Loading branch information
fredowski authored and mascguy committed Nov 29, 2021
1 parent e416013 commit baf0c8b
Showing 1 changed file with 62 additions and 2 deletions.
64 changes: 62 additions & 2 deletions devel/gettext/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,60 @@ 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/*] \
{*}[glob ${destroot}${prefix}/share/*]
}
}

if {${subport} in "${name}-runtime libasprintf"} {
pre-activate {
# gettext < 0.20 installed files now installed by gettext-runtime and
Expand Down Expand Up @@ -150,7 +204,10 @@ if {${subport} eq ${name}} {

depends_lib-append port:libiconv \
port:libtextstyle \
port:gettext-runtime
port:gettext-runtime \
port:gettext-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
Expand Down Expand Up @@ -184,7 +241,10 @@ if {${subport} eq ${name}} {
post-destroot {
# Remove files already installed by gettext-runtime.
# https://savannah.gnu.org/bugs/?58669
delete {*}[glob ${destroot}${prefix}/*/libintl.*] \
# 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
}

Expand Down

0 comments on commit baf0c8b

Please sign in to comment.