From 74181d3944b5fbe6309a8ab65573a4c232164ac4 Mon Sep 17 00:00:00 2001 From: "grepwood@sucs.org" Date: Wed, 3 Nov 2021 03:31:34 +0100 Subject: [PATCH] Removed games-util/lgogdownloader as upstream already provides our patch. Due to refusal to also merge our export script, we relegate it to another package which becomes the central piece for gog eclass --- eclass/gog.eclass | 4 +- .../Manifest | 3 + ...lgogdownloader-export-credentials-1.ebuild | 36 ++++++++++++ .../metadata.xml | 8 +++ games-util/lgogdownloader/Manifest | 1 - .../0001-recycle-cookies-and-tokens.patch | 58 ------------------- .../files/export_gog_to_portage | 24 -------- .../lgogdownloader-3.7-r1.ebuild | 51 ---------------- games-util/lgogdownloader/metadata.xml | 12 ---- 9 files changed, 49 insertions(+), 148 deletions(-) create mode 100644 games-util/lgogdownloader-export-credentials/Manifest create mode 100644 games-util/lgogdownloader-export-credentials/lgogdownloader-export-credentials-1.ebuild create mode 100644 games-util/lgogdownloader-export-credentials/metadata.xml delete mode 100644 games-util/lgogdownloader/Manifest delete mode 100644 games-util/lgogdownloader/files/0001-recycle-cookies-and-tokens.patch delete mode 100644 games-util/lgogdownloader/files/export_gog_to_portage delete mode 100644 games-util/lgogdownloader/lgogdownloader-3.7-r1.ebuild delete mode 100644 games-util/lgogdownloader/metadata.xml diff --git a/eclass/gog.eclass b/eclass/gog.eclass index e4af077..166ebe2 100644 --- a/eclass/gog.eclass +++ b/eclass/gog.eclass @@ -44,14 +44,14 @@ PROPERTIES+="live" LICENSE+="GOG_EULA" BDEPEND+=" - games-util/lgogdownloader[portage] + games-util/lgogdownloader-export-credentials app-arch/innoextract " gog_sanity_check() { portageq envvar GOG_CONFIG >/dev/null 2>/dev/null if [ $? -ne 0 ]; then - die "Please define GOG_CONFIG in /etc/portage/make.conf as the output of export_gog_to_portage." + die "Please define GOG_CONFIG in /etc/portage/make.conf as the output of lgogdownloader-export-credentials." fi } diff --git a/games-util/lgogdownloader-export-credentials/Manifest b/games-util/lgogdownloader-export-credentials/Manifest new file mode 100644 index 0000000..e2b2277 --- /dev/null +++ b/games-util/lgogdownloader-export-credentials/Manifest @@ -0,0 +1,3 @@ +DIST v1.tar.gz 12802 BLAKE2B 0523782f9a802a9ffc708d7240265d603cbb24c4694ad2a0a12564a19b9652e49c3b8f6f38dfd209dc8f83ac8579b154682a1beeb9f72d731978f6143a269ee5 SHA512 a81af47124f18b30ce8eb81a31b2c743f4ead3b503b00db2ffe67f92c84c80442937c792a6c4bf9c9621d2c420f487bc9f7e96afe985257a2c6d7f2c050895a1 +EBUILD lgogdownloader-export-credentials-1.ebuild 665 BLAKE2B a4ee4e23d62ab357d1c5377bc2a80b4d9d31720607c09a93432a501859625704ca4c50d144e5d99a8ea099c46841a97aa0eb597f91325212dc3c025cc5e9f702 SHA512 91130de6f4e8c1818bde3ca3781929d997ac867f87006e78c245c9ee31674b06fa2768029bfabfb1275bcffba201acd082f4d237c59c7aac2a40ee5289d936bf +MISC metadata.xml 244 BLAKE2B 1871daef7b117a255d4458fc1b0276b0ee33170ccc477c4ee08da07df9a3ba1cd5029d1b7e8ecc124508e1f490308df3aa52355f5bdbd9cc63bfcb91e17ad52b SHA512 5f6859ff6e0140b286a554cc0b306c2e78caf97ab4e1aed6d337701f2950df08d8e7442d9fcef1bcca2a6b6b4a3e2d78ace65ec39873b7e52e286c5c79b62721 diff --git a/games-util/lgogdownloader-export-credentials/lgogdownloader-export-credentials-1.ebuild b/games-util/lgogdownloader-export-credentials/lgogdownloader-export-credentials-1.ebuild new file mode 100644 index 0000000..1d5e5bd --- /dev/null +++ b/games-util/lgogdownloader-export-credentials/lgogdownloader-export-credentials-1.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Helper script for src_prepare-overlay GOG eclass that exports credentials." +HOMEPAGE="https://github.com/grepwood/lgogdownloader-export-credentials" + +LICENSE="GPLv3" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + +SRC_URI=" + https://github.com/grepwood/${PN}/archive/refs/tags/v${PV}.tar.gz +" + +RDEPEND=" + app-arch/tar + app-arch/xz-utils + sys-apps/coreutils + sys-apps/sed + games-util/lgogdownloader + app-shells/bash +" + +DEPEND="${RDEPEND}" + +S=${WORKDIR} + +src_compile() { + cp ${S}/${PN}-${PV}/${PN} ${S} +} + +src_install() { + dobin ${PN} +} diff --git a/games-util/lgogdownloader-export-credentials/metadata.xml b/games-util/lgogdownloader-export-credentials/metadata.xml new file mode 100644 index 0000000..4e10656 --- /dev/null +++ b/games-util/lgogdownloader-export-credentials/metadata.xml @@ -0,0 +1,8 @@ + + + + + moog621@gmail.com + MichaƂ Dec + + diff --git a/games-util/lgogdownloader/Manifest b/games-util/lgogdownloader/Manifest deleted file mode 100644 index e11639e..0000000 --- a/games-util/lgogdownloader/Manifest +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 20dcc86..0000000 --- a/games-util/lgogdownloader/files/0001-recycle-cookies-and-tokens.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- lgogdownloader/src/downloader.cpp 2020-04-17 15:41:32.142346898 +0200 -+++ lgogdownloader-portage/src/downloader.cpp 2020-04-17 17:04:49.688606206 +0200 -@@ -246,6 +246,7 @@ - { - std::string email; - std::string password; -+ bool headless = false; - - if (!Globals::globalConfig.sEmail.empty() && !Globals::globalConfig.sPassword.empty()) - { -@@ -255,24 +256,32 @@ - 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")); -+ std::cout << Globals::globalConfig.curlConf.sCookiePath << std::endl; -+ std::cout << (Globals::globalConfig.sConfigDirectory + "/galaxy_tokens.json") << std::endl; -+ if(cookie_gone || tokens_gone) { -+ std::cerr << "Unable to read email and password" << std::endl; -+ return 0; -+ } else headless = true; -+ } 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()) -+ if ((email.empty() || password.empty()) && !headless) - { - std::cerr << "Email and/or password empty" << std::endl; - return 0; diff --git a/games-util/lgogdownloader/files/export_gog_to_portage b/games-util/lgogdownloader/files/export_gog_to_portage deleted file mode 100644 index e433931..0000000 --- a/games-util/lgogdownloader/files/export_gog_to_portage +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -function stringify_dir { - tar -c "$1" | xz -z9evc 2>/dev/null | base64 | tr -d '\n' | sed 's/$/\n/' -} - -pushd ~ >/dev/null - BACKUP="" - GOG_CONF_DIR=".config/lgogdownloader" - if [ -d ${GOG_CONF_DIR} ]; then - BACKUP=$(stringify_dir "${GOG_CONF_DIR}") - fi - rm -rf "${GOG_CONF_DIR}" - lgogdownloader --login - OUTPUT=$(stringify_dir "${GOG_CONF_DIR}") - rm -rf "${GOG_CONF_DIR}" - if [ "${BACKUP}" != "" ]; then - echo "${BACKUP}" | base64 -d | tar -Jxf - -C ~ - fi -popd >/dev/null - -echo "Your GOG_CONFIG:" -echo "${OUTPUT}" diff --git a/games-util/lgogdownloader/lgogdownloader-3.7-r1.ebuild b/games-util/lgogdownloader/lgogdownloader-3.7-r1.ebuild deleted file mode 100644 index 1c15b42..0000000 --- a/games-util/lgogdownloader/lgogdownloader-3.7-r1.ebuild +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake - -DESCRIPTION="Unofficial downloader for GOG content." -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] ) - portage? ( app-shells/bash:0 - sys-apps/coreutils - app-arch/xz-utils - app-arch/tar - sys-apps/sed - )" - -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 - if use portage; then - dobin "${FILESDIR}/export_gog_to_portage" - fi -} diff --git a/games-util/lgogdownloader/metadata.xml b/games-util/lgogdownloader/metadata.xml deleted file mode 100644 index 43f8c55..0000000 --- a/games-util/lgogdownloader/metadata.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Enables headless operation required for Portage integration - - - Graphical user interface - - -