1*4882a593Smuzhiyun#!/bin/sh 2*4882a593Smuzhiyun 3*4882a593Smuzhiyunset -e 4*4882a593Smuzhiyunset -x 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun# 7*4882a593Smuzhiyun# based on instructions for building xorg-server in https://www.xquartz.org/Developer-Info.html 8*4882a593Smuzhiyun# 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun# install XQuartz for libraries, headers, etc. 11*4882a593SmuzhiyunXQUARTZ_VERSION="2.7.11" 12*4882a593Smuzhiyunwget -nv https://dl.bintray.com/xquartz/downloads/XQuartz-${XQUARTZ_VERSION}.dmg 13*4882a593Smuzhiyunhdiutil attach XQuartz-${XQUARTZ_VERSION}.dmg 14*4882a593Smuzhiyunsudo installer -pkg /Volumes/XQuartz-${XQUARTZ_VERSION}/XQuartz.pkg -target / 15*4882a593Smuzhiyunhdiutil detach /Volumes/XQuartz-${XQUARTZ_VERSION} 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun# build environment 18*4882a593Smuzhiyunexport PATH="/opt/X11/bin:${PATH}" 19*4882a593Smuzhiyunexport PKG_CONFIG_PATH="/opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig:${PKG_CONFIG_PATH}" 20*4882a593Smuzhiyunexport ACLOCAL="aclocal -I /opt/X11/share/aclocal -I /usr/local/share/aclocal" 21*4882a593Smuzhiyunexport CFLAGS="-Wall -O2 -ggdb3 -arch i386 -arch x86_64 -pipe" 22*4882a593Smuzhiyunexport CXXFLAGS=$CFLAGS 23*4882a593Smuzhiyunexport OBJCFLAGS=$CFLAGS 24*4882a593Smuzhiyunexport LDFLAGS=$CFLAGS 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun# travis currently requires explicit ccache setup on OSX 27*4882a593Smuzhiyunexport PATH="/usr/local/opt/ccache/libexec:$PATH" 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun# need newer xorgproto 30*4882a593Smuzhiyunpushd $HOME 31*4882a593Smuzhiyungit clone git://anongit.freedesktop.org/git/xorg/proto/xorgproto 32*4882a593Smuzhiyuncd xorgproto 33*4882a593Smuzhiyunautoreconf -fvi 34*4882a593Smuzhiyun./configure --prefix=/opt/X11 35*4882a593Smuzhiyunsudo make install 36*4882a593Smuzhiyunpopd 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun# build 39*4882a593Smuzhiyunautoreconf -fvi 40*4882a593Smuzhiyun./configure --prefix=/opt/X11 --disable-dependency-tracking --with-apple-application-name=XQuartz --with-bundle-id-prefix=org.macosforge.xquartz 41*4882a593Smuzhiyunmake 42*4882a593Smuzhiyunmake check 43*4882a593Smuzhiyunmake install DESTDIR=$(pwd)/staging 44