forked from CICM/pd-faustgen
-
Notifications
You must be signed in to change notification settings - Fork 5
221 lines (186 loc) · 6.8 KB
/
makefile.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: github ci
on:
push:
branches: [ faustgen2, testing ]
tags: [ '*' ]
pull_request:
branches: [ faustgen2 ]
jobs:
macos-build:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: version
run: |
echo "version=$(git describe --tags)" >> $GITHUB_ENV
- name: dependencies
run: |
brew install llvm@14
brew link llvm@14
- name: make
run: |
echo version: $version
mkdir build && cd build
cmake .. && make
# staged install into dist
cmake --install . --prefix dist
# copy over libLLVM.dylib and fix the loader path of the external
llvmdir="$(brew --prefix)/opt/llvm@14/lib"
(cd dist/Faustgen2~; for x in $(otool -L faustgen2~.pd_darwin | sed -n 's|.*llvm@14/lib/\(.*\.dylib\).*|\1|p'); do echo "$llvmdir/$x:"; cp $llvmdir/$x .; install_name_tool -change $llvmdir/$x @loader_path/$x faustgen2~.pd_darwin; done)
cp ../README.md ../LICENSE dist/faustgen2~
chmod 0444 dist/faustgen2~/default.dsp
- name: upload
uses: actions/upload-artifact@v3
with:
name: pd-faustgen2-${{ env.version }}-macos-x86_64
path: build/dist
retention-days: 2
macos-arm-build:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: version
run: |
echo "version=$(git describe --tags)" >> $GITHUB_ENV
- name: prepare
run: |
# This is a bit tricky since we want to cross-compile for arm64 on
# an x86_64 Big Sur runner using the llvm@14 arm64 homebrew package.
# Here is a suitable snapshot of the package that we prepared:
curl -L https://github.com/agraef/pd-faustgen/releases/download/llvm-14-homebrew/llvm-14.0.6-homebrew-macos11-arm64.zip -o llvm.zip
unzip llvm.zip
- name: make
run: |
echo version: $version
# we need llvm-config for the static build
export PATH=$PWD/llvm/bin:$PATH
mkdir build && cd build
cmake .. -DLLVM_DIR=./llvm/lib/cmake/llvm -DCMAKE_OSX_ARCHITECTURES="arm64" && make
# staged install into dist
cmake --install . --prefix dist
# copy over libLLVM.dylib and fix the loader path of the external
for x in $(otool -L dist/faustgen2~/faustgen2~.pd_darwin | sed -n 's|.*llvm@14/lib/\(.*\.dylib\).*|\1|p'); do echo "../llvm/lib/$x:"; cp ../llvm/lib/$x dist/faustgen2~; install_name_tool -change @@HOMEBREW_PREFIX@@/opt/llvm@14/lib/$x @loader_path/$x dist/faustgen2~/faustgen2~.pd_darwin; done
cp ../README.md ../LICENSE dist/faustgen2~
chmod 0444 dist/faustgen2~/default.dsp
- name: upload
uses: actions/upload-artifact@v3
with:
name: pd-faustgen2-${{ env.version }}-macos-arm64
path: build/dist
retention-days: 2
ubuntu-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: install dependencies
run: sudo apt-get install -y pkg-config libedit-dev
- name: version
run: |
echo "version=$(git describe --tags)" >> $GITHUB_ENV
- name: prepare
run: |
curl -o ./llvm.tar.xz https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
tar xvf ./llvm.tar.xz && mv clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 llvm
- name: make
run: |
echo version: $version
mkdir build && cd build
cmake .. -DCMAKE_C_FLAGS=-m64 -DUSE_LLVM_CONFIG=off -DLLVM_DIR=./llvm/lib/cmake/llvm -DCMAKE_BUILD_TYPE=Release -DINSTALL_DIR=faustgen2~ -DCMAKE_INSTALL_PREFIX=/
cmake --build . --config Release --target faustgen_tilde_project
make install DESTDIR=$PWD/dist
cp ../README.md ../LICENSE dist/faustgen2~
chmod 0444 dist/faustgen2~/default.dsp
- name: upload
uses: actions/upload-artifact@v3
with:
name: pd-faustgen2-${{ env.version }}-ubuntu-x86_64
path: build/dist
retention-days: 2
windows-build:
runs-on: windows-2019
# We use bash for the entire build since powershell just drives me insane.
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: version
run: |
echo "version=$(git describe --tags)" >> $GITHUB_ENV
# The Windows runner has an LLVM installation in /c/Program Files/LLVM
# which is pretty useless since it lacks important development tools.
# In particular, we need llvm-config (even with USE_LLVM_CONFIG=off)
# for the faust staticlib build to work. So we just get rid of the
# runner's LLVM version and move our version in its place.
- name: prepare
run: |
mkdir build && cd build
curl -L https://github.com/agraef/pd-faustgen/releases/download/llvm-9.0.0-windows-build/llvm-9.0.0-windows-x64-mt.zip -o llvm.zip
7z x llvm.zip
rm -rf "/c/Program Files/LLVM"
mv llvm "/c/Program Files/LLVM"
echo "llvmdir=/c/Program Files/LLVM" >> $GITHUB_ENV
- name: make
run: |
cd build
echo "version: $version"
echo "llvmdir: $llvmdir"
echo "llvm-config: $(which llvm-config)"
cmake .. -G "Visual Studio 16 2019" -A x64 -DUSE_LLVM_CONFIG=off -DLLVM_DIR="$llvmdir/lib/cmake/llvm"
cmake --build . --config Release
cmake --install . --prefix dist
cp ../README.md dist/faustgen2~
cp ../LICENSE dist/faustgen2~
chmod 0444 dist/faustgen2~/default.dsp
- name: upload
uses: actions/upload-artifact@v3
with:
name: pd-faustgen2-${{ env.version }}-windows-x86_64
path: build/dist
retention-days: 2
tarball:
#if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: make dist
run: |
echo "version=$(git describe --tags)" >> $GITHUB_ENV
./make-dist.sh
- name: upload
uses: actions/upload-artifact@v3
with:
name: pd-faustgen2-${{ env.version }}-source
path: pd-faustgen2-*.tar.gz
retention-days: 2
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [macos-build, macos-arm-build, windows-build, ubuntu-build, tarball]
steps:
- uses: actions/download-artifact@v3
- name: ziptie
run: |
mkdir dist
for x in pd-faustgen2-*; do (cd $x && zip -r ../dist/$x.zip *); done
- name: release
uses: softprops/action-gh-release@v1
with:
prerelease: true
draft: true
files: dist/*.zip