forked from yousseb/meld
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_gir.sh
More file actions
executable file
·37 lines (30 loc) · 1.06 KB
/
Copy pathfix_gir.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1.06 KB
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
#!/bin/bash
set -o nounset
set -o errexit
set -o functrace
trap "exit" INT
failure() {
local lineno=$1
local msg=$2
echo "Failed at $lineno: $msg"
}
trap 'failure ${LINENO} "$BASH_COMMAND"' ERR
export MACOSX_DEPLOYMENT_TARGET=10.9
export PATH=$HOME/.new_local/bin:$HOME/gtk/inst/bin:$PATH
# Seems like the build system changed for introspection. We now get many
# gir files without the prefix/full path to the library.
# We want the prefixes. We'll edit them manually later in build_app to point
# to the ones we include.
WORKDIR=$(mktemp -d)
for i in $(find $HOME/gtk/inst/share/gir-1.0 -name *.gir); do
if [ `grep shared-library=\"lib* ${i}` ]; then
gir=$(echo $(basename $i))
typelib=${gir%.*}.typelib
echo Processing $gir to ${WORKDIR}/$typelib
cat $i | sed s_"shared-library=\""_"shared-library=\"$HOME/gtk/inst/lib/"_g > ${WORKDIR}/$gir
cp ${WORKDIR}/$gir $HOME/gtk/inst/share/gir-1.0
$HOME/gtk/inst/bin/g-ir-compiler ${WORKDIR}/$gir -o ${WORKDIR}/$typelib
fi
done
cp ${WORKDIR}/*.typelib $HOME/gtk/inst/lib/girepository-1.0
rm -fr ${WORKDIR}