nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 rustPlatform,
7 pkg-config,
8 alsa-lib,
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "kord";
13 version = "0.6.1";
14
15 # kord depends on nightly features
16 env.RUSTC_BOOTSTRAP = 1;
17
18 src = fetchFromGitHub {
19 owner = "twitchax";
20 repo = "kord";
21 rev = "v${version}";
22 sha256 = "sha256-CeMh6yB4fGoxtGLbkQe4OMMvBM0jesyP+8JtU5kCP84=";
23 };
24
25 cargoHash = "sha256-DpZsi2eIhuetHnLLYGAvv871mbPfAIUevqBLaV8ljGA=";
26
27 patches = [
28 # Fixes build issues due to refactored Rust compiler feature annotations.
29 # Should be removable with the next release after v. 0.6.1.
30 (fetchpatch {
31 name = "fix-rust-features.patch";
32 url = "https://github.com/twitchax/kord/commit/fa9bb979b17d77f54812a915657c3121f76c5d82.patch";
33 hash = "sha256-XQu9P7372J2dHWzvpvbPtALS0Bh8EC+J1EyG3qlak2M=";
34 excludes = [ "Cargo.*" ];
35 })
36 ];
37
38 nativeBuildInputs =
39 lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]
40 ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
41
42 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ];
43
44 meta = {
45 description = "Music theory binary and library for Rust";
46 homepage = "https://github.com/twitchax/kord";
47 maintainers = with lib.maintainers; [ kidsan ];
48 license = with lib.licenses; [ mit ];
49 };
50}