Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 899658

Summary: media-gfx/openscad-9999: add experimental USE flag
Product: Gentoo Linux Reporter: Michael Moon <triffid.hunter>
Component: Current packagesAssignee: Bernd <waebbl-gentoo>
Status: RESOLVED FIXED    
Severity: enhancement CC: proxy-maint
Priority: Normal Keywords: PATCH, PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/30334
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: openscad-9999.ebuild w/ experimental USE flag
openscad-9999.ebuild w/ experimental USE flag

Description Michael Moon 2023-03-05 08:30:03 UTC
Created attachment 856184 [details]
openscad-9999.ebuild w/ experimental USE flag

OpenSCAD has a number of useful experimental features locked behind a -DEXPERIMENTAL=ON compile-time flag.

Many Gentoo packages have an `experimental` USE flag.

This flag should be available for OpenSCAD too.

I have implemented the following patch and confirmed that it works as expected:

--- a/openscad-9999.ebuild	2022-04-23 00:24:48.843712420 +0800
+++ b/openscad-9999.ebuild	2023-03-05 16:19:12.711233567 +0800
@@ -16,7 +16,7 @@
 LICENSE="GPL-3+ LGPL-2.1"
 SLOT="0"
 KEYWORDS=""
-IUSE="cairo dbus emacs gamepad headless spacenav"
+IUSE="cairo dbus emacs gamepad headless spacenav experimental"
 RESTRICT="test" # 32 out 1300+ tests fail
 
 REQUIRED_USE="
@@ -80,6 +80,7 @@ src_configure() {
 		-DENABLE_TESTS=OFF
 		-DHEADLESS=$(usex headless)
 		-DUSE_CCACHE=OFF
+		$(usex experimental -DEXPERIMENTAL=ON "")
 	)
 
 	if use !headless; then

I have also attached my updated ebuild in full in case that's preferable.

This may not be the best way to apply this option, so I'll defer to the ebuild experts on how best to implement this of course ;)
Comment 1 Michael Moon 2023-03-05 08:40:36 UTC
I wonder if -DEXPERIMENTAL=$(usex experimental) would work?

I haven't dug into how the cmake script plugs into the actual source code, but since the source uses #ifdef I didn't try this avenue first.

I'll try it now and report back, looks like it'd fit the style better if it does work
Comment 2 Michael Moon 2023-03-05 08:55:36 UTC
Created attachment 856186 [details]
openscad-9999.ebuild w/ experimental USE flag

-DEXPERIMENTAL=$(usex experimental) works fine.

Relevant patch is now:

--- a/openscad-9999.ebuild
+++ b/openscad-9999.ebuild
@@ -16,7 +16,7 @@ EGIT_REPO_URI="https://github.com/openscad/openscad.git"
 LICENSE="GPL-3+ LGPL-2.1"
 SLOT="0"
 KEYWORDS=""
-IUSE="cairo dbus emacs gamepad headless spacenav"
+IUSE="cairo dbus emacs gamepad headless spacenav experimental"
 RESTRICT="test" # 32 out 1300+ tests fail
 
 REQUIRED_USE="
@@ -80,6 +80,7 @@ src_configure() {
 		-DENABLE_TESTS=OFF
 		-DHEADLESS=$(usex headless)
 		-DUSE_CCACHE=OFF
+		-DEXPERIMENTAL=$(usex experimental)
 	)
 
 	if use !headless; then
Comment 3 Bernd 2023-03-09 21:12:17 UTC
Thanks for your effort. Looks like a useful addition to me.
Comment 4 Larry the Git Cow gentoo-dev 2023-04-06 06:54:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a834e3baa2c0cad3d1f954866687d79b18682b28

commit a834e3baa2c0cad3d1f954866687d79b18682b28
Author:     Bernd Waibel <waebbl-gentoo@posteo.net>
AuthorDate: 2023-03-24 17:58:20 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-04-06 06:54:22 +0000

    media-gfx/openscad: allow experimental features
    
    add experimental USE flag to enable newer features
    update ebuild to reflect upstream changes
    
    Thanks to Michael Moon for pointing this out.
    
    Suggested-by: Michael Moon <triffid.hunter@gmail.com>
    Closes: https://bugs.gentoo.org/899658
    Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
    Closes: https://github.com/gentoo/gentoo/pull/30334
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 media-gfx/openscad/metadata.xml         | 16 ++++++++--
 media-gfx/openscad/openscad-9999.ebuild | 55 +++++++++++++++++----------------
 2 files changed, 43 insertions(+), 28 deletions(-)