klystrack: Maintain abit

- rec -> finalAttrs
- sha256 -> hash
- Use pkg-config instead of sdl2-config
- Enable strictDeps
- Add runHook calls in overridden installPhase
- Drop meta-wide "with lib"

OPNA2608 42ca2cc0 836cf3d9

+23 -10
+23 -10
pkgs/by-name/kl/klystrack/package.nix
··· 8 pkg-config, 9 }: 10 11 - stdenv.mkDerivation rec { 12 pname = "klystrack"; 13 version = "1.7.6"; 14 15 src = fetchFromGitHub { 16 owner = "kometbomb"; 17 repo = "klystrack"; 18 - tag = version; 19 fetchSubmodules = true; 20 - sha256 = "1h99sm2ddaq483hhk2s3z4bjbgn0d2h7qna7l7qq98wvhqix8iyz"; 21 }; 22 23 # https://github.com/kometbomb/klystrack/commit/6dac9eb5e75801ce4dec1d8b339f78e3df2f54bc fixes build but doesn't apply as-is, just patch in the flag 24 # Make embedded date reproducible 25 postPatch = '' 26 substituteInPlace Makefile \ 27 --replace-fail '-DUSESDL_IMAGE' '-DUSESDL_IMAGE -DUSESDL_RWOPS' 28 29 substituteInPlace Makefile klystron/Makefile \ 30 --replace-fail 'date' 'date --date @$(SOURCE_DATE_EPOCH)' 31 ''; 32 33 buildInputs = [ 34 SDL2 35 SDL2_image 36 ]; 37 - nativeBuildInputs = [ pkg-config ]; 38 39 patches = [ 40 (fetchpatch { 41 url = "https://github.com/kometbomb/klystrack/commit/bb537595d02140176831c4a1b8e9121978b32d22.patch"; 42 - sha256 = "06gl9q0jwg039kpxb13lg9x0k59s11968qn4lybgkadvzmhxkgmi"; 43 }) 44 ]; 45 ··· 55 ]; 56 57 installPhase = '' 58 install -Dm755 bin.release/klystrack $out/bin/klystrack 59 60 mkdir -p $out/lib/klystrack ··· 65 mkdir -p $out/share/applications 66 substitute linux/klystrack.desktop $out/share/applications/klystrack.desktop \ 67 --replace "klystrack %f" "$out/bin/klystrack %f" 68 ''; 69 70 - meta = with lib; { 71 description = "Chiptune tracker"; 72 homepage = "https://kometbomb.github.io/klystrack"; 73 - license = licenses.mit; 74 - maintainers = with maintainers; [ suhr ]; 75 - platforms = platforms.linux; 76 mainProgram = "klystrack"; 77 }; 78 - }
··· 8 pkg-config, 9 }: 10 11 + stdenv.mkDerivation (finalAttrs: { 12 pname = "klystrack"; 13 version = "1.7.6"; 14 15 src = fetchFromGitHub { 16 owner = "kometbomb"; 17 repo = "klystrack"; 18 + tag = finalAttrs.version; 19 fetchSubmodules = true; 20 + hash = "sha256-30fUI4abo4TxoUdZfKBowL4lF/lDiwnhQASr1kTVKcE="; 21 }; 22 23 # https://github.com/kometbomb/klystrack/commit/6dac9eb5e75801ce4dec1d8b339f78e3df2f54bc fixes build but doesn't apply as-is, just patch in the flag 24 # Make embedded date reproducible 25 + # Use pkg-config instead of sdl2-config 26 postPatch = '' 27 substituteInPlace Makefile \ 28 --replace-fail '-DUSESDL_IMAGE' '-DUSESDL_IMAGE -DUSESDL_RWOPS' 29 30 substituteInPlace Makefile klystron/Makefile \ 31 --replace-fail 'date' 'date --date @$(SOURCE_DATE_EPOCH)' 32 + 33 + substituteInPlace klystron/common.mk klystron/tools/makebundle/Makefile \ 34 + --replace-fail 'sdl2-config' 'pkg-config sdl2 SDL2_image' 35 ''; 36 37 + strictDeps = true; 38 + 39 + nativeBuildInputs = [ 40 + pkg-config 41 + ]; 42 + 43 buildInputs = [ 44 SDL2 45 SDL2_image 46 ]; 47 48 patches = [ 49 (fetchpatch { 50 url = "https://github.com/kometbomb/klystrack/commit/bb537595d02140176831c4a1b8e9121978b32d22.patch"; 51 + hash = "sha256-sb7ZYf27qfmWp8RiZFIIOpUJenp0hNXvTAM8LgFO9Bk="; 52 }) 53 ]; 54 ··· 64 ]; 65 66 installPhase = '' 67 + runHook preInstall 68 + 69 install -Dm755 bin.release/klystrack $out/bin/klystrack 70 71 mkdir -p $out/lib/klystrack ··· 76 mkdir -p $out/share/applications 77 substitute linux/klystrack.desktop $out/share/applications/klystrack.desktop \ 78 --replace "klystrack %f" "$out/bin/klystrack %f" 79 + 80 + runHook postInstall 81 ''; 82 83 + meta = { 84 description = "Chiptune tracker"; 85 homepage = "https://kometbomb.github.io/klystrack"; 86 + license = lib.licenses.mit; 87 + maintainers = with lib.maintainers; [ suhr ]; 88 + platforms = lib.platforms.linux; 89 mainProgram = "klystrack"; 90 }; 91 + })