Skip to content

Commit c72809d

Browse files
committed
Prepare for 0.6 precompiled release
1 parent 56384ce commit c72809d

File tree

4 files changed

+65
-23
lines changed

4 files changed

+65
-23
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
- precompiled
7+
# - precompiled
88
paths:
99
# Just run on main branch if "native" path changed.
1010
- "native/**"
@@ -23,18 +23,16 @@ jobs:
2323
matrix:
2424
nif: ["2.15"]
2525
job:
26-
# - { target: aarch64-apple-darwin , os: macos-11 }
27-
# - { target: x86_64-apple-darwin , os: macos-11 }
28-
# - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 , apt: musl-tools alsa-utils alsa-tools libasound2-dev libudev-dev pkg-config portaudio19-dev build-essential libpulse-dev libdbus-1-dev llvm-dev libclang-dev clang }
29-
# - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04 , apt: musl-tools alsa-utils alsa-tools libasound2-dev libudev-dev pkg-config portaudio19-dev build-essential libpulse-dev libdbus-1-dev llvm-dev libclang-dev clang }
30-
# - { target: aarch64-unknown-linux-gnu , os: ubuntu-22.04 , arch: aarch64 , apt: "libasound2-dev:arm64 pkg-config libgcc-s1:arm64 libc6:arm64 gcc-aarch64-linux-gnu build-essential crossbuild-essential-arm64" }
31-
# - { target: aarch64-unknown-linux-musl , os: ubuntu-22.04 , arch: aarch64 , apt: "musl-tools libasound2-dev:arm64 pkg-config libgcc-s1:arm64 libc6:arm64 gcc-aarch64-linux-gnu build-essential crossbuild-essential-arm64" }
32-
# ## 32 bit cross compiling not working - { target: arm-unknown-linux-gnueabihf , arch: armhf , os: ubuntu-latest , apt: "libatomic1:armhf libasound2-dev:armhf libudev-dev:armhf pkg-config build-essential crossbuild-essential-armhf" }
33-
# - { target: riscv64gc-unknown-linux-gnu , os: ubuntu-22.04 , arch: riscv64 , apt: "wget gcc-riscv64-linux-gnu libc6-riscv64-cross crossbuild-essential-riscv64 libasound2-dev:riscv64 pkg-config" }
34-
# - { target: x86_64-pc-windows-gnu , os: windows-2022 }
35-
# - { target: x86_64-pc-windows-msvc , os: windows-2019 }
36-
- { target: x86_64-unknown-freebsd , os: ubuntu-22.04, c, apt: libasound2-dev pkg-config }
37-
26+
- { target: aarch64-apple-darwin , os: macos-11 }
27+
- { target: x86_64-apple-darwin , os: macos-11 }
28+
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 , apt: musl-tools alsa-utils alsa-tools libasound2-dev libudev-dev pkg-config portaudio19-dev build-essential libpulse-dev libdbus-1-dev llvm-dev libclang-dev clang }
29+
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04 , apt: musl-tools alsa-utils alsa-tools libasound2-dev libudev-dev pkg-config portaudio19-dev build-essential libpulse-dev libdbus-1-dev llvm-dev libclang-dev clang }
30+
- { target: aarch64-unknown-linux-gnu , os: ubuntu-22.04 , arch: aarch64 , apt: "libasound2-dev:arm64 pkg-config libgcc-s1:arm64 libc6:arm64 gcc-aarch64-linux-gnu build-essential crossbuild-essential-arm64" }
31+
- { target: aarch64-unknown-linux-musl , os: ubuntu-22.04 , arch: aarch64 , apt: "musl-tools libasound2-dev:arm64 pkg-config libgcc-s1:arm64 libc6:arm64 gcc-aarch64-linux-gnu build-essential crossbuild-essential-arm64" }
32+
- { target: riscv64gc-unknown-linux-gnu , os: ubuntu-22.04 , arch: riscv64 , apt: "wget gcc-riscv64-linux-gnu libc6-riscv64-cross crossbuild-essential-riscv64 libasound2-dev:riscv64 pkg-config" }
33+
- { target: x86_64-pc-windows-gnu , os: windows-2022 }
34+
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
35+
# 32 bit cross compiling not working - { target: arm-unknown-linux-gnueabihf , arch: armhf , os: ubuntu-latest , apt: "libatomic1:armhf libasound2-dev:armhf libudev-dev:armhf pkg-config build-essential crossbuild-essential-armhf" }
3836

3937
steps:
4038
- name: Checkout source code

BUILDING.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,34 @@
33
[![Documentation](http://img.shields.io/badge/hex.pm-docs-green.svg?style=flat)](https://hexdocs.pm/midiex)
44
[![Package](https://img.shields.io/hexpm/v/supercollider.svg)](https://hex.pm/packages/midiex)
55

6+
## Precompiled binaries
7+
Since v0.6, Midiex uses [Rustler Precompiled](https://dashbit.co/blog/rustler-precompiled) to provide precompiled binaries on the following platforms:
8+
9+
- Apple Mac:
10+
- M-series: aarch64-apple-darwin
11+
- x86-series: x86_64-apple-darwin
12+
- Linux x86 based:
13+
- x86_64-unknown-linux-gnu
14+
- x86_64-unknown-linux-musl
15+
- Linux ARM based:
16+
- aarch64-unknown-linux-gnu
17+
- aarch64-unknown-linux-musl
18+
- Linux RISC-V based:
19+
- riscv64gc-unknown-linux-gnu
20+
- Windows x86 based:
21+
- x86_64-pc-windows-msvc
22+
- x86_64-pc-windows-gnu
23+
24+
For the above platforms you should not need Rust's build tools as Rustler will download Midiex's precompiled NIF for the correct platform.
25+
26+
### Forcing compilation
27+
Should you wish to build your own binary of Midiex's Rust-based NIF on the above platforms, you can force that by setting the environmental `MIDIEX_BUILD` to `true` or `1`, e.g.:
28+
29+
```
30+
export MIDIEX_BUILD=true
31+
```
32+
You'll need to have the Rust build toolchain installed (see below).
33+
634
# Building Midiex
735
In most cases, the standard Rust build toolchain is all you need. That being said there may be additional packages that need to be installed on Linux distributions related to ALSA (Advanced Linux Sound Architecture) as well as compilation in general (pkg-config).
836

@@ -14,7 +42,4 @@ Additionally on Linux (currently tested on Ubuntu 22.04), you may need some addi
1442

1543
If using the apt package manager, you can install those via the terminal prompt with:
1644

17-
```sudo apt install libasound2-dev pkg-config.```
18-
19-
## Future - precompiled binaries
20-
It is a goal of this project to migrate to [Rustler Precompiled](https://dashbit.co/blog/rustler-precompiled) so that the rust build tools don't have to be installed and the precompiled binaries of Midiex's Rust-based NIF is downloaded for the correct platform.
45+
```sudo apt install libasound2-dev pkg-config.```

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Using WinRT or Jack requires special feature flags enabled. See the [midir GitHu
2222
The hot-plug support of MIDI devices on MacOS is made possible with with the Rust [coremidi](https://github.com/chris-zen/coremidi) library.
2323

2424
## Status
25-
This library is currently under active development and it’s API is likely to change. It's been tested on MacOS only.
25+
This library is currently under active development and it’s API is likely to change. It's been tested on MacOS only although it is currently building on Mac (M-series and x86), Linux (64-bit ARM, RISC-V and x86) and Windows (x86_64) with precompiled binary packages (see the Getting started section below).
2626

2727
## API
2828
At it's most basic level, the core functions of Midiex are for:
@@ -74,8 +74,28 @@ Midiex.send_msg(piano, note_off)
7474

7575
## Getting started
7676

77+
### Platforms with precompiled binaries
78+
Since v0.6, Midiex uses [Rustler Precompiled](https://dashbit.co/blog/rustler-precompiled) to provide precompiled binaries on the following platforms:
79+
80+
- Apple Mac:
81+
- M-series: aarch64-apple-darwin
82+
- x86-series: x86_64-apple-darwin
83+
- Linux x86 based:
84+
- x86_64-unknown-linux-gnu
85+
- x86_64-unknown-linux-musl
86+
- Linux ARM based:
87+
- aarch64-unknown-linux-gnu
88+
- aarch64-unknown-linux-musl
89+
- Linux RISC-V based:
90+
- riscv64gc-unknown-linux-gnu
91+
- Windows x86 based:
92+
- x86_64-pc-windows-msvc
93+
- x86_64-pc-windows-gnu
94+
95+
This means you shouldn't need the Rust build tools for the above plaforms. Just add midiex as a dependency to your Elixir file and Rustler will download and install the correct binary.
96+
7797
### Rust build tools
78-
If you don't already have Rust's build tools installed, you'll likely need to. See [BUILDING.md](BUILDING.md) for more information.
98+
If you want to use Midiex on a different platform than those listed above, or want to force complication, you'll need to have Rust's build tools installed. See [BUILDING.md](BUILDING.md) for more information.
7999

80100
### Adding it to your Elixir project
81101
The package can be installed by adding midiex to your list of dependencies in mix.exs:

lib/midiex/backend.ex

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ defmodule Midiex.Backend do
1717
base_url: "#{github_url}/releases/download/v#{version}",
1818
targets: ~w(
1919
aarch64-apple-darwin
20+
x86_64-apple-darwin
21+
x86_64-unknown-linux-gnu
22+
x86_64-unknown-linux-musl
2023
aarch64-unknown-linux-gnu
2124
aarch64-unknown-linux-musl
2225
riscv64gc-unknown-linux-gnu
23-
x86_64-apple-darwin
2426
x86_64-pc-windows-msvc
2527
x86_64-pc-windows-gnu
26-
x86_64-unknown-linux-gnu
27-
x86_64-unknown-linux-musl
28-
x86_64-unknown-freebsd
2928
),
3029
nif_versions: ["2.15"],
3130
mode: mode,

0 commit comments

Comments
 (0)