Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
49faba6266 WIP Stronghold Crusaders package 2019-01-27 23:35:04 +01:00
3 changed files with 74 additions and 0 deletions

View file

@ -6,5 +6,7 @@
wildfly = pkgs.callPackage ./wildfly/default.nix {};
postman_appimage = pkgs.callPackage ./postman-appimage/default.nix {};
gog = import ./gog/default.nix {};
services = import ./services/default.nix;
}

5
gog/default.nix Normal file
View file

@ -0,0 +1,5 @@
{ pkgs ? import <nixpkgs> {} }:
{
stronghold_crusader = pkgs.callPackage ./stronghold-crusader/default.nix {};
}

View file

@ -0,0 +1,67 @@
{ pkgs ? import <nixpkgs> {} }:
let
_basename = "stronghold-crusader";
_version = "1.41_20410";
setup_exe = pkgs.requireFile rec {
name = "setup_stronghold_crusader_extreme_hd_${_version}.exe";
message = "Please download ${name} from https://gog.com/.";
sha256 = "05crr9801biasbb57yj6vcr65kz6y7hwgcijjbhlxwpzk4fsgxfv";
};
game_extracted = pkgs.stdenv.mkDerivation rec {
name = "${_basename}-extracted-${_version}";
version = _version;
src = setup_exe;
nativeBuildInputs = with pkgs; [ innoextract ];
unpackPhase = ''
innoextract --gog --extract $src
'';
buildPhase = ":";
installPhase = ''
mkdir -p $out/share/${_basename}
cp -R . $out/share/${_basename}/
'';
};
game_wrapped = pkgs.stdenv.mkDerivation rec {
name = "${_basename}-wrapped-${_version}";
version = _version;
buildInputs = with pkgs; [ game_extracted wine icoutils ];
unpackPhase = ''
wrestool -x -t 14 "${game_extracted}/share/${_basename}/Stronghold Crusader.exe" > stronghold_crusader.ico
wrestool -x -t 14 "${game_extracted}/share/${_basename}/Stronghold_Crusader_Extreme.exe" > stronghold_crusader_extreme.ico
'';
buildPhase = ":";
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/icons/hicolor/{32x32,256x256}/apps
cp 'stronghold_crusader.ico' $out/share/icons/hicolor/256x256/apps/
cp 'stronghold_crusader_extreme.ico' $out/share/icons/hicolor/32x32/apps/
cat << EOF > $out/bin/stronghold_crusader
#!${pkgs.bash}/bin/bash
${pkgs.wine}/bin/wine "${game_extracted}/share/${_basename}/Stronghold Crusader.exe"
EOF
chmod +x $out/bin/stronghold_crusader
cat << EOF > $out/bin/stronghold_crusader_extreme
#!${pkgs.bash}/bin/bash
${pkgs.wine}/bin/wine "${game_extracted}/share/${_basename}/Stronghold_Crusader_Extreme.exe"
EOF
chmod +x $out/bin/stronghold_crusader_extreme
'';
};
in game_wrapped