Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 rustPlatform,
3 fetchFromGitHub,
4 lib,
5 ffmpeg,
6 pkg-config,
7 alsa-lib,
8 wayland,
9 makeWrapper,
10 libxkbcommon,
11 vulkan-loader,
12 xorg,
13}:
14let
15 version = "0.3.1";
16
17 src = fetchFromGitHub {
18 owner = "PolyMeilex";
19 repo = "Neothesia";
20 rev = "v${version}";
21 hash = "sha256-qYwBSye6RYClSlWmHwuy/rxq9w5932tR33Z+o2S1l8k=";
22 };
23in
24rustPlatform.buildRustPackage {
25 pname = "neothesia";
26
27 inherit src version;
28
29 buildInputs = [
30 ffmpeg
31 alsa-lib
32 ];
33
34 nativeBuildInputs = [
35 pkg-config
36 makeWrapper
37 rustPlatform.bindgenHook
38 ];
39
40 cargoHash = "sha256-mXeNAVYqPsBWiUZFV/atx/xjLgFNarm2HwI7k/NaAbc=";
41
42 cargoBuildFlags = [
43 "-p neothesia -p neothesia-cli"
44 ];
45
46 postInstall = ''
47 wrapProgram $out/bin/neothesia --prefix LD_LIBRARY_PATH : "${
48 lib.makeLibraryPath [
49 wayland
50 libxkbcommon
51 vulkan-loader
52 xorg.libX11
53 xorg.libXcursor
54 xorg.libXi
55 xorg.libXrender
56 ]
57 }"
58
59 install -Dm 644 flatpak/com.github.polymeilex.neothesia.desktop $out/share/applications/com.github.polymeilex.neothesia.desktop
60 install -Dm 644 flatpak/com.github.polymeilex.neothesia.png $out/share/icons/hicolor/256x256/apps/com.github.polymeilex.neothesia.png
61 install -Dm 644 default.sf2 $out/share/neothesia/default.sf2
62 '';
63
64 meta = {
65 description = "Flashy Synthesia Like Software For Linux, Windows and macOS";
66 homepage = "https://github.com/PolyMeilex/Neothesia";
67 license = lib.licenses.gpl3;
68 platforms = lib.platforms.linux;
69 mainProgram = "neothesia";
70 maintainers = [
71 lib.maintainers.naxdy
72 ];
73 };
74}