1 { lib, stdenv, fetchFromGitHub, fetchpatch
6 stdenv.mkDerivation rec {
10 src = fetchFromGitHub {
14 fetchSubmodules = true;
15 sha256 = "1h99sm2ddaq483hhk2s3z4bjbgn0d2h7qna7l7qq98wvhqix8iyz";
21 nativeBuildInputs = [ pkg-config ];
25 url = "https://github.com/kometbomb/klystrack/commit/bb537595d02140176831c4a1b8e9121978b32d22.patch";
26 sha256 = "06gl9q0jwg039kpxb13lg9x0k59s11968qn4lybgkadvzmhxkgmi";
30 # Workaround build failure on -fno-common toolchains:
31 # ld: libengine_gui.a(gui_menu.o):(.bss+0x0): multiple definition of
32 # `menu_t'; objs.release/action.o:(.bss+0x20): first defined here
33 # TODO: remove it for 1.7.7+ release as it was fixed upstream.
34 env.NIX_CFLAGS_COMPILE = "-fcommon";
36 buildFlags = [ "PREFIX=${placeholder "out"}" "CFG=release" ];
39 install -Dm755 bin.release/klystrack $out/bin/klystrack
41 mkdir -p $out/lib/klystrack
42 cp -R res $out/lib/klystrack
43 cp -R key $out/lib/klystrack
45 install -DT icon/256x256.png $out/share/icons/hicolor/256x256/apps/klystrack.png
46 mkdir -p $out/share/applications
47 substitute linux/klystrack.desktop $out/share/applications/klystrack.desktop \
48 --replace "klystrack %f" "$out/bin/klystrack %f"
52 description = "Chiptune tracker";
53 homepage = "https://kometbomb.github.io/klystrack";
54 license = licenses.mit;
55 maintainers = with maintainers; [ suhr ];
56 platforms = platforms.linux;
57 mainProgram = "klystrack";