Skip to content

Commit

Permalink
Make this build when pkg-config inserts extra commas (e.g. gtk-3.24.21)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhx committed Jul 12, 2020
1 parent 7f0c35c commit 16a9535
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ BUILD_BIN=${BUILD_DIR}/debug
BUILT_PRODUCTS_DIR=${BUILD_DIR}/app
export PACKAGES=.build/checkouts
[ -e $PACKAGES ] || export PACKAGES=Packages
export PATH="${BUILD_DIR}/gir2swift/.build/release:${BUILD_DIR}/gir2swift/.build/debug:${PATH}"
export PATH="${GIR2SWIFT_PATH}:${BUILD_DIR}/gir2swift/.build/release:${BUILD_DIR}/gir2swift/.build/debug:${PATH}"
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:${PKG_CONFIG_PATH}
GOBJECT_LIBDIR=`pkg-config --libs-only-L gobject-introspection-1.0 2>/dev/null | tr ' ' '\n' | grep gobject-introspection | tail -n1 | cut -c3-`
LINKFLAGS=`pkg-config --libs gtk+-$ver gdk-$ver pangocairo pangoft2 pango gobject-2.0 gio-unix-2.0 glib-2.0 | sed -e 's/ *--export-dynamic */ /g' -e 's/ *-Wl, */ /g' -e 's/-pthread/-lpthread/g' -e 's/ */ /g' -e 's/^ *//' -e 's/ *$//' | tr ' ' '\n' | tr ' ' '\n' | sed -e 's/^/-Xlinker /' | tr '\n' ' ' | sed -e 's/-Xlinker *-Xlinker/-Xlinker/g' -e 's/-Xlinker *$//'`" -Xlinker -L/usr/local/lib"
CCFLAGS=`pkg-config --cflags gtk+-$ver gdk-$ver pangocairo pangoft2 pango gobject-2.0 gio-unix-2.0 glib-2.0 | sed -e 's/ *-Wl, */ /g' -e 's/ *-pthread */ /g' -e 's/ *--export-dynamic */ /g' -e 's/ */ /g' -e 's/^ *//' -e 's/ *$//' | tr ' ' '\n' | tr ' ' '\n' | sed 's/^/-Xcc /' | tr '\n' ' ' | sed -e 's/-Xcc *$//'`
LINKFLAGS=`pkg-config --libs gtk+-$ver gdk-$ver pangocairo pangoft2 pango gobject-2.0 gio-unix-2.0 glib-2.0 | sed -e 's/ *--export-dynamic */ /g' -e 's/ *-Wl, */ /g' -e 's/,/ -Xlinker /g' -e 's/-pthread/-lpthread/g' -e 's/ */ /g' -e 's/^ *//' -e 's/ *$//' | tr ' ' '\n' | tr ' ' '\n' | sed -e 's/^/-Xlinker /' | tr '\n' ' ' | sed -e 's/-Xlinker[ ]*-Xlinker/-Xlinker/g' -e 's/-Xlinker[ ]*-Xlinker/-Xlinker/g' -e 's/-Xlinker *$//'`" -Xlinker -L/usr/local/lib"
CCFLAGS=`pkg-config --cflags gtk+-$ver gdk-$ver pangocairo pangoft2 pango gobject-2.0 gio-unix-2.0 glib-2.0 | sed -e 's/ *-Wl, */ /g' -e 's/,/ -Xlinker /g' -e 's/ *-pthread */ /g' -e 's/ *--export-dynamic */ /g' -e 's/ */ /g' -e 's/^ *//' -e 's/ *$//' | tr ' ' '\n' | tr ' ' '\n' | sed 's/^/-Xcc /' | tr '\n' ' ' | sed -e 's/-Xlinker[ ]*-Xlinker/-Xlinker/g' -e 's/-Xcc *$//'`
TAC="tail -r"
if which tac >/dev/null ; then
TAC=tac
Expand Down
11 changes: 6 additions & 5 deletions generate-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
#
. ./config.sh
./package.sh update
if ! pushd .build/gir2swift >/dev/null 2>&1 ; then
mkdir -p .build
pushd .build >/dev/null
if [ ! -x "${GIR2SWIFT_PATH}/gir2swift" ] &&
! pushd "$BUILD_DIR/gir2swift" >/dev/null 2>&1 ; then
mkdir -p "$BUILD_DIR"
pushd "$BUILD_DIR" >/dev/null
git clone https://github.com/rhx/gir2swift.git
cd gir2swift && ./build.sh
fi
export PATH=`pwd`/.build/debug:${PATH}
popd >/dev/null
export PACKAGES=.build/checkouts
popd >/dev/null 2>&1
export PACKAGES="$BUILD_DIR/checkouts"
[ -e $PACKAGES ] || export PACKAGES=Packages
if which parallel >/dev/null ; then
for gen in $PACKAGES/*/gir-to-swift.sh ; do \
Expand Down

0 comments on commit 16a9535

Please sign in to comment.