source: git/buildmacosx.sh @ b7510ee

RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-datawalls-data-hanging-as-warning
Last change on this file since b7510ee was b7510ee, checked in by Olly Betts <olly@…>, 14 years ago

buildmacosx.sh: Update to use WX_CONFIG not WXCONFIG. Update to
use a Unicode build. If building a private wx, use wx 2.8.11 not
2.7.0-1 (and don't replace carbon-glcanvas.cpp with our own version).

git-svn-id: file:///home/survex-svn/survex/trunk@3480 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100755
File size: 3.5 KB
RevLine 
[6df03c1]1#!/bin/sh
2#
[0580c6a]3# Note: this script requires MacOS X 10.2 or greater, and builds diskimages
4# which require MacOS X 10.1 or greater to install.
5#
[b72f4b5]6# Run from the unpacked survex-1.1.X directory like so:
[6df03c1]7#
[0580c6a]8#   ./buildmacosx.sh --install-wx
9#
[1324d6c]10# This will automatically download and temporarily install wxWidgets
[0580c6a]11# (this script is smart enough not to download or build it if it already
12# has).
13#
[1324d6c]14# If you already have wxWidgets installed permanently, use:
[0580c6a]15#
[6df03c1]16#   ./buildmacosx.sh
17#
[1324d6c]18# If wxWidgets is installed somewhere such that wx-config isn't on your
[6df03c1]19# PATH you need to indicate where wx-config is by running this script
20# something like this:
21#
[b7510ee]22#   env WX_CONFIG=/path/to/wx-config ./buildmacosx.sh
[b72f4b5]23#
[1324d6c]24# If using a pre-installed wxWidgets, note that it must satisfy the
[b72f4b5]25# following requirements:
26#   - It must be built with OpenGL support (--with-opengl).
27#   - It must be the Carbon version.
[b7510ee]28#   - It probably should be a "Unicode" build (--enable-unicode).
[b72f4b5]29#
[6df03c1]30
31set -e
[0580c6a]32
[b7510ee]33WXVERSION=2.8.11
[b72f4b5]34
[0580c6a]35if test "x$1" = "x--install-wx" ; then
36  if test -x WXINSTALL/bin/wx-config ; then
37    :
38  else
[deb58b87]39    prefix=`pwd`/WXINSTALL
[b72f4b5]40    test -f wxWidgets-$WXVERSION.tar.bz2 || \
[deb58b87]41      curl -O ftp://ftp.wxwidgets.org/pub/$WXVERSION/wxWidgets-$WXVERSION.tar.bz2
[b72f4b5]42    test -d wxWidgets-$WXVERSION || tar jxvf wxWidgets-$WXVERSION.tar.bz2
43    test -d wxWidgets-$WXVERSION/build || mkdir wxWidgets-$WXVERSION/build
44    cd wxWidgets-$WXVERSION/build
[b7510ee]45    ../configure --disable-shared --prefix="$prefix" --with-opengl --enable-unicode
[0580c6a]46    make -s
47    make -s install
48    cd ../..
49  fi
[b7510ee]50  WX_CONFIG=`pwd`/WXINSTALL/bin/wx-config
[0580c6a]51fi
52
[b7510ee]53test -n "$WX_CONFIG" || WX_CONFIG=`which wx-config`
54if test -z "$WX_CONFIG" ; then
55  echo "WX_CONFIG not set and wx-config not on your PATH"
[6df03c1]56  exit 1
57fi
[1324d6c]58# Force static linking so the user doesn't need to install wxWidgets.
[b7510ee]59WX_CONFIG=$WX_CONFIG' --static'
[0580c6a]60rm -rf *.dmg Survex macosxtmp
[deb58b87]61D=`pwd`/Survex
62T=`pwd`/macosxtmp
[b7510ee]63./configure --prefix="$D" --bindir="$D" --mandir="$T" WX_CONFIG="$WX_CONFIG"
[6df03c1]64make
65make install
66#mv Survex/survex Survex/Survex
67
[b72f4b5]68# Construct the Aven application bundle.
69cp -r lib/Aven.app Survex
70cp -r $D/share/survex/* Survex/Aven.app/Contents/Resources/
71mv Survex/aven Survex/Aven.app/Contents/MacOS/
72rm -f Survex/share/survex/aven.txf
73rm -rf Survex/share/survex/icons
74
[6df03c1]75size=`du -s Survex|sed 's/[^0-9].*//'`
76# Allow 1000 extra sectors for various overheads (500 wasn't enough).
77sectors=`expr 1000 + $size`
78# Partition needs to be at least 4M and sectors are 512 bytes.
79if test $sectors -lt 8192 ; then
80  sectors=8192
81fi
82echo "Creating new blank image survex-macosx.dmg of $sectors sectors"
[0580c6a]83# This creates the diskimage file and initialises it as an HFS+ volume.
84hdiutil create -sectors $sectors survex-macosx -layout NONE -fs HFS+ -volname Survex
[6df03c1]85
[b72f4b5]86echo "Presenting image to the filesystems for mounting."
[6df03c1]87# This will mount the image onto the Desktop.
[0580c6a]88# Get the name of the device we mounted it on...
89dev=`hdid survex-macosx.dmg|tail -1|sed 's!/dev/\([!-~]*\).*!\1!;'`
90echo "Mounted on device $dev, copying files into image."
[6df03c1]91ditto -rsrcFork Survex /Volumes/Survex/Survex
92ditto lib/INSTALL.OSX /Volumes/Survex/INSTALL
[0580c6a]93echo "Detaching image."
94hdiutil detach $dev
[6df03c1]95
[deb58b87]96version=`sed 's/.*AM_INIT_AUTOMAKE([^,]*, *\([0-9.]*\).*/\1/p;d' configure.in`
97file=survex-macosx-`echo $version`.dmg
[6df03c1]98echo "Compressing image file survex-macosx.dmg to $file"
[0580c6a]99# This needs MacOS X 10.1 or above for unpacking - change UDZO to UDCO to allow
100# the dmg to be unpacked on 10.0 as well:
101hdiutil convert survex-macosx.dmg -format UDZO -o "$file"
102rm survex-macosx.dmg
[6df03c1]103
104echo "$file created successfully."
Note: See TracBrowser for help on using the repository browser.