build.sh 2.18 KB
Newer Older
Roman Haefeli's avatar
Roman Haefeli committed
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
65
66
67
68
69
70
#!/bin/bash

version="2.2"
app_name="netpd-${version}.app"

# Pd
pd_archive_file=~/Downloads/pd-0.51-0test3.mac.tar.gz

# Libraries
ext_urls=()
ext_urls+=("http://puredata.info/Members/rdz/software/binfile-v0.1~git20151118-(Darwin-i386-32)(Darwin-x86_64-32)-externals.tar.gz")
ext_urls+=("http://puredata.info/Members/porres/software/else/1.0beta27/else%5Bv1.0beta27%5D(Darwin-amd64-32).dek")
ext_urls+=("http://puredata.info/Members/musil/software/iemlib/1.22/iemlib%5Bv1.22%5D(Darwin-amd64-32)(Darwin-i386-32)(Linux-amd64-32)(Windows-amd64-32)(Windows-i386-32)(Sources).dek")
ext_urls+=("http://puredata.info/Members/zmoelnigbot/software/iemnet/0.2.3/iemnet%5Bv0.2.3%5D(Darwin-amd64-32).dek")
ext_urls+=("http://puredata.info/Members/zmoelnig/software/iem/20150529.2247/osc-v0.2-20150529iem-(Darwin-i386-32)(Darwin-x86_64-32)-externals.tar.gz")
ext_urls+=("http://puredata.info/Members/rdz/software/slip/0.1~git20151118/slip-v0.1~git20151118-(Darwin-i386-32)(Darwin-x86_64-32)-externals.tar.gz")
ext_urls+=("http://puredata.info/Members/zmoelnigbot/software/zexy/2.3.1/zexy%5Bv2.3.1%5D(Darwin-amd64-32)(Linux-amd64-32)(Linux-arm64-32)(Linux-armv7-32)(Linux-i386-32)(Windows-amd64-32)(Windows-i386-32).dek")

# netpd bundle
netpd_bundle_url="https://www.netpd.org/~roman/netpd-plus-instruments.zip"

# workdir
work_dir=workdir

function fail {
  echo "abort due some error"
  exit 1
}

# do stuff
(
  mkdir -p "${work_dir}"
  cd "${work_dir}"

  # install pd
  tar xvf "${pd_archive_file}" || fail
  mv Pd-*.app "${app_name}" || fail

  # install externals
  (
    cd ${app_name}/Contents/Resources/extra
    for url in ${ext_urls[@]}
    do
      echo "downloading $url"
      curl -o file "${url}" || fail
      if file file | grep ' Zip archive data' > /dev/null
      then
        unzip file || fail
      fi
      if file file | grep 'gzip compressed data' > /dev/null
      then
        tar xvf file || fail
      fi
      rm file || fail
    done
  )

  # install netpd
  (
    cd ${app_name}/Contents/Resources
    curl -o file "${netpd_bundle_url}" || fail
    unzip file && rm file || fail
  )

)

# apply patch to load netpd at start
patch ${work_dir}/${app_name}/Contents/Resources/tcl/pd-gui.tcl < files/pd-gui.tcl.patch