Skip to content

Commit

Permalink
games-fps/duke3d-data: bump to EAPI=7
Browse files Browse the repository at this point in the history
This is a major overhaul of the ebuild.

Changes:
* Integration of 'games-fps/duke3d-demodata' (will be last-rited)
* Switch to 3DRealms FTP for shareware version.
* Simplify handling of lower- and uppercase files.
* Unpacking all files directly in lowercase.
* Installing shipped maps (_SE, _ST and _ZOO), as they are not present
  in the *.GRP file.
* Updated CDROM_NAME_SET to CDROM_NAMES.
* Updated CD names.

Tested with Duke Nukem 3D Retail 1.3 and Atomic 1.5 CDs, Existing
Install, GOG version and shareware version.

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Conrad Kostecki <[email protected]>
  • Loading branch information
ConiKost committed Jan 10, 2021
1 parent d32a07c commit 562a08d
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 1 deletion.
1 change: 1 addition & 0 deletions games-fps/duke3d-data/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST 3dduke13.zip 5924374 BLAKE2B 177329f04defdd2a2ab35a1926a321bbc8de023878ad6bec610669b5578cbe2f38bc0b03a37c0d0d2dcc99acf2b473ddf683b498b971b857b20964bcdbc7d7c8 SHA512 eb92daa88b4e7cfeebe1fb3d2c021e0a4a66262d0d6e76b5e27fe3cedd382e381d23b392a6d9adb42a418b9318e011c2d8adfbdc77d7c5371e61d8c091c7eb65
DIST gog_duke_nukem_3d_atomic_edition_2.0.0.9.sh 31969896 BLAKE2B 7e93515f8aedaedf6f0dc90faf5e7fef165c000414ae9dc62bad77c78568ecdec1f16b72befe1c80c7c9c8c4bd7fb11f2fd3c36f53aa9ef9d787f8b7215228f3 SHA512 d06f20bc1334172b80e4a75bd3321c3835cd95ac823836899fda8d5f8667ac83471b04a5863646aa953a39fd1cb64eb1818ee668340ede62d0a356ebdcb4065c
111 changes: 111 additions & 0 deletions games-fps/duke3d-data/duke3d-data-1.0-r5.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

CDROM_OPTIONAL="yes"
MY_PN_DEMO="3dduke"
MY_PN_GOG="gog_duke_nukem_3d_atomic_edition"
MY_PV_DEMO="13"
MY_PV_GOG="2.0.0.9"
MY_P_DEMO="${MY_PN_DEMO}${MY_PV_DEMO}"
MY_P_GOG="${MY_PN_GOG}_${MY_PV_GOG}"

inherit cdrom

DESCRIPTION="Duke Nukem 3D (Atomic Edition) data files"
HOMEPAGE="http://www.3drealms.com/"
SRC_URI="
demo? ( "ftp://ftp.3drealms.com/share/${MY_P_DEMO}.zip" )
gog? ( "${MY_P_GOG}.sh" )
"
S="${WORKDIR}"

LICENSE="DUKE3D gog? ( GOG-EULA )"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
IUSE="+demo gog"
REQUIRED_USE="^^ ( cdinstall demo gog )"
RESTRICT="bindist gog? ( fetch ) mirror"

BDEPEND="
demo? ( app-arch/unzip )
gog? ( app-arch/unzip )
"

pkg_nofetch() {
if use gog; then
einfo "Please download ${MY_P_GOG}.sh from your GOG.com account after"
einfo "buying Duke Nukem 3D and place it into your DISTDIR directory."
fi
}

src_unpack() {
if use cdinstall ; then
local CDROM_NAMES=(
"Existing installation"
"Duke Nukem 3D CD"
"Duke Nukem 3D Atomic Edition CD"
)

cdrom_get_cds duke3d.grp:dn3dinst/duke3d.grp:atominst/duke3d.grp

! [[ "${CDROM_SET}" -ge 0 && "${CDROM_SET}" -le 2 ]] && die "Could not locate data files."
fi

if use demo; then
# Use '-LL' to extract everything in lowercase.
unzip "${DISTDIR}/${MY_P_DEMO}.zip" || die
unzip -LL "DN3DSW${MY_PV_DEMO}.SHR" || die
fi

if use gog; then
# Since 'unpacker' eclass does not support options,
# doing manual unpack and checking for return code,
# as all non-fatal errors should be ignored, because
# it's a self-extracting archive and will fail otherwise.
# Also use '-LL' to extract everything in lowercase.
unzip -LL "${DISTDIR}/${MY_P_GOG}.sh"
[[ $? -le 1 ]] || die
fi
}

src_install() {
if use cdinstall; then
local DATAROOT

case ${CDROM_SET} in
0) DATAROOT="" ;;
1) DATAROOT="dn3dinst" ;;
2) DATAROOT="atominst" ;;
esac

pushd "${CDROM_ROOT}/${DATAROOT}" || die
fi

if use gog; then
pushd "${S}/data/noarch/data" || die
fi

insinto /usr/share/duke3d
for file in *.con *.dmo *.grp *.rts; do
newins "${file}" "${file,,}"
done

if ! use demo; then
if use cdinstall && [[ "${CDROM_SET}" -ne 0 ]]; then
doins ../goodies/build/*.map
else
doins *.map
fi

popd || die
fi
}

pkg_postinst() {
if use demo; then
einfo "Please keep in mind, that many addons for Duke Nukem 3D will require"
einfo "the registered version and will not work with the shareware version."
fi
}
7 changes: 6 additions & 1 deletion games-fps/duke3d-data/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Conrad Kostecki</name>
</maintainer>
<maintainer type="project">
<email>[email protected]</email>
<name>Gentoo Games Project</name>
</maintainer>
<use>
<flag name="gog">Extract the data from the GOG.com installer.</flag>
<flag name="demo">Extract data files from the shareware version.</flag>
<flag name="gog">Extract data files from the GOG.com version.</flag>
</use>
</pkgmetadata>

0 comments on commit 562a08d

Please sign in to comment.