There is an increasing number of ebuilds using 'scons' as a buildsystem. As SCons doesn't resemble all of GNU make opts (e.g. --load-average is missing, and --jobs requires an argument), some cleaning on MAKEOPTS needs to be performed. Quick look at gx86 shows that some ebuilds perform that on their own, some other just pass MAKEOPTS uncleaned (which could lead to build failures) and some simply do not pass it at all. I think it would be a good idea to prepare a single implementation of the cleaning function and put it in an eclass. This could be the first functon for the future 'scons.eclass', or maybe another one for 'flag-o-matic.eclass' (but then we'd have to make the function more adjustable), or maybe even a co-operation of a general MAKEOPTS cleaning function in f-o-m and specific one in s.
TBH I would like to see scons gone in huge nuke blastwave, but i think some basic standards should be done. So if you are willing to do the work just do it :) (and assign it to yourself :)) Also I still preffer convincing upstream about that scons is NO-GO.
Created attachment 243995 [details] The first draft of the eclass
(In reply to comment #1) > TBH I would like to see scons gone in huge nuke blastwave, but i think some > basic standards should be done. +1 (In reply to comment #2) > Created an attachment (id=243995) [details] > The first draft of the eclass > A suggestion and a question: - a function "escons" which automatically calls scons with the right MAKEOPTS (much like emake for make) would be handy - is there a special reasons why you use "-" instead of "_" (I would prefer scons_use instead of scons-use, though I have no problems with dashes ;) ) ?
(In reply to comment #3) > - a function "escons" which automatically calls scons with the right MAKEOPTS > (much like emake for make) would be handy > - is there a special reasons why you use "-" instead of "_" (I would prefer > scons_use instead of scons-use, though I have no problems with dashes ;) ) ? Both already applied. Please take a look at the discussion at the gentoo-dev ml.
Created attachment 244603 [details] Eclass rev4 This is fourth revision of the eclass, after applying various changes suggested on gentoo-dev. Here's the ChangeLog: 3e30e1f Rename to scons-utils.eclass. 6477004 Remove exported phase functions. 41784fc Implement a cache in scons_clean_makeopts(). 9b3ce5d Clarify doc on SCONSOPTS. ac9f7ed Call scons_clean_makeopts() inline instead of exporting SCONSOPTS. ae6afd9 Fix SCONSOPTS check in escons(). 151ddf2 Support passing a flag list to scons_clean_makeopts(). 82a3ee7 Output the resulting flag list in scons_clean_makeopts() instead of assigning it. 8062ec7 Provide a blank src_configure() for EAPI 2+. 33b4406 Drop default pkg_setup() -- no longer necessary. 44188e0 escons(): set SCONSOPTS implicitly if they are unset. 0f2ea92 Fix tests to use underscores in function names. ccf1ef9 Introduce SCONSOPTS and use it instead of MAKEOPTS. 501ba41 Rename scons_use() to use_scons(), and the related vars. 681d73f Print the complete SCons command line in escons(). 194e52e Use @DEFAULT-UNSET. 42aec9f Remove incorrect @CODE use. 83678d1 Export a default pkg_setup() and src_compile(). 7f9b565 Introduce escons() function (similar to emake). 19b7e14 Use underscores instead of dashes in function names.
Line 5: "# @ECLASS: scons.eclass" should be "# @ECLASS: scons-utils.eclass".
(In reply to comment #6) > Line 5: "# @ECLASS: scons.eclass" should be "# @ECLASS: scons-utils.eclass". Thanks, fixed.
Created attachment 245766 [details] Eclass, r5 As I'm not getting any comments, I'm uploading the fifth revision, with final polishing: 795b0b4 Add an use example. d0b1344 Fix the docs to use @DEFAULT_UNSET. e739d3b Update @ECLASS line.
Can this be added to the tree soon? I'd like to use it in an ebuild for a new package.
(In reply to comment #9) > Can this be added to the tree soon? I'd like to use it in an ebuild for a new > package. I'll try to finish up describing its use nicely and commit it either today or tomorrow.
/var/cvsroot/gentoo-x86/eclass/scons-utils.eclass,v <-- scons-utils.eclass initial revision: 1.1 /var/cvsroot/gentoo-x86/eclass/tests/scons-utils.sh,v <-- tests/scons-utils.sh initial revision: 1.1