summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /games-rpg/nwn
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'games-rpg/nwn')
-rw-r--r--games-rpg/nwn/Manifest19
-rwxr-xr-xgames-rpg/nwn/files/fixinstall107
-rw-r--r--games-rpg/nwn/metadata.xml13
-rw-r--r--games-rpg/nwn/nwn-1.68-r5.ebuild249
-rw-r--r--games-rpg/nwn/nwn-1.68-r6.ebuild236
-rw-r--r--games-rpg/nwn/nwn-1.69-r1.ebuild95
6 files changed, 719 insertions, 0 deletions
diff --git a/games-rpg/nwn/Manifest b/games-rpg/nwn/Manifest
new file mode 100644
index 00000000000..3f30eb40f7e
--- /dev/null
+++ b/games-rpg/nwn/Manifest
@@ -0,0 +1,19 @@
+DIST English_linuxclient168_orig.tar.gz 130569338 SHA256 03687bff0469cb08a7e5a14316e076a6bfe698121ccee4e2116f0bf119988092
+DIST English_linuxclient168_xp1.tar.gz 134673662 SHA256 e78716a83add4980674f86fd648d374b6086365620bde478b678edfdd4e7e82c
+DIST English_linuxclient168_xp2.tar.gz 120144829 SHA256 b8d69ad68c3e3ddf2332176ffd1494682bd9f9d254531720327a62be44e1ac2c
+DIST English_linuxclient169_orig.tar.gz 473297170 SHA256 50932f9647ea7968dbb8f7ab1fc6478035fff0826379a45762c1de8e46d1d2b0 SHA512 e24c0a44e41c97e313aeae1f001ee9ab15d97432b754246bc38b79d8adb7b372f5063a45c378fcf2ea07835f46ed20d02cca727bd7f9ce3800ab36e0ccc4b30c WHIRLPOOL 098a9d80f923971e19f036b93b0bc3ad550c7bb72e1efb1fd850ceacfc61a8159c9cabbf74ce91c9c3435a346e8aa5a80020427d1abd83f02b948616cbb753dd
+DIST English_linuxclient169_xp1.tar.gz 477419208 SHA256 678254a1dbc52c5c3fa628410e3231b05afa3a612433729e7ef12d41bea8fc16
+DIST English_linuxclient169_xp2.tar.gz 506025948 SHA256 09715e2b95c025ef7f00d218deec1b1edce501530d8cba51d61097c69699763f
+DIST French_linuxclient168_orig.tar.gz 131090499 SHA256 f32ed5a759a0a6b49d8f9ef39e313d49a8931725c0d5a61d3a8737d125902315
+DIST French_linuxclient168_xp1.tar.gz 151199720 SHA256 b9f8fe388519bc824bd2b0198a6c51b93d8a3534d16718b164b6c983fea08f9a
+DIST French_linuxclient168_xp2.tar.gz 133316339 SHA256 7cc11a8cc7a613714c8d01c42b061baad874001da479db1d26903f494894e98a
+DIST German_linuxclient168_orig.tar.gz 131790824 SHA256 d0850968fe68cdabfa3138810387dd4be0bf4338173dc02a46cd5ed7c4348b45
+DIST German_linuxclient168_xp1.tar.gz 152951618 SHA256 11e0b929547860309007298e1851d368d445b7dc8ceab17cece33d51342bfdd8
+DIST German_linuxclient168_xp2.tar.gz 134425276 SHA256 5d8fe43b751dd9372f45a1193cbf21da04b99fa5c735e5286d7306cf325f796d
+DIST Italian_linuxclient168_orig.tar.gz 132705873 SHA256 650235b4ac464f7bdc873aaf8404ec51deef6e8a7c780a9bb237782c1575f95b
+DIST Italian_linuxclient168_xp1.tar.gz 143425395 SHA256 52da3063290f564c64905b0806201ad9623a62d99f38adae39e3eb0f5970eb94
+DIST Italian_linuxclient168_xp2.tar.gz 133867117 SHA256 8a8f87034ccda517e2c69dea61f6fe799a0e1ef5ced6eab2081980da988f49d8
+DIST Spanish_linuxclient168_orig.tar.gz 132704890 SHA256 01bfd907735a69112fc1847e82269ed2a3d00760a9906dd24819269e53173f13
+DIST Spanish_linuxclient168_xp1.tar.gz 143415370 SHA256 c74faed185b87a0f187f4e1bcf873ec3810a1fd8dba026b81bcf421e1ca121d9
+DIST Spanish_linuxclient168_xp2.tar.gz 133862305 SHA256 b4d4efb0eb5d3395e42e665b518f3cec19c690b0f7f57783ecaa2e6aa8b70a5e
+DIST nwn-libs-1.tar.bz2 250395 SHA256 8cf73b69f5c254125713b0bf8dcb89e3320eee5a3339df11d6d18d8381b36f31 SHA512 9a1941f232a0d2cf890660b8e383068f37cb573023c751e57e77cd803290425d9169844c9c550fa7f2a242ba7e7fe499d0f07a618acde9d2d02eab57495e948f WHIRLPOOL 740ce19b2292f961feab1d8829f1128f9e81613885fad5bab014dff7f975563265e4bfecc405b69a409472281cee213e0675696f3173ffd8f48e32a15c40b0ee
diff --git a/games-rpg/nwn/files/fixinstall b/games-rpg/nwn/files/fixinstall
new file mode 100755
index 00000000000..c324b61bf89
--- /dev/null
+++ b/games-rpg/nwn/files/fixinstall
@@ -0,0 +1,107 @@
+#!/bin/bash
+# Initial version by Bioware
+# Modified to match the gentoo setup
+# 03/27/2003 phoen][x <phoenix@gentoo.org>
+
+cd GENTOO_DIR/nwn || exit 1
+
+aRequiredDirs=(ambient data music override miles nwm)
+aRequiredFiles=(chitin.key dialog.tlk nwmain)
+aLCDirs=(ambient data dmvault hak localvault music override portraits)
+aProblemFiles=()
+aWritables=(nwn.ini nwnplayer.ini nwncdkey.ini saves localvault tempclient currentgame dmvault)
+
+printf "Checking for required files\n\n"
+
+for d in ${aRequiredDirs[@]} ; do
+ if [[ -d $d ]] ; then
+ printf "PASSED: $d directory exists\n"
+ else
+ printf "FAILED: $d directory missing\n"
+ exit 1
+ fi
+done
+
+for f in ${aRequiredFiles[@]} ; do
+ if [[ -f $f ]] ; then
+ printf "PASSED: $f exists\n"
+ else
+ printf "FAILED: $f missing\n"
+ exit 1
+ fi
+done
+
+printf "\nFixing case\n\n"
+
+if [[ -f dialog.TLK ]] ; then
+ mv dialog.TLK dialog.tlk
+fi
+
+if [[ -f dialogF.TLK ]] ; then
+ mv dialogF.TLK dialogf.tlk
+fi
+
+for d in ${aLCDirs[@]} ; do
+ if [[ -d $d ]] ; then
+ printf "$d\n"
+ cd $d
+
+ for f in $(find . -name '*.*') ; do
+ lcf=$(echo $f | tr [:upper:] [:lower:])
+ if [[ $f != $lcf ]] && [[ -f $f ]] ; then
+ mv $f $(echo $f | tr [:upper:] [:lower:])
+ fi
+ printf .
+ done
+
+ cd ..
+ printf "\n"
+ fi
+done
+
+defIFS=$IFS
+IFS='|'
+
+if [[ -d saves ]] ; then
+ cd saves
+ for d in $(find . -name '* - *' -type d -printf "%f|") ; do
+ printf "saves/$d\n"
+ cd "$d"
+
+ [[ -f Portrait.tga ]] && mv Portrait.tga portrait.tga
+ [[ -f Screen.tga ]] && mv Screen.tga screen.tga
+
+ cd ..
+ done
+ cd ..
+fi
+
+IFS=$defIFS
+
+printf "\nChecking for problem files\n\n"
+
+for f in ${aProblemFiles[@]} ; do
+ if [[ -e $f ]] ; then
+ printf "WARNING: $f exists, deleting this file is recommended\n"
+ fi
+done
+
+printf "\nFixing permissions\n\n"
+
+chown GENTOO_USER:GENTOO_GROUP GENTOO_DIR/nwn/ -R
+chmod g+rwX GENTOO_DIR/nwn/ -R
+
+# 1.65-specific fixes to permissions
+[ -e GENTOO_DIR/nwn/data/patch.bif ] && \
+ chmod a-x GENTOO_DIR/nwn/data/patch.bif 2>&1 > /dev/null
+chmod a-x GENTOO_DIR/nwn/nwm/Chapter1.nwm 2>&1 > /dev/null
+chmod a-x GENTOO_DIR/nwn/nwm/Chapter1E.nwm 2>&1 > /dev/null
+chmod a-x GENTOO_DIR/nwn/nwm/Chapter2.nwm 2>&1 > /dev/null
+chmod a-x GENTOO_DIR/nwn/nwm/Chapter2E.nwm 2>&1 > /dev/null
+chmod a-x GENTOO_DIR/nwn/nwm/Chapter3.nwm 2>&1 > /dev/null
+chmod a-x GENTOO_DIR/nwn/nwm/Chapter4.nwm 2>&1 > /dev/null
+chmod a-x GENTOO_DIR/nwn/nwm/Prelude.nwm 2>&1 > /dev/null
+[ -e GENTOO_DIR/nwn/patch.key ] && \
+ chmod a-x GENTOO_DIR/nwn/patch.key 2>&1 > /dev/null
+
+printf "\nYou are ready to run Neverwinter Nights.\n\n"
diff --git a/games-rpg/nwn/metadata.xml b/games-rpg/nwn/metadata.xml
new file mode 100644
index 00000000000..b725b9d0202
--- /dev/null
+++ b/games-rpg/nwn/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>games</herd>
+ <maintainer>
+ <email>calchan@gentoo.org</email>
+ <name>Denis Dupeyron</name>
+ </maintainer>
+ <use>
+ <flag name="hou">Install the Hordes of the Underdark expansion pack</flag>
+ <flag name="sou">Installs the Shadows of Undrentide expension pack</flag>
+ </use>
+</pkgmetadata>
diff --git a/games-rpg/nwn/nwn-1.68-r5.ebuild b/games-rpg/nwn/nwn-1.68-r5.ebuild
new file mode 100644
index 00000000000..769c24bdd00
--- /dev/null
+++ b/games-rpg/nwn/nwn-1.68-r5.ebuild
@@ -0,0 +1,249 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils games
+
+LANGUAGES="linguas_fr linguas_it linguas_es linguas_de linguas_en"
+
+MY_PV=${PV//.}
+PATCH_URL_BASE=http://files.bioware.com/neverwinternights/updates/linux/${MY_PV}
+PACKAGE_NAME=_linuxclient${MY_PV}_orig.tar.gz
+SOU_NAME=_linuxclient${MY_PV}_xp1.tar.gz
+HOU_NAME=_linuxclient${MY_PV}_xp2.tar.gz
+
+DESCRIPTION="Epic role-playing game set in a huge medieval fantasy world of Dungeons and Dragons"
+HOMEPAGE="http://nwn.bioware.com/downloads/linuxclient.html"
+SRC_URI="http://dev.gentoo.org/~calchan/distfiles/nwn-libs-1.tar.bz2
+ linguas_fr? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/French${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/French${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/French${HOU_NAME} ) )
+ linguas_it? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/Italian${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/Italian${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/Italian${HOU_NAME} ) )
+ linguas_en? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/English${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/English${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/English${HOU_NAME} ) )
+ linguas_es? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/Spanish${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/Spanish${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/Spanish${HOU_NAME} ) )
+ linguas_de? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/German${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/German${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/German${HOU_NAME} ) )
+ !linguas_en? (
+ !linguas_es? (
+ !linguas_de? (
+ !linguas_fr? (
+ !linguas_it? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/English${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/English${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/English${HOU_NAME} ) ) ) ) ) )"
+
+LICENSE="NWN-EULA"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="sou hou ${LANGUAGES}"
+# nowin USE flag not used anymore by pkg_setup()
+RESTRICT="mirror strip"
+
+RDEPEND="
+ >=games-rpg/nwn-data-1.29-r3
+ !<games-rpg/nwmouse-0.1-r1
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ >=media-libs/libsdl-1.2.15-r5[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+"
+DEPEND="app-arch/unzip"
+
+S=${WORKDIR}/nwn
+
+dir=${GAMES_PREFIX_OPT}/${PN}
+Ddir=${D}/${dir}
+
+die_from_busted_nwn-data() {
+ local use=$*
+ ewarn "You must emerge games-rpg/nwn-data with USE=$use. You can fix this"
+ ewarn "by doing the following:"
+ echo
+ elog "mkdir -p /etc/portage"
+ elog "echo 'games-rpg/nwn-data $use' >> /etc/portage/package.use"
+ elog "emerge --oneshot games-rpg/nwn-data"
+ die "nwn-data requires USE=$use"
+}
+
+die_from_busted_linguas_nwn-data() {
+ local use=$*
+ ewarn "You must emerge games-rpg/nwn-data with LINGUAS=${use/linguas_/}."
+ ewarn "You can fix this by doing the following:"
+ echo
+ elog "mkdir -p /etc/portage"
+ elog "echo 'games-rpg/nwn-data $use' >> /etc/portage/package.use"
+ elog "emerge --oneshot games-rpg/nwn-data"
+ die "nwn-data requires LINGUAS='$use'"
+}
+
+pkg_setup() {
+ games_pkg_setup
+ if use sou
+ then
+ built_with_use games-rpg/nwn-data sou || die_from_busted_nwn-data sou
+ fi
+ if use hou
+ then
+ built_with_use games-rpg/nwn-data hou || die_from_busted_nwn-data hou
+ fi
+
+ strip-linguas de en es fr it
+}
+
+src_unpack() {
+ mkdir -p "${S}"
+ cd "${S}"
+ mkdir -p .metadata
+ for a in ${A}
+ do
+ if [ -z "${a/*libs*}" ]
+ then
+ unpack "${a}" || die "unpack ${a}"
+ fi
+
+ if [ -z "${a/*orig*}" ]
+ then
+ currentlocale=""
+ if [ -z "${a/*German*/}" ]
+ then
+ currentlocale=de
+ elif [ -z "${a/*English*/}" ]
+ then
+ currentlocale=en
+ elif [ -z "${a/*Spanish*/}" ]
+ then
+ currentlocale=es
+ elif [ -z "${a/*Italian*/}" ]
+ then
+ currentlocale=it
+ elif [ -z "${a/*French*/}" ]
+ then
+ currentlocale=fr
+ fi
+ if [ -n "$currentlocale" ]
+ then
+ mkdir -p "${currentlocale}"
+ cd "${currentlocale}"
+ unpack "${a}" || die "unpack ${a}"
+ cd ..
+ fi
+ fi
+ done
+ use sou && (
+ for a in ${A}
+ do
+ if [ -z "${a/*$SOU_NAME}" ]
+ then
+ currentlocale=""
+ if [ -z "${a/*German*/}" ]
+ then
+ currentlocale=de
+ elif [ -z "${a/*English*/}" ]
+ then
+ currentlocale=en
+ elif [ -z "${a/*Spanish*/}" ]
+ then
+ currentlocale=es
+ elif [ -z "${a/*Italian*/}" ]
+ then
+ currentlocale=it
+ elif [ -z "${a/*French*/}" ]
+ then
+ currentlocale=fr
+ fi
+ if [ -n "$currentlocale" ]
+ then
+ mkdir -p "${currentlocale}"
+ cd "${currentlocale}"
+ rm -f data/patch.bif patch.key
+ unpack "${a}" || die "unpack ${a}"
+ cd ..
+ fi
+ fi
+ done )
+ use hou && (
+ for a in ${A}
+ do
+ if [ -z "${a/*$HOU_NAME}" ]
+ then
+ currentlocale=""
+ if [ -z "${a/*German*/}" ]
+ then
+ currentlocale=de
+ elif [ -z "${a/*English*/}" ]
+ then
+ currentlocale=en
+ elif [ -z "${a/*Spanish*/}" ]
+ then
+ currentlocale=es
+ elif [ -z "${a/*Italian*/}" ]
+ then
+ currentlocale=it
+ elif [ -z "${a/*French*/}" ]
+ then
+ currentlocale=fr
+ fi
+ if [ -n "$currentlocale" ]
+ then
+ mkdir -p "${currentlocale}"
+ cd "${currentlocale}"
+ rm -f data/patch.bif patch.key data/xp1patch.bif xp1patch.key override/*
+ unpack "${a}" || die "unpack ${a}"
+ cd ..
+ fi
+ fi
+ done )
+}
+
+src_install() {
+ dodir "${dir}"
+ exeinto "${dir}"
+ doexe "${FILESDIR}"/fixinstall
+ sed -i \
+ -e "s:GENTOO_USER:${GAMES_USER}:" \
+ -e "s:GENTOO_GROUP:${GAMES_GROUP}:" \
+ -e "s:GENTOO_DIR:${GAMES_PREFIX_OPT}:" \
+ -e "s:override miles nwm:miles:" \
+ -e "s:chitin.key dialog.tlk nwmain:chitin.key:" \
+ -e "s:^chmod a-x:#chmod a-x:" \
+ "${Ddir}"/fixinstall || die "sed"
+ if use hou || use sou
+ then
+ sed -i \
+ -e "s:chitin.key patch.key:chitin.key:" \
+ "${Ddir}"/fixinstall || die "sed"
+ fi
+ fperms ug+x "${dir}"/fixinstall || die "perms"
+ mv "${S}"/* "${Ddir}"
+ mv "${S}"/.metadata "${Ddir}"
+ games_make_wrapper nwn ./nwn "${dir}" "${dir}"
+ make_desktop_entry nwn "Neverwinter Nights"
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ elog "The included custom libSDL is patched to enable the following key sequences:"
+ elog " * Left-Alt & Enter - Iconify Window"
+ elog " * Right-Alt & Enter - Toggle between FullScreen/Windowed"
+ elog " * Left-Control & G - Disable the mouse grab that keeps the cursor inside the NWN window"
+ elog " * Right-Control & G - Re-enable the mouse grab to keep the cursor inside the NWN window"
+ elog
+ elog "The NWN linux client is now installed."
+ elog "Proceed with the following step in order to get it working:"
+ elog "Run ${dir}/fixinstall as root"
+}
diff --git a/games-rpg/nwn/nwn-1.68-r6.ebuild b/games-rpg/nwn/nwn-1.68-r6.ebuild
new file mode 100644
index 00000000000..8232df43ee3
--- /dev/null
+++ b/games-rpg/nwn/nwn-1.68-r6.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils games
+
+LANGUAGES="linguas_fr linguas_it linguas_es linguas_de linguas_en"
+
+MY_PV=${PV//.}
+PATCH_URL_BASE=http://files.bioware.com/neverwinternights/updates/linux/${MY_PV}
+PACKAGE_NAME=_linuxclient${MY_PV}_orig.tar.gz
+SOU_NAME=_linuxclient${MY_PV}_xp1.tar.gz
+HOU_NAME=_linuxclient${MY_PV}_xp2.tar.gz
+
+DESCRIPTION="Epic role-playing game set in a huge medieval fantasy world of Dungeons and Dragons"
+HOMEPAGE="http://nwn.bioware.com/downloads/linuxclient.html"
+SRC_URI="http://dev.gentoo.org/~calchan/distfiles/nwn-libs-1.tar.bz2
+ linguas_fr? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/French${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/French${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/French${HOU_NAME} ) )
+ linguas_it? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/Italian${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/Italian${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/Italian${HOU_NAME} ) )
+ linguas_en? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/English${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/English${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/English${HOU_NAME} ) )
+ linguas_es? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/Spanish${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/Spanish${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/Spanish${HOU_NAME} ) )
+ linguas_de? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/German${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/German${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/German${HOU_NAME} ) )
+ !linguas_en? (
+ !linguas_es? (
+ !linguas_de? (
+ !linguas_fr? (
+ !linguas_it? (
+ !sou? ( !hou? ( ${PATCH_URL_BASE}/English${PACKAGE_NAME} ) )
+ sou? ( ${PATCH_URL_BASE}/English${SOU_NAME} )
+ hou? ( ${PATCH_URL_BASE}/English${HOU_NAME} ) ) ) ) ) )"
+
+LICENSE="NWN-EULA"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="sou hou ${LANGUAGES}"
+RESTRICT="mirror strip"
+
+RDEPEND="
+ >=games-rpg/nwn-data-1.29-r3
+ !<games-rpg/nwmouse-0.1-r1
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ >=media-libs/libsdl-1.2.15-r5[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+"
+DEPEND="app-arch/unzip"
+
+S=${WORKDIR}/nwn
+
+dir=${GAMES_PREFIX_OPT}/${PN}
+Ddir=${D}/${dir}
+
+die_from_busted_nwn-data() {
+ local use=$*
+ ewarn "You must emerge games-rpg/nwn-data with USE=$use. You can fix this"
+ ewarn "by doing the following:"
+ echo
+ elog "mkdir -p /etc/portage"
+ elog "echo 'games-rpg/nwn-data $use' >> /etc/portage/package.use"
+ elog "emerge --oneshot games-rpg/nwn-data"
+ die "nwn-data requires USE=$use"
+}
+
+pkg_setup() {
+ games_pkg_setup
+ if use sou
+ then
+ has_version "games-rpg/nwn-data[sou]" || die_from_busted_nwn-data sou
+ fi
+ if use hou
+ then
+ has_version "games-rpg/nwn-data[hou]" || die_from_busted_nwn-data hou
+ fi
+
+ strip-linguas de en es fr it
+}
+
+src_unpack() {
+ mkdir -p "${S}"
+ cd "${S}"
+ mkdir -p .metadata
+ for a in ${A}
+ do
+ if [ -z "${a/*libs*}" ]
+ then
+ unpack "${a}"
+ fi
+
+ if [ -z "${a/*orig*}" ]
+ then
+ currentlocale=""
+ if [ -z "${a/*German*/}" ]
+ then
+ currentlocale=de
+ elif [ -z "${a/*English*/}" ]
+ then
+ currentlocale=en
+ elif [ -z "${a/*Spanish*/}" ]
+ then
+ currentlocale=es
+ elif [ -z "${a/*Italian*/}" ]
+ then
+ currentlocale=it
+ elif [ -z "${a/*French*/}" ]
+ then
+ currentlocale=fr
+ fi
+ if [ -n "$currentlocale" ]
+ then
+ mkdir -p "${currentlocale}"
+ cd "${currentlocale}"
+ unpack "${a}"
+ cd ..
+ fi
+ fi
+ done
+ use sou && (
+ for a in ${A}
+ do
+ if [ -z "${a/*$SOU_NAME}" ]
+ then
+ currentlocale=""
+ if [ -z "${a/*German*/}" ]
+ then
+ currentlocale=de
+ elif [ -z "${a/*English*/}" ]
+ then
+ currentlocale=en
+ elif [ -z "${a/*Spanish*/}" ]
+ then
+ currentlocale=es
+ elif [ -z "${a/*Italian*/}" ]
+ then
+ currentlocale=it
+ elif [ -z "${a/*French*/}" ]
+ then
+ currentlocale=fr
+ fi
+ if [ -n "$currentlocale" ]
+ then
+ mkdir -p "${currentlocale}"
+ cd "${currentlocale}"
+ rm -f data/patch.bif patch.key
+ unpack "${a}"
+ cd ..
+ fi
+ fi
+ done )
+ use hou && (
+ for a in ${A}
+ do
+ if [ -z "${a/*$HOU_NAME}" ]
+ then
+ currentlocale=""
+ if [ -z "${a/*German*/}" ]
+ then
+ currentlocale=de
+ elif [ -z "${a/*English*/}" ]
+ then
+ currentlocale=en
+ elif [ -z "${a/*Spanish*/}" ]
+ then
+ currentlocale=es
+ elif [ -z "${a/*Italian*/}" ]
+ then
+ currentlocale=it
+ elif [ -z "${a/*French*/}" ]
+ then
+ currentlocale=fr
+ fi
+ if [ -n "$currentlocale" ]
+ then
+ mkdir -p "${currentlocale}"
+ cd "${currentlocale}"
+ rm -f data/patch.bif patch.key data/xp1patch.bif xp1patch.key override/*
+ unpack "${a}"
+ cd ..
+ fi
+ fi
+ done )
+}
+
+src_install() {
+ dodir "${dir}"
+ exeinto "${dir}"
+ doexe "${FILESDIR}"/fixinstall
+ sed -i \
+ -e "s:GENTOO_USER:${GAMES_USER}:" \
+ -e "s:GENTOO_GROUP:${GAMES_GROUP}:" \
+ -e "s:GENTOO_DIR:${GAMES_PREFIX_OPT}:" \
+ -e "s:override miles nwm:miles:" \
+ -e "s:chitin.key dialog.tlk nwmain:chitin.key:" \
+ -e "s:^chmod a-x:#chmod a-x:" \
+ "${Ddir}"/fixinstall || die
+ if use hou || use sou
+ then
+ sed -i \
+ -e "s:chitin.key patch.key:chitin.key:" \
+ "${Ddir}"/fixinstall || die
+ fi
+ fperms ug+x "${dir}"/fixinstall || die
+ mv "${S}"/* "${Ddir}"
+ mv "${S}"/.metadata "${Ddir}"
+ games_make_wrapper nwn ./nwn "${dir}" "${dir}"
+ make_desktop_entry nwn "Neverwinter Nights"
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ elog "The included custom libSDL is patched to enable the following key sequences:"
+ elog " * Left-Alt & Enter - Iconify Window"
+ elog " * Right-Alt & Enter - Toggle between FullScreen/Windowed"
+ elog " * Left-Control & G - Disable the mouse grab that keeps the cursor inside the NWN window"
+ elog " * Right-Control & G - Re-enable the mouse grab to keep the cursor inside the NWN window"
+ elog
+ elog "The NWN linux client is now installed."
+ elog "Proceed with the following step in order to get it working:"
+ elog "Run ${dir}/fixinstall as root"
+}
diff --git a/games-rpg/nwn/nwn-1.69-r1.ebuild b/games-rpg/nwn/nwn-1.69-r1.ebuild
new file mode 100644
index 00000000000..91b26c80430
--- /dev/null
+++ b/games-rpg/nwn/nwn-1.69-r1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils games
+
+MY_PV=${PV//.}
+PATCH_URL_BASE=http://files.bioware.com/neverwinternights/updates/linux/${MY_PV}/English_linuxclient${MY_PV}_
+
+DESCRIPTION="role-playing game set in a huge medieval fantasy world of Dungeons and Dragons"
+HOMEPAGE="http://nwn.bioware.com/downloads/linuxclient.html"
+SRC_URI="http://dev.gentoo.org/~calchan/distfiles/nwn-libs-1.tar.bz2
+ !sou? ( !hou? ( ${PATCH_URL_BASE}orig.tar.gz ) )
+ sou? ( !hou? ( ${PATCH_URL_BASE}xp1.tar.gz ) )
+ hou? ( ${PATCH_URL_BASE}xp2.tar.gz )"
+
+LICENSE="NWN-EULA"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="sou hou"
+RESTRICT="mirror strip"
+
+QA_FLAGS_IGNORED="/opt/nwn/en/nwserver /opt/nwn/en/nwmain /opt/nwn/lib/libSDL-1.2.so.0.11.2 /opt/nwn/lib/libelf.so.1"
+
+NWN_DATA=">=games-rpg/nwn-data-1.29-r3[sou?,hou?"
+
+# ${P} requires games-rpg/nwn-data emerged with at least LINGUAS=en or none at all
+RDEPEND="
+ || (
+ ${NWN_DATA},linguas_en]
+ ${NWN_DATA},-linguas_fr,-linguas_de,-linguas_es,-linguas_it]
+ )
+ !<games-rpg/nwmouse-0.1-r1
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ >=media-libs/libsdl-1.2.15-r5[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+"
+DEPEND=""
+
+S=${WORKDIR}/nwn
+
+dir=${GAMES_PREFIX_OPT}/${PN}
+Ddir=${D}/${dir}
+
+src_unpack() {
+ mkdir -p "${S}"/en
+ cd "${S}"/en
+ unpack ${A}
+ mv lib ..
+}
+
+src_install() {
+ exeinto "${dir}"
+ doexe "${FILESDIR}"/fixinstall
+ sed -i \
+ -e "s:GENTOO_USER:${GAMES_USER}:" \
+ -e "s:GENTOO_GROUP:${GAMES_GROUP}:" \
+ -e "s:GENTOO_DIR:${GAMES_PREFIX_OPT}:" \
+ -e "s:override miles nwm:miles:" \
+ -e "s:chitin.key dialog.tlk nwmain:chitin.key:" \
+ -e "s:^chmod a-x:#chmod a-x:" \
+ "${Ddir}"/fixinstall || die "sed"
+ if use hou || use sou
+ then
+ sed -i \
+ -e "s:chitin.key patch.key:chitin.key:" \
+ "${Ddir}"/fixinstall || die "sed"
+ fi
+ fperms ug+x "${dir}"/fixinstall || die "perms"
+ mv "${S}"/* "${Ddir}"
+ games_make_wrapper nwn ./nwn "${dir}" "${dir}"
+ make_desktop_entry nwn "Neverwinter Nights"
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ elog "The included custom libSDL is patched to enable the following key sequences:"
+ elog " * Left-Alt & Enter - Iconify Window"
+ elog " * Right-Alt & Enter - Toggle between FullScreen/Windowed"
+ elog " * Left-Control & G - Disable the mouse grab that keeps the cursor inside the NWN window"
+ elog " * Right-Control & G - Re-enable the mouse grab to keep the cursor inside the NWN window"
+ elog
+ elog "The NWN linux client is now installed."
+ elog "Proceed with the following step in order to get it working:"
+ elog "Run ${dir}/fixinstall as root"
+ echo
+ ewarn "This version supports only english, see http://nwn.bioware.com/support/patch.html"
+ ewarn "If you were playing with a different language you may want to backup your ~/.nwn and do:"
+ ewarn " mv ~/.nwn/<language> ~/.nwn/en"
+ ewarn "If it does not work, try removing ~/.nwn, start nwn then quit, and re-import all you"
+ ewarn "need (saves, etc...) in ~/.nwn/en, but please do not file a bug."
+}