File: make_osx_bundle.sh

package info (click to toggle)
adonthell-data 0.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 24,860 kB
  • ctags: 456
  • sloc: python: 5,169; sh: 4,355; makefile: 415; sed: 16
file content (64 lines) | stat: -rwxr-xr-x 1,291 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh

cwd=`pwd`
adonthell_exe="adonthell-0.3"
appname="adonthell-wastesedge"


# -- check arg
if test "x$1" = "x" ; then
  echo "Usage: $0 <path/to/Adonthell.app>"
  exit 1
fi

if test ! -f $1"/Contents/MacOS/$adonthell_exe" ; then
  echo "Error: $1 is not the expected Adonthell.app"
  exit 1
fi

# -- we need absolute path to Adonthell.app
cd $1
prefix=`pwd`/Contents
APP=$prefix/MacOS/$adonthell_exe
cd $cwd

# -- prepare build
if [ ! -f "configure" ]; then
  if [ ! -f "autogen.sh" ]; then
    echo "This script must be run in the wastesedge-0.3.x directory"
    exit 1
  fi
  ./autogen.sh
fi

# -- build wastesedge
echo "Configuring $appname. This may take a while ..."
./configure --with-adonthell-binary=$APP --disable-pyc --bindir=$prefix/MacOS --mandir=/tmp --datadir=/tmp > /dev/null
if [ $? -ne 0 ]; then
   exit 1
fi

# -- compile wastesedge
make V=0 -j 2
if [ $? -ne 0 ]; then
   exit 1
fi

# -- install wastesedge
make V=0 install
if [ $? -ne 0 ]; then
   exit 1
fi

# -- copy icon
cp osx/adonthell.icns $prefix/Resources

# -- create a launch script that works inside the bundle
cat > $prefix/MacOS/$appname <<EOF
#!/bin/sh
mypath=\`dirname "\$0"\`
"\$mypath/$adonthell_exe" wastesedge
EOF

# -- update executable
sed -i '' "s/$adonthell_exe/$appname/" $prefix/Info.plist