4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
{ lib, stdenv, fetchFromGitHub, fetchpatch
|
|
, SDL2, SDL2_image
|
|
, pkgconfig
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "klystrack";
|
|
version = "1.7.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "kometbomb";
|
|
repo = pname;
|
|
rev = version;
|
|
fetchSubmodules = true;
|
|
sha256 = "1h99sm2ddaq483hhk2s3z4bjbgn0d2h7qna7l7qq98wvhqix8iyz";
|
|
};
|
|
|
|
buildInputs = [
|
|
SDL2 SDL2_image
|
|
];
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
patches = [
|
|
(fetchpatch {
|
|
url = "https://github.com/kometbomb/klystrack/commit/bb537595d02140176831c4a1b8e9121978b32d22.patch";
|
|
sha256 = "06gl9q0jwg039kpxb13lg9x0k59s11968qn4lybgkadvzmhxkgmi";
|
|
})
|
|
];
|
|
|
|
buildFlags = [ "PREFIX=${placeholder "out"}" "CFG=release" ];
|
|
|
|
installPhase = ''
|
|
install -Dm755 bin.release/klystrack $out/bin/klystrack
|
|
|
|
mkdir -p $out/lib/klystrack
|
|
cp -R res $out/lib/klystrack
|
|
cp -R key $out/lib/klystrack
|
|
|
|
install -DT icon/256x256.png $out/share/icons/hicolor/256x256/apps/klystrack.png
|
|
mkdir -p $out/share/applications
|
|
substitute linux/klystrack.desktop $out/share/applications/klystrack.desktop \
|
|
--replace "klystrack %f" "$out/bin/klystrack %f"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A chiptune tracker";
|
|
homepage = "https://kometbomb.github.io/klystrack";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ suhr ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|