diff --git a/G/Gettext/build_tarballs.jl b/G/Gettext/build_tarballs.jl index 7e3bea920c3..5341f938252 100644 --- a/G/Gettext/build_tarballs.jl +++ b/G/Gettext/build_tarballs.jl @@ -2,35 +2,56 @@ using BinaryBuilder # Collection of sources required to build Gettext name = "Gettext" -version = v"0.20.1" +version = v"0.21.0" + sources = [ - ArchiveSource("https://ftp.gnu.org/pub/gnu/gettext/gettext-$(version).tar.xz", - "53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800"), + ArchiveSource("https://ftp.gnu.org/pub/gnu/gettext/gettext-$(version.major).$(version.minor).tar.xz", + "d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192"), + DirectorySource("./bundled"), ] # Bash recipe for building across all platforms script = raw""" cd $WORKSPACE/srcdir/gettext-*/ + export CFLAGS="-O2" -./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target} +export CPPFLAGS="-I${includedir}" +export LDFLAGS="-L${libdir}" + +if [[ "${target}" == *-mingw* ]]; then + # Apply patch from https://lists.gnu.org/archive/html/bug-gettext/2020-07/msg00035.html + # ../woe32dll/.libs/libgettextsrc_la-c++format.o: In function `__static_initialization_and_destruction_0': + # /workspace/srcdir/gettext-0.21/gettext-tools/src/../woe32dll/../src/format.c:67: undefined reference to `__imp_formatstring_ruby' + atomic_patch -p1 ../patches/0001-build-Fix-build-failure-on-mingw-formatstring_ruby.patch +fi + +./configure --prefix=${prefix} \ + --build=${MACHTYPE} \ + --host=${target} \ + --disable-static \ + --enable-relocatable \ + --with-libiconv-prefix=${prefix} \ + am_cv_lib_iconv=yes \ + am_cv_func_iconv=yes make -j${nproc} make install """ # These are the platforms we will build for by default, unless further # platforms are passed in on the command line -platforms = supported_platforms() +platforms = expand_cxxstring_abis(supported_platforms(; experimental=true)) # The products that we will ensure are always built products = [ - LibraryProduct(["libgettextlib", "libgettextlib-0-20"], :libgettext) + LibraryProduct(["libgettextlib", "libgettextlib-$(version.major)"], :libgettext) ] # Dependencies that must be installed before this package can be built dependencies = [ + Dependency("CompilerSupportLibraries_jll"), Dependency("Libiconv_jll"), Dependency("XML2_jll"), ] # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6") diff --git a/G/Gettext/bundled/patches/0001-build-Fix-build-failure-on-mingw-formatstring_ruby.patch b/G/Gettext/bundled/patches/0001-build-Fix-build-failure-on-mingw-formatstring_ruby.patch new file mode 100644 index 00000000000..1444d5f79b7 --- /dev/null +++ b/G/Gettext/bundled/patches/0001-build-Fix-build-failure-on-mingw-formatstring_ruby.patch @@ -0,0 +1,24 @@ +From 296c70c182c93c78c59c751db45823012dad5b4e Mon Sep 17 00:00:00 2001 +From: Michele Locati +Date: Thu, 30 Jul 2020 18:58:02 +0200 +Subject: [PATCH] build: Fix build failure on mingw (formatstring_ruby) + +--- + gettext-tools/woe32dll/gettextsrc-exports.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gettext-tools/woe32dll/gettextsrc-exports.c b/gettext-tools/woe32dll/gettextsrc-exports.c +index 4477ae8d4..6d7608959 100644 +--- a/gettext-tools/woe32dll/gettextsrc-exports.c ++++ b/gettext-tools/woe32dll/gettextsrc-exports.c +@@ -50,6 +50,7 @@ VARIABLE(formatstring_python) + VARIABLE(formatstring_python_brace) + VARIABLE(formatstring_qt) + VARIABLE(formatstring_qt_plural) ++VARIABLE(formatstring_ruby) + VARIABLE(formatstring_scheme) + VARIABLE(formatstring_sh) + VARIABLE(formatstring_smalltalk) +-- +2.28.0.windows.1 +