Upgrade to Swift 3.1 and Xcode 8.3.1

This commit is contained in:
Rene Hexel 2017-04-11 10:11:21 +10:00
parent 2068b0b485
commit 85e179cc66
7 changed files with 30 additions and 10 deletions

View File

@ -4,7 +4,7 @@ import CPango
import CGdkPixbuf
import CGdk
import GLib
import GObject
import GLibObject
import Pango
import Cairo
import PangoCairo

View File

@ -19,3 +19,5 @@ s/: \([A-Za-z.]*Hook[,)]\)/: @escaping \1/g
s/: \([A-Za-z.]*Mapping[,)]\)/: @escaping \1/g
s/: \([A-Za-z.]*Listener[,)]\)/: @escaping \1/g
s/: \([A-Za-z.]*ListenerInit[,)]\)/: @escaping \1/g
s/GObject.Callback/GLibObject.Callback/g
s/public func endPaint/@available(*, deprecated) public func endPaint/

View File

@ -6,21 +6,21 @@ A Swift wrapper around gdk-3.x that is largely auto-generated from gobject-intro
### Swift
To build, you need Swift 3.0 (download from https://swift.org/download/ -- if you are using macOS, make sure you have the command line tools installed as well). Test that your compiler works using `swift --version`, which should give you something like
To build, you need Swift 3.1 (download from https://swift.org/download/ -- if you are using macOS, make sure you have the command line tools installed as well). Test that your compiler works using `swift --version`, which should give you something like
$ swift --version
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Apple Swift version 3.1 (swiftlang-802.0.51 clang-802.0.41)
Target: x86_64-apple-macosx10.9
on macOS, or on Linux you should get something like:
$ swift --version
Swift version 3.0 (swift-3.0-RELEASE)
Swift version 3.1 (swift-3.1-RELEASE)
Target: x86_64-unknown-linux-gnu
### Gtk 3.18 or higher
The Swift wrappers have been tested with glib-2.46 and 2.48, and gdk/gtk 3.18 and 3.20. They should work with higher versions, but YMMV. Also make sure you have `gobject-introspection` and its `.gir` files installed.
The Swift wrappers have been tested with glib-2.46, 2.48 and 2.52, and gdk/gtk 3.18, 3.20, and 3.22. They should work with higher versions, but YMMV. Also make sure you have `gobject-introspection` and its `.gir` files installed.
#### Linux

View File

@ -10,3 +10,10 @@ mod=`echo "${Mod}" | tr '[:upper:]' '[:lower:]'`
export PATH=`pwd`/.build/gir2swift/.build/debug:"${PATH}"
LINKFLAGS=`pkg-config --libs $module pangocairo pangoft2 pango gobject-2.0 gio-unix-2.0 glib-2.0 | tr ' ' '\n' | sed 's/^/-Xlinker /' | tr '\n' ' '`
CCFLAGS=`pkg-config --cflags $module pangocairo pangoft2 pango gobject-2.0 gio-unix-2.0 glib-2.0 | tr ' ' '\n' | sed 's/^/-Xcc /' | tr '\n' ' ' `
TAC="tail -r"
if which tac >/dev/null ; then
TAC=tac
else if which gtac >/dev/null ; then
TAC=gtac
fi
fi

View File

@ -4,4 +4,4 @@
#
. ./config.sh
./clean.sh
exec rm -rf Packages Sources/${Module}.swift Sources/Swift${Mod}.swift ${Mod}.xcodeproj
exec rm -rf Package.pins Packages Sources/${Module}.swift Sources/Swift${Mod}.swift ${Mod}.xcodeproj

View File

@ -13,7 +13,17 @@ if ! pushd .build/gir2swift >/dev/null 2>&1 ; then
fi
export PATH=`pwd`/.build/debug:${PATH}
popd >/dev/null
for gen in Packages/*/gir-to-swift.sh ; do
( cd `dirname $gen` && ./`basename $gen` )
done
export PACKAGES=.build/checkouts
[ -e $PACKAGES ] || export PACKAGES=Packages
if which parallel >/dev/null ; then
for gen in $PACKAGES/*/gir-to-swift.sh ; do \
echo echo \"Generate Swift Wrapper for `basename $(dirname $gen) | cut -d- -f1`\" \; \
"( cd `dirname $gen` && ./`basename $gen` $@ )" ; \
done | $TAC | parallel
else
for gen in $PACKAGES/*/gir-to-swift.sh ; do
echo "Generate Swift Wrapper for `basename $(dirname $gen) | cut -d- -f1`"
( cd `dirname $gen` && ./`basename $gen` "$@" )
done
fi
. ./gir-to-swift.sh "$@"

View File

@ -7,6 +7,7 @@
. ./config.sh
[ -e Sources/${Module}.swift ] || ./generate-wrapper.sh
./package.sh generate-xcodeproj "$@"
[ ! -e ${Mod}.xcodeproj/Configs ] || \
( cd ${Mod}.xcodeproj/Configs && \
mv Project.xcconfig Project.xcconfig.in && \
echo 'SWIFT_VERSION = 3.0' >> Project.xcconfig.in && \
@ -18,5 +19,5 @@
( cd ${Mod}.xcodeproj && \
mv project.pbxproj project.pbxproj.in && \
sed < project.pbxproj.in > project.pbxproj \
-e "s/\(HEADER_SEARCH_PATHS[^A-Za-z][^']*'[^']*\)'/\\1 \\\$(inherited)'/"
-e "s|\(HEADER_SEARCH_PATHS = .\)$|\\1 \"`echo $CCFLAGS | sed -e 's/-Xcc *-I */ /g' -e 's/^ *//' -e 's/ *$//'`\",|"
)