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-fps/yamagi-quake2: new package #6904

Closed
wants to merge 1 commit into from

Conversation

puleglot
Copy link
Contributor

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull Request assignment

Areas affected: ebuilds
Packages affected: games-fps/yamagi-quake2

games-fps/yamagi-quake2: @gentoo/proxy-maint (new package)

Bugs linked: 314751

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

@gentoo-repo-qa-bot gentoo-repo-qa-bot added new package The PR is adding a new package. 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 Jan 18, 2018
Copy link
Member

@monsieurp monsieurp left a comment

Choose a reason for hiding this comment

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

Hi @puleglot. Thanks for the PR. Could you explain a bit what this package is about in the commit message?

@puleglot
Copy link
Contributor Author

@monsieurp I've added commit message.

@puleglot puleglot force-pushed the yamagi-quake2 branch 2 times, most recently from 57afc7f to cc574c0 Compare February 15, 2018 08:46
@soredake
Copy link
Contributor

soredake commented Mar 1, 2018

ping

-CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
- -Wall -pipe -g -fwrapv -arch i386 -arch x86_64
+CFLAGS += -fno-strict-aliasing -fomit-frame-pointer \
+ -Wall -fwrapv -arch i386 -arch x86_64
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we do multi-arch builds on Darwin. Plus, you've removed that from LDFLAGS, so I suppose you broke Darwin for good ;-). Not that it matters.

Copy link
Contributor Author

@puleglot puleglot Mar 3, 2018

Choose a reason for hiding this comment

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

Hmm.. I don't quite get your comment about LDFLAGS.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I have mistaken the if branches. Please disregard that part.

+LDFLAGS += -lm -ldl -rdynamic
else ifeq ($(YQ2_OSTYPE),FreeBSD)
-LDFLAGS := -L/usr/local/lib -lm
+LDFLAGS += -L/usr/local/lib -lm
Copy link
Member

Choose a reason for hiding this comment

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

Again, if you alter other variables, please make sure to remove stray -L flags there as well.

@@ -0,0 +1,30 @@
--- a/Makefile 2017-05-25 12:45:51.000000000 +0300
Copy link
Member

Choose a reason for hiding this comment

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

The context between the two patches looks very similar. Maybe you'd be enable to reduce them to one patch e.g. by reducing -U context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

eapply -l seems to work here


RDEPEND="sys-libs/zlib:0=
client? (
media-libs/libsdl2
Copy link
Member

Choose a reason for hiding this comment

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

Deps on SDL usually require some USE flags like [video] or [sound] for the respective subsystems.

use dedicated && targets+=" server"

local t
for t in config "${targets}"; do
Copy link
Member

Choose a reason for hiding this comment

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

This loop looks ugly-ish and is going to repeatedly make people wtf about quoting. Can't you just pass all targets to emake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"config" target just shows configuration variables. It's output is messed up when doing parallel build, eg:

make -j6 config game client ref_gl1 ref_gl3 server VERBOSE=1 DLOPEN_OPENAL=no WITH_CDA=no WITH_SYSTEMWIDE=yes WITH_SYSTEMDIR=/usr/share/games/quake2 WITH_ZIP=yes WITH_OGG=yes WITH_OPENAL=yes                                                
Build configuration                                                                                                                                                                                                                           
============================                                                                                                                                                                                                                  
WITH_CDA = no                                                                                                                                                                                                                                 
===> Building baseq2/game.so                                                                                                                                                                                                                  
mkdir -p release/baseq2                                                                                                                                                                                                                       
WITH_OPENAL = yes                                                                                                                                                                                                                             
make release/baseq2/game.so                                                                                                                                                                                                                   
WITH_SDL2 = yes                                                                                                                                                                                                                               
make[1]: Entering directory '/var/tmp/portage/games-fps/yamagi-quake2-7.10/work/quake2-7.10'                                                                                                                                                  
WITH_X11GAMMA = no                                                                                                                                                                                                                            
WITH_ZIP = yes
WITH_SYSTEMWIDE = yes
===> Building quake2
mkdir -p release
WITH_SYSTEMDIR = /usr/share/games/quake2
============================

Copy link
Member

Choose a reason for hiding this comment

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

Oh. In that case I'd suggest a helper function that wraps emake with arguments, and call it like mymake config, then mymake everything.

}

src_install() {
insinto /usr/$(get_libdir)/${PN}
Copy link
Member

Choose a reason for hiding this comment

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

Use /usr/lib, and don't use ${PN} in src_install as that impairs readability.

# Yamagi Quake II expects all binaries to be in the same directory
# See stuff/packaging.md for more info
exeinto /usr/$(get_libdir)/${PN}
doins -r release/*
Copy link
Member

Choose a reason for hiding this comment

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

Use release/. to avoid unnecessary instant-glob.


if use client; then
doexe release/quake2
dosym /usr/$(get_libdir)/${PN}/quake2 /usr/bin/yquake2
Copy link
Member

Choose a reason for hiding this comment

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

Do not ever use absolute symlinks, they're broken in some versions of Portage.


einstalldocs
if use client; then
insinto /usr/share/doc/${PF}/examples
Copy link
Member

Choose a reason for hiding this comment

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

docinto/dodoc

@puleglot puleglot force-pushed the yamagi-quake2 branch 3 times, most recently from bc15e33 to a26b3e9 Compare March 3, 2018 18:47
}

src_compile() {
local targets="game"
Copy link
Member

Choose a reason for hiding this comment

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

Could you convert this into an array? Appending with whitespace is kinda ugly.

for addon in ctf rogue xatrix; do
use ${addon} || continue
pushd "${WORKDIR}"/quake2-${addon}-* >/dev/null || die
emake VERBOSE=1
Copy link
Member

Choose a reason for hiding this comment

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

emake -C ... instead of pushd/popd.

Afterwards, you may leverage using three inline use ... && emake -C ... instead of the loop (your choice).

dosym ../lib/yamagi-quake2/quake2 /usr/bin/yquake2

newicon stuff/icon/Quake2.svg "yamagi-quake2.svg"
make_desktop_entry "yquake2" "Yamagi Quake II"
Copy link
Member

Choose a reason for hiding this comment

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

Don't you need to specify the icon somehow if it's not named after the executable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Icon is named after the package name (${PN}) by default.

use ${addon} || continue
pushd "${WORKDIR}"/quake2-${addon}-* >/dev/null || die
insinto /usr/lib/yamagi-quake2/${addon}
doins release/game.so
Copy link
Member

Choose a reason for hiding this comment

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

Put the path here instead of pushd/popd?

esac

make_wrapper "yquake2-${addon}" "yquake2 +set game ${addon}"
make_desktop_entry "yquake2-${addon}" "Yamagi Quake II: ${addon_name}"
Copy link
Member

Choose a reason for hiding this comment

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

Icon here too.


einstalldocs
if use client; then
docinto examples
Copy link
Member

Choose a reason for hiding this comment

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

Is it really an example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. This script shows how one could rip a soundtrack from the game CD to use it with this engine.

This is the Yamagi Quake II Client, an enhanced version of id Software's
Quake II with focus on offline and coop gameplay. Both the gameplay and
the graphics are unchanged, but many bugs in the last official release
were fixed and some nice to have features like widescreen support and a
modern OpenGL 3.2 renderer were added. Unlike most other Quake II source
ports Yamagi Quake II is fully 64 bit clean and is still actively
maintained.

Closes: https://bugs.gentoo.org/314751
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2018-03-04 05:13 UTC
Newest commit scanned: 0c9b68f
Status: ✅ good

Issues already there before the PR (double-check them):
https://qa-reports.gentoo.org/output/gentoo-ci/6edff93a8/output.html#app-portage/eix
https://qa-reports.gentoo.org/output/gentoo-ci/6edff93a8/output.html#net-dns/avahi

Copy link
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

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

Ok, thanks for all the work. I think it's good enough to go now, so I'm just going to test it and merge it if it works.

@mgorny mgorny self-assigned this Mar 4, 2018
@puleglot
Copy link
Contributor Author

puleglot commented Mar 4, 2018

Thank you for review! :)

@mgorny
Copy link
Member

mgorny commented Mar 4, 2018

…aaaand merged. By the way, you may look into establishing some relation to quake2-data package in Gentoo and/or adding some postinst to help people on the first install.

@mgorny
Copy link
Member

mgorny commented Mar 5, 2018

f405aa6

@mgorny mgorny closed this Mar 5, 2018
@puleglot
Copy link
Contributor Author

puleglot commented Mar 6, 2018

Yes, I'll do it later. Other quake2 engines in gentoo repo have cdinstall and demo USE flags. They control optional run-time dependencies, and IIRC it's a QA violation. So I assume a simple postinst message will suffice?

@mgorny
Copy link
Member

mgorny commented Mar 6, 2018

Weird. I thought the purpose of separate data package is to deal with the that. Yeah, postinst is fine.

@puleglot puleglot deleted the yamagi-quake2 branch March 6, 2018 20:38
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. new package The PR is adding a new package. 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