diff options
Diffstat (limited to 'games-fps')
-rw-r--r-- | games-fps/xonotic-data/metadata.xml | 14 | ||||
-rw-r--r-- | games-fps/xonotic-data/xonotic-data-scm.ebuild | 182 | ||||
-rw-r--r-- | games-fps/xonotic-maps/metadata.xml | 11 | ||||
-rw-r--r-- | games-fps/xonotic-maps/xonotic-maps-scm.ebuild | 161 | ||||
-rw-r--r-- | games-fps/xonotic/metadata.xml | 17 | ||||
-rw-r--r-- | games-fps/xonotic/xonotic-scm.ebuild | 137 |
6 files changed, 522 insertions, 0 deletions
diff --git a/games-fps/xonotic-data/metadata.xml b/games-fps/xonotic-data/metadata.xml new file mode 100644 index 0000000..82a6eba --- /dev/null +++ b/games-fps/xonotic-data/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>nikoli@lavabit.com</email> + <name>Nikoli</name> + </maintainer> + <use> + <flag name="client">Install files for client. Disabling is experimental.</flag> + <flag name="convert">Use cached-converter.sh for converting tga to jpeg</flag> + <flag name="low">Use low preset of cached-converter.sh: compress wav to ogg, lower jpeg quality.</flag> + <flag name="zip">Compress resources dirs in zip archives.</flag> + </use> +</pkgmetadata> diff --git a/games-fps/xonotic-data/xonotic-data-scm.ebuild b/games-fps/xonotic-data/xonotic-data-scm.ebuild new file mode 100644 index 0000000..b682d9d --- /dev/null +++ b/games-fps/xonotic-data/xonotic-data-scm.ebuild @@ -0,0 +1,182 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit games git-2 + +MY_PN="${PN%-data}" +DESCRIPTION="Xonotic data files" +HOMEPAGE="http://www.xonotic.org/" +BASE_URI="git://git.xonotic.org/${MY_PN}/${MY_PN}" +EGIT_REPO_URI="${BASE_URI}.git" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" +IUSE="+client +convert low +zip" + +RDEPEND="" +DEPEND=" + dev-lang/perl + ~games-util/gmqcc-9999 + convert? ( + media-gfx/imagemagick[jpeg,png] + low? ( media-sound/vorbis-tools ) + ) + zip? ( app-arch/p7zip ) +" +RESTRICT="test" + + +pkg_pretend() { + check-reqs_pkg_pretend +} + +pkg_setup() { + ewarn "You need at least 4 Gb diskspace for distfiles." + check-reqs_pkg_setup + games_pkg_setup + + if use convert; then + ewarn "cached-converter.sh will use \"xonotic-cached-converter\" subdirectory of your DISTDIR" + echo + fi + + if use !client; then + ewarn "You have disabled client USE flag, only files for server will be installed." + ewarn "This feature is experimental, if anything goes wrong, contact the maintainer." + echo + fi +} + +src_unpack() { + # root + git-2_src_unpack + + # Data + git_pk3_unpack() { + EGIT_REPO_URI="${BASE_URI}-${1}.pk3dir.git" \ + EGIT_SOURCEDIR="${S}/data/${MY_PN}-${1}.pk3dir" \ + git-2_src_unpack + } + git_pk3_unpack data + git_pk3_unpack maps + # needed only for client + if use client; then + git_pk3_unpack music + git_pk3_unpack nexcompat + else + rm -rf "${S}"/data/font-*.pk3dir || die + fi +} + +src_prepare() { + # Data + if use !client; then + pushd data || die + rm -rf \ + xonotic-data.pk3dir/gfx \ + xonotic-data.pk3dir/particles \ + xonotic-data.pk3dir/sound/cyberparcour01/rocket.txt \ + xonotic-data.pk3dir/textures \ + xonotic-maps.pk3dir/textures \ + || die + rm -f \ + $(find -type f -name '*.jpg') \ + $(find -type f -name '*.png' ! -name 'sky??.png') \ + $(find -type f -name '*.svg') \ + $(find -type f -name '*.tga') \ + $(find -type f -name '*.wav') \ + $(find -type f -name '*.ogg') \ + $(find -type f -name '*.mp3') \ + $(find -type f -name '*.ase') \ + $(find -type f -name '*.map') \ + $(find -type f -name '*.zym') \ + $(find -type f -name '*.obj') \ + $(find -type f -name '*.blend') \ + || die + find -type d \ + -exec rmdir '{}' &>/dev/null \; || die + sed -i \ + -e '/^qc-recursive:/s/menu.dat//' \ + xonotic-data.pk3dir/qcsrc/Makefile || die + popd || die + fi +} + +src_compile() { + # Data + cd data || die + pushd xonotic-data.pk3dir || die + emake \ + QCC="${EPREFIX}/usr/bin/gmqcc" \ + QCCFLAGS_WATERMARK='' + popd || die + + if use convert; then + # Used git.eclass,v 1.50 as example + : ${CACHE_STORE_DIR:="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/xonotic-cached-converter"} + # initial download, we have to create master maps storage directory and play + # nicely with sandbox + if [[ ! -d ${CACHE_STORE_DIR} ]] ; then + addwrite "${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}" # git.eclass was used, DISTDIR sure exists + mkdir -p "${CACHE_STORE_DIR}" \ + || die "can't mkdir ${CACHE_STORE_DIR}." + export SANDBOX_WRITE="${SANDBOX_WRITE%%:/}" + fi + # allow writing into CACHE_STORE_DIR + addwrite "${CACHE_STORE_DIR}" + + if use low; then + export jpeg_qual_rgb=80 + export jpeg_qual_a=97 + export do_ogg=true + export ogg_qual=1 + else + export jpeg_qual_rgb=97 + export jpeg_qual_a=99 + export do_ogg=false + fi + + for i in data music maps nexcompat; do + einfo "Converting ${i}" + find xonotic-${i}.pk3dir -type f -print0 | + git_src_repo="${S}"/data/xonotic-${i}.pk3dir \ + CACHEDIR="${CACHE_STORE_DIR}" \ + do_jpeg=true \ + do_dds=false \ + del_src=true \ + xargs -0 "${S}"/misc/tools/cached-converter.sh || die + done + fi + + einfo "Removing useless files" + rm -rvf \ + $(find -name '.git*') \ + $(find -type d -name '.svn') \ + $(find -type d -name 'qcsrc') \ + $(find -type f -name '*.sh') \ + $(find -type f -name '*.pl') \ + $(find -type f -name 'Makefile') \ + || die + + if use zip; then + for d in *.pk3dir; do + pushd "${d}" || die + einfo "Compressing ${d}" + 7za a -tzip "../${d%dir}" . || die + popd || die + rm -rf "${d}" || die + done + fi +} + +src_install() { + # Data + insinto "${GAMES_DATADIR}/${MY_PN}" + doins -r data + + prepgamesdirs +} diff --git a/games-fps/xonotic-maps/metadata.xml b/games-fps/xonotic-maps/metadata.xml new file mode 100644 index 0000000..0945c61 --- /dev/null +++ b/games-fps/xonotic-maps/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>nikoli@lavabit.com</email> + <name>Nikoli</name> + </maintainer> + <use> + <flag name="unofficial">Install unofficial maps. May be incomplete, unstable or broken.</flag> + </use> +</pkgmetadata> diff --git a/games-fps/xonotic-maps/xonotic-maps-scm.ebuild b/games-fps/xonotic-maps/xonotic-maps-scm.ebuild new file mode 100644 index 0000000..d7e2d31 --- /dev/null +++ b/games-fps/xonotic-maps/xonotic-maps-scm.ebuild @@ -0,0 +1,161 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit games + +MY_PN="${PN%-maps}" +DESCRIPTION="Xonotic maps" +HOMEPAGE="http://www.xonotic.org/" + +LICENSE="GPL-2" +SLOT="0" +IUSE="unofficial" + +RDEPEND="" +DEPEND=" + app-arch/unzip + net-misc/wget +" +S="${WORKDIR}" +RESTRICT="test" + + +pkg_pretend() { + check-reqs_pkg_pretend +} + +pkg_setup() { + check-reqs_pkg_setup + games_pkg_setup + + ewarn "Downloaded pk3 files will be stored in \"xonotic-maps\" subdirectory of your DISTDIR" + echo + + if use unofficial; then + ewarn "You have enabled \"unofficial\" USE flag. Incomplete, unstable or broken maps may be installed." + echo + fi +} + +src_unpack() { + # Used git.eclass,v 1.50 as example + : ${MAPS_STORE_DIR:="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/xonotic-maps"} + # initial download, we have to create master maps storage directory and play + # nicely with sandbox + if [[ ! -d ${MAPS_STORE_DIR} ]] ; then + addwrite / + mkdir -p "${MAPS_STORE_DIR}" \ + || die "can't mkdir ${MAPS_STORE_DIR}." + export SANDBOX_WRITE="${SANDBOX_WRITE%%:/}" + fi + # allow writing into MAPS_STORE_DIR + addwrite "${MAPS_STORE_DIR}" + + # FETCHCOMMAND from make.globals is example + local WGET="/usr/bin/wget -t 3 -T 60" + local base_url="http://beta.xonotic.org/autobuild-bsp/" + + einfo "Downloading lists" + $WGET -O all_maps.html \ + "${base_url}" || die + + $WGET -O official_maps.html \ + 'http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=tree;f=maps' || die + + grep -e '\.map</a>' official_maps.html |\ + sed -e 's,.*">\([^<]*\).map<\/a>.*,\1,' > official_maps.txt || die + [ -s official_maps.txt ] || die "List of official maps is empty" + cp official_maps.txt install_maps.txt || die + + if use unofficial; then + # For maps not in master branch we need to download fullpk3 + # AllMaps - OfficialMaps = UnofficialMaps + grep all_maps.html \ + -e '<td class="mapname">' |\ + sed -e 's,.*="mapname">\([^<]*\)<.*,\1,' |\ + sort -u |\ + grep -v -x -e '' \ + -f official_maps.txt |\ + sed -e 's,$,-full,' > unofficial_maps.txt + [ -s unofficial_maps.txt ] || die "List of unofficial maps is empty" + cat unofficial_maps.txt >> install_maps.txt + fi + + latest_pk3_version() { + # latest builds of maps are above + latest_version="$( + grep all_maps.html -m1 \ + -e "href=\"${name%-full}-.*.pk3\">bspk3<" |\ + sed -e "s,.*href=\"${name%-full}-\([^\"]*\).pk3\">bspk3<.*,\1," + )" + } + + validate_pk3() { + if unzip -t "${1}" > /dev/null; then + true + else + ewarn "\"${1}\" is not valid pk3 file, removing" + rm -f "${1}" || die + fi + } + + # Remove obsolete and broken files from MAPS_STORE_DIR + # If map becomes official, it changes branch and git hashes in name => no need to check both fullpk3 and bsppk3 + einfo "Cleaning \"${MAPS_STORE_DIR}\"" + for file in "${MAPS_STORE_DIR}"/*; do + local name="$( + echo "${file}" |\ + sed -e "s,${MAPS_STORE_DIR}/\([^/]*\)-[0-9a-f]\{40\}-[0-9a-f]\{40\}.pk3$,\1," + )" + local version="$( + echo "${file}" |\ + sed -e "s,${MAPS_STORE_DIR}/${name}-\([0-9a-f]\{40\}-[0-9a-f]\{40\}\).pk3$,\1," + )" + latest_pk3_version + + if [ "${version}" != "${latest_version}" ]; then + einfo "\"${file}\" is obsolete, removing" + rm -f "${file}" || die + elif [ "x${version}" = "x" ]; then + ewarn "\"${file}\" has incorrect name, removing" + rm -f "${file}" || die + elif [ "x${latest_version}" = "x" ]; then + ewarn "\"${file}\" is not available in ${base_url}, removing" + rm -f "${file}" || die + else + validate_pk3 "${file}" + fi + done + + einfo "Downloading maps" + while read name; do + latest_pk3_version + local file="${name}-${latest_version}.pk3" + local path="${MAPS_STORE_DIR}/${file}" + local url="${base_url}${file}" + + if [[ ! -f "${path}" ]]; then + rm -f "${path}" 2> /dev/null || die + einfo "Downloading ${file}" + $WGET "${url}" -O "${path}" || ewarn "downloading \"${url}\" failed" + validate_pk3 "${path}" + fi + echo "${file}" >> install_files.txt + done < install_maps.txt +} + +src_prepare() { :; } +src_configure() { :; } +src_compile() { :; } + +src_install() { + insinto "${GAMES_DATADIR}/${MY_PN}/data" + while read file; do + nonfatal doins "${MAPS_STORE_DIR}/${file}" || ewarn "installing \"${file}\" failed" + done < install_files.txt + + prepgamesdirs +} diff --git a/games-fps/xonotic/metadata.xml b/games-fps/xonotic/metadata.xml new file mode 100644 index 0000000..d1c53cf --- /dev/null +++ b/games-fps/xonotic/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>nikoli@lavabit.com</email> + <name>Nikoli</name> + </maintainer> + <use> + <flag name='experimental'>Use experimental master git branch instead of div0-stable</flag> + <flag name='maps'>Download and install maps</flag> + <flag name='ode'>Enable ODE physics engine support</flag> + <flag name='s3tc'>Install <pkg>media-libs/libtxc_dxtn</pkg> for S3TC texture (de)compression, works with mesa drivers only</flag> + <flag name='server'>Enable compilation of server</flag> + <flag name='sdl2'>Use SDL2 instead of SDL-1.2</flag> + <flag name='videocapture'>Enable video capture feature</flag> + </use> +</pkgmetadata> diff --git a/games-fps/xonotic/xonotic-scm.ebuild b/games-fps/xonotic/xonotic-scm.ebuild new file mode 100644 index 0000000..8012eb0 --- /dev/null +++ b/games-fps/xonotic/xonotic-scm.ebuild @@ -0,0 +1,137 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit eutils toolchain-funcs flag-o-matic git-2 games + +DESCRIPTION="Fork of Nexuiz, Deathmatch FPS based on DarkPlaces, an advanced Quake 1 engine" +HOMEPAGE="http://www.xonotic.org/" +BASE_URI="git://git.xonotic.org/${PN}/" +EGIT_REPO_URI="${BASE_URI}${PN}.git" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" +IUSE="cdda custom-cflags dedicated experimental +maps +ode opengl +s3tc +sdl sdl2 +server videocapture" +REQUIRED_USE=" + || ( opengl sdl server ) + dedicated? ( server !opengl !sdl ) + sdl2? ( sdl ) +" + +UIRDEPEND=" + media-libs/libogg + videocapture? ( media-libs/libtheora[encode] ) + media-libs/libvorbis + x11-libs/libX11 + virtual/opengl + media-libs/freetype:2 + ~games-fps/xonotic-data-9999[client] + s3tc? ( media-libs/libtxc_dxtn ) +" +RDEPEND=" + sys-libs/zlib + virtual/jpeg + media-libs/libpng:0= + net-misc/curl + ~dev-libs/d0_blind_id-${PV} + ~games-fps/xonotic-data-9999 + maps? ( ~games-fps/xonotic-maps-9999 ) + ode? ( dev-games/ode[double-precision] ) + opengl? ( + ${UIRDEPEND} + x11-libs/libXext + x11-libs/libXpm + x11-libs/libXxf86vm + media-libs/alsa-lib + ) + sdl? ( + ${UIRDEPEND} + !sdl2? ( media-libs/libsdl[X,joystick,opengl,sound,video] ) + sdl2? ( media-libs/libsdl2[X,opengl,video] ) + ) +" +DEPEND="${RDEPEND} + opengl? ( + x11-proto/xextproto + x11-proto/xf86vidmodeproto + x11-proto/xproto + cdda? ( virtual/os-headers ) + ) +" + +src_unpack() { + git-2_src_unpack + + if use !experimental; then + EGIT_BRANCH="div0-stable" + EGIT_COMMIT=${EGIT_BRANCH} + fi + EGIT_REPO_URI="${BASE_URI}darkplaces.git" \ + EGIT_SOURCEDIR="${S}/darkplaces" \ + git-2_src_unpack +} + +src_prepare() { + sed -e 's,Version=2.5,Version=1.0,' -i misc/logos/xonotic-*.desktop || die + + cd darkplaces || die + epatch_user + + # let upstream pick the optimization level by default + use custom-cflags || filter-flags -O? + + sed -i \ + -e "/^EXE_/s:darkplaces:${PN}:" \ + -e "/^OPTIM_RELEASE=/s:$: ${CFLAGS}:" \ + -e "/^LDFLAGS_RELEASE=/s:$: -DNO_BUILD_TIMESTAMPS ${LDFLAGS}:" \ + makefile.inc || die +} + +src_compile() { + cd darkplaces || die + emake \ + STRIP=true \ + CC="$(tc-getCC)" \ + DP_FS_BASEDIR="${GAMES_DATADIR}/${PN}" \ + DP_SOUND_API="ALSA" \ + DP_LINK_ODE="shared" \ + DP_LINK_CRYPTO="shared" \ + $(usex cdda "" "DP_CDDA=") \ + $(usex ode "" "LIB_ODE=") \ + $(usex ode "" "CFLAGS_ODE=") \ + $(usex sdl2 "SDL_CONFIG=sdl2-config" "SDL_CONFIG=sdl-config") \ + $(usex videocapture "" "DP_VIDEO_CAPTURE=") \ + $(usex opengl cl-release "") \ + $(usex sdl sdl-release "") \ + $(usex server sv-release "") +} + +src_install() { + if use opengl; then + dogamesbin darkplaces/${PN}-glx + domenu misc/logos/xonotic-glx.desktop + fi + if use sdl; then + dogamesbin darkplaces/${PN}-sdl + domenu misc/logos/xonotic-sdl.desktop + fi + if use opengl || use sdl; then + newicon misc/logos/icons_png/${PN}_512.png ${PN}.png + fi + use server && dogamesbin darkplaces/${PN}-dedicated + + dodoc Docs/*.txt + dohtml -r Docs + + insinto "${GAMES_DATADIR}/${PN}" + + # public key for d0_blind_id + doins key_0.d0pk + + use server && doins -r server + + prepgamesdirs +} |