From 126cc690ac291e2290f3e151866b2bc37c178c8d Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Sun, 4 Feb 2018 21:31:39 +0800 Subject: [PATCH] build-support gogUnpackHook: support for unpacking games from gog.com --- pkgs/build-support/setup-hooks/gog-unpack.sh | 11 +++++++++++ pkgs/top-level/all-packages.nix | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 pkgs/build-support/setup-hooks/gog-unpack.sh diff --git a/pkgs/build-support/setup-hooks/gog-unpack.sh b/pkgs/build-support/setup-hooks/gog-unpack.sh new file mode 100644 index 000000000000..559b543fadfc --- /dev/null +++ b/pkgs/build-support/setup-hooks/gog-unpack.sh @@ -0,0 +1,11 @@ +unpackPhase="unpackGog" + +unpackGog() { + runHook preUnpackGog + + innoextract --silent --extract --exclude-temp "${src}" + + find . -depth -print -execdir rename -f 'y/A-Z/a-z/' '{}' \; + + runHook postUnpackGog +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 934c7388bccb..74969c98b4df 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -92,6 +92,11 @@ with pkgs; { substitutions = { gnu_config = gnu-config;}; } ../build-support/setup-hooks/update-autotools-gnu-config-scripts.sh; + gogUnpackHook = makeSetupHook { + name = "gog-unpack-hook"; + deps = [ innoextract file-rename ]; } + ../build-support/setup-hooks/gog-unpack.sh; + buildEnv = callPackage ../build-support/buildenv { }; # not actually a package buildFHSUserEnv = callPackage ../build-support/build-fhs-userenv { };