build_windows.sh 3.41 KB
Newer Older
1
2
3
#!/bin/bash

app_name="netpd"
4
app_version="2.3.0"
5
6
7
package_version=$(date +%Y-%m-%d)

# Pd
8
pd_archive_file=~/Downloads/pd-0.51-4.msw.zip
9
10
11
12
13
14

# Libraries
ext_urls=()
ext_urls+=("http://puredata.info/Members/rdz/software/binfile/0.1~git20181006/binfile%5Bv0.1~git20181006%5D(Windows-amd64-32).dek")
ext_urls+=("https://netpd.org/~roman/else%5Bv1.0beta27%5D(Windows-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")
Roman Haefeli's avatar
Roman Haefeli committed
15
ext_urls+=("http://puredata.info/Members/zmoelnigbot/software/iemnet/0.3.0/iemnet%5Bv0.3.0%5D(Darwin-amd64-32)(Linux-amd64-32)(Linux-arm64-32)(Linux-armv7-32)(Linux-i386-32)(Windows-amd64-32)(Windows-i386-32).dek")
16
17
18
ext_urls+=("http://puredata.info/Members/rdz/software/osc/0.2~git20181006/osc%5Bv0.2~git20181006%5D(Windows-amd64-32).dek")
ext_urls+=("http://puredata.info/Members/rdz/software/slip/0.1~git20181006/slip%5Bv0.1~git20181006%5D(Windows-amd64-32).dek")
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")
19
ext_urls+=("https://puredata.info/downloads/kiosk-plugin/releases/1.0/kiosk-plugin.zip")
20
21

# netpd bundle
22
netpd_bundle_url="https://www.netpd.org/~roman/netpd-plus-instruments-beta.zip"
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

# workdir
work_dir="${app_name}-${app_version}"

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

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

    # install pd
    unzip -q "${pd_archive_file}" || fail
    mv pd-0.*-* pd-netpd || fail

    # install externals
    (
      cd pd-netpd/extra
      for url in ${ext_urls[@]}
      do
Roman Haefeli's avatar
Roman Haefeli committed
48
        curl --fail -s -o file "${url}" || fail
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
        if file file | grep ' Zip archive data' > /dev/null
        then
          unzip -q file || fail
        fi
        if file file | grep 'gzip compressed data' > /dev/null
        then
          tar xf file || fail
        fi
        rm file || fail
      done
    ) || fail

    # install netpd
    (
      cd pd-netpd
Roman Haefeli's avatar
Roman Haefeli committed
64
      curl --fail -s -o file "${netpd_bundle_url}" || fail
65
66
67
68
69
70
71
72
73
74
      unzip -q file && rm file || fail
      mv netpd/instruments .. || fail
    ) || fail

  ) || fail

  # apply patch to load netpd at start
  patch -s ${work_dir}/pd-netpd/tcl/pd-gui.tcl < files/pd-gui.tcl.patch || fail
  # fix instruments path in preferences
  patch -s ${work_dir}/pd-netpd/netpd/includes/netpd-preferences.cnf < files/netpd-preferences.cnf.patch || fail
75
76
  # configure kiosk-plugin
  cp files/kiosk.cfg "${work_dir}/pd-netpd/extra/kiosk-plugin/" || fail
77
78
79
80
81
82
83
84
85
86
87
88
89
90
  # copy launcher exe
  cp files/netpd.exe "${work_dir}" || fail
  # copy README
  cp files/README.txt.win "${work_dir}/README.txt" || fail
  # create version file
  echo "${app_version} (${package_version})" > "${work_dir}/VERSION.txt"

  # create archive
  zip -q -r "${app_name}-${app_version}_windows_${package_version}.zip" "${app_name}-${app_version}"

  # upload bundle
  scp -q "${app_name}-${app_version}_windows_${package_version}.zip" all@netpd.org:public_html/software/

  # clean up
91
92
93
  rm -rf "${work_dir}" "${app_name}-${app_version}_windows_${package_version}.zip"

  # create shortcut to latest
94
  ssh all@netpd.org ln -f -s "${app_name}-${app_version}_windows_${package_version}.zip" "public_html/software/${app_name}-${app_version}_windows.zip" || fail
95
)