Update snapshot ebuilds

- Remove the d1x, d2x ebuilds.  Gentoo uses the dxx name now, so the old
  placeholder ebuilds are no longer needed.
- Update the dxx snapshot ebuild to a current commit.
- Resynchronize the dxx snapshot ebuild from the dxx live ebuild.
  - This adds support for USE=valgrind and for USE=data.
- Add a helper script to generate snapshot ebuilds for arbitrary
  commits.
This commit is contained in:
Kp 2020-04-19 20:47:07 +00:00
parent 3b1f33c0c3
commit d2e190ec3d
5 changed files with 96 additions and 35 deletions

View file

@ -1,28 +0,0 @@
# This is a meta-package to depend on games-action/dxx-rebirth-$PVR and
# require that it have the same USE flag settings as used on this
# package. See the comments in that ebuild for an explanation.
#
# This meta-package is provided primarily to ease the upgrade path, so
# that users who previously installed a non-meta-package for d1x-rebirth
# or d2x-rebirth are offered an upgrade to the combined dxx-rebirth
# package.
EAPI=6
# Upstream's game engine number (Descent 1 vs Descent 2), not a release
# version number.
MY_ENGINE="${PN:1:1}"
DESCRIPTION="Descent Rebirth - enhanced Descent $MY_ENGINE engine"
HOMEPAGE="https://www.dxx-rebirth.com/"
SRC_URI=""
LICENSE="DXX-Rebirth GPL-3"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="debug editor ipv6 +opengl timidity tracker"
MY_USE_DEP="${IUSE//+} "
DEPEND="=games-action/dxx-rebirth-$PVR[${MY_USE_DEP// /=,}d${MY_ENGINE}x]"
RDEPEND="$DEPEND"
unset MY_USE_DEP
unset MY_ENGINE

View file

@ -1 +0,0 @@
../d1x-rebirth/d1x-rebirth-0.61.0_pre20190720.ebuild

View file

@ -1,4 +1,10 @@
# Distributed under the terms of the GNU General Public License v2
# This file is part of the DXX-Rebirth project.
#
# It is copyright by its individual contributors, as recorded in the
# project's Git history. See COPYING.txt at the top level for license
# terms and a link to the Git history.
#
# After release 0.58.1 and before beta release 0.59.100, upstream
# combined the source for the Descent 1 and Descent 2 engines into a
@ -15,7 +21,7 @@ if [[ "$PV" = 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dxx-rebirth/dxx-rebirth"
else
MY_COMMIT='a17792c89fd49dd12fdf5981670dd7f64b42850f'
MY_COMMIT='3b1f33c0c34d799906905644f04b1231bcf15e3c'
S="$WORKDIR/$PN-$MY_COMMIT"
SRC_URI="https://github.com/dxx-rebirth/dxx-rebirth/archive/$MY_COMMIT.zip -> $PN-$PVR.zip"
unset MY_COMMIT
@ -40,8 +46,14 @@ SLOT="0"
KEYWORDS="amd64 x86"
# Default to building both game engines. The total size is relatively
# small.
IUSE="+d1x +d2x debug editor +flac ipv6 +joystick l10n_de +midi +mp3 +music +opengl opl3-musicpack +png sc55-musicpack sdl2 tracker +vorbis"
IUSE="+d1x +d2x +data debug editor +flac ipv6 +joystick l10n_de +midi +mp3 +music +opengl opl3-musicpack +png sc55-musicpack sdl2 tracker valgrind +vorbis"
# Game data is stored in HOG files.
# Game movies are in MVL files.
# Various add-ons use zip files to bundle their content together.
#
# PNG support enables writing screenshots as PNG instead of TGA (for
# USE=opengl) or PCX (for USE=-opengl).
DEPEND="dev-games/physfs[hog,mvl,zip]
opengl? (
virtual/opengl
@ -70,7 +82,7 @@ DXX_RDEPEND_USE_FREEDATA_FRAGMENT='
'
# Block <0.59.100 due to file collision.
#
# Require game data package.
# If USE=data, then require a game data package.
# The build process does not use the game data, nor change how the game
# is built based on what game data will be used. At startup, the game
# will search for both types of game data and use what it finds. Users
@ -83,9 +95,11 @@ DXX_RDEPEND_USE_FREEDATA_FRAGMENT='
DXX_RDEPEND_ENGINE_FRAGMENT='
d${ENGINE}x? (
!<games-action/d${ENGINE}x-rebirth-0.59.100
|| (
games-action/descent${ENGINE}-data
games-action/descent${ENGINE}-demodata
data? (
|| (
games-action/descent${ENGINE}-data
games-action/descent${ENGINE}-demodata
)
)
'"
${DXX_RDEPEND_USE_FREEDATA_FRAGMENT//\$\{USE\}/l10n_de}
@ -117,6 +131,13 @@ RDEPEND="${DEPEND}
"
unset DXX_RDEPEND_ENGINE_FRAGMENT
unset DXX_RDEPEND_USE_SDL_VERSION_FRAGMENT
# USE=valgrind enables use of a Valgrind header. A build with valgrind
# instrumentation can be run without installing Valgrind, so this
# dependency is only in DEPEND, instead of being in both DEPEND and
# RDEPEND.
DEPEND+='
valgrind? ( dev-util/valgrind )
'
# This ebuild builds d1x-rebirth, d2x-rebirth, or both. Building none
# would mean this ebuild installs zero files.
@ -196,6 +217,7 @@ dxx_scons() {
# named profile would be used.
use d1x && mysconsargs+=( d1x_sharepath="/usr/share/games/d1x" d1x="$scons_build_profile,site," )
use d2x && mysconsargs+=( d2x_sharepath="/usr/share/games/d2x" d2x="$scons_build_profile,site," )
use valgrind && mysconsargs+=( poison=valgrind )
escons "${mysconsargs[@]}" "$@"
}
@ -220,3 +242,16 @@ src_install() {
doicon "${PROGRAM}/${PROGRAM}.xpm"
done
}
pkg_postinst() {
default
if ! use data; then
elog "$PN requires game data to play."
elog "Game data is not included in this package. To play the game,"
elog "emerge the packages required by USE=data or install the game"
elog "data by hand."
elog
elog "Changing USE=data does not change how this package is built,"
elog "only its runtime dependencies."
fi
}

View file

@ -1,4 +1,10 @@
# Distributed under the terms of the GNU General Public License v2
# This file is part of the DXX-Rebirth project.
#
# It is copyright by its individual contributors, as recorded in the
# project's Git history. See COPYING.txt at the top level for license
# terms and a link to the Git history.
#
# After release 0.58.1 and before beta release 0.59.100, upstream
# combined the source for the Descent 1 and Descent 2 engines into a

49
mk-ebuild-snapshot.bash Normal file
View file

@ -0,0 +1,49 @@
#!/bin/bash
# This file is part of the DXX-Rebirth project.
#
# It is copyright by its individual contributors, as recorded in the
# project's Git history. See COPYING.txt at the top level for license
# terms and a link to the Git history.
set -eu
cd "$(dirname "$0")"
parse_version_from_SConstruct() {
local version
unset descent_version_MAJOR descent_version_MINOR descent_version_MICRO
for version in $( git show "$git_commit:SConstruct" | sed -n -e 's/^\s*VERSION_\(\w\+\)\s*=\s*\([0-9]\+\)/\1=\2/p' ); do
printf -v "descent_version_${version%=*}" '%s' "${version#*=}"
done
[[ -n "$descent_version_MAJOR" ]]
[[ -n "$descent_version_MINOR" ]]
[[ -n "$descent_version_MICRO" ]]
}
set_git_commit_information() {
declare -a git_commit_information
git_commit_information=( $(git log -1 '--pretty=%ad %H' '--date=format:%Y%m%d' "$git_commit" ) )
git_commit_date="${git_commit_information[0]}"
git_commit_hash="${git_commit_information[1]}"
}
generate_snapshot_ebuild() {
[[ -n "$git_commit_date" ]]
[[ -n "$git_commit_hash" ]]
local live_ebuild
live_ebuild=contrib/gentoo/games-action/dxx-rebirth/dxx-rebirth-9999.ebuild
git show "$git_commit:$live_ebuild" | \
sed -e "s/MY_COMMIT=''/MY_COMMIT='$git_commit_hash'/" \
> "$(dirname "$live_ebuild")/dxx-rebirth-${descent_version_MAJOR}.${descent_version_MINOR}.${descent_version_MICRO}_pre${git_commit_date}.ebuild"
}
if [[ "$#" = 0 ]]; then
git_commit=HEAD
else
git_commit="$1"
fi
parse_version_from_SConstruct
set_git_commit_information
generate_snapshot_ebuild