Skip to content

Commit

Permalink
[Zstd] Use meson to configure the build
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed May 1, 2020
1 parent a68d009 commit 5988375
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Z/Zstd/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name = "Zstd"
version = v"1.4.4"

sources = [
"https://github.com/facebook/zstd/releases/download/v$version/zstd-$version.tar.gz" =>
"59ef70ebb757ffe74a7b3fe9c305e2ba3350021a918d168a046c6300aeea9315",
"./bundled"
ArchiveSource("https://github.com/facebook/zstd/releases/download/v$version/zstd-$version.tar.gz",
"59ef70ebb757ffe74a7b3fe9c305e2ba3350021a918d168a046c6300aeea9315"),
DirectorySource("./bundled"),
]

script = raw"""
Expand All @@ -15,11 +15,15 @@ atomic_patch -p1 ../patches/timefn_h_windows.patch
mkdir build-zstd && cd build-zstd
if [[ "${target}" == aarch64-linux-gnu ]]; then
# Work around https://github.com/facebook/zstd/issues/1872
export CFLAGS=-D_POSIX_C_SOURCE
#
# ../programs/util.c:76:29: error: ‘stat_t’ has no member named ‘st_mtim’
# timebuf[1] = statbuf->st_mtim;
# ^
sed -i "s/c_args = \[\]/c_args = ['-D_POSIX_C_SOURCE']/" "${MESON_TARGET_TOOLCHAIN}"
fi
cmake -DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release ../build/cmake/
make -j${nproc}
make install
meson --cross-file="${MESON_TARGET_TOOLCHAIN}" ../build/meson/
ninja -j${nproc}
ninja install
"""

platforms = supported_platforms()
Expand All @@ -30,6 +34,6 @@ products = [
ExecutableProduct("zstdmt", :zstdmt),
]

dependencies = []
dependencies = Dependency[]

build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)

0 comments on commit 5988375

Please sign in to comment.