source: git/buildmacosx.sh @ 6df03c1

RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-data
Last change on this file since 6df03c1 was 6df03c1, checked in by <nobody>, 20 years ago

This commit was manufactured by cvs2svn to create branch 'survex-1_1'.

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

  • Property mode set to 100755
File size: 2.2 KB
Line 
1#!/bin/sh
2#
3# Run from the unpacked survex-1.0.X directory like so:
4#
5#   ./buildmacosx.sh
6#
7# If wxWindows is installed somewhere such that wx-config isn't on your
8# PATH you need to indicate where wx-config is by running this script
9# something like this:
10#
11#   env WXCONFIG=/path/to/wx-config ./buildmacosx.sh
12
13set -e
14test -n "$WXCONFIG" || WXCONFIG=`which wx-config`
15if test -z "$WXCONFIG" ; then
16  echo "WXCONFIG not set and wx-config not on your PATH"
17  exit 1
18fi
19# Force static linking so the user doesn't need to install wxWindows.
20WXCONFIG=$WXCONFIG' --static'
21export WXCONFIG
22rm -rf *.dmg Survex macosx
23D="`pwd`/Survex"
24T="`pwd`/macosxtmp"
25./configure --prefix="$D" --bindir="$D" --mandir="$T"
26make
27make install
28#mv Survex/survex Survex/Survex
29
30size=`du -s Survex|sed 's/[^0-9].*//'`
31# Allow 1000 extra sectors for various overheads (500 wasn't enough).
32sectors=`expr 1000 + $size`
33# Partition needs to be at least 4M and sectors are 512 bytes.
34if test $sectors -lt 8192 ; then
35  sectors=8192
36fi
37echo "Creating new blank image survex-macosx.dmg of $sectors sectors"
38# This just writes ASCII data to the file until it's the correct size.
39hdiutil create -sectors $sectors survex-macosx -layout NONE
40
41# Get the name of the next available device that can be used for mounting
42# (attaching).
43dev=`hdid -nomount survex-macosx.dmg|tail -1|sed 's!/dev/!!'`
44echo "Constructing new HFS+ filesystem on $dev"
45# This will initialize /dev/r$dev as a HFS Plus volume.
46sudo newfs_hfs -v Survex /dev/r$dev
47# We have to eject (detach) the device.
48# Note: 'hdiutil info' will show what devices are still attached.
49hdiutil eject $dev
50
51echo "Present image to the filesystems for mounting."
52# This will mount the image onto the Desktop.
53hdid survex-macosx.dmg
54ditto -rsrcFork Survex /Volumes/Survex/Survex
55ditto lib/INSTALL.OSX /Volumes/Survex/INSTALL
56hdiutil eject $dev
57
58version="`sed 's/.*AM_INIT_AUTOMAKE([^,]*, *\([0-9.]*\).*/\1/p;d' configure.in`"
59file="survex-macosx-`echo $version`.dmg"
60echo "Compressing image file survex-macosx.dmg to $file"
61hdiutil convert survex-macosx.dmg -format UDCO -o "$file"
62# Better compression but needs MacOS X 10.1 or above for unpacking:
63#hdiutil convert survex-macosx.dmg -format UDZO -o "$file"
64
65echo "$file created successfully."
Note: See TracBrowser for help on using the repository browser.