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