-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libgimp: generate build-only GIR/Typelib variants for macOS.
The previous commit worked for all the compiled executables, but for Python plug-ins (and likely all other GObject-Introspected bindings), we need to generate a temporary typelib linking to the in-build-directory libgimp* libraries. This is similar to what the script `package/macports_build_app.sh` does for packaging in gimp-macos-build repository.
- Loading branch information
Jehan
committed
Apr 16, 2024
1 parent
a78c41d
commit 3e980d5
Showing
3 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters