commit:     b4951760ac44efbd7c7552e8bac4ce720192bdff
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Tue Jan 28 04:38:05 2025 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Tue Jan 28 22:08:48 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4951760

games-strategy/openra: fix multilib symlinks

Otherwise openra naively symlinks 32-bit libraries on a 64-bit target.

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40340
Closes: https://bugs.gentoo.org/927929
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 .../files/openra-20231010-handle-multilib.patch    |  39 ++++
 games-strategy/openra/openra-20231010-r2.ebuild    | 214 +++++++++++++++++++++
 2 files changed, 253 insertions(+)

diff --git a/games-strategy/openra/files/openra-20231010-handle-multilib.patch 
b/games-strategy/openra/files/openra-20231010-handle-multilib.patch
new file mode 100644
index 000000000000..8faaedde9243
--- /dev/null
+++ b/games-strategy/openra/files/openra-20231010-handle-multilib.patch
@@ -0,0 +1,39 @@
+https://github.com/OpenRA/OpenRA/pull/21382
+https://github.com/OpenRA/OpenRA/issues/21353
+
+From 5ec6e5d5a45855e047d251864292524a9b7a4597 Mon Sep 17 00:00:00 2001
+From: Jakub Vesely <[email protected]>
+Date: Mon, 1 Apr 2024 15:03:00 +0200
+Subject: [PATCH] configure-system-libraries.sh: Skip 32bit libraries during
+ lookup on x64 Linux. #21353
+
+--- a/configure-system-libraries.sh
++++ b/configure-system-libraries.sh
+@@ -5,7 +5,6 @@
+ # This file must stay /bin/sh and POSIX compliant for macOS and BSD 
portability.
+ # Copy-paste the entire script into http://shellcheck.net to check.
+ ####
+-
+ set -o errexit || exit $?
+ 
+ patch_config()
+@@ -37,11 +36,18 @@ patch_config()
+               if [ -L "bin/${REPLACE}" ]; then
+                       return 0
+               fi
+-
++              KERNEL="$(uname -s)"
++              ARCH="$(arch)"
+               printf "Searching for %s... " "${LABEL}"
+               for DIR in ${SEARCHDIRS} ; do
+                       for LIB in ${SEARCH}; do
+                               if [ -f "${DIR}/${LIB}" ]; then
++                                      # x86-64 Linux might have 32-bit 
libraries present, link against the 64 bit libraries since there is no 32-bit 
Linux release of dotnet
++                                      if [ "${KERNEL}" = "Linux" ] && [ 
"${ARCH}" = "x86_64" ];  then
++                                              if [ "$(LANG=C file -L -b 
"${DIR}/${LIB}" | cut -d" " -f2)" != "64-bit" ]; then
++                                                      continue
++                                              fi
++                                      fi
+                                       echo "${LIB}"
+                                       ln -s "${DIR}/${LIB}" "bin/${REPLACE}"
+                                       return 0

diff --git a/games-strategy/openra/openra-20231010-r2.ebuild 
b/games-strategy/openra/openra-20231010-r2.ebuild
new file mode 100644
index 000000000000..77c5f66e3032
--- /dev/null
+++ b/games-strategy/openra/openra-20231010-r2.ebuild
@@ -0,0 +1,214 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-1 )
+
+DOTNET_PKG_COMPAT=6.0
+NUGETS="
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
+runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl@4.3.2
+runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl@4.3.2
+runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl@4.3.2
[email protected]
[email protected]
[email protected]
[email protected]
+runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl@4.3.2
+runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl@4.3.2
+runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple@4.3.0
+runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl@4.3.2
+runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl@4.3.2
+runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl@4.3.2
+runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl@4.3.2
+runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl@4.3.2
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
+"
+
+inherit check-reqs dotnet-pkg lua-single xdg
+
+DESCRIPTION="A free RTS engine supporting games like Command & Conquer, Red 
Alert and Dune2k"
+HOMEPAGE="https://www.openra.net/
+       https://github.com/OpenRA/OpenRA/";
+
+if [[ "${PV}" == *9999* ]] ; then
+       inherit git-r3
+
+       EGIT_REPO_URI="https://github.com/OpenRA/OpenRA.git";
+else
+       SRC_URI="https://github.com/OpenRA/OpenRA/archive/release-${PV}.tar.gz
+               -> ${P}.tar.gz"
+       S="${WORKDIR}/OpenRA-release-${PV}"
+
+       KEYWORDS="~amd64"
+fi
+
+SRC_URI+=" ${NUGET_URIS} "
+
+# Engine is GPL-3, dependent DLLs are mixed.
+LICENSE="GPL-3 Apache-2.0 BSD GPL-2 MIT"
+SLOT="0"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+RDEPEND="
+       ${LUA_DEPS}
+       app-misc/ca-certificates
+       media-libs/freetype:2
+       media-libs/libsdl2[opengl,video]
+       media-libs/openal
+"
+BDEPEND="
+       ${RDEPEND}
+"
+
+CHECKREQS_DISK_BUILD="2G"
+PATCHES=(
+       "${FILESDIR}/${PN}-20231010-configure-system-libraries.patch"
+       "${FILESDIR}/${PN}-20231010-makefile.patch"
+       "${FILESDIR}/${PN}-20231010-packaging-functions.patch"
+       "${FILESDIR}/${PN}-20231010-handle-multilib.patch"
+)
+
+DOCS=( AUTHORS CODE_OF_CONDUCT.md CONTRIBUTING.md README.md )
+
+pkg_setup() {
+       check-reqs_pkg_setup
+       dotnet-pkg_pkg_setup
+       lua-single_pkg_setup
+}
+
+src_unpack() {
+       dotnet-pkg_src_unpack
+
+       if [[ -n "${EGIT_REPO_URI}" ]] ; then
+               git-r3_src_unpack
+       fi
+}
+
+src_compile() {
+       emake VERSION="release-${PV}" version
+       emake RUNTIME=net6
+}
+
+src_install() {
+       local openra_home="/usr/lib/${PN}"
+
+       # We compiled to "bin", not standard "dotnet-pkg" path.
+       mkdir -p "${ED}/usr/share" || die
+       cp -r bin "${ED}/usr/share/${P}" || die
+
+       # This is used by "linux-shortcuts" (see below make-install).
+       dotnet-pkg-base_launcherinto "${openra_home}"
+       dotnet-pkg-base_dolauncher "/usr/share/${P}/OpenRA" OpenRA
+       dotnet-pkg-base_dolauncher "/usr/share/${P}/OpenRA.Server" OpenRA.Server
+
+       emake DESTDIR="${ED}" RUNTIME=net6 prefix=/usr bindir=/usr/bin \
+                 install install-linux-shortcuts install-linux-appdata 
install-man
+
+       local -a assets=(
+               glsl
+               mods
+               AUTHORS
+               COPYING
+               VERSION
+               'global mix database.dat'
+       )
+       local asset
+       for asset in "${assets[@]}" ; do
+               dosym -r "${openra_home}/${asset}" "/usr/share/${P}/${asset}"
+       done
+
+       einstalldocs
+}

Reply via email to