Files
nixpkgs/pkgs/by-name/ro/rott/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

82 lines
2.0 KiB
Nix

{
stdenv,
lib,
fetchurl,
fetchzip,
SDL_compat,
SDL_mixer,
makeDesktopItem,
copyDesktopItems,
unzip,
buildShareware ? false,
withSharewareData ? buildShareware,
}:
assert withSharewareData -> buildShareware;
let
datadir = "share/data/rott-shareware/";
in
stdenv.mkDerivation (finalAttrs: {
pname = "rott";
version = "1.1.2";
__structuredAttrs = true;
srcs = [
(fetchurl {
url = "https://icculus.org/rott/releases/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
hash = "sha256-ECUW6MMS9rC79sYj4fAcv7vDFKzorf4fIB1HsVvZJ/8=";
})
]
++ lib.optional withSharewareData (fetchzip {
url = "http://icculus.org/rott/share/1rott13.zip";
hash = "sha256-l0pP+mNPAabGh7LZrwcB6KOhPRSycrZpAlPVTyDXc6Y=";
stripRoot = false;
});
sourceRoot = "rott-${finalAttrs.version}/rott";
nativeBuildInputs = [ copyDesktopItems ] ++ lib.optional withSharewareData unzip;
buildInputs = [
SDL_compat
SDL_mixer
];
enableParallelBuilding = true;
makeFlags = [
"SHAREWARE=${if buildShareware then "1" else "0"}"
''EXTRACFLAGS=-DDATADIR=\"${if withSharewareData then "${placeholder "out"}/${datadir}" else ""}\"''
];
installPhase = ''
runHook preInstall
${lib.optionalString withSharewareData ''
mkdir -p "$out/${datadir}"
unzip -d "$out/${datadir}" ../../source/ROTTSW13.SHR
''}
install -Dm755 -t $out/bin rott
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "rott";
exec = "rott";
desktopName = "Rise of the Triad: ${if buildShareware then "The HUNT Begins" else "Dark War"}";
categories = [ "Game" ];
})
];
meta = {
description = "SDL port of Rise of the Triad";
mainProgram = "rott";
homepage = "https://icculus.org/rott/";
license = with lib.licenses; [ gpl2Plus ] ++ lib.optional withSharewareData unfreeRedistributable;
maintainers = with lib.maintainers; [ sander ];
platforms = lib.platforms.all;
};
})