Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-games/openscenegraph-openmw: migrate to lua-single.eclass #18229

Closed
wants to merge 1 commit into from

Conversation

DarthGandalf
Copy link
Contributor

Closes: https://bugs.gentoo.org/752576
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Alexey Sokolov alexey+gentoo@asokolov.org

diff
--- openscenegraph-openmw-3.4_p20200425.ebuild	2020-10-15 14:04:09.542713716 +0100
+++ openscenegraph-openmw-3.4_p20200425-r100.ebuild	2020-11-12 09:29:16.050988604 +0000
@@ -3,8 +3,9 @@
 
 EAPI=7
 
+LUA_COMPAT=( lua5-{1..2} )
 WX_GTK_VER="3.0-gtk3"
-inherit cmake flag-o-matic wxwidgets
+inherit cmake flag-o-matic lua-single wxwidgets
 
 DESCRIPTION="OpenMW-specific fork of OpenSceneGraph"
 HOMEPAGE="https://github.com/OpenMW/osg"
@@ -20,6 +21,7 @@ IUSE="curl debug doc examples egl ffmpeg
 	truetype vnc wxwidgets xine xrandr zlib"
 
 REQUIRED_USE="
+	lua? ( ${LUA_REQUIRED_USE} )
 	sdl2? ( sdl )
 	openexr? ( zlib )
 "
@@ -53,7 +55,7 @@ RDEPEND="
 		media-libs/gst-plugins-base:1.0
 	)
 	jpeg? ( virtual/jpeg:0 )
-	lua? ( >=dev-lang/lua-5.1.5:* )
+	lua? ( ${LUA_DEPS} )
 	openexr? (
 		media-libs/ilmbase:=
 		media-libs/openexr:=
@@ -86,6 +88,12 @@ PATCHES=(
 	"${FILESDIR}"/openscenegraph-3.6.3-docdir.patch
 )
 
+pkg_setup() {
+	if use lua; then
+		lua-single_pkg_setup
+	fi
+}
+
 src_prepare() {
 	sed -i "s/ FIND_PACKAGE/ MACRO_OPTIONAL_FIND_PACKAGE/g" CMakeLists.txt || die "can't replace FIND_PACKAGE"
 	cmake_src_prepare
@@ -146,6 +154,12 @@ src_configure() {
 			-DWITH_wxWidgets=$(usex wxwidgets)
 		)
 	fi
+	if use lua; then
+		mycmakeargs+=(
+			-DLUA_INCLUDE_DIR="$(lua_get_include_dir)"
+			-DLUA_LIBRARY="$(lua_get_shared_lib)"
+		)
+	fi
 
 	cmake_src_configure
 }

@gentoo-bot
Copy link

Pull Request assignment

Submitter: @DarthGandalf
Areas affected: ebuilds, profiles
Packages affected: dev-games/openscenegraph-openmw

dev-games/openscenegraph-openmw: @DarthGandalf, @gentoo/proxy-maint, @gentoo/games

Linked bugs

Bugs linked: 752576


In order to force reassignment and/or bug reference scan, please append [please reassign] to the pull request title.

Docs: Code of ConductCopyright policy (expl.) ● DevmanualGitHub PRsProxy-maint guide

@gentoo-bot gentoo-bot added self-maintained The PR changes only packages that are maintained by the submitter (i.e. no need to ask anybody else) assigned PR successfully assigned to the package maintainer(s). bug linked Bug/Closes found in footer, and cross-linked with the PR. labels Nov 12, 2020
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2020-11-12 10:00 UTC
Newest commit scanned: 852e82d
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/74bbb0a4ef/output.html

Closes: https://bugs.gentoo.org/752576
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2020-11-15 21:10 UTC
Newest commit scanned: 7dae7f4
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/51deb12aa3/output.html

media-libs/gst-plugins-base:1.0
)
jpeg? ( virtual/jpeg:0 )
lua? ( ${LUA_DEPS} )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lua? ( ${LUA_DEPS} )
${LUA_DEPS}

I think the correct way to use this is to just specify ${LUA_DEPS} in a *DEPEND block. Since now you can enable lua_single_target_lua5-1 lua_single_target_lua5-2 and disable lua, and maybe the other way around, and not sure what that does to the ebuild. Just depending on ${LUA_DEPS} should enable lua USE flag and enable the specifics correctly.

Let me know if it works fine in your opinion like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it will depend on dev-lang/lua:5.1 (or 5.2, depending on which LUA_SINGLE_TARGET are enabled) even if lua USE flag is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s). bug linked Bug/Closes found in footer, and cross-linked with the PR. self-maintained The PR changes only packages that are maintained by the submitter (i.e. no need to ask anybody else)
Projects
None yet
5 participants