Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 336626 - port games.eclass to EAPI=4
Summary: port games.eclass to EAPI=4
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All All
: Normal enhancement with 1 vote (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 17:04 UTC by Fabian Groffen
Modified: 2013-01-16 22:48 UTC (History)
14 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
eapi=3 and prefix patch for games.eclass (games.eclass-eapi3-prefix.patch,5.00 KB, patch)
2010-09-09 18:31 UTC, Fabian Groffen
Details | Diff
updated eapi=3 patch for games.eclass (games.eclass.patch,4.63 KB, patch)
2011-01-27 18:06 UTC, Fabian Groffen
Details | Diff
games.eclass-eapi4.patch (games.eclass-eapi4.patch,2.24 KB, patch)
2011-12-28 17:44 UTC, Michael Palimaka (kensington)
Details | Diff
games.eclass-fowners.patch (games.eclass-fowners.patch,553 bytes, patch)
2012-06-09 21:29 UTC, Julian Ospald
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2010-09-09 17:04:55 UTC
It seems that it is considered normal to drop prefix changes and keywords without notice, because games.eclass isn't EAPI=3 ready.

This bug serves the purpose of reminding me to port games.eclass to EAPI=3, and to ask the games people to approve it once it's ready.

I guess it's too late to try and list ebuilds that have gone lost this way, which is a shame in both ways.
Comment 1 Fabian Groffen gentoo-dev 2010-09-09 18:31:24 UTC
Created attachment 246621 [details, diff]
eapi=3 and prefix patch for games.eclass

@games: please review the attached patch.  It makes the games.eclass ready for Prefix and EAPI=3.
Comment 2 Fabian Groffen gentoo-dev 2010-09-30 09:34:50 UTC
@games: please give some comment
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2010-09-30 15:57:25 UTC
The parts that start with use prefix || look wrong to me.

games_set_prefix_vars seems unnecessary since it should be enough for it to be inline in games_pkg_setup
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-09-30 16:11:49 UTC
(In reply to comment #3)
> The parts that start with use prefix || look wrong to me.

We can't chown or chmod as the non-root user so if prefix is in USE then don't try to chown/chmod (and fail because the user can't do it).

> 
> games_set_prefix_vars seems unnecessary since it should be enough for it to be
> inline in games_pkg_setup
> 

Comment 5 Tristan Heaven (RETIRED) gentoo-dev 2010-09-30 16:16:26 UTC
Why change D to ED then?
Comment 6 Fabian Groffen gentoo-dev 2011-01-27 18:06:43 UTC
Created attachment 260877 [details, diff]
updated eapi=3 patch for games.eclass

games_set_prefix_vars is now an integral part of games_pkg_setup
Comment 7 SpanKY gentoo-dev 2011-03-22 17:13:53 UTC
why not change GAMES_USER and such to valid accounts in prefix profiles then ?

as for the EPREFIX stuff, instead of updating every reference, how about putting it into the base definition ?  then no call sites need to be updated.

-export GAMES_PREFIX=${GAMES_PREFIX:-/usr/games}
+export GAMES_PREFIX=${GAMES_PREFIX:-${EPREFIX}/usr/games}
Comment 8 Fabian Groffen gentoo-dev 2011-03-22 17:43:22 UTC
(In reply to comment #7)
> why not change GAMES_USER and such to valid accounts in prefix profiles then ?

You don't have control over them.  The only user you know is the user you run as.

> as for the EPREFIX stuff, instead of updating every reference, how about
> putting it into the base definition ?  then no call sites need to be updated.
> 
> -export GAMES_PREFIX=${GAMES_PREFIX:-/usr/games}
> +export GAMES_PREFIX=${GAMES_PREFIX:-${EPREFIX}/usr/games}

This is only possible when we assume the caller sets GAMES_PREFIX including $EPREFIX, and also that GAMES_PREFIX isn't used with helpers.  It seems the eclass uses it with into.  Easy to change that, both ways are possible options to me.
Comment 9 SpanKY gentoo-dev 2011-03-22 17:45:31 UTC
but you can easily do:
GAMES_USER=`whoami`

as for GAMES_PREFIX & friends, if a user changes it to a location where they dont have control, that's their problem.
Comment 10 Peter Volkov (RETIRED) gentoo-dev 2011-09-11 12:12:59 UTC
In tree games.eclass supports EAPI=3. Is there any reason to keep this bug open?
Also looks like it's time to add support for EAPI=4 :)
Comment 11 Tomáš Chvátal (RETIRED) gentoo-dev 2011-10-18 14:20:48 UTC
It would be nice to have eapi4 :)
Without any other desired changes adding 4 to known eapis is working enough.
Comment 12 Michael Palimaka (kensington) gentoo-dev 2011-12-08 16:31:29 UTC
(In reply to comment #11)
> Without any other desired changes adding 4 to known eapis is working enough.

Ditto, please bump.
Comment 13 Michael Palimaka (kensington) gentoo-dev 2011-12-28 17:44:27 UTC
Created attachment 297227 [details, diff]
games.eclass-eapi4.patch

Patch to support EAPI4 by making more things automatically die.
Comment 14 Nikos Chantziaras 2012-03-02 02:08:50 UTC
Would be nice to have EAPI 4 support.  I need to use REQUIRED_USE, but right now I'm tied down to overriding pkg_setup() and use confutils.eclass.
Comment 15 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2012-04-03 12:55:25 UTC
Any activity on this bug?
Comment 16 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2012-04-22 05:26:44 UTC
Hey, guys! Can I help with porting of eclass to EAPI4?
We're all need EAPI4-compat games.eclass
Comment 17 Julian Ospald 2012-06-02 14:11:18 UTC
(In reply to comment #16)
> Hey, guys! Can I help with porting of eclass to EAPI4?
> We're all need EAPI4-compat games.eclass

Hack existing games ebuilds locally to fool the eclass:

EAPI=4

EAPI=3 inherit games

<ebuild shit>...

and add EAPI=4 specific stuff like REQUIRED_USE etc pp and see how they behave. Report eclass-specific bugs here if you find some (or open a new one and make it block this bug).

There are some common errors you might encounter like "The source directory '${S}' doesn't exist", cause EAPI=4 does not default to "${WORKDIR}" if "${WORKDIR}/${P}" is not found.
That's ebuild-specific and expected and not worth a bug.
Comment 18 Ulrich Müller gentoo-dev 2012-06-02 15:06:38 UTC
(In reply to comment #17)
> Hack existing games ebuilds locally to fool the eclass:
> 
> EAPI=4
> 
> EAPI=3 inherit games

Please don't do this, because the resulting behaviour would be completely undefined. Ebuilds must not assign EAPI more than once.
Comment 19 Julian Ospald 2012-06-02 15:13:12 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > Hack existing games ebuilds locally to fool the eclass:
> > 
> > EAPI=4
> > 
> > EAPI=3 inherit games
> 
> Please don't do this, because the resulting behaviour would be completely
> undefined. Ebuilds must not assign EAPI more than once.

Right, the second-level inherited eclasses could cause unexpected behavior.

Seems it has been bumped already anyway:


slyfox      12/05/30 06:35:44

  Modified:             ChangeLog games.eclass
  Log:
  Allow EAPI=4.
Comment 20 Julian Ospald 2012-06-02 17:03:11 UTC
ok, I'v ported a few ebuilds

things to look for:
- ${S} does not default to ${WORKDIR} if ${WORKDIR}/${P} is not found
- remove "|| die" from helper functions (not from shell commands)
- remove prepalldocs
- check-reqs.eclass now exports pkg_pretend, so better put things like CHECKREQS_DISK_BUILD="3G" in global scope, otherwise it will say:
check-reqs_prepare: check-reqs eclass called but not actualy used!
- check for fancy checks in pkg_setup or usex lines that work around missing REQUIRED_USE
- RDEPEND="${DEPEND}" is not assigned when RDEPEND is unset
- consider using function "default" also in src_install instead of "emake ... install"
Comment 21 Azamat H. Hackimov 2012-06-09 18:42:14 UTC
Current EAPI=4 with games.eclass fails with errors 

 * ERROR: games-fps/lonesurvivor-1.11d_p1 failed (install phase):
 *   fowners failed
 * ERROR: games-fps/lonesurvivor-1.11d_p1 failed (install phase):
 *   fperms failed
Comment 22 Julian Ospald 2012-06-09 21:29:35 UTC
Created attachment 314819 [details, diff]
games.eclass-fowners.patch

(In reply to comment #21)
> Current EAPI=4 with games.eclass fails with errors 
> 
>  * ERROR: games-fps/lonesurvivor-1.11d_p1 failed (install phase):
>  *   fowners failed
>  * ERROR: games-fps/lonesurvivor-1.11d_p1 failed (install phase):
>  *   fperms failed

That is related to some unconditional fperms/fowners calls that do not check if the directories exist. Since EAPI=4 all helpers die unless you set "nonfatal" before them and because the directories do not exist we get this error.

Attached patch to eclass should fix that. Can you confirm?
Comment 23 Azamat H. Hackimov 2012-06-10 09:28:45 UTC
With this patch fperms/fowner works correctly. 

But please, double check commits to eclass.
And where in games.eclass DOCUMENTATION?
Comment 24 Julian Ospald 2012-06-10 13:49:11 UTC
(In reply to comment #23)
> With this patch fperms/fowner works correctly. 
> 
> But please, double check commits to eclass.

The switch to EAPI=4 was expected to have side effects, but it did not break ANY existing ebuild, cause all of them where still on EAPI=3 or lower.
The user is completely unaffected of this migration, only developers and ebuild writers may encounter bugs and issues. If people just bump/publish their ebuilds to EAPI=4 without testing then it's their own fault.

> And where in games.eclass DOCUMENTATION?

Please open a new documentation bug for that.