diff --git a/pkgs/games/wargus/default.nix b/pkgs/games/wargus/default.nix index c225e2bbcb2a..9cae3c537840 100644 --- a/pkgs/games/wargus/default.nix +++ b/pkgs/games/wargus/default.nix @@ -1,11 +1,30 @@ { stdenv, lib, callPackage, fetchFromGitHub +, fetchurl, runCommand, unzip, bchunk, p7zip , cmake, pkg-config, makeWrapper , zlib, bzip2, libpng -, dialog, python3, cdparanoia +, dialog, python3, cdparanoia, ffmpeg }: let stratagus = callPackage ./stratagus.nix {}; + + dataDownload = fetchurl { + url = "https://archive.org/download/warcraft-ii-tides-of-darkness_202105/Warcess.zip"; + sha256 = "0yxgvf8xpv1w2bjmny4a38pa3xcdgqckk9abj21ilkc5zqzqmm9b"; + }; + + data = runCommand "warcraft2" { + buildInputs = [ unzip bchunk p7zip ]; + meta.license = lib.licenses.unfree; + } '' + unzip ${dataDownload} "Warcraft.II.Tides.of.Darkness/Warcraft II - Tides of Darkness (1995)/games/WarcrafD/cd/"{WC2BTDP.img,WC2BTDP.cue} + bchunk "Warcraft.II.Tides.of.Darkness/Warcraft II - Tides of Darkness (1995)/games/WarcrafD/cd/"{WC2BTDP.img,WC2BTDP.cue} WC2BTDP + rm -r Warcraft.II.Tides.of.Darkness + 7z x WC2BTDP01.iso + rm WC2BTDP*.{iso,cdr} + cp -r DATA $out + ''; + in stdenv.mkDerivation rec { pname = "wargus"; @@ -18,7 +37,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-yJeMFxCD0ikwVPQApf+IBuMQ6eOjn1fVKNmqh6r760c="; }; - nativeBuildInputs = [ cmake pkg-config makeWrapper ]; + nativeBuildInputs = [ cmake pkg-config makeWrapper ffmpeg ]; buildInputs = [ zlib bzip2 libpng ]; cmakeFlags = [ "-DSTRATAGUS=${stratagus}/games/stratagus" @@ -26,7 +45,10 @@ stdenv.mkDerivation rec { ]; postInstall = '' makeWrapper $out/games/wargus $out/bin/wargus \ - --prefix PATH : ${lib.makeBinPath [ "$out" cdparanoia python3 ]} + --prefix PATH : ${lib.makeBinPath [ "$out" ]} + + $out/bin/wartool -v -r ${data} $out/share/games/stratagus/wargus + ln -s $out/share/games/stratagus/wargus/{contrib/black_title.png,graphics/ui/black_title.png} ''; meta = with lib; {