diff --git a/.gitignore b/.gitignore index 7a033165..bd7648bf 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ example.mid cov */cov *.profraw +bin/* +!bin/README.md +!bin/*.sh diff --git a/.gitmodules b/.gitmodules index c52699df..15f065ba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,3 +5,6 @@ [submodule "tengri"] path = deps/tengri url = ../tengri/ +[submodule "deps/rust-jack"] + path = deps/rust-jack + url = https://codeberg.org/unspeaker/rust-jack diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..f40cf8e8 --- /dev/null +++ b/CONTRIBUTING.md @@ -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. diff --git a/Cargo.lock b/Cargo.lock index b2ac3b65..3cc30419 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -269,6 +269,15 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" 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]] name = "crossbeam-deque" version = "0.8.6" @@ -319,6 +328,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "darling" version = "0.20.11" @@ -554,9 +573,11 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jack" version = "0.13.0" -source = "git+https://codeberg.org/unspeaker/rust-jack?rev=a13c1c4#a13c1c4d20343e574787a703eaeea7aeda63b084" dependencies = [ + "approx", "bitflags 2.9.0", + "crossbeam-channel", + "ctor", "jack-sys", "lazy_static", "libc", @@ -566,7 +587,6 @@ dependencies = [ [[package]] name = "jack-sys" version = "0.5.1" -source = "git+https://codeberg.org/unspeaker/rust-jack?rev=a13c1c4#a13c1c4d20343e574787a703eaeea7aeda63b084" dependencies = [ "bitflags 2.9.0", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index 76cce246..b41ec6a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,12 @@ path = "./deps/tengri/tengri" #rev = "6048d24" features = [ "tui", "dsl" ] +[workspace.dependencies.jack] +#git = "https://codeberg.org/unspeaker/rust-jack" +#rev = "a13c1c4" +path = "./deps/rust-jack" +default-features = false + [workspace.dependencies] tek = { path = "./crates/app" } tek_cli = { path = "./crates/cli" } @@ -39,7 +45,6 @@ atomic_float = { version = "1.0.0" } backtrace = { version = "0.3.72" } clap = { version = "4.5.4", features = [ "derive" ] } gtk = { version = "0.18.1" } -jack = { git = "https://codeberg.org/unspeaker/rust-jack", rev = "a13c1c4" } livi = { version = "0.7.4" } midly = { version = "0.5" } palette = { version = "0.7.6", features = [ "random" ] } diff --git a/Dockerfile b/Dockerfile index 7c62fc68..421701da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,15 @@ FROM docker.io/library/alpine:edge + 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 + RUN adduser -Du1000 build + 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" \ - && rustup install nightly \ - && rustup default nightly \ && cargo version -vv diff --git a/README.md b/README.md index 8900b5dc..7a29918a 100644 --- a/README.md +++ b/README.md @@ -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 [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) ![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`) * **recommended:** midi controller; samples in wav format; lv2 plugins. -``` -Usage: tek [OPTIONS] - -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 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 Initial tempo in beats per minute - -t, --show-clock Whether to include a transport toolbar (default: true) - -I, --midi-from MIDI outs to connect to (multiple instances accepted) - -i, --midi-from-re MIDI outs to connect to (multiple instances accepted) - -O, --midi-to MIDI ins to connect to (multiple instances accepted) - -o, --midi-to-re MIDI ins to connect to (multiple instances accepted) - -l, --left-from Audio outs to connect to left input - -r, --right-from Audio outs to connect to right input - -L, --left-to Audio ins to connect from left output - -R, --right-to Audio ins to connect from right output - -h, --help Print help - -V, --version Print version -``` - ## keymaps * [x] `arrows/wasd`: navigate @@ -68,18 +36,6 @@ Options: ## 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 [![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 ``` -## 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 ``` - -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. +git clone https://codeberg.org/unspeaker/tek # obtain source +cd tek # enter directory +cat bin/release.sh # preview build script +sudo bin/release.sh # run build script +sudo cp bin/tek /usr/local/bin/tek # install +``` ## design goals diff --git a/bin/README.md b/bin/README.md new file mode 100644 index 00000000..e69de29b diff --git a/bin/release-shell.sh b/bin/release-shell.sh new file mode 100755 index 00000000..88323a3a --- /dev/null +++ b/bin/release-shell.sh @@ -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 $@ diff --git a/bin/release.sh b/bin/release.sh new file mode 100755 index 00000000..34f0a8e9 --- /dev/null +++ b/bin/release.sh @@ -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/'" diff --git a/deps/rust-jack b/deps/rust-jack new file mode 160000 index 00000000..a13c1c4d --- /dev/null +++ b/deps/rust-jack @@ -0,0 +1 @@ +Subproject commit a13c1c4d20343e574787a703eaeea7aeda63b084 diff --git a/release.sh b/release.sh deleted file mode 100755 index 9820dbb0..00000000 --- a/release.sh +++ /dev/null @@ -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