|
| 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, Pkg |
| 4 | + |
| 5 | +name = "GlibNetworking" |
| 6 | +version = v"2.74.0" |
| 7 | + |
| 8 | +# Collection of sources required to complete build |
| 9 | +sources = [ |
| 10 | + ArchiveSource("https://download.gnome.org/sources/glib-networking/$(version.major).$(version.minor)/glib-networking-$(version).tar.xz", "1f185aaef094123f8e25d8fa55661b3fd71020163a0174adb35a37685cda613b") |
| 11 | +] |
| 12 | + |
| 13 | +# Bash recipe for building across all platforms |
| 14 | +script = raw""" |
| 15 | +
|
| 16 | +# We need to run some commands with a native Glib |
| 17 | +apk add glib-dev |
| 18 | +# Copied from GTK4 recipe |
| 19 | +ln -sf /usr/bin/glib-compile-resources ${bindir}/glib-compile-resources |
| 20 | +ln -sf /usr/bin/glib-compile-schemas ${bindir}/glib-compile-schemas |
| 21 | +# Remove gio-2.0 pkgconfig file so that it isn't picked up by post-install script. |
| 22 | +rm ${prefix}/lib/pkgconfig/gio-2.0.pc |
| 23 | +
|
| 24 | +
|
| 25 | +cd $WORKSPACE/srcdir |
| 26 | +install_license glib-networking-*/COPYING |
| 27 | +
|
| 28 | +MESON_FLAGS=(--cross-file="${MESON_TARGET_TOOLCHAIN}") |
| 29 | +MESON_FLAGS+=(--buildtype=release) |
| 30 | +MESON_FLAGS+=(-Dopenssl=enabled) |
| 31 | +
|
| 32 | +meson "${MESON_FLAGS[@]}" glib-networking-*/ |
| 33 | +ninja -j${nproc} --verbose |
| 34 | +ninja install |
| 35 | +
|
| 36 | +
|
| 37 | +# Remove temporary links |
| 38 | +rm ${bindir}/glib-compile-{resources,schemas} |
| 39 | +""" |
| 40 | + |
| 41 | +# These are the platforms we will build for by default, unless further |
| 42 | +# platforms are passed in on the command line |
| 43 | +platforms = filter!(p -> !Sys.iswindows(p), supported_platforms()) |
| 44 | +platforms_windows = filter!(p -> Sys.iswindows(p), supported_platforms()) |
| 45 | + |
| 46 | + |
| 47 | +# The products that we will ensure are always built |
| 48 | +products = [ |
| 49 | + FileProduct("lib/gio/modules/libgioenvironmentproxy.so", :libgioenvironmentproxy), |
| 50 | + FileProduct("lib/gio/modules/libgioopenssl.so", :libgioopenssl) |
| 51 | +] |
| 52 | + |
| 53 | +products_windows = [ |
| 54 | + FileProduct("bin/libgioenvironmentproxy.dll", :libgioenvironmentproxy), |
| 55 | + FileProduct("bin/libgioopenssl.dll", :libgioopenssl) |
| 56 | +] |
| 57 | + |
| 58 | +# Dependencies that must be installed before this package can be built |
| 59 | +dependencies = [ |
| 60 | + HostBuildDependency("Gettext_jll") |
| 61 | + Dependency("OpenSSL_jll"; compat="1.1.10") |
| 62 | + Dependency("Glib_jll"; compat="2.74.0") |
| 63 | +] |
| 64 | + |
| 65 | +include("../../fancy_toys.jl") |
| 66 | + |
| 67 | +# Build the tarballs, and possibly a `build.jl` as well. |
| 68 | +if any(should_build_platform.(triplet.(platforms_windows))) |
| 69 | + build_tarballs(ARGS, name, version, sources, script, platforms_windows, products_windows, dependencies; julia_compat="1.6") |
| 70 | +end |
| 71 | +if any(should_build_platform.(triplet.(platforms))) |
| 72 | + build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6") |
| 73 | +end |
0 commit comments