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

games-rpg/{draci-historie,drascula,dreamweb,gwiz,soltys}: EAPI8, ebuild improvements #21464

Closed
wants to merge 6 commits into from

Conversation

mm1ke
Copy link
Contributor

@mm1ke mm1ke commented Jun 28, 2021

Hi,

This PR updates some games-rpg ebuilds. Some notes:

  • some ebuilds have some big if .. then blocks to control the installation of the language. While I don't have any strong opinion about that i think it would look nicer and more compact to have it like in the ebuild drascula to install them.
  • all ebuilds were updated to EAPI=7 but i see that EAPI=8 is getting more and more used so i think updating them straight to EAPI=8 would be a good idea too? Any thoughts about this?

@ionenwks @SoapGentoo

@gentoo-bot
Copy link

Pull Request assignment

Submitter: @mm1ke
Areas affected: ebuilds
Packages affected: games-rpg/draci-historie, games-rpg/drascula, games-rpg/dreamweb, games-rpg/eschalon-book-1-demo, games-rpg/gwiz...

games-rpg/draci-historie: @gentoo/games
games-rpg/drascula: @gentoo/games
games-rpg/dreamweb: @gentoo/games
games-rpg/eschalon-book-1-demo: @gentoo/games
games-rpg/gwiz: @gentoo/games
games-rpg/soltys: @gentoo/games

Linked bugs

No bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment.

If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers.


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 assigned PR successfully assigned to the package maintainer(s). no bug found No Bug/Closes found in the commits. labels Jun 28, 2021
@ionenwks
Copy link
Contributor

ionenwks commented Jun 29, 2021

some ebuilds have some big if .. then blocks to control the installation of the language. While I don't have any strong opinion about that i think it would look nicer and more compact to have it like in the ebuild drascula to install them.

Yes, this wall of copy/paste is looking pretty worthless. But rather than drascula's, l10n.eclass notably has a l10n_for_each_locale_do which could call a custom function (it seems soon to be replaced by not-yet-in-tree plocale.eclass, but easy conversion so don't worry about that).
Edit: on side-note, single-use custom functions should typically be defined inside the phase function, still with some namespace like packagename/abbreviation_someaction()

It's okay if not, but if you're interested in trying to improve these it'd be welcome. Have a tendency to semi-rewrite most of those old game ebuilds when I touch them myself, some of them were barely improved since 2003 and their original maintainer is gone -- sometimes even broken by drive-by / games.eclass migration too.
Edit: when doing some more major refactoring, I'd suggest comparing image/filelists before and after / with and without all USEs to see if everything's normal

all ebuilds were updated to EAPI=7 but i see that EAPI=8 is getting more and more used so i think updating them straight to EAPI=8 would be a good idea too? Any thoughts about this?

Early adoption may not always be the best thing to do, but we're talking about old ~arch-only game ebuilds here that may not be touched again for a long time, I don't see a reason not to start using 8 wherever the eclasses allow it (using l10n.eclass would notably mean no eapi8 yet, but that's fine).

I notably started doing this in my last small batch of commits anyhow, not that many devs jumped into this yet (Edit: there's only a few perl ebuilds, app-doc/pms, one intel ebuild, and few games ebuild I changed that use EAPI=8 right now, first eapi8 ebuild I pushed was this because I wanted fetch+ and dosym8).


if use l10n_en || ( ! use l10n_cs && ! use l10n_de && ! use l10n_en && ! use l10n_pl ); then
make_wrapper draci-historie-en "scummvm -f -p \"${EPREFIX}/usr/share/${PN}/en\" draci" .
make_desktop_entry ${PN}-en "Dračí Historie (English)" "${EPREFIX}/usr/share/pixmaps/draci-historie.ico"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a full review but this bothers me. Nice to have thought of prefix but this whole thing was wrong to start with, not only should desktop entries not have full path to icons, but icons other than png, xpm, and svg are all invalid as far as XDG is concerned and won't be displayed in most cases.

Optimally the idea would be to convert them and add them to SRC_URI but I've personally been lazy with these and just use the generic "applications-games" icon (i.e. make_desktop_entry name Name applications-games) for now and remove bad icons. Going through all of these and eventually giving them proper icons in my devspace is a TODO I'm keeping for later (for old games anyway).

Copy link
Contributor

@ionenwks ionenwks Jun 29, 2021

Choose a reason for hiding this comment

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

Actually, if any icons are bad / missing I'll fix these on merge now (feel free to leave a applications-games placeholder) -- don't want to get too backlogged on this so started adding them to devspace now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for doing that. As you suggested i've now simply use the applications-games placeholder (only for draci-historie now, but going to update the others too) :)

Copy link
Contributor

@ionenwks ionenwks Jul 3, 2021

Choose a reason for hiding this comment

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

You can add the icon now if you want (similar to the old .ico):
https://dev.gentoo.org/~ionen/distfiles/${PN}.png (draci-historie.png)
doicon "${DISTDIR}"/${PN}.png
And update Manifest.

For make_desktop_entry, remove the applications-games placeholder and it'll use ${PN}.png by default.

In this batch, was there any other missing/wrong? I see xpm and png on others, and that sounds okay (assuming they are square, I've had a case where the icon was 32x33 and it wouldn't display 👀).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've checked all icons and the others seems to be fine except for games-rpg/eschalon-book-1-demo (which doesn't seems to have a icon). I guess using applications-games would be the right way to fix it (or getting a icon for this game) but since it doesn't even start (see comment below) i haven't touched the ebuild for now.

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2021-06-29 09:24 UTC
Newest commit scanned: 65ebcae
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/67986a4448/output.html

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2021-07-02 19:59 UTC
Newest commit scanned: d9473bc
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/73c3726696/output.html

@mm1ke
Copy link
Contributor Author

mm1ke commented Jul 2, 2021

some ebuilds have some big if .. then blocks to control the installation of the language. While I don't have any strong opinion about that i think it would look nicer and more compact to have it like in the ebuild drascula to install them.

Yes, this wall of copy/paste is looking pretty worthless. But rather than drascula's, l10n.eclass notably has a l10n_for_each_locale_do which could call a custom function (it seems soon to be replaced by not-yet-in-tree plocale.eclass, but easy conversion so don't worry about that).
Edit: on side-note, single-use custom functions should typically be defined inside the phase function, still with some namespace like packagename/abbreviation_someaction()

It's okay if not, but if you're interested in trying to improve these it'd be welcome. Have a tendency to semi-rewrite most of those old game ebuilds when I touch them myself, some of them were barely improved since 2003 and their original maintainer is gone -- sometimes even broken by drive-by / games.eclass migration too.
Edit: when doing some more major refactoring, I'd suggest comparing image/filelists before and after / with and without all USEs to see if everything's normal

I've now looked into l10n.eclass and tried to use the l10n_for_each_locale_do function. However i've decided to choose another solution (more on that later).
As far as i could see l10n.eclass works only with the LINGUAS variable, which means the user would need to set wanted languages in make.conf (don't know if it's possible per package). This would also make the usage of l10n_* USE-Flags obsolete (since they are controlled by the L10N variable) and i would need to initially download all versions of the game and decide later which version i should install (based on the LINGUAS setting - which i think is also not easily done too).

Mainly I didn't like that because for two reason's:

  • for users it's not really visible that there are even different langues available (since there are no IUSE settings) for this game.
  • unless there is as way to set LINGUAS variable per package, users are forced to install the language version of the game based on the global setting.

However, my other solution works similar like the function l10n_for_each_locale_do, but with some major advantages:

  • it works with IUSE settings
  • doesn't require l10n.eclass, thus EAPI=8
  • is almost as simple as with l10n_for_each_locale_do

In order to make it even more simple i've also added REQUIRED_USE for the languages. One language needs to be decided anyway and now users get more aware of this. One thing i'm not so sure about is if i should set a default for the language via +l10n_en (like before, were en was used too if nothing was set). Any opinions about that?
Since a default would be set anyway as long as a languages are set in the L10N variable i hesitated.

One more thing to note: I've added a for .. do loop to control the installed versions with passing IUSE there. This only works because the draci-historie ebuild has only l10n_* use flags. I hope this is fine, otherwise i would do something like this to highlight the difference:

LANGS_IUSE="l10n_cs l10n_de l10n_en l10n_pl"
IUSE="${LANGS_IUSE}"
.
.
for loc in ${LANGS_IUSE}; do
...

I've also checked the installed files with the original ebuild and afaics it's the same except for the ico file which i'm now already remove in src_prepare

I think this is a better solutions as with l10n but i'm open for other solutions, which is why i've updated only drace-historie for now.

EDIT: Nevermind, my solution is pretty much the same as in drascula :D. I've adapted it once more to save on more variable and not using IUSE variables directly, which makes my note about the for .. do loop obsolete too. ;)

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2021-07-02 21:19 UTC
Newest commit scanned: 58352aa
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/b6b7194c98/output.html

@ionenwks
Copy link
Contributor

ionenwks commented Jul 2, 2021

Haven't reviewed the changes yet, but just to reply.

As far as i could see l10n.eclass works only with the LINGUAS variable [...]

Sorry for making you waste time on checking this, as I mentioned I didn't have a close look at it myself yet.

Thought we did have an eclass for generic l10n_ handling, but looking closer every ebuild is doing their own thing -- so it makes sense too here then. And, indeed I didn't mean to use LINGUAS at all here, so there's no need to convince me.

In order to make it even more simple i've also added REQUIRED_USE for the languages. One language needs to be decided anyway and now users get more aware of this. One thing i'm not so sure about is if i should set a default for the language via +l10n_en (like before, were en was used too if nothing was set). Any opinions about that?

Using REQUIRED_USE sounds good to me, but yes, l10n_en should be default given not every users set L10N and then they won't be able to emerge the package without setting it (annoyance for them). There's no profile default for L10N (all disabled) unlike there is for PYTHON_TARGETS and the like.

@ionenwks
Copy link
Contributor

ionenwks commented Jul 2, 2021

Using REQUIRED_USE sounds good to me, but yes, l10n_en should be default given not every users set L10N and then they won't be able to emerge the package without setting it (annoyance for them). There's no profile default for L10N (all disabled) unlike there is for PYTHON_TARGETS and the like.

Although using REQUIRED_USE does have some disadvantages, making it default is nice but if users set say.. L10N="nl" it'll disable the default and now you have no language if _nl isn't provided as well, forcing them to add "en".

@mm1ke
Copy link
Contributor Author

mm1ke commented Jul 2, 2021

Haven't reviewed the changes yet, but just to reply.

As far as i could see l10n.eclass works only with the LINGUAS variable [...]

Sorry for making you waste time on checking this, as I mentioned I didn't have a close look at it myself yet.

Thought we did have an eclass for generic l10n_ handling, but looking closer every ebuild is doing their own thing -- so it makes sense too here then. And, indeed I didn't mean to use LINGUAS at all here, so there's no need to convince me.

No Problem. :)
I don't mind trying out different solutions and in this case i even got to know the l10n.eclass a bit. ;)

@mm1ke
Copy link
Contributor Author

mm1ke commented Jul 2, 2021

Using REQUIRED_USE sounds good to me, but yes, l10n_en should be default given not every users set L10N and then they won't be able to emerge the package without setting it (annoyance for them). There's no profile default for L10N (all disabled) unlike there is for PYTHON_TARGETS and the like.

Although using REQUIRED_USE does have some disadvantages, making it default is nice but if users set say.. L10N="nl" it'll disable the default and now you have no language if _nl isn't provided as well, forcing them to add "en".

Hmm, you're right. It's a pity that the default setting with +l10n_en doesn't work in this case :/
I'm sure i can work around this (i'll remove REQUIRED_USE and defaulting to en unconditionally again)

I'll update my PR tomorrow, it's already late, but thanks again for the hints.

Copy link
Contributor

@ionenwks ionenwks left a comment

Choose a reason for hiding this comment

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

Only had a quick look at draci-historie to give potential ideas, I'll check the rest after the next set of updates. Thanks for doing this 👍


LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="l10n_cs l10n_de l10n_en l10n_pl"
REQUIRED_USE="|| ( l10n_cs l10n_de l10n_en l10n_pl )"

RDEPEND=">=games-engines/scummvm-1.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not everyone may agree but I'd argue should drop those >= checks when we reach 6+ years of being gone from the tree (1.1 was added in 2010 and <1.1 was removed at same time), or at least on non-core packages.

Comment on lines 29 to 31
local loc
for loc in cs de en pl; do
if use l10n_${loc}; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Admit I do like the simplicity with REQUIRED_USE and I wouldn't have minded keeping it, but if want it to be nicer for users than it is for us (which is certainly not a bad thing).

There's many ways to go about it (like a function, or alternate styling, if anything you prefer), but for one option that keeps it simple (don't want to overdo this):

Suggested change
local loc
for loc in cs de en pl; do
if use l10n_${loc}; then
MY_L10N=( $(usev l10n_cs) $(usev l10n_de) $(usev l10n_en) $(usev l10n_pl) )
[[ ${MY_L10N} ]] || MY_L10N=( l10n_en )
local loc
for loc in "${MY_L10N[@]//l10n_/}"; do

Then you can re-use the non-local MY_L10N in src_install. Whether it's enabled is already checked so no need to run "if use" anymore. Also skips the need to repeat the locales an extra time.

Will still need to restore that ugly thing though:
!l10n_cs? ( !l10n_de? ( !l10n_en? ( !l10n_pl? ( ${BASE_URL}-en-${PV}.zip ) ) ) )

"
S="${WORKDIR}"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="l10n_cs l10n_de l10n_en l10n_pl"
Copy link
Contributor

@ionenwks ionenwks Jul 2, 2021

Choose a reason for hiding this comment

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

Maybe still set +l10n_en as default just to indicate it's used. REQUIRED_USE below can of course be dropped if changing method.

Comment on lines 39 to 42
src_prepare() {
default
rm -f *.{bat,exe,ins} readme.* || die
rm -f *.{bat,exe,ins,ico} readme.* || die
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, I was going to mention removing the -f, but I don't see the use for this src_prepare. Only the ${loc}/ directories are installed, and cleaning those seem pointless.

Comment on lines 46 to 49
local lingua
for lingua in $(find * -type d); do
doins -r ${lingua}
done
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we have our own loop, just remove this block and add a doins -r ${loc} in the new one.

make_desktop_entry ${PN}-${loc} "Dračí Historie (${loc})" applications-games
fi
done

einstalldocs
Copy link
Contributor

Choose a reason for hiding this comment

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

This einstalldocs isn't installing anything, you can drop it.

The readme.txt in the .zip doesn't seem to really apply to using this with our packaging and is kinda messy (src_prepare was deleting it), I don't think it's worth trying to preserve it.

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2021-07-04 08:54 UTC
Newest commit scanned: b8c97e9
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/8b6baf7636/output.html

@mm1ke
Copy link
Contributor Author

mm1ke commented Jul 4, 2021

@ionenwks
Some more updates. I've included all your suggestions and used your MY_L10N usage (thx btw for the example).
Additional notes:

  • for dreamweb i had to adapt the languages names (en -> us, en_GB -> uk) so that they work with the filenames. Other solutions would probably to be renaming the .zip files.
  • I've also fixed drascula. The dat file was too old (used newer dat file) and music were missing (scummvm[vorbis]). However since i'm using different files now i guess a revision bump would be required.
  • The same would apply for draci-historie i guess? Since we are installing a new icon file i think we should make a revision bump?

@mm1ke mm1ke changed the title games-rpg/{draci-historie,drascula,dreamweb,eschalon-book-1-demo,gwiz,soltys}: EAPI7, ebuild improvements games-rpg/{draci-historie,drascula,dreamweb,eschalon-book-1-demo,gwiz,soltys}: EAPI8, ebuild improvements Jul 4, 2021
@mm1ke mm1ke force-pushed the game-tCfIc8tI branch 2 times, most recently from 3fd3f4f to c23789a Compare July 4, 2021 11:07
@mm1ke
Copy link
Contributor Author

mm1ke commented Jul 4, 2021

One more note. games-rpg/eschalon-book-1-demo segfaults when trying to start. I've tried a few things to see if i could fix it but without luck. Since i don't have a 32bit environment i don't know if its a multilib issue either. My plan now is to remove it from the PR. Maybe it's simply too old and doesn't work with newer packages (treeclean candidate?)

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2021-07-04 11:14 UTC
Newest commit scanned: 3fd3f4f
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/1cf138789a/output.html

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2021-07-04 11:24 UTC
Newest commit scanned: c23789a
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/7e63e9ba26/output.html

@ionenwks
Copy link
Contributor

ionenwks commented Jul 4, 2021

I've also fixed drascula. The dat file was too old (used newer dat file) and music were missing (scummvm[vorbis]). However since i'm using different files now i guess a revision bump would be required.

yep, adding [vorbis] also warrant a revbump on its own, dynamic deps are unreliable and a revbump will ensure the requirement is known on users' systems

The same would apply for draci-historie i guess? Since we are installing a new icon file i think we should make a revision bump?

More of a grey area here, I don't typically consider a .desktop icon relevant enough for a revbump, opinions may differ.

One more note. games-rpg/eschalon-book-1-demo segfaults when trying to start. I've tried a few things to see if i could fix it but without luck. Since i don't have a 32bit environment i don't know if its a multilib issue either. My plan now is to remove it from the PR. Maybe it's simply too old and doesn't work with newer packages (treeclean candidate?)

https://www.gog.com/forum/eschalon_series/linux_crash_on_startup/post5

Someone attempted a fix but it needs updating and is very fragile, and alternative is no good. Sounds like it'd be easy for upstream to fix but doesn't look like they've really done anything in years. If someone really want to play this I'd suggest they use Wine at this point.

I'll make a note of it and throw it in a last-rite batch later. Don't waste more time with it.

@mm1ke mm1ke changed the title games-rpg/{draci-historie,drascula,dreamweb,eschalon-book-1-demo,gwiz,soltys}: EAPI8, ebuild improvements games-rpg/{draci-historie,drascula,dreamweb,gwiz,soltys}: EAPI8, ebuild improvements Jul 4, 2021
@mm1ke
Copy link
Contributor Author

mm1ke commented Jul 4, 2021

I've also fixed drascula. The dat file was too old (used newer dat file) and music were missing (scummvm[vorbis]). However since i'm using different files now i guess a revision bump would be required.

yep, adding [vorbis] also warrant a revbump on its own, dynamic deps are unreliable and a revbump will ensure the requirement is known on users' systems

Done, I've split the commit to reflect this (revbump + removal). Keeping the old is probably not required, especially since it has no stable keywords.

The same would apply for draci-historie i guess? Since we are installing a new icon file i think we should make a revision bump?

More of a grey area here, I don't typically consider a .desktop icon relevant enough for a revbump, opinions may differ.

Ok, i'll keep it then :)

One more note. games-rpg/eschalon-book-1-demo segfaults when trying to start. I've tried a few things to see if i could fix it but without luck. Since i don't have a 32bit environment i don't know if its a multilib issue either. My plan now is to remove it from the PR. Maybe it's simply too old and doesn't work with newer packages (treeclean candidate?)

https://www.gog.com/forum/eschalon_series/linux_crash_on_startup/post5

Someone attempted a fix but it needs updating and is very fragile, and alternative is no good. Sounds like it'd be easy for upstream to fix but doesn't look like they've really done anything in years. If someone really want to play this I'd suggest they use Wine at this point.

I'll make a note of it and throw it in a last-rite batch later. Don't waste more time with it.

Agreed and removed from the PR

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2021-07-04 13:59 UTC
Newest commit scanned: e631fa5
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/96077bea8b/output.html

Copy link
Contributor

@ionenwks ionenwks left a comment

Choose a reason for hiding this comment

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

More full review this time, new ebuilds sure look a lot nicer.

Drascula's commit message could use a small note explaining why it's being revbumped (vorbis/data).

Comment on lines 12 to 16
https://dev.gentoo.org/~ionen/distfiles/${PN}.png
l10n_cs? ( ${BASE_URL}-cz-${PV}.zip )
l10n_de? ( ${BASE_URL}-de-${PV}.zip )
l10n_en? ( ${BASE_URL}-en-${PV}.zip )
l10n_pl? ( ${BASE_URL}-pl-${PV}.zip )
!l10n_cs? ( !l10n_de? ( !l10n_en? ( !l10n_pl? ( ${BASE_URL}-en-${PV}.zip ) ) ) )
Copy link
Contributor

Choose a reason for hiding this comment

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

It's just my own rule for sorting SRC_URI (which differs from DEPEND), but I prefer the main package to be listed first and support files (aka the icon) after, and these l10n_* happen to be the main package. I typically always put the icon dead bottom.

Comment on lines 42 to 43
insinto /usr/share/${PN}
for lingua in $(find * -type d); do
doins -r ${lingua}
doicon "${DISTDIR}"/${PN}.png
Copy link
Contributor

Choose a reason for hiding this comment

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

Having a doicon after a insinto feels a bit awkward, maybe move the doicon below the loop to keep the relation with the doins.

src_prepare() {
default
rm -f *.{bat,exe,ins} readme.* || die
MY_L10N=( $(usev l10n_cs) $(usev l10n_de) $(usev l10n_en) $(usev l10n_pl) )
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noticed the l10n_cs .zip is named -cz-

Suggested change
MY_L10N=( $(usev l10n_cs) $(usev l10n_de) $(usev l10n_en) $(usev l10n_pl) )
MY_L10N=( $(usev l10n_{cs,cz}) $(usev l10n_de) $(usev l10n_en) $(usev l10n_pl) )

Note that usev 2nd argument is a new EAPI-8 feature, in EAPI-7 we'd have to use:
$(usex l10n_{cs,cz} '')


S="${WORKDIR}"
RDEPEND="games-engines/scummvm[vorbis]"
DEPEND="${RDEPEND}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop DEPEND line, like the others scummvm is only needed at runtime.

make_wrapper ${PN} "scummvm -f -p \"/usr/share/${PN}\" drascula" .
doicon "${DISTDIR}"/${PN}.png
make_wrapper ${PN} "scummvm -f -p \"${EPREFIX}/usr/share/${PN}\" drascula" .
make_desktop_entry ${PN} "Drascula: The Vampire Strikes Back" ${PN}
Copy link
Contributor

Choose a reason for hiding this comment

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

desktop eclass adds DESCRIPTION to the desktop entry automatically, so usually this is kept shorter

Suggested change
make_desktop_entry ${PN} "Drascula: The Vampire Strikes Back" ${PN}
make_desktop_entry ${PN} Drascula

}

src_prepare() {
default
rm -rf license.txt soltys-es-v1-0
rm license.txt || die
}

src_install() {
insinto /usr/share/${PN}
doins -r *
Copy link
Contributor

Choose a reason for hiding this comment

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

Bit like the find, this doins -r * feels a bit too much.

So like the other ebuilds, add doins -r ${lang} in the loop, and move newicon after the loop.

Comment on lines 37 to 40
src_prepare() {
default
rm -rf license.txt soltys-es-v1-0
rm license.txt || die
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If no longer use doins -r *, this src_prepare also becomes useless like the others.

for lang in "${MY_L10N[@]//l10n_/}"; do
mkdir -p ${lang} || die
unpack ${PN}-${lang}-v${PV}.zip
mv vol.{cat,dat} ${lang}/ || die
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, the l10n_es zip comes ruin it by extracting in a subdir unlike the others:

>>> Unpacking soltys-es-v1.0.zip to /var/tmp/portage/games-rpg/soltys-1.0-r2/work
mv: cannot stat 'vol.cat': No such file or directory
mv: cannot stat 'vol.dat': No such file or directory

I don't really like doing it like this but well, I feel like splitting it again would be messier with the enable-english logic:

Suggested change
mv vol.{cat,dat} ${lang}/ || die
if [[ ${lang} == es ]]; then
mv ${PN}-${lang}-v$(ver_rs 1 -)/vol.{cat,dat} ${lang}/ || die
else
mv vol.{cat,dat} ${lang}/ || die
fi


local lang
for lang in "${MY_L10N[@]//l10n_/}"; do
mkdir -p "${S}"/${lang} || die
Copy link
Contributor

@ionenwks ionenwks Jul 4, 2021

Choose a reason for hiding this comment

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

Drop the -p everywhere (including other ebuilds), it would be strange if "${S}" didn't already exist and creating leading directories was somehow needed.

Comment on lines 49 to 50
make_wrapper ${PN}-${lang} "scummvm -f -p \"${EPREFIX}/usr/share/${PN}/${lang}\" ${PN}" .
make_desktop_entry ${PN}-${lang} "Soltys (${lang})" ${PN}
Copy link
Contributor

Choose a reason for hiding this comment

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

The third argument on either of those isn't needed for any of these ebuilds.

  • . makes the wrapper change directory.. to the current dir, unspecifying does nothing which is current dir
  • ${PN} is the default for icon if unspecified

mm1ke added 6 commits July 5, 2021 21:34
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at>
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at>
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at>
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at>
games-rpg/drascula was revbumped because of a missing dep on
games-engines/scummvm[vorbis] and also because it requires a newer dat
file to play.

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at>
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at>
@mm1ke
Copy link
Contributor Author

mm1ke commented Jul 5, 2021

@ionenwks
Thanks again for the detailed review.
I've addressed all you comments and i hope i've fixed all. I've removed a few more case were the third argument shouldn't be needed for make_wrapper and make_desktop_entry.
Also thanks for the hints (usev) and suggestions. I've also compiled tested all ebuilds with all languages enabled.

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2021-07-05 19:49 UTC
Newest commit scanned: 21e3b03
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/b93943cf4c/output.html

@gentoo-bot gentoo-bot closed this in 774cc71 Jul 5, 2021
@ionenwks
Copy link
Contributor

ionenwks commented Jul 5, 2021

Merged as-is, thanks :)

Much better than the old ebuilds.

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). no bug found No Bug/Closes found in the commits.
Projects
None yet
4 participants