source: git/buildmacosx.sh @ 0580c6a

RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-data
Last change on this file since 0580c6a was 0580c6a, checked in by Olly Betts <olly@…>, 20 years ago

Copy changes over from 1.0 branch - everything except Printing from Aven, and
Exporting CAD formats from Aven.

git-svn-id: file:///home/survex-svn/survex/branches/survex-1_1@2743 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/sh
2#
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#
6# Run from the unpacked survex-1.0.X directory like so:
7#
8#   ./buildmacosx.sh --install-wx
9#
10# This will automatically download and temporarily install wxWindows
11# (this script is smart enough not to download or build it if it already
12# has).
13#
14# If you already have wxWindows installed permanently, use:
15#
16#   ./buildmacosx.sh
17#
18# If wxWindows is installed somewhere such that wx-config isn't on your
19# PATH you need to indicate where wx-config is by running this script
20# something like this:
21#
22#   env WXCONFIG=/path/to/wx-config ./buildmacosx.sh
23
24set -e
25
26if test "x$1" = "x--install-wx" ; then
27  if test -x WXINSTALL/bin/wx-config ; then
28    :
29  else
30    prefix="`pwd`"/WXINSTALL
31    test -f wxMac-2.4.2.tar.gz || \
32      wget ftp://biolpc22.york.ac.uk/pub/2.4.2/wxMac-2.4.2.tar.gz
33    test -d wxMac-2.4.2 || tar zxvf wxMac-2.4.2.tar.gz
34    test -d wxMac-2.4.2/build || mkdir wxMac-2.4.2/build
35    cd wxMac-2.4.2/build
36    ../configure --disable-shared --prefix="$prefix"
37    make -s
38    make -s install
39    cd ../..
40  fi
41  WXCONFIG="`pwd`"/WXINSTALL/bin/wx-config
42fi
43
44test -n "$WXCONFIG" || WXCONFIG=`which wx-config`
45if test -z "$WXCONFIG" ; then
46  echo "WXCONFIG not set and wx-config not on your PATH"
47  exit 1
48fi
49# Force static linking so the user doesn't need to install wxWindows.
50WXCONFIG=$WXCONFIG' --static'
51export WXCONFIG
52rm -rf *.dmg Survex macosxtmp
53D="`pwd`/Survex"
54T="`pwd`/macosxtmp"
55./configure --prefix="$D" --bindir="$D" --mandir="$T" CFLAGS=-DMACOSX_BUNDLE
56make
57make install
58#mv Survex/survex Survex/Survex
59
60size=`du -s Survex|sed 's/[^0-9].*//'`
61# Allow 1000 extra sectors for various overheads (500 wasn't enough).
62sectors=`expr 1000 + $size`
63# Partition needs to be at least 4M and sectors are 512 bytes.
64if test $sectors -lt 8192 ; then
65  sectors=8192
66fi
67echo "Creating new blank image survex-macosx.dmg of $sectors sectors"
68# This creates the diskimage file and initialises it as an HFS+ volume.
69hdiutil create -sectors $sectors survex-macosx -layout NONE -fs HFS+ -volname Survex
70
71echo "Present image to the filesystems for mounting."
72# This will mount the image onto the Desktop.
73# Get the name of the device we mounted it on...
74dev=`hdid survex-macosx.dmg|tail -1|sed 's!/dev/\([!-~]*\).*!\1!;'`
75echo "Mounted on device $dev, copying files into image."
76ditto -rsrcFork Survex /Volumes/Survex/Survex
77ditto lib/INSTALL.OSX /Volumes/Survex/INSTALL
78echo "Detaching image."
79hdiutil detach $dev
80
81version="`sed 's/.*AM_INIT_AUTOMAKE([^,]*, *\([0-9.]*\).*/\1/p;d' configure.in`"
82file="survex-macosx-`echo $version`.dmg"
83echo "Compressing image file survex-macosx.dmg to $file"
84# This needs MacOS X 10.1 or above for unpacking - change UDZO to UDCO to allow
85# the dmg to be unpacked on 10.0 as well:
86hdiutil convert survex-macosx.dmg -format UDZO -o "$file"
87rm survex-macosx.dmg
88
89echo "$file created successfully."
Note: See TracBrowser for help on using the repository browser.