build-travis-osx.sh (1821B)
1 #!/bin/sh 2 3 set -e 4 set -x 5 6 # 7 # based on instructions for building xorg-server in https://www.xquartz.org/Developer-Info.html 8 # 9 10 # install XQuartz for libraries, headers, etc. 11 XQUARTZ_VERSION="2.7.11" 12 wget -nv https://dl.bintray.com/xquartz/downloads/XQuartz-${XQUARTZ_VERSION}.dmg 13 hdiutil attach XQuartz-${XQUARTZ_VERSION}.dmg 14 sudo installer -pkg /Volumes/XQuartz-${XQUARTZ_VERSION}/XQuartz.pkg -target / 15 hdiutil detach /Volumes/XQuartz-${XQUARTZ_VERSION} 16 17 # build environment 18 export PATH="/opt/X11/bin:${PATH}" 19 export PKG_CONFIG_PATH="/opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig:${PKG_CONFIG_PATH}" 20 export ACLOCAL="aclocal -I /opt/X11/share/aclocal -I /usr/local/share/aclocal" 21 export CFLAGS="-Wall -O2 -ggdb3 -arch x86_64 -pipe -Wno-typedef-redefinition -Wno-deprecated-declarations" 22 export CXXFLAGS=$CFLAGS 23 export OBJCFLAGS=$CFLAGS 24 export LDFLAGS=$CFLAGS 25 26 # travis currently requires explicit ccache setup on OSX 27 export PATH="/usr/local/opt/ccache/libexec:$PATH" 28 29 # need newer xorgproto 30 pushd $HOME 31 git clone git://anongit.freedesktop.org/git/xorg/proto/xorgproto 32 cd xorgproto 33 if [[ "$1" == "autotools" ]]; then 34 autoreconf -fvi 35 ./configure --prefix=/opt/X11 36 sudo make install 37 elif [[ "$1" == "meson" ]]; then 38 meson _build/ -Dprefix=/opt/X11 39 ninja -C _build/ 40 sudo ninja -C _build/ install 41 else 42 echo "Unknown build tool $1" 43 exit 1 44 fi 45 popd 46 47 # build 48 if [[ "$1" == "autotools" ]]; then 49 autoreconf -fvi 50 ./configure --prefix=/opt/X11 --disable-dependency-tracking --with-apple-application-name=XQuartz --with-bundle-id-prefix=org.macosforge.xquartz 51 make 52 make check 53 make install DESTDIR=$(pwd)/staging 54 elif [[ "$1" == "meson" ]]; then 55 meson _build/ -Dprefix=/opt/X11 -Dsecure-rpc=false 56 DESTDIR=$(pwd)/staging ninja -C _build/ install 57 ninja -C _build/ test 58 fi