1 { stdenv, lib, callPackage, fetchFromGitHub
2 , fetchurl, runCommand, unzip, bchunk, p7zip
3 , cmake, pkg-config, makeWrapper
5 , dialog, python3, cdparanoia, ffmpeg
9 stratagus = callPackage ./stratagus.nix {};
11 dataDownload = fetchurl {
12 url = "https://archive.org/download/warcraft-ii-tides-of-darkness_202105/Warcess.zip";
13 sha256 = "0yxgvf8xpv1w2bjmny4a38pa3xcdgqckk9abj21ilkc5zqzqmm9b";
16 data = runCommand "warcraft2" {
17 buildInputs = [ unzip bchunk p7zip ];
18 meta.license = lib.licenses.unfree;
20 unzip ${dataDownload} "Warcraft.II.Tides.of.Darkness/Warcraft II - Tides of Darkness (1995)/games/WarcrafD/cd/"{WC2BTDP.img,WC2BTDP.cue}
21 bchunk "Warcraft.II.Tides.of.Darkness/Warcraft II - Tides of Darkness (1995)/games/WarcrafD/cd/"{WC2BTDP.img,WC2BTDP.cue} WC2BTDP
22 rm -r Warcraft.II.Tides.of.Darkness
29 stdenv.mkDerivation rec {
31 inherit (stratagus) version;
33 src = fetchFromGitHub {
37 sha256 = "sha256-yJeMFxCD0ikwVPQApf+IBuMQ6eOjn1fVKNmqh6r760c=";
40 nativeBuildInputs = [ cmake pkg-config makeWrapper ffmpeg ];
41 buildInputs = [ zlib bzip2 libpng ];
43 "-DSTRATAGUS=${stratagus}/games/stratagus"
44 "-DSTRATAGUS_INCLUDE_DIR=${stratagus.src}/gameheaders"
47 makeWrapper $out/games/wargus $out/bin/wargus \
48 --prefix PATH : ${lib.makeBinPath [ "$out" ]}
49 substituteInPlace $out/share/applications/wargus.desktop \
50 --replace $out/games/wargus $out/bin/wargus
52 $out/bin/wartool -v -r ${data} $out/share/games/stratagus/wargus
53 ln -s $out/share/games/stratagus/wargus/{contrib/black_title.png,graphics/ui/black_title.png}
57 description = "Importer and scripts for Warcraft II: Tides of Darkness, the expansion Beyond the Dark Portal, and Aleonas Tales";
58 homepage = "https://wargus.github.io/";
59 license = licenses.gpl2Only;
60 maintainers = [ maintainers.astro ];
61 platforms = platforms.linux;