Skip to content

Commit

Permalink
[Gettext] Upgrade to v0.21 and build for experimental platforms (#3037)
Browse files Browse the repository at this point in the history
* [Gettext] Upgrade to v0.21 and build for experimental platforms
  • Loading branch information
giordano authored May 20, 2021
1 parent b77ee50 commit 0c67fe3
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
35 changes: 28 additions & 7 deletions G/Gettext/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 296c70c182c93c78c59c751db45823012dad5b4e Mon Sep 17 00:00:00 2001
From: Michele Locati <[email protected]>
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

0 comments on commit 0c67fe3

Please sign in to comment.