Skip to content

Commit c399db7

Browse files
authored
Merge pull request #2835 from sonic-pi-net/elixir
Introduce Elixir
2 parents 2fb1310 + 2db4e75 commit c399db7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+294
-1103
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,36 @@ jobs:
7979
extra: '--b http://mirrors.ocf.berkeley.edu/qt/'
8080
cached: ${{ steps.cache-qt2.outputs.cache-hit }}
8181

82-
# Latest Erlang on Ubuntu
83-
- uses: gleam-lang/setup-erlang@v1.1.2
82+
# Install Elixir on Ubuntu
83+
- name: Linux Elixir
84+
uses: erlef/setup-beam@v1
8485
with:
85-
otp-version: 23.2.1
86+
otp-version: '24'
87+
elixir-version: '1.12'
8688
if: matrix.os == 'ubuntu-latest'
8789

88-
# Install Erlang on MacOS
89-
- name: Mac Erlang
90+
# Install Elixir on Windows
91+
- name: Win Elixir
92+
uses: erlef/setup-beam@v1
93+
with:
94+
otp-version: '24'
95+
elixir-version: '1.12'
96+
if: matrix.os == 'windows-latest'
97+
98+
# Install Elixir on MacOS
99+
- name: Mac Elixir
90100
continue-on-error: true
91101
run: |
92102
export HOMEBREW_NO_INSTALL_CLEANUP=1
93103
brew update
94-
brew install erlang
104+
brew install elixir
95105
if: matrix.os == 'macos-latest'
96106

97107
# Prebuild on Ubuntu
98108
- name: Prebuild Linux
99109
working-directory: ${{github.workspace}}/app
100110
env:
101-
CC: ${{ matrix.cc }}
111+
CC: ${{ matrix.cc }}
102112
QT_INSTALL_LOCATION: ${{env.Qt5_DIR}}
103113
run: |
104114
sudo apt install -y pulseaudio dbus-x11 libssl-dev ruby-dev supercollider-server sc3-plugins-server alsa-utils jackd2 libjack-jackd2-dev libjack-jackd2-0 libasound2-dev librtmidi-dev pulseaudio-module-jack
@@ -109,34 +119,34 @@ jobs:
109119
- name: Prebuild Mac
110120
working-directory: ${{github.workspace}}/app
111121
env:
112-
CC: ${{ matrix.cc }}
122+
CC: ${{ matrix.cc }}
113123
QT_INSTALL_LOCATION: ${{env.Qt5_DIR}}
114124
run: |
115125
./mac-prebuild.sh
116126
if: matrix.os == 'macos-latest'
117-
127+
118128
# Prebuild on Windows
119-
# Note that we 'hide' the msys folders on windows to stop conflicts when building
129+
# Note that we 'hide' the msys folders on windows to stop conflicts when building
120130
# Flac
121131
- name: Prebuild Windows
122132
working-directory: ${{github.workspace}}/app
123133
shell: cmd
124134
env:
125-
CC: ${{ matrix.cc }}
135+
CC: ${{ matrix.cc }}
126136
QT_INSTALL_LOCATION: ${{env.Qt5_DIR}}
127137
run: |
128138
mv c:/msys64 c:/__msys64
129139
win-prebuild.bat
130140
if: matrix.os == 'windows-latest'
131-
141+
132142
#- name: Setup tmate session
133143
# uses: mxschmitt/action-tmate@v3
134144

135145
# Run Configuration Config on Ubuntu
136146
- name: Config Linux
137147
working-directory: ${{github.workspace}}/app
138148
env:
139-
CC: ${{ matrix.cc }}
149+
CC: ${{ matrix.cc }}
140150
QT_INSTALL_LOCATION: ${{env.Qt5_DIR}}
141151
run: |
142152
./linux-config.sh
@@ -146,7 +156,7 @@ jobs:
146156
- name: Config Mac
147157
working-directory: ${{github.workspace}}/app
148158
env:
149-
CC: ${{ matrix.cc }}
159+
CC: ${{ matrix.cc }}
150160
QT_INSTALL_LOCATION: ${{env.Qt5_DIR}}
151161
run: |
152162
./mac-config.sh
@@ -157,35 +167,35 @@ jobs:
157167
working-directory: ${{github.workspace}}/app
158168
shell: cmd
159169
env:
160-
CC: ${{ matrix.cc }}
170+
CC: ${{ matrix.cc }}
161171
QT_INSTALL_LOCATION: ${{env.Qt5_DIR}}
162172
run: |
163173
win-config.bat
164174
if: matrix.os == 'windows-latest'
165-
175+
166176
# Finally: Build
167177
- name: Do build
168178
working-directory: ${{github.workspace}}/app/build
169179
run: cmake --build . --config ${{ matrix.build_type }}
170-
180+
171181
- name: Ruby Tests (Mac/Linux)
172182
working-directory: ${{github.workspace}}/app/server/ruby
173-
run: rake test
183+
run: rake test
174184
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
175185

176186
- name: API Tests - Mac
177187
working-directory: ${{github.workspace}}/app/build/api-tests
178188
run: ctest --verbose
179189
if: matrix.os == 'macos-latest'
180-
190+
181191
- name: API Tests - Linux
182192
working-directory: ${{github.workspace}}/app/build/api-tests
183193
run: |
184194
jackd -d dummy &
185195
ctest --verbose
186-
if: matrix.os == 'ubuntu-latest'
187-
188-
- name: API Tests Windows - Install Scream Audio Device
196+
if: matrix.os == 'ubuntu-latest'
197+
198+
- name: API Tests Windows - Install Scream Audio Device
189199
shell: powershell
190200
run: |
191201
Start-Service audio*
@@ -212,5 +222,3 @@ jobs:
212222
name: Logs_${{matrix.title}}_${{matrix.build_type}}
213223
path: |
214224
~/.sonic-pi/log/*.log
215-
216-

BUILD-LINUX.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,23 @@ few dependencies:
4343
* Qt + Dev tools (5.15+)
4444
* Jack (and pulse-audio-module-jack if you are running Raspberry Pi OS)
4545
* Ruby + Dev tools (2.5+)
46-
* Erlang + Dev tools (21+)
46+
* Elixir + Dev tools (21+)
4747
* SuperCollider + SC3 plugins
4848
*
4949

5050

5151
### 1.1 Raspberry Pi OS
5252

53-
The following is a list of packages required for Raspberry Pi OS released in Dec 2020:
53+
The following is a list of packages required for Raspberry Pi OS
54+
released in August 2021:
5455

5556
```
5657
sudo apt-get install -y \
57-
build-essential cmake git libssl-dev \
58-
ruby-dev erlang-base erlang-dev erlang-tools \
59-
supercollider-server sc3-plugins-server alsa-utils libaubio5 jackd2 libjack-jackd2-dev libjack-jackd2-0 libasound2-dev librtmidi-dev pulseaudio-module-jack\
60-
qt5-default qttools5-dev-tools libqt5concurrent5 libqt5core5a libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5concurrent5 libqt5svg5 libqt5widgets5 libqt5svg5-dev \
61-
compton pulseaudio-module-jack
58+
build-essential git libssl-dev \
59+
ruby-dev erlang-base erlang-dev erlang-tools elixir \
60+
qttools5-dev-tools qttools5-dev libqt5svg5-dev \
61+
supercollider-server sc3-plugins-server alsa-utils libaubio5 librtmidi-dev libasound2-dev \
62+
jackd2 libjack-jackd2-dev libjack-jackd2-0 pulseaudio-module-jack \
6263
```
6364

6465

BUILD-MAC.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ few dependencies:
3939

4040
1. Xcode (12.1+) and command line tools
4141
2. Homebrew
42-
3. All other dependencies - Qt5 (5.15+), CMake (3.18+)
42+
3. All other dependencies - Qt5 (5.15+), CMake (3.18+), Elixir(2.12+)
4343

4444
### 1.1 Install Xcode
4545

@@ -68,7 +68,7 @@ Once you have Homebrew installed, pulling in the rest of the
6868
dependencies is a couple of lines to execute within a terminal:
6969

7070
```
71-
brew install qt@5 cmake
71+
brew install qt@5 cmake elixir
7272
7373
```
7474

BUILD-WINDOWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dependencies:
4646
2. Qt (5.15+)
4747
3. CMake (3.18+)
4848
4. Ruby (2.7.1+)
49+
5. Elixir (1.12+)
4950

5051
Let's look at each in turn.
5152

@@ -120,6 +121,14 @@ force the locale to UTF-8. For more information see:
120121

121122
https://github.com/samaaron/sonic-pi/issues/2416
122123

124+
### 1.5 Install Elixir
125+
126+
Lastly we just need to head over to the Elixir website and download and
127+
run the installer:
128+
129+
https://elixir-lang.org/install.html#windows
130+
131+
123132
## 2. Preparing the Build
124133

125134
Once we have installed all the dependencies, we're now ready to build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ Sonic Pi is under active development, and welcomes new contributors:
103103
[![Weblate](https://hosted.weblate.org/widgets/sonic-pi/-/svg-badge.svg)](https://hosted.weblate.org/engage/sonic-pi/)
104104
<br/>
105105
[![Travis CI](https://travis-ci.org/samaaron/sonic-pi.svg?branch=main)](https://travis-ci.org/samaaron/sonic-pi)
106-
<br/>
106+
<br/>

app/linux-build-all.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
set -e # Quit script on error
33

44
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5-
cd ${SCRIPT_DIR}
65

6+
cd ${SCRIPT_DIR}
77
"${SCRIPT_DIR}/linux-prebuild.sh"
8+
9+
cd ${SCRIPT_DIR}
810
"${SCRIPT_DIR}/linux-config.sh"
911

12+
13+
cd ${SCRIPT_DIR}
1014
cd build
1115
cmake --build . --config Release
1216

app/linux-prebuild.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ PATH=`pkg-config --variable bindir Qt5`:$PATH lrelease "${SCRIPT_DIR}"/gui/qt/la
4747

4848
echo "Compiling Erlang files..."
4949
cd "${SCRIPT_DIR}/server/erlang/tau"
50-
erl -make
50+
mix local.hex --force
51+
mix deps.get
52+
mix release
53+
5154
cp src/tau.app.src ebin/tau.app
5255
cd "${SCRIPT_DIR}"

app/mac-build-all.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
55
cd ${SCRIPT_DIR}
66

77
"${SCRIPT_DIR}/mac-prebuild.sh"
8+
cd ${SCRIPT_DIR}
89
"${SCRIPT_DIR}/mac-config.sh"
910

11+
cd ${SCRIPT_DIR}
1012
cd build
1113
cmake --build . --config Release
1214

app/mac-prebuild.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ echo "Updating GUI translation files..."
8282
# Use lrelease on PATH if available otherwise assume Qt was installed via homebrew
8383
PATH=$PATH:/usr/local/opt/qt@5/bin lrelease "${SCRIPT_DIR}"/gui/qt/lang/*.ts
8484

85-
echo "Compiling Erlang files..."
85+
echo "Compiling Erlang/Elixir files..."
8686
cd "${SCRIPT_DIR}/server/erlang/tau"
87-
../../native/erlang/erl -make
87+
mix local.hex --force
88+
mix deps.get
89+
mix release
90+
8891
cp src/tau.app.src ebin/tau.app
8992
cd "${SCRIPT_DIR}"

app/pi-build-all.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
set -e # Quit script on error
33

44
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5-
cd ${SCRIPT_DIR}
65

6+
cd ${SCRIPT_DIR}
77
"${SCRIPT_DIR}/pi-prebuild.sh"
8+
9+
cd ${SCRIPT_DIR}
810
"${SCRIPT_DIR}/pi-config.sh"
911

12+
cd ${SCRIPT_DIR}
1013
cd build
1114
cmake --build . --config Release
1215

0 commit comments

Comments
 (0)