Update Gentoo ebuilds

- Add descentX-freedata-1.ebuild to manage the freely downloadable
  music, German briefings, and (for Descent 1 only) higher resolution
  textures.  These can be added/removed without rebuilding the game, so
  they get a separate ebuild.  This prevents reinstalling these
  resources on game upgrades, and permits using these resources with
  live ebuilds.
- Fix $LICENSE to reflect Rebirth 2014 license change.
- Add USE=+joystick.  When unset, SDL joystick support is unnecessary
  and Rebirth is built without joystick support.  This reduces
  code size, which may be important on constrained targets.  When
  USE=joystick is set, SDL joystick support is now required.
- Add blockers for co-installation with <d1x-rebirth-0.59.100,
  <d2x-rebirth-0.59.100, as these install files of the same name and
  would otherwise collide with this package.  Compiling while the older
  version is installed is safe, so this is only an RDEPEND blocker.
- Add USE flags for the various descentX-freedata features, and depend
  on a descentX-freedata with those flags enabled.  When all such flags
  are clear, there is no dependency, since descentX-freedata with USE=-*
  installs no files.
- Add commented out IUSE_RUNTIME to record which USE flags are
  runtime-only.  When Portage implements IUSE_RUNTIME, this definition
  should be uncommented.
- Mirror xdg integration from main Gentoo Portage ebuild for Rebirth.
  Also match layout with that ebuild where possible, to simplify sharing
  changes.  Notable differences remaining:
  - Gentoo Portage ebuild handles freedata assets inline.
  - Gentoo Portage ebuild disallows enabling both music pack USE flags,
    even though the files install to separate names.  Rebirth freedata
    ebuild permits both to be enabled.
  - Gentoo Portage ebuild hard-enables joystick support and
    hard-requires SDL joystick support.  Rebirth ebuild makes it
    optional via USE=joystick.
  - Gentoo Portage ebuild is less strict about SDL_mixer features.
  - Gentoo Portage ebuild has USE=+data to control whether game data is
    a required dependency.  Rebirth ebuild hard-depends on game data
    (but still provides a choice of demo data or retail data).
  - Gentoo Portage ebuild hard-blocks _all_ d1x-rebirth, d2x-rebirth
    package versions.  Rebirth ebuild hard-blocks only such packages
    that would cause a file collision, so that the transition
    meta-packages can be installed.
  - Gentoo Portage ebuild carries two useless patches.
    - $P-flags.patch removes default CXXFLAGS flags, even though
      SConstruct adds them to the left of the user's CXXFLAGS, so that
      user CXXFLAGS override default flags.
    - $P-sharepath.patch changes the sharepath by patching SConstruct.
      Rebirth ebuild changes the sharepath by passing an appropriate
      `sharepath=` argument to the `scons` call.
  - Gentoo Portage ebuild lacks USE=editor and associated build of Descent
    editor mode.
  - Gentoo Portage ebuild does not export PKG_CONFIG.
This commit is contained in:
Kp 2017-11-25 01:56:51 +00:00
parent d42fff397b
commit e53e969d92
4 changed files with 167 additions and 26 deletions

View file

@ -16,7 +16,7 @@ DESCRIPTION="Descent Rebirth - enhanced Descent $MY_ENGINE engine"
HOMEPAGE="http://www.dxx-rebirth.com/"
SRC_URI=""
LICENSE="D1X GPL-3"
LICENSE="DXX-Rebirth GPL-3"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="debug editor ipv6 +opengl timidity tracker"

View file

@ -0,0 +1,48 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=6
DXX_ENGINE="${PN:7:1}"
DESCRIPTION="Free content for games-action/d${DXX_ENGINE}x-rebirth"
HOMEPAGE="http://www.dxx-rebirth.com/"
IUSE="l10n_de opl3-musicpack sc55-musicpack"
SRC_URI="
l10n_de? ( http://www.dxx-rebirth.com/download/dxx/res/d${DXX_ENGINE}xr-briefings-ger.dxa )
opl3-musicpack? ( http://www.dxx-rebirth.com/download/dxx/res/d${DXX_ENGINE}xr-opl3-music.dxa )
sc55-musicpack? ( http://www.dxx-rebirth.com/download/dxx/res/d${DXX_ENGINE}xr-sc55-music.dxa )
"
if [[ "${PN}" = descent1-freedata ]]; then
IUSE+=" +textures"
SRC_URI+="
textures? ( http://www.dxx-rebirth.com/download/dxx/res/d1xr-hires.dxa )
"
fi
LICENSE="public-domain"
SLOT="0"
KEYWORDS="~amd64 ~x86"
# If all USE flags are unset, this ebuild installs zero files. Require
# at least one to be set.
REQUIRED_USE="|| ( ${IUSE//+/} )"
DEPEND=""
RDEPEND=""
unset DXX_ENGINE
src_install() {
local DXX_ENGINE="${PN:7:1}"
insinto /usr/share/games/d${DXX_ENGINE}x
use opl3-musicpack && doins "${DISTDIR}"/d${DXX_ENGINE}xr-opl3-music.dxa
use sc55-musicpack && doins "${DISTDIR}"/d${DXX_ENGINE}xr-sc55-music.dxa
use l10n_de && doins "${DISTDIR}"/d${DXX_ENGINE}xr-briefings-ger.dxa
# This ebuild is used for both Descent 1 free data and Descent 2
# free data. Only Descent 1 provides alternate textures.
if [[ "${PN}" = descent1-freedata ]] && use textures; then
insinto /usr/share/games/d1x
doins "${DISTDIR}"/d1xr-hires.dxa
fi
}

View file

@ -0,0 +1 @@
../descent1-freedata/descent1-freedata-1.ebuild

View file

@ -1,3 +1,5 @@
# Distributed under the terms of the GNU General Public License v2
#
# 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
# single tree. The combined tree builds common code into a static
@ -8,7 +10,7 @@
EAPI=6
inherit eutils scons-utils toolchain-funcs
inherit eutils scons-utils toolchain-funcs xdg
if [[ "$PV" = 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dxx-rebirth/dxx-rebirth"
@ -20,10 +22,10 @@ else
RESTRICT='mirror'
fi
DESCRIPTION="Descent Rebirth - enhanced Descent engines"
DESCRIPTION="Descent Rebirth - enhanced Descent 1 & 2 engine"
HOMEPAGE="http://www.dxx-rebirth.com/"
LICENSE="D1X GPL-3"
LICENSE="DXX-Rebirth GPL-3"
SLOT="0"
# Other architectures are reported to work, but not tested regularly by
# the core team.
@ -35,50 +37,122 @@ SLOT="0"
KEYWORDS="amd64 x86"
# Default to building both game engines. The total size is relatively
# small.
IUSE="+d1x +d2x debug editor ipv6 +opengl timidity tracker"
IUSE="+d1x +d2x debug editor +flac ipv6 +joystick l10n_de +midi +mp3 +music +opengl opl3-musicpack sc55-musicpack tracker +vorbis"
DEPEND="opengl? ( virtual/opengl virtual/glu )
dev-games/physfs[hog,mvl,zip]
media-libs/libsdl[sound,opengl?,video]
media-libs/sdl-mixer[timidity?]"
DEPEND="dev-games/physfs[hog,mvl,zip]
media-libs/libsdl[joystick?,opengl?,sound,video]
music? ( media-libs/sdl-mixer )
opengl? (
virtual/opengl
virtual/glu )"
# As of this writing, there is no Portage shorthand syntax to express:
# "
# flag1? ( package[flag1] )
# flag2? ( package[flag2] )
# ...
# flagN? ( package[flagN] )
# ", such that unsetting all flags removes the dependency on package.
# Fake it by using a text fragment that is repeatedly expanded with
# differing substitutions.
#
# The use of single quotes is intentional here. The ${word} is a
# placeholder to be matched by text substitution when the fragment is
# expanded, not a shell variable reference.
#
# For each flag, depend on freedata using the same flag. If none of the
# flags are set, freedata is not needed.
DXX_RDEPEND_USE_FREEDATA_FRAGMENT='
${USE}? ( games-action/descent${ENGINE}-freedata[${USE}] )
'
# Block <0.59.100 due to file collision.
#
# Require 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
# can switch between shareware/retail data at any time by
# adding/removing the appropriate data packages. A rebuild is _not_
# required after swapping the data files.
#
# USE-depend on freedata for various extras, but only if any of those
# extras are enabled.
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
)
'"
${DXX_RDEPEND_USE_FREEDATA_FRAGMENT//\$\{USE\}/l10n_de}
${DXX_RDEPEND_USE_FREEDATA_FRAGMENT//\$\{USE\}/opl3-musicpack}
${DXX_RDEPEND_USE_FREEDATA_FRAGMENT//\$\{USE\}/sc55-musicpack}
"'
)
'
unset DXX_RDEPEND_USE_FREEDATA_FRAGMENT
RDEPEND="${DEPEND}
d1x? (
|| (
games-action/descent1-data
games-action/descent1-demodata
)
)
d2x? (
|| (
games-action/descent2-data
games-action/descent2-demodata
)
)
music? ( media-libs/sdl-mixer[flac?,midi?,mp3?,vorbis?] )
${DXX_RDEPEND_ENGINE_FRAGMENT//\$\{ENGINE\}/1}
${DXX_RDEPEND_ENGINE_FRAGMENT//\$\{ENGINE\}/2}
"
unset DXX_RDEPEND_ENGINE_FRAGMENT
# This ebuild builds d1x-rebirth, d2x-rebirth, or both. Building none
# would mean this ebuild installs zero files.
REQUIRED_USE="|| ( d1x d2x )"
#
# For each of the supported music flags, require USE=music, so that the
# package is built with sdl-mixer support. Individual music types can be
# changed without a Rebirth rebuild by rebuilding sdl-mixer with
# appropriate support, but Rebirth must have sdl-mixer support at build
# time in order to support any of these music formats at runtime.
#
# All music files in the optional musicpack downloads are .ogg, so
# require USE=vorbis if those packs are enabled.
REQUIRED_USE='
|| ( d1x d2x )
flac? ( music )
midi? ( music )
mp3? ( music )
vorbis? ( music )
opl3-musicpack? ( vorbis )
sc55-musicpack? ( vorbis )
'
# As of this writing, IUSE_RUNTIME is a GLEP, but not an implemented
# feature. This variable is stored here to be ready to activate when
# Portage implements this feature.
#
# Note that while individual music formats can be switched without a
# rebuild, the master flag USE=music controls whether sdl-mixer is used,
# and therefore requires a rebuild when changed.
#IUSE_RUNTIME="flac l10n_de midi mp3 opl3-musicpack sc55-musicpack vorbis"
dxx_scons() {
# Always build profile `m`. If use editor, also build profile `e`.
# Set most variables in the default anonymous profile. Only
# `builddir` and `editor` are set in the named profiles, since those
# must be different between the two builds.
#
# Notes for end users:
# - Per-engine options can be set with an engine prefix, as shown
# for sharepath. Such options are used in place of
# engine-unqualified options. For example, to disable sdlmixer
# for Descent 2: Rebirth, but use the setting below for Descent 1:
# Rebirth, set EXTRA_ESCONS="d2x_sdlmixer=0".
# - Profile `site` is searched before the anonymous profile, and is
# deliberately unused in this ebuild. Set options in the site
# profile to affect both engines:
# EXTRA_ESCONS="site_verbosebuild=0".
local scons_build_profile=m mysconsargs=(
sdlmixer=1
sdlmixer=$(usex music 1 0)
verbosebuild=1
debug=$(usex debug 1 0)
ipv6=$(usex ipv6 1 0)
opengl=$(usex opengl 1 0)
use_tracker=$(usex tracker 1 0)
prefix=/usr
prefix="${EPREFIX}"/usr
m_builddir=build/main/
m_editor=0
)
@ -89,12 +163,17 @@ dxx_scons() {
e_editor=1
)
fi
if ! use joystick; then
mysconsargs+=(
max_joysticks=0
)
fi
# Add sharepath and enable build of selected games. The trailing
# comma after `$scons_build_profile` is required to cause scons to
# search the anonymous profile. If omitted, only settings from the
# named profile would be used.
use d1x && mysconsargs+=( d1x_sharepath="/usr/share/games/d1x" d1x="$scons_build_profile," )
use d2x && mysconsargs+=( d2x_sharepath="/usr/share/games/d2x" d2x="$scons_build_profile," )
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," )
escons "${mysconsargs[@]}" "$@"
}
@ -104,5 +183,18 @@ src_compile() {
}
src_install() {
# Use upstream install target to handle the various combinations of
# enabled/disabled engines and optional editor support.
dxx_scons register_compile_target=0 register_install_target=1 DESTDIR="$D" "$D"
local DV
for DV in 1 2; do
if ! use d${DV}x; then
continue
fi
local PROGRAM=d${DV}x-rebirth
docinto "${PROGRAM}"
dodoc "${PROGRAM}"/*.txt
make_desktop_entry "${PROGRAM}" "Descent ${DV} Rebirth" "${PROGRAM}"
doicon "${PROGRAM}/${PROGRAM}.xpm"
done
}