Split out non-recursive gir-to-swift.sh
This commit is contained in:
parent
177bdd8806
commit
8465c21efc
|
@ -1,28 +1,11 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Swift code wrapper generator for gobject-introspection (.gir) files.
|
||||
# This needs an installed `gir2swift' executable (github.com/rhx/gir2swift)
|
||||
# Recursive swift code wrapper generator for gobject-introspection (.gir) files.
|
||||
# This calls the non-recursive gir-to-swift.sh to do the heavy lifting.
|
||||
#
|
||||
. ./config.sh
|
||||
./package.sh fetch
|
||||
mkdir -p Sources
|
||||
GOBJECT_LIBDIR=`pkg-config --libs-only-L gobject-introspection-1.0 2>/dev/null | tr ' ' '\n' | grep gobject-introspection | tail -n1 | cut -c3-`
|
||||
GOBJECT_DIR=`dirname "${GOBJECT_LIBDIR}"`
|
||||
for prefix in $PREFIX GOBJECT_DIR /usr/local /usr ; do
|
||||
gir_dir=${prefix}/share/gir-1.0
|
||||
gir=${gir_dir}/${Module}.gir
|
||||
if [ -e "${gir}" ] ; then
|
||||
export GIR=${gir}
|
||||
export GIR_DIR=${gir_dir}
|
||||
fi
|
||||
done
|
||||
if [ ! -e "${GIR}" ] ; then
|
||||
echo "*** ${GIR} does not exist!"
|
||||
echo "Make sure libgirepository1.0-dev is installed"
|
||||
echo "and can be found in /usr /usr/local or by pkg-config!"
|
||||
exit 1
|
||||
fi
|
||||
for gen in Packages/*/generate-wrapper.sh ; do
|
||||
for gen in Packages/*/gir-to-swift.sh ; do
|
||||
( cd `dirname $gen` && ./`basename $gen` )
|
||||
done
|
||||
gir2swift -p ${GIR_DIR}/GLib-2.0.gir -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/Pango-1.0.gir -p ${GIR_DIR}/cairo-1.0.gir -p ${GIR_DIR}/PangoCairo-1.0.gir -p ${GIR_DIR}/GdkPixbuf-2.0.gir "${GIR}" | sed -f ${Module}.sed > Sources/${Module}.swift
|
||||
. ./gir-to-swift.sh "$@"
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Swift code wrapper generator for gobject-introspection (.gir) files.
|
||||
# This needs an installed `gir2swift' executable (github.com/rhx/gir2swift)
|
||||
#
|
||||
. ./config.sh
|
||||
mkdir -p Sources
|
||||
GOBJECT_LIBDIR=`pkg-config --libs-only-L gobject-introspection-1.0 2>/dev/null | tr ' ' '\n' | grep gobject-introspection | tail -n1 | cut -c3-`
|
||||
GOBJECT_DIR=`dirname "${GOBJECT_LIBDIR}"`
|
||||
for prefix in $PREFIX GOBJECT_DIR /usr/local /usr ; do
|
||||
gir_dir=${prefix}/share/gir-1.0
|
||||
gir=${gir_dir}/${Module}.gir
|
||||
if [ -e "${gir}" ] ; then
|
||||
export GIR=${gir}
|
||||
export GIR_DIR=${gir_dir}
|
||||
fi
|
||||
done
|
||||
if [ ! -e "${GIR}" ] ; then
|
||||
echo "*** ${GIR} does not exist!"
|
||||
echo "Make sure libgirepository1.0-dev is installed"
|
||||
echo "and can be found in /usr /usr/local or by pkg-config!"
|
||||
exit 1
|
||||
fi
|
||||
gir2swift -p ${GIR_DIR}/GLib-2.0.gir -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/Pango-1.0.gir -p ${GIR_DIR}/cairo-1.0.gir -p ${GIR_DIR}/PangoCairo-1.0.gir -p ${GIR_DIR}/GdkPixbuf-2.0.gir "${GIR}" | sed -f ${Module}.sed > Sources/${Module}.swift
|
Loading…
Reference in New Issue