public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Joonas Niilola" <juippis@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/pcsx2/files/, games-emulation/pcsx2/
Date: Tue, 27 Oct 2020 07:35:41 +0000 (UTC)	[thread overview]
Message-ID: <1603784130.5d316c08962efd9c4f8dd213206aaea9de686f8f.juippis@gentoo> (raw)

commit:     5d316c08962efd9c4f8dd213206aaea9de686f8f
Author:     Yuri Konotopov <ykonotopov <AT> gnome <DOT> org>
AuthorDate: Sat Oct 24 14:44:09 2020 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Tue Oct 27 07:35:30 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d316c08

games-emulation/pcsx2: fixed sandbox violation

Closes: https://bugs.gentoo.org/730536
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Yuri Konotopov <ykonotopov <AT> gnome.org>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../pcsx2/files/pcsx2-1.6.0-disable-setcap.patch   |  49 +++++++++
 games-emulation/pcsx2/pcsx2-1.6.0-r1.ebuild        | 110 +++++++++++++++++++++
 2 files changed, 159 insertions(+)

diff --git a/games-emulation/pcsx2/files/pcsx2-1.6.0-disable-setcap.patch b/games-emulation/pcsx2/files/pcsx2-1.6.0-disable-setcap.patch
new file mode 100644
index 00000000000..07040b62b91
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-1.6.0-disable-setcap.patch
@@ -0,0 +1,49 @@
+From 4366d2973316a6c250a17cf9a170f187e2ed9f93 Mon Sep 17 00:00:00 2001
+From: Yuri Konotopov <ykonotopov@gnome.org>
+Date: Sat, 17 Oct 2020 12:05:36 +0400
+Subject: [PATCH] Added cmake options to bypass setcap execution.
+
+This call became a problem with distributions (eg Gentoo GNU/Linux) that
+builds PCSX2 in sandboxed environment which disallows setcap execution.
+
+Signed-off-by: Yuri Konotopov <ykonotopov@gnome.org>
+---
+ cmake/BuildParameters.cmake |  1 +
+ pcsx2/CMakeLists.txt        | 10 ++++++----
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake
+index 235bdb8e5..a3ff0041f 100644
+--- a/cmake/BuildParameters.cmake
++++ b/cmake/BuildParameters.cmake
+@@ -46,6 +46,7 @@ option(GSDX_LEGACY "Build a GSdx legacy plugin compatible with GL3.3")
+ option(PACKAGE_MODE "Use this option to ease packaging of PCSX2 (developer/distribution option)")
+ option(DISABLE_CHEATS_ZIP "Disable including the cheats_ws.zip file")
+ option(DISABLE_PCSX2_WRAPPER "Disable including the PCSX2-linux.sh file")
++option(DISABLE_SETCAP "Do not set files capabilities")
+ option(XDG_STD "Use XDG standard path instead of the standard PCSX2 path")
+ option(EXTRA_PLUGINS "Build various 'extra' plugins")
+ option(SDL2_API "Use SDL2 on spu2x and onepad (wxWidget mustn't be built with SDL1.2 support" ON)
+diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt
+index 6839089d7..6e129caca 100644
+--- a/pcsx2/CMakeLists.txt
++++ b/pcsx2/CMakeLists.txt
+@@ -739,9 +739,11 @@ endif()
+ add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}")
+ 
+ if(dev9ghzdrk)
+-    if(PACKAGE_MODE)
+-        install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${BIN_DIR}/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${BIN_DIR}/${Output}; set +x\")")
+-    else()
+-        install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${CMAKE_SOURCE_DIR}/bin/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${CMAKE_SOURCE_DIR}/bin/${Output}; set +x\")")
++    if(NOT DISABLE_SETCAP)
++        if(PACKAGE_MODE)
++            install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${BIN_DIR}/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${BIN_DIR}/${Output}; set +x\")")
++        else()
++            install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${CMAKE_SOURCE_DIR}/bin/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${CMAKE_SOURCE_DIR}/bin/${Output}; set +x\")")
++        endif()
+     endif()
+ endif()
+-- 
+2.26.2
+

diff --git a/games-emulation/pcsx2/pcsx2-1.6.0-r1.ebuild b/games-emulation/pcsx2/pcsx2-1.6.0-r1.ebuild
new file mode 100644
index 00000000000..0333043f873
--- /dev/null
+++ b/games-emulation/pcsx2/pcsx2-1.6.0-r1.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+MY_PV="${PV/_/-}"
+
+inherit cmake fcaps flag-o-matic multilib toolchain-funcs wxwidgets
+
+DESCRIPTION="A PlayStation 2 emulator"
+HOMEPAGE="https://www.pcsx2.net"
+SRC_URI="https://github.com/PCSX2/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+
+RDEPEND="
+	app-arch/bzip2[abi_x86_32(-)]
+	app-arch/xz-utils[abi_x86_32(-)]
+	dev-libs/libaio[abi_x86_32(-)]
+	dev-libs/libxml2:2[abi_x86_32(-)]
+	media-libs/alsa-lib[abi_x86_32(-)]
+	media-libs/libpng:=[abi_x86_32(-)]
+	media-libs/libsdl2[abi_x86_32(-),haptic,joystick,sound]
+	media-libs/libsoundtouch[abi_x86_32(-)]
+	media-libs/portaudio[abi_x86_32(-)]
+	net-libs/libpcap[abi_x86_32(-)]
+	sys-libs/zlib[abi_x86_32(-)]
+	virtual/libudev[abi_x86_32(-)]
+	virtual/opengl[abi_x86_32(-)]
+	x11-libs/gtk+:3[abi_x86_32(-)]
+	x11-libs/libICE[abi_x86_32(-)]
+	x11-libs/libX11[abi_x86_32(-)]
+	x11-libs/libXext[abi_x86_32(-)]
+	>=x11-libs/wxGTK-3.0.4-r301:3.0-gtk3[abi_x86_32(-),X]
+"
+DEPEND="${RDEPEND}
+	dev-cpp/pngpp
+	dev-cpp/sparsehash
+"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+FILECAPS=(
+	"CAP_NET_RAW+eip CAP_NET_ADMIN+eip" usr/bin/PCSX2
+)
+
+PATCHES=(
+	"${FILESDIR}/${P}-disable-setcap.patch"
+)
+
+pkg_setup() {
+	if [[ ${MERGE_TYPE} != binary && $(tc-getCC) == *gcc* ]]; then
+		# -mxsave flag is needed when GCC >= 8.2 is used
+		# https://bugs.gentoo.org/685156
+		if [[ $(gcc-major-version) -gt 8 || $(gcc-major-version) == 8 && $(gcc-minor-version) -ge 2 ]]; then
+			append-flags -mxsave
+		fi
+	fi
+}
+
+src_configure() {
+	multilib_toolchain_setup x86
+	# Build with ld.gold fails
+	# https://github.com/PCSX2/pcsx2/issues/1671
+	tc-ld-disable-gold
+
+	# pcsx2 build scripts will force CMAKE_BUILD_TYPE=Devel
+	# if it something other than "Devel|Debug|Release"
+	local CMAKE_BUILD_TYPE="Release"
+
+	if use amd64; then
+		# Passing correct CMAKE_TOOLCHAIN_FILE for amd64
+		# https://github.com/PCSX2/pcsx2/pull/422
+		local MYCMAKEARGS=(-DCMAKE_TOOLCHAIN_FILE=cmake/linux-compiler-i386-multilib.cmake)
+	fi
+
+	local mycmakeargs=(
+		-DARCH_FLAG=
+		-DDISABLE_BUILD_DATE=TRUE
+		-DDISABLE_PCSX2_WRAPPER=TRUE
+		-DDISABLE_SETCAP=TRUE
+		-DEXTRA_PLUGINS=FALSE
+		-DOPTIMIZATION_FLAG=
+		-DPACKAGE_MODE=TRUE
+		-DXDG_STD=TRUE
+
+		-DCMAKE_LIBRARY_PATH="/usr/$(get_libdir)/${PN}"
+		-DDOC_DIR=/usr/share/doc/"${PF}"
+		-DEGL_API=FALSE
+		-DGTK3_API=TRUE
+		-DOPENCL_API=FALSE
+		-DPLUGIN_DIR="/usr/$(get_libdir)/${PN}"
+		# wxGTK must be built against same sdl version
+		-DSDL2_API=TRUE
+		-DUSE_VTUNE=FALSE
+	)
+
+	WX_GTK_VER="3.0-gtk3" setup-wxwidgets
+	cmake_src_configure
+}
+
+src_install() {
+	# Upstream issues:
+	#  https://github.com/PCSX2/pcsx2/issues/417
+	#  https://github.com/PCSX2/pcsx2/issues/3077
+	QA_EXECSTACK="usr/bin/PCSX2"
+	QA_TEXTRELS="usr/$(get_libdir)/pcsx2/* usr/bin/PCSX2"
+	cmake_src_install
+}


             reply	other threads:[~2020-10-27  7:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27  7:35 Joonas Niilola [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-01  9:43 [gentoo-commits] repo/gentoo:master commit in: games-emulation/pcsx2/files/, games-emulation/pcsx2/ Ionen Wolkens
2024-07-02 15:55 Ionen Wolkens
2024-07-02  5:17 Ionen Wolkens
2024-06-22  9:34 Ionen Wolkens
2024-05-23  0:53 Ionen Wolkens
2024-05-21 17:19 Ionen Wolkens
2024-04-13 17:29 Ionen Wolkens
2024-01-08 12:59 Ionen Wolkens
2023-10-10 20:20 Ionen Wolkens
2023-07-25  0:10 Ionen Wolkens
2023-07-01  9:07 Ionen Wolkens
2023-01-11 11:26 Ionen Wolkens
2022-12-29 20:29 Ionen Wolkens
2022-12-29  2:05 Ionen Wolkens
2022-12-19  5:48 Ionen Wolkens
2022-09-23  0:27 Ionen Wolkens
2022-07-31 20:38 James Le Cuirot
2018-07-23  6:17 Sergei Trofimovich
2017-01-18 10:46 David Seifert
2016-01-13 14:23 Patrice Clement

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1603784130.5d316c08962efd9c4f8dd213206aaea9de686f8f.juippis@gentoo \
    --to=juippis@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox