-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-json-glib.sh
57 lines (39 loc) · 1.58 KB
/
build-json-glib.sh
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
#!/bin/bash
set -ex
[[ $# -eq 2 ]]
source settings.sh
GLIB_RELEASE="${1}"
JSON_GLIB_RELEASE="${2}"
GLIB_PREFIX="${DESTDIR}${GLIB_PREFIX}/${GLIB_RELEASE}"
[[ -d "${GLIB_PREFIX}" ]]
# Environment variables to found uninstalled glib and build against it.
export PKG_CONFIG_PATH="${GLIB_PREFIX}/lib/pkgconfig"
export PKG_CONFIG="pkg-config --define-variable=prefix=${GLIB_PREFIX}"
export LD_LIBRARY_PATH="${GLIB_PREFIX}/lib:${LD_LIBRARY_PATH}"
export PATH="${GLIB_PREFIX}/bin:${PATH}"
JSON_GLIB_VERSION="${JSON_GLIB_RELEASE%.*}"
JSON_GLIB_BASE_SRC_DIR="${JSON_GLIB_BUILD}/${GLIB_RELEASE}"
JSON_GLIB_SRC_DIR="${JSON_GLIB_BASE_SRC_DIR}/json-glib-${JSON_GLIB_RELEASE}"
JSON_GLIB_BUILD_DIR="${JSON_GLIB_BUILD}/json-glib-${JSON_GLIB_RELEASE}-build/${GLIB_RELEASE}"
JSON_GLIB_PREFIX_DIR="${JSON_GLIB_PREFIX}/${JSON_GLIB_RELEASE}/${GLIB_RELEASE}"
wget \
--continue \
--directory-prefix="${JSON_GLIB_BUILD}" \
"http://ftp.gnome.org/pub/gnome/sources/json-glib/${JSON_GLIB_VERSION}/json-glib-${JSON_GLIB_RELEASE}.tar.xz"
mkdir -p "${JSON_GLIB_BASE_SRC_DIR}"
tar \
--extract \
--verbose \
--file "${JSON_GLIB_BUILD}/json-glib-${JSON_GLIB_RELEASE}.tar.xz" \
--directory "${JSON_GLIB_BASE_SRC_DIR}"
mkdir -p "${JSON_GLIB_BUILD_DIR}"
export LDFLAGS="-Wl,--no-as-needed"
pushd "${JSON_GLIB_BUILD_DIR}" > /dev/null
"${JSON_GLIB_SRC_DIR}/configure" \
--prefix="${JSON_GLIB_PREFIX_DIR}" \
--disable-gcov \
--disable-introspection
make -j"$(($(cat /proc/cpuinfo | grep processor | wc -l)+1))"
make DESTDIR="${DESTDIR}" install
find "${DESTDIR}" -name \*.la -delete
popd > /dev/null