From ccf44033f755215ddfabc20b01f3a75c87dd3888 Mon Sep 17 00:00:00 2001 From: grepwood Date: Fri, 17 Apr 2020 15:53:39 +0200 Subject: [PATCH] Version bump against games-util/lgogdownloader::gentoo, added portage USE to enable Portage integration that will become critical in a lot of games-*/* ebuilds. --- games-util/lgogdownloader/Manifest | 1 + .../0001-recycle-cookies-and-tokens.patch | 44 +++++++++++++++++++ .../lgogdownloader/lgogdownloader-3.7.ebuild | 42 ++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 games-util/lgogdownloader/Manifest create mode 100644 games-util/lgogdownloader/files/0001-recycle-cookies-and-tokens.patch create mode 100644 games-util/lgogdownloader/lgogdownloader-3.7.ebuild diff --git a/games-util/lgogdownloader/Manifest b/games-util/lgogdownloader/Manifest new file mode 100644 index 0000000..e11639e --- /dev/null +++ b/games-util/lgogdownloader/Manifest @@ -0,0 +1 @@ +DIST lgogdownloader-3.7.tar.gz 85653 BLAKE2B bb6fe56be291ca726b97cfb7ce83e87e855584da911839a9bc6a923c027e7ea67e83e62a5e8bb1a0c62dd053a7d6728c1e82896d19ba48a310574dc8c6a647f5 SHA512 2085b9c64008d790a28dcb9d22009340acac164db316523919dcf797255fd57a36160950fb222e82b9ee6262ef8c0e86193e2d9a4488ea2105f9f4bbe7db727b diff --git a/games-util/lgogdownloader/files/0001-recycle-cookies-and-tokens.patch b/games-util/lgogdownloader/files/0001-recycle-cookies-and-tokens.patch new file mode 100644 index 0000000..daa75c8 --- /dev/null +++ b/games-util/lgogdownloader/files/0001-recycle-cookies-and-tokens.patch @@ -0,0 +1,44 @@ +--- a/src/downloader.cpp 2020-04-17 15:41:32.142346898 +0200 ++++ b/src/downloader.cpp 2020-04-17 14:54:23.614337011 +0200 +@@ -255,21 +255,27 @@ + else + { + if (!isatty(STDIN_FILENO)) { +- std::cerr << "Unable to read email and password" << std::endl; +- return 0; +- } +- std::cerr << "Email: "; +- std::getline(std::cin,email); ++ /* Attempt to read this stuff from elsewhere */ ++ bool cookie_gone = boost::filesystem::exists(Globals::globalConfig.curlConf.sCookiePath); ++ bool tokens_gone = boost::filesystem::exists(Globals::globalConfig.sConfigDirectory + "/galaxy_tokens.json"); ++ if(cookie_gone || tokens_gone) { ++ std::cerr << "Unable to read email and password" << std::endl; ++ return 0; ++ } ++ } else { ++ std::cerr << "Email: "; ++ std::getline(std::cin,email); + +- std::cerr << "Password: "; +- struct termios termios_old, termios_new; +- tcgetattr(STDIN_FILENO, &termios_old); // Get current terminal attributes +- termios_new = termios_old; +- termios_new.c_lflag &= ~ECHO; // Set ECHO off +- tcsetattr(STDIN_FILENO, TCSANOW, &termios_new); // Set terminal attributes +- std::getline(std::cin, password); +- tcsetattr(STDIN_FILENO, TCSANOW, &termios_old); // Restore old terminal attributes +- std::cerr << std::endl; ++ std::cerr << "Password: "; ++ struct termios termios_old, termios_new; ++ tcgetattr(STDIN_FILENO, &termios_old); // Get current terminal attributes ++ termios_new = termios_old; ++ termios_new.c_lflag &= ~ECHO; // Set ECHO off ++ tcsetattr(STDIN_FILENO, TCSANOW, &termios_new); // Set terminal attributes ++ std::getline(std::cin, password); ++ tcsetattr(STDIN_FILENO, TCSANOW, &termios_old); // Restore old terminal attributes ++ std::cerr << std::endl; ++ } + } + + if (email.empty() || password.empty()) diff --git a/games-util/lgogdownloader/lgogdownloader-3.7.ebuild b/games-util/lgogdownloader/lgogdownloader-3.7.ebuild new file mode 100644 index 0000000..b46952a --- /dev/null +++ b/games-util/lgogdownloader/lgogdownloader-3.7.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="Unofficial GOG.com downloader for Linux with patchset that allows integration with Portage" +HOMEPAGE="https://sites.google.com/site/gogdownloader/" +SRC_URI="https://sites.google.com/site/gogdownloader/${P}.tar.gz" +LICENSE="WTFPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="gui portage" + +RDEPEND=">=app-crypt/rhash-1.3.3-r2:0= + dev-cpp/htmlcxx:0= + dev-libs/boost:0= + >=dev-libs/jsoncpp-1.7:0= + dev-libs/tinyxml2:0= + >=net-misc/curl-7.32:0=[ssl] + gui? ( dev-qt/qtwebengine:5=[widgets] )" + +DEPEND="${RDEPEND}" + +BDEPEND="sys-apps/help2man + virtual/pkgconfig" + +src_configure() { + local mycmakeargs=( + -DUSE_QT_GUI=$(usex gui) + ) + if use portage; then + patch -p1 < ${FILESDIR}/0001-recycle-cookies-and-tokens.patch + fi + cmake_src_configure +} + +src_install() { + cmake_src_install + gunzip "${ED}"/usr/share/man/man1/${PN}.1.gz || die +}