-
Notifications
You must be signed in to change notification settings - Fork 571
/
Copy pathbuild_tarballs.jl
65 lines (54 loc) · 1.64 KB
/
build_tarballs.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg
name = "MiniZinc"
version = v"2.8.5"
sources = [
GitSource(
"https://github.com/MiniZinc/libminizinc.git",
"2fdef7b40921981f3f9ea82017e9d84937ddab77",
),
DirectorySource("./bundled"),
]
script = raw"""
cd $WORKSPACE/srcdir/libminizinc
atomic_patch -p1 ${WORKSPACE}/srcdir/patches/fixes.patch
# Patch for MinGW toolchain
find .. -type f -exec sed -i 's/Windows.h/windows.h/g' {} +
# FAST_BUILD is needed when linking HiGHS, because that's what
# we used when compiling HiGHS_jll.
cmake -B build \
-DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-I${includedir}/highs" \
-DFAST_BUILD=ON
cmake --build build --parallel ${nproc}
cmake --install build
"""
products = [
ExecutableProduct("minizinc", :minizinc),
]
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = expand_cxxstring_abis(
supported_platforms(; exclude = p -> arch(p) == "i686" && Sys.iswindows(p)),
)
dependencies = [
Dependency("CompilerSupportLibraries_jll"),
# Use an exact version for HiGHS. @odow has observed segfaults with
# HiGHS_jll v1.5.3 when libminizinc compiled with v1.5.1.
Dependency("HiGHS_jll"; compat="=1.7.1"),
]
build_tarballs(
ARGS,
name,
version,
sources,
script,
platforms,
products,
dependencies;
preferred_gcc_version = v"6",
julia_compat = "1.6",
)