nixpkgs/pkgs/games/freenukum/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.8 KiB
Nix
Raw Normal View History

{ lib, stdenv
2020-12-11 16:47:56 +00:00
, rustPlatform
, fetchFromGitLab
, makeDesktopItem
, installShellFiles
, dejavu_fonts
, SDL2
, SDL2_ttf
2022-09-06 06:46:36 +00:00
, SDL2_image
2020-12-11 16:47:56 +00:00
}:
let
pname = "freenukum";
description = "Clone of the original Duke Nukum 1 Jump'n Run game";
desktopItem = makeDesktopItem {
desktopName = pname;
name = pname;
exec = pname;
icon = pname;
comment = description;
categories = [ "Game" "ArcadeGame" "ActionGame" ];
2020-12-11 16:47:56 +00:00
genericName = pname;
};
in
rustPlatform.buildRustPackage rec {
inherit pname;
2022-09-06 06:46:36 +00:00
version = "0.4.0";
2020-12-11 16:47:56 +00:00
src = fetchFromGitLab {
2022-09-06 06:46:36 +00:00
domain = "salsa.debian.org";
2020-12-11 16:47:56 +00:00
owner = "silwol";
2022-09-06 06:46:36 +00:00
repo = "freenukum";
2020-12-11 16:47:56 +00:00
rev = "v${version}";
2022-09-06 06:46:36 +00:00
sha256 = "sha256-Tk9n2gPwyPin6JZ4RSO8d/+xVpEz4rF8C2eGKwrAXU0=";
2020-12-11 16:47:56 +00:00
};
2022-09-06 06:46:36 +00:00
cargoSha256 = "sha256-8RfiObWDqZJg+sjjDBk+sRoS5CiECIdNPH79T+O8e8M=";
2020-12-11 16:47:56 +00:00
nativeBuildInputs = [
installShellFiles
];
buildInputs = [
SDL2
SDL2_ttf
2022-09-06 06:46:36 +00:00
SDL2_image
2020-12-11 16:47:56 +00:00
];
postPatch = ''
substituteInPlace src/graphics.rs \
--replace /usr $out
'';
postInstall = ''
mkdir -p $out/share/fonts/truetype/dejavu
ln -sf \
${dejavu_fonts}/share/fonts/truetype/DejaVuSans.ttf \
$out/share/fonts/truetype/dejavu/DejaVuSans.ttf
mkdir -p $out/share/doc/freenukum
2022-09-06 06:46:36 +00:00
install -Dm644 README.md CHANGELOG.md $out/share/doc/freenukum/
2020-12-11 16:47:56 +00:00
installManPage doc/freenukum.6
install -Dm644 "${desktopItem}/share/applications/"* -t $out/share/applications/
'';
meta = with lib; {
2020-12-11 16:47:56 +00:00
description = "Clone of the original Duke Nukum 1 Jump'n Run game";
2022-09-06 06:46:36 +00:00
homepage = "https://salsa.debian.org/silwol/freenukum";
changelog = "https://salsa.debian.org/silwol/freenukum/-/blob/v${version}/CHANGELOG.md";
2020-12-11 16:47:56 +00:00
license = licenses.agpl3Plus;
maintainers = with maintainers; [ _0x4A6F ];
broken = stdenv.isDarwin;
};
}