local dockerized build

This commit is contained in:
🪞👃🪞 2025-04-19 01:39:52 +03:00
parent 8fa0f8a409
commit 393634a1a4
12 changed files with 93 additions and 71 deletions

3
.gitignore vendored
View file

@ -6,3 +6,6 @@ example.mid
cov cov
*/cov */cov
*.profraw *.profraw
bin/*
!bin/README.md
!bin/*.sh

3
.gitmodules vendored
View file

@ -5,3 +5,6 @@
[submodule "tengri"] [submodule "tengri"]
path = deps/tengri path = deps/tengri
url = ../tengri/ url = ../tengri/
[submodule "deps/rust-jack"]
path = deps/rust-jack
url = https://codeberg.org/unspeaker/rust-jack

18
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,18 @@
## development
you'll need a Rust toolchain and various system libraries.
you can obtain the former using `rustup` and the latter using `nix-shell`.
there's a `shell.nix` provided with the project.
from there, use the commands in the `Justfile`, e.g.:
```sh
just arranger
```
note that `tek > 0.2.0-rc.7` will require rust nightly
for the unstable features `type_alias_impl_trait` and
`impl_trait_in_assoc_type`. make some noise for lucky
[**rust rfc2515**](https://github.com/rust-lang/rust/issues/63063)
if you want to see this buildable with stable/beta.

24
Cargo.lock generated
View file

@ -269,6 +269,15 @@ version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2459fc9262a1aa204eb4b5764ad4f189caec88aea9634389c0a25f8be7f6265e" checksum = "2459fc9262a1aa204eb4b5764ad4f189caec88aea9634389c0a25f8be7f6265e"
[[package]]
name = "crossbeam-channel"
version = "0.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2"
dependencies = [
"crossbeam-utils",
]
[[package]] [[package]]
name = "crossbeam-deque" name = "crossbeam-deque"
version = "0.8.6" version = "0.8.6"
@ -319,6 +328,16 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "ctor"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501"
dependencies = [
"quote",
"syn",
]
[[package]] [[package]]
name = "darling" name = "darling"
version = "0.20.11" version = "0.20.11"
@ -554,9 +573,11 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
[[package]] [[package]]
name = "jack" name = "jack"
version = "0.13.0" version = "0.13.0"
source = "git+https://codeberg.org/unspeaker/rust-jack?rev=a13c1c4#a13c1c4d20343e574787a703eaeea7aeda63b084"
dependencies = [ dependencies = [
"approx",
"bitflags 2.9.0", "bitflags 2.9.0",
"crossbeam-channel",
"ctor",
"jack-sys", "jack-sys",
"lazy_static", "lazy_static",
"libc", "libc",
@ -566,7 +587,6 @@ dependencies = [
[[package]] [[package]]
name = "jack-sys" name = "jack-sys"
version = "0.5.1" version = "0.5.1"
source = "git+https://codeberg.org/unspeaker/rust-jack?rev=a13c1c4#a13c1c4d20343e574787a703eaeea7aeda63b084"
dependencies = [ dependencies = [
"bitflags 2.9.0", "bitflags 2.9.0",
"lazy_static", "lazy_static",

View file

@ -26,6 +26,12 @@ path = "./deps/tengri/tengri"
#rev = "6048d24" #rev = "6048d24"
features = [ "tui", "dsl" ] features = [ "tui", "dsl" ]
[workspace.dependencies.jack]
#git = "https://codeberg.org/unspeaker/rust-jack"
#rev = "a13c1c4"
path = "./deps/rust-jack"
default-features = false
[workspace.dependencies] [workspace.dependencies]
tek = { path = "./crates/app" } tek = { path = "./crates/app" }
tek_cli = { path = "./crates/cli" } tek_cli = { path = "./crates/cli" }
@ -39,7 +45,6 @@ atomic_float = { version = "1.0.0" }
backtrace = { version = "0.3.72" } backtrace = { version = "0.3.72" }
clap = { version = "4.5.4", features = [ "derive" ] } clap = { version = "4.5.4", features = [ "derive" ] }
gtk = { version = "0.18.1" } gtk = { version = "0.18.1" }
jack = { git = "https://codeberg.org/unspeaker/rust-jack", rev = "a13c1c4" }
livi = { version = "0.7.4" } livi = { version = "0.7.4" }
midly = { version = "0.5" } midly = { version = "0.5" }
palette = { version = "0.7.6", features = [ "random" ] } palette = { version = "0.7.6", features = [ "random" ] }

View file

@ -1,11 +1,15 @@
FROM docker.io/library/alpine:edge FROM docker.io/library/alpine:edge
RUN apk add --no-cache \ RUN apk add --no-cache \
bash tree rustup git just cloc build-base clang20-dev \ build-base bash tree rustup git just cloc clang20-dev \
pipewire-jack-dev lilv-dev serd-dev pipewire-jack-dev lilv-dev serd-dev
RUN adduser -Du1000 build RUN adduser -Du1000 build
USER 1000 USER 1000
RUN rustup-init -y
RUN rustup-init -y --profile minimal --default-toolchain nightly \
&& rm -rvf "$HOME/.rustup/roolchains/*/share"
RUN source "$HOME/.cargo/env" \ RUN source "$HOME/.cargo/env" \
&& rustup install nightly \
&& rustup default nightly \
&& cargo version -vv && cargo version -vv

View file

@ -10,7 +10,7 @@ for [jack](https://jackaudio.org/) and [pipewire](https://www.pipewire.org/).
[statically linked binaries](https://codeberg.org/unspeaker/tek/releases), and on the [statically linked binaries](https://codeberg.org/unspeaker/tek/releases), and on the
[aur](https://codeberg.org/unspeaker/tek#arch-linux). [aur](https://codeberg.org/unspeaker/tek#arch-linux).
hmu on [**mastodon** `@unspeaker@mastodon.social`](https://mastodon.social/@unspeaker) author is reachable via [**mastodon** `@unspeaker@mastodon.social`](https://mastodon.social/@unspeaker)
or [**matrix** `@unspeaker:matrix.org`](https://matrix.to/#/@unspeaker:matrix.org) or [**matrix** `@unspeaker:matrix.org`](https://matrix.to/#/@unspeaker:matrix.org)
![Screenshot](https://codeberg.org/unspeaker/tek/releases/download/0.2.0-rc.7/Screenshot%20From%202025-01-02%2023-18-05.png) ![Screenshot](https://codeberg.org/unspeaker/tek/releases/download/0.2.0-rc.7/Screenshot%20From%202025-01-02%2023-18-05.png)
@ -20,38 +20,6 @@ or [**matrix** `@unspeaker:matrix.org`](https://matrix.to/#/@unspeaker:matrix.or
* **requirements:** linux; jack or pipewire; 24-bit terminal (i use `kitty`) * **requirements:** linux; jack or pipewire; 24-bit terminal (i use `kitty`)
* **recommended:** midi controller; samples in wav format; lv2 plugins. * **recommended:** midi controller; samples in wav format; lv2 plugins.
```
Usage: tek [OPTIONS] <COMMAND>
Commands:
clock A standalone transport clock
sequencer A MIDI sequencer
sampler A MIDI-controlled audio sampler
groovebox Sequencer and sampler together
arranger Multi-track MIDI sequencer
mixer TODO: A MIDI-controlled audio mixer
track TODO: A customizable channel strip
plugin TODO: An audio plugin host
help Print this message or the help of the given subcommand(s)
Options:
-n, --name <NAME> Name of JACK client
-S, --sync-lead Whether to attempt to become transport master
-s, --sync-follow Whether to sync to external transport master
-b, --bpm <BPM> Initial tempo in beats per minute
-t, --show-clock Whether to include a transport toolbar (default: true)
-I, --midi-from <MIDI_FROM> MIDI outs to connect to (multiple instances accepted)
-i, --midi-from-re <MIDI_FROM_RE> MIDI outs to connect to (multiple instances accepted)
-O, --midi-to <MIDI_TO> MIDI ins to connect to (multiple instances accepted)
-o, --midi-to-re <MIDI_TO_RE> MIDI ins to connect to (multiple instances accepted)
-l, --left-from <LEFT_FROM> Audio outs to connect to left input
-r, --right-from <RIGHT_FROM> Audio outs to connect to right input
-L, --left-to <LEFT_TO> Audio ins to connect from left output
-R, --right-to <RIGHT_TO> Audio ins to connect from right output
-h, --help Print help
-V, --version Print version
```
## keymaps ## keymaps
* [x] `arrows/wasd`: navigate * [x] `arrows/wasd`: navigate
@ -68,18 +36,6 @@ Options:
## installation ## installation
### binary download
see the [releases page](https://codeberg.org/unspeaker/tek/releases).
### from source with cargo
requires rust nightly.
```
cargo install --git https://codeberg.org/unspeaker/tek
```
### from distro repositories ### from distro repositories
[![Packaging status](https://repology.org/badge/vertical-allrepos/tek.svg)](https://repology.org/project/tek/versions) [![Packaging status](https://repology.org/badge/vertical-allrepos/tek.svg)](https://repology.org/project/tek/versions)
@ -93,24 +49,17 @@ you can install it using an AUR helper (e.g. `paru`):
paru -S tek paru -S tek
``` ```
## development ### building from source
you'll need a Rust toolchain and various system libraries. requires docker
you can obtain the former using `rustup` and the latter using `nix-shell`.
there's a `shell.nix` provided with the project.
from there, use the commands in the `Justfile`, e.g.:
```sh
just arranger
``` ```
git clone https://codeberg.org/unspeaker/tek # obtain source
note that `tek > 0.2.0-rc.7` will require rust nightly cd tek # enter directory
for the unstable features `type_alias_impl_trait` and cat bin/release.sh # preview build script
`impl_trait_in_assoc_type`. make some noise for lucky sudo bin/release.sh # run build script
[**rust rfc2515**](https://github.com/rust-lang/rust/issues/63063) sudo cp bin/tek /usr/local/bin/tek # install
if you want to see this buildable with stable/beta. ```
## design goals ## design goals

0
bin/README.md Normal file
View file

10
bin/release-shell.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env sh
set -exo pipefail
docker inspect tek || time docker build --cache-from=internal -t tek .
time docker run \
-itu0 \
-v .:/build -w /build \
-vtek-build-cargo:/home/build/.cargo \
-vtek-build-target:/build/target \
-eRUST_JACK_DLOPEN=true \
tek $@

13
bin/release.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
set -exo pipefail
docker inspect tek || time docker build --cache-from=internal -t tek .
time docker run \
-itu0 \
-v .:/build -w /build \
-vtek-build-cargo:/home/build/.cargo \
-vtek-build-target:/build/target \
-eRUST_JACK_DLOPEN=true \
tek sh -c "chown -R 1000:1000 /build/target \
&& su build -c 'source ~/.cargo/env \
&& just build-release \
&& cp target/release/tek bin/'"

1
deps/rust-jack vendored Submodule

@ -0,0 +1 @@
Subproject commit a13c1c4d20343e574787a703eaeea7aeda63b084

View file

@ -1,4 +0,0 @@
#!/usr/bin/env sh
set -exo pipefail
docker build --cache-from=internal -t tek .
docker run -itu0 -v .:/build -vtek-build-target:/build/target -w/build tek