diff options
Diffstat (limited to 'pkgs/games/gog')
-rw-r--r-- | pkgs/games/gog/default.nix | 1 | ||||
-rw-r--r-- | pkgs/games/gog/fetch-gog/default.nix | 29 | ||||
-rw-r--r-- | pkgs/games/gog/kingdoms-and-castles.nix | 14 |
3 files changed, 35 insertions, 9 deletions
diff --git a/pkgs/games/gog/default.nix b/pkgs/games/gog/default.nix index 6588d6f2..f1010a00 100644 --- a/pkgs/games/gog/default.nix +++ b/pkgs/games/gog/default.nix @@ -16,6 +16,7 @@ let dungeons3 = callPackage ./dungeons3.nix {}; epistory = callPackage ./epistory.nix { }; homm3 = callPackage ./homm3 {}; + kingdoms-and-castles = callPackage ./kingdoms-and-castles.nix {}; overload = callPackage ./overload.nix {}; party-hard = callPackage ./party-hard.nix {}; satellite-reign = callPackage ./satellite-reign.nix {}; diff --git a/pkgs/games/gog/fetch-gog/default.nix b/pkgs/games/gog/fetch-gog/default.nix index d4a35a05..c1d350ce 100644 --- a/pkgs/games/gog/fetch-gog/default.nix +++ b/pkgs/games/gog/fetch-gog/default.nix @@ -147,14 +147,24 @@ let } ''; - in runCommandCC "get-captcha" { - nativeBuildInputs = [ pkgconfig ]; + in stdenv.mkDerivation { + name = "get-captcha"; + + dontUnpack = true; + + nativeBuildInputs = [ pkgconfig (qt5.wrapQtAppsHook or null) ]; buildInputs = [ qt5.qtbase qt5.qtwebengine ]; preferLocalBuild = true; - } '' - g++ $(pkg-config --libs --cflags Qt5WebEngineWidgets Qt5WebEngine) \ - -Wall -std=c++11 -o "$out" ${application} - ''; + + buildPhase = '' + g++ $(pkg-config --libs --cflags Qt5WebEngineWidgets Qt5WebEngine) \ + -Wall -std=c++11 -o get-captcha ${application} + ''; + + installPhase = '' + install -vD get-captcha "$out/bin/get-captcha" + ''; + }; mkPyStr = str: "'${stdenv.lib.escape ["'" "\\"] (toString str)}'"; @@ -178,7 +188,7 @@ let def login(self): browser = mechanicalsoup.StatefulBrowser() response = browser.open(${mkPyStr authURL}) - if "google.com/recaptcha" in response.text: + if "https://www.recaptcha.net/recaptcha" in response.text: token_url = self.login_with_captcha() else: browser.select_form('form[name="login"]') @@ -190,7 +200,7 @@ let if 'code' not in query: sys.stderr.write( - "Unable to login with the provided GOG credentials." + "Unable to login with the provided GOG credentials.\n" ) raise SystemExit(1) @@ -210,7 +220,8 @@ let def login_with_captcha(self): sys.stderr.write("Solving a captcha is required to log in.\n") - sys.stderr.write("Please run " ${mkPyStr getCaptcha} " now.\n") + sys.stderr.write("Please run " ${mkPyStr getCaptcha} + "/bin/get-captcha now.\n") sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sys.stderr.write("Waiting for connection") i = 0 diff --git a/pkgs/games/gog/kingdoms-and-castles.nix b/pkgs/games/gog/kingdoms-and-castles.nix new file mode 100644 index 00000000..e31551cc --- /dev/null +++ b/pkgs/games/gog/kingdoms-and-castles.nix @@ -0,0 +1,14 @@ +{ buildUnity, fetchGog }: + +buildUnity { + name = "kingdoms-and-castles"; + fullName = "KingdomsAndCastles"; + saveDir = "LionShield/Kingdoms and Castles"; + version = "115r12"; + + src = fetchGog { + productId = 2067763543; + downloadName = "en3installer0"; + sha256 = "1ag03piq09z7hljcbs145hyj8z0gjcvffj99znf3mnbw2qipb7pq"; + }; +} |