File: make-in-build-typelib.sh

package info (click to toggle)
gimp 3.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 210,368 kB
  • sloc: ansic: 845,152; lisp: 10,855; python: 10,330; cpp: 7,238; perl: 4,382; sh: 1,412; xml: 963; yacc: 609; lex: 348; javascript: 150; makefile: 43
file content (33 lines) | stat: -rw-r--r-- 1,202 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
# macOS-only script to generate temporary .gir and .typelib files only to be
# used during build, pointing to the non-installed libgimp* libraries.
# This allows to run non-installed GIMP binaries in a macOS development
# environment.

gimp_gir="$1"
gimp_typelib="$2"
gimpui_gir="$3"
gimpui_typelib="$4"
builddir="$5"
prefix="$6"
g_ir_compiler="$7"

echo PWD: $PWD
echo ARGS: "$*"

# This is only for macOS.
mkdir -p $builddir/tmp/
cp -f "$gimp_gir" "$gimpui_gir" "$builddir/tmp/"
cd "$builddir/tmp/"
gimp_gir=`basename "$gimp_gir"`
gimpui_gir=`basename "$gimpui_gir"`
gimp_typelib=`basename "$gimp_typelib"`
gimpui_typelib=`basename "$gimpui_typelib"`

sed -i '' "s|${prefix}/*||g" "$gimp_gir" "$gimpui_gir"
sed -i '' "s|@rpath/||g" "$gimp_gir" "$gimpui_gir"
sed -i '' 's|lib/\(libgimp\(ui\)\?-\([0-9.]*\).dylib\)|libgimp/\1|g; s|lib/\(libgimp\([a-z]*\)-\([0-9.]*\).dylib\)|libgimp\2/\1|g;' "$gimp_gir" "$gimpui_gir"
$g_ir_compiler --includedir=${prefix}/share/gir-1.0/ --includedir=. "$gimp_gir" -o "${gimp_typelib}"
$g_ir_compiler --includedir=${prefix}/share/gir-1.0/ --includedir=.  "$gimpui_gir" -o "${gimpui_typelib}"

echo "/* Generated on `date`. */" > $builddir/macos-typelib.stamp