Skip to content

Commit a7648fd

Browse files
authored
[GR] Add GRQt5 package (#6752)
1 parent 00d2df2 commit a7648fd

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

G/GRQt5/build_tarballs.jl

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Note that this script can accept some limited command-line arguments, run
2+
# `julia build_tarballs.jl --help` to see a usage message.
3+
using BinaryBuilder
4+
5+
name = "GRQt5"
6+
version = v"0.72.7"
7+
8+
# Collection of sources required to complete build
9+
sources = [
10+
GitSource("https://github.com/sciapp/gr.git", "d0758e25475bcbe3da796ef0290be9e2a942e87c"),
11+
FileSource("https://github.com/sciapp/gr/releases/download/v$version/gr-$version.js",
12+
"203269cc2dbce49536e54e7f0ece3542a8bd5bec4931b0937846a1e260e00312", "gr.js"),
13+
ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.14.sdk.tar.xz",
14+
"0f03869f72df8705b832910517b47dd5b79eb4e160512602f593ed243b28715f")
15+
]
16+
17+
# Bash recipe for building across all platforms
18+
script = raw"""
19+
cd $WORKSPACE/srcdir/gr
20+
21+
if test -f "$prefix/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake"; then
22+
sed -i 's/_qt5gui_find_extra_libs.*AGL.framework.*//' $prefix/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake
23+
fi
24+
25+
update_configure_scripts
26+
27+
make -C 3rdparty/qhull -j${nproc}
28+
29+
if [[ $target == *"mingw"* ]]; then
30+
winflags=-DCMAKE_C_FLAGS="-D_WIN32_WINNT=0x0f00"
31+
tifflags=-DTIFF_LIBRARY=${libdir}/libtiff-5.dll
32+
else
33+
tifflags=-DTIFF_LIBRARY=${libdir}/libtiff.${dlext}
34+
fi
35+
36+
if [[ "${target}" == x86_64-apple-darwin* ]]; then
37+
apple_sdk_root=$WORKSPACE/srcdir/MacOSX10.14.sdk
38+
sed -i "s!/opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root!$apple_sdk_root!" $CMAKE_TARGET_TOOLCHAIN
39+
export MACOSX_DEPLOYMENT_TARGET=10.14
40+
fi
41+
42+
if [[ "${target}" == *apple* ]]; then
43+
make -C 3rdparty/zeromq ZEROMQ_EXTRA_CONFIGURE_FLAGS="--host=${target}"
44+
fi
45+
46+
if [[ "${target}" == arm-* ]]; then
47+
export CXXFLAGS="-Wl,-rpath-link,/opt/${target}/${target}/lib"
48+
fi
49+
50+
stagingprefix=$WORKSPACE/srcdir/staging
51+
mkdir $stagingprefix
52+
mkdir build
53+
54+
cd build
55+
cmake $winflags -DCMAKE_INSTALL_PREFIX=$stagingprefix -DCMAKE_FIND_ROOT_PATH=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DGR_USE_BUNDLED_LIBRARIES=ON $tifflags -DCMAKE_BUILD_TYPE=Release ..
56+
57+
VERBOSE=ON cmake --build . --config Release --target install -- -j${nproc}
58+
cp -a $stagingprefix/lib/*qt5* $prefix/lib
59+
60+
install_license $WORKSPACE/srcdir/gr/LICENSE.md
61+
62+
if [[ $target == *"apple-darwin"* ]]; then
63+
rm -rf $stagingprefix/Applications/GKSTerm.app
64+
cp -a $stagingprefix/Applications $prefix
65+
cd ${bindir}
66+
ln -s ../Applications/gksqt.app/Contents/MacOS/gksqt ./
67+
ln -s ../Applications/grplot.app/Contents/MacOS/grplot ./
68+
else
69+
cp -a $stagingprefix/bin/gksqt* $bindir
70+
cp -a $stagingprefix/bin/grplot* $bindir
71+
fi
72+
73+
if [[ $target == *"mingw32"* ]]; then
74+
cp -a $stagingprefix/bin/*qt5* $bindir
75+
fi
76+
"""
77+
78+
# These are the platforms we will build for by default, unless further
79+
# platforms are passed in on the command line
80+
platforms = [
81+
Platform("armv7l", "linux"; libc="glibc"),
82+
Platform("aarch64", "linux"; libc="glibc"),
83+
Platform("x86_64", "linux"; libc="glibc"),
84+
Platform("i686", "linux"; libc="glibc"),
85+
Platform("powerpc64le", "linux"; libc="glibc"),
86+
Platform("x86_64", "windows"),
87+
Platform("i686", "windows"),
88+
Platform("x86_64", "macos"),
89+
Platform("aarch64", "macos"),
90+
Platform("x86_64", "freebsd"),
91+
]
92+
platforms = expand_cxxstring_abis(platforms)
93+
94+
# The products that we will ensure are always built
95+
products = [
96+
ExecutableProduct("gksqt", :gksqt),
97+
ExecutableProduct("grplot", :grplot),
98+
]
99+
100+
# Dependencies that must be installed before this package can be built
101+
dependencies = [
102+
Dependency("Bzip2_jll"; compat="1.0.8"),
103+
Dependency("Cairo_jll"; compat="1.16.1"),
104+
Dependency("FFMPEG_jll"),
105+
Dependency("Fontconfig_jll"),
106+
Dependency("JpegTurbo_jll"),
107+
Dependency("libpng_jll"),
108+
Dependency("Libtiff_jll"; compat="4.3.0"),
109+
Dependency("Pixman_jll"),
110+
# Dependency("Qhull_jll"),
111+
Dependency("Qt5Base_jll"),
112+
BuildDependency("Xorg_libX11_jll"),
113+
BuildDependency("Xorg_xproto_jll"),
114+
Dependency("Zlib_jll"),
115+
]
116+
117+
# Build the tarballs, and possibly a `build.jl` as well.
118+
# GCC version 7 because of ffmpeg, but building against Qt requires v8 on Windows.
119+
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
120+
preferred_gcc_version = v"8", julia_compat="1.6")

0 commit comments

Comments
 (0)