public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Nikoli" <nikoli@lavabit.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gamerlay:master commit in: games-fps/xonotic-data/
Date: Sun, 27 Mar 2011 19:38:26 +0000 (UTC)	[thread overview]
Message-ID: <a57cec6cba3099290e178516decc28b6d2f92310.nikoli@gentoo> (raw)

commit:     a57cec6cba3099290e178516decc28b6d2f92310
Author:     Nikoli <nikoli <AT> lavabit <DOT> com>
AuthorDate: Sun Mar 27 19:36:21 2011 +0000
Commit:     Nikoli <nikoli <AT> lavabit <DOT> com>
CommitDate: Sun Mar 27 19:36:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gamerlay.git;a=commit;h=a57cec6c

xonotic-data: use cached-converter.sh, do not run 7za as root

(Portage version: 2.1.9.42/git/Linux x86_64, unsigned Manifest commit)

---
 games-fps/xonotic-data/ChangeLog                |    4 ++
 games-fps/xonotic-data/metadata.xml             |    2 +
 games-fps/xonotic-data/xonotic-data-9999.ebuild |   61 ++++++++++++++++++++---
 3 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/games-fps/xonotic-data/ChangeLog b/games-fps/xonotic-data/ChangeLog
index 3702ccb..8dd9774 100644
--- a/games-fps/xonotic-data/ChangeLog
+++ b/games-fps/xonotic-data/ChangeLog
@@ -2,6 +2,10 @@
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  27 Mar 2011; Nikoli <nikoli@lavabit.com> xonotic-data-9999.ebuild,
+  metadata.xml:
+  use cached-converter.sh, do not run 7za as root
+
   02 Feb 2011; Nikoli <nikoli@lavabit.com> xonotic-data-9999.ebuild:
   move maps to xonotic-maps package
 

diff --git a/games-fps/xonotic-data/metadata.xml b/games-fps/xonotic-data/metadata.xml
index 9533e9d..1663973 100644
--- a/games-fps/xonotic-data/metadata.xml
+++ b/games-fps/xonotic-data/metadata.xml
@@ -8,6 +8,8 @@
 	</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="maps">Download and install maps.</flag>
 		<flag name="zip">Compress resources dirs in zip archives.</flag>
 	</use>

diff --git a/games-fps/xonotic-data/xonotic-data-9999.ebuild b/games-fps/xonotic-data/xonotic-data-9999.ebuild
index 3120f81..d79b77d 100644
--- a/games-fps/xonotic-data/xonotic-data-9999.ebuild
+++ b/games-fps/xonotic-data/xonotic-data-9999.ebuild
@@ -16,11 +16,15 @@ EGIT_PROJECT="${MY_PN}"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS=""
-IUSE="+client +maps +zip"
+IUSE="+client +convert low +maps +zip"
 
 RDEPEND=""
 DEPEND="
 	~games-util/fteqcc-xonotic-9999
+	convert? (
+		media-gfx/imagemagick[jpeg,png]
+		low? ( media-sound/vorbis-tools )
+	)
 	zip? ( app-arch/p7zip )
 "
 PDEPEND="maps? ( ~games-fps/xonotic-maps-9999 )"
@@ -28,6 +32,11 @@ PDEPEND="maps? ( ~games-fps/xonotic-maps-9999 )"
 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."
@@ -110,17 +119,14 @@ src_prepare() {
 
 src_compile() {
 	# Data
-	pushd data/xonotic-data.pk3dir
+	cd data
+	pushd xonotic-data.pk3dir
 	emake \
 		FTEQCC="/usr/bin/fteqcc-xonotic" \
 		FTEQCCFLAGS_WATERMARK='' \
 		|| die "emake data.pk3 failed"
 	popd
-}
 
-src_install() {
-	# Data
-	cd data
 	rm -rf \
 		$(find -name '.git*') \
 		$(find -type d -name '.svn') \
@@ -130,6 +136,42 @@ src_install() {
 		$(find -type f -name 'Makefile') \
 		|| die "rm failed"
 
+	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
+			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
+		done
+	fi
+
 	if use zip; then
 		for d in *.pk3dir; do
 			pushd "${d}"
@@ -138,9 +180,12 @@ src_install() {
 			rm -rf "${d}" || die "rm failed"
 		done
 	fi
+}
 
-	insinto "${GAMES_DATADIR}/${MY_PN}/data"
-	doins -r . || die "doins data failed"
+src_install() {
+	# Data
+	insinto "${GAMES_DATADIR}/${MY_PN}"
+	doins -r data || die "doins data failed"
 
 	prepgamesdirs
 }



             reply	other threads:[~2011-03-27 19:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-27 19:38 Nikoli [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-05 21:45 [gentoo-commits] proj/gamerlay:master commit in: games-fps/xonotic-data/ Nikoli
2011-07-06 12:43 Nikoli
2013-03-06 14:56 Azamat H. Hackimov
2013-07-19 16:43 Nikoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a57cec6cba3099290e178516decc28b6d2f92310.nikoli@gentoo \
    --to=nikoli@lavabit.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox