summaryrefslogtreecommitdiff
path: root/games-util/pyfa
diff options
context:
space:
mode:
Diffstat (limited to 'games-util/pyfa')
-rw-r--r--games-util/pyfa/Manifest2
-rw-r--r--games-util/pyfa/files/configforced-1.15.1.py4
-rw-r--r--games-util/pyfa/files/pyfa-1.15.1-import-pyfa.patch27
-rw-r--r--games-util/pyfa/files/pyfa-1.15.1-staticdata.patch61
-rw-r--r--games-util/pyfa/pyfa-1.15.0.ebuild (renamed from games-util/pyfa/pyfa-1.12.0.ebuild)2
-rw-r--r--games-util/pyfa/pyfa-9999.ebuild31
6 files changed, 113 insertions, 14 deletions
diff --git a/games-util/pyfa/Manifest b/games-util/pyfa/Manifest
index 37684441c5..5d7d734745 100644
--- a/games-util/pyfa/Manifest
+++ b/games-util/pyfa/Manifest
@@ -1 +1 @@
-DIST pyfa-1.12.0.tar.gz 5898063 SHA256 d22f725efee6cd48a30ccc16a04e913afa1a7e9e89a2004ef8ca12263663ae87 SHA512 c7cda257c0ebffee113df713b8e4a2578fc46ec4493a13341c3907cd8de99c19f4cb1dbae4fe4365134c9ebced618efee2614cb57889a50330d37cf5996ec602 WHIRLPOOL eaf0bc3907b0f32feb601319ca8630e18e8eababb8d3623e56ee3fdc45dfc30946c817e2040e10f0f0e13093672b4faf0e5893088a125bb056d14dd006d623f6
+DIST pyfa-1.15.0.tar.gz 6243527 SHA256 27ec6748b5f1083050d47a364a8699e521a614c5c643a639441c82168017123c SHA512 c966e3fd7627ef575247b00eacee7392f7f2d32b14485c2a7e5aa0c6f3fe6ad99c1a536bfcbfcc6de29fa4bdc177b6a12e0a571926c1b7b755ef9fc6f76f3bad WHIRLPOOL f6ba22d7f3899c4a3fd702a5d0145b39e06e70793da2682c6bb0df0b3772c02f250b59d05a4fee23f72d87010f02d916a944c0499852dc0be845e1ae56b61904
diff --git a/games-util/pyfa/files/configforced-1.15.1.py b/games-util/pyfa/files/configforced-1.15.1.py
new file mode 100644
index 0000000000..51fcb958ce
--- /dev/null
+++ b/games-util/pyfa/files/configforced-1.15.1.py
@@ -0,0 +1,4 @@
+# Gentoo-specific settings
+pyfaPath = u'%%SITEDIR%%/pyfa'
+gameDB = u'%%EPREFIX%%/usr/share/pyfa/eve.db'
+imgsZIP = u'%%EPREFIX%%/usr/share/pyfa/imgs.zip'
diff --git a/games-util/pyfa/files/pyfa-1.15.1-import-pyfa.patch b/games-util/pyfa/files/pyfa-1.15.1-import-pyfa.patch
new file mode 100644
index 0000000000..f29b75d7fe
--- /dev/null
+++ b/games-util/pyfa/files/pyfa-1.15.1-import-pyfa.patch
@@ -0,0 +1,27 @@
+From 6c7b6ab7d1aae47d3a3f72a7951c7de294be2917 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Tue, 6 Oct 2015 22:16:38 -0400
+Subject: [PATCH] Append $(python_get_sitedir)/pyfa to import path
+
+Ensures that pyfa's import statements continue to work for systemwide
+installation.
+---
+ pyfa.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/pyfa.py b/pyfa.py
+index 8189918..7b81f10 100755
+--- a/pyfa.py
++++ b/pyfa.py
+@@ -20,6 +20,8 @@
+
+ import sys
+ import re
++import os
++sys.path.append(os.path.join("%%SITEDIR%%", "pyfa"))
+ import config
+
+
+--
+2.6.0
+
diff --git a/games-util/pyfa/files/pyfa-1.15.1-staticdata.patch b/games-util/pyfa/files/pyfa-1.15.1-staticdata.patch
new file mode 100644
index 0000000000..8b8fa91307
--- /dev/null
+++ b/games-util/pyfa/files/pyfa-1.15.1-staticdata.patch
@@ -0,0 +1,61 @@
+From c7bb5210ce9feebb753734b5c581acca9f5c9d06 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Tue, 6 Oct 2015 21:37:44 -0400
+Subject: [PATCH] make gameDB and imgs.zip paths settable from configforced
+
+---
+ config.py | 10 +++++++++-
+ gui/bitmapLoader.py | 2 +-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/config.py b/config.py
+index 4072236..a9e71ee 100644
+--- a/config.py
++++ b/config.py
+@@ -28,6 +28,7 @@ pyfaPath = None
+ savePath = None
+ saveDB = None
+ gameDB = None
++imgsZIP = None
+
+
+ class StreamToLogger(object):
+@@ -66,6 +67,7 @@ def defPaths():
+ global savePath
+ global saveDB
+ global gameDB
++ global imgsZIP
+ global saveInRoot
+
+ if debug:
+@@ -117,7 +119,13 @@ def defPaths():
+ # The database where the static EVE data from the datadump is kept.
+ # This is not the standard sqlite datadump but a modified version created by eos
+ # maintenance script
+- gameDB = os.path.join(pyfaPath, "eve.db")
++ gameDB = getattr(configforced, "gameDB", None)
++ if gameDB is None:
++ gameDB = os.path.join(pyfaPath, "eve.db")
++
++ imgsZIP = getattr(configforced, "imgsZIP", None)
++ if imgsZIP is None:
++ imgsZIP = os.path.join(pyfaPath, "imgs.zip")
+
+ ## DON'T MODIFY ANYTHING BELOW ##
+ import eos.config
+diff --git a/gui/bitmapLoader.py b/gui/bitmapLoader.py
+index 45026be..02985c1 100644
+--- a/gui/bitmapLoader.py
++++ b/gui/bitmapLoader.py
+@@ -31,7 +31,7 @@ except ImportError:
+ class BitmapLoader():
+
+ try:
+- archive = zipfile.ZipFile(os.path.join(config.pyfaPath, 'imgs.zip'), 'r')
++ archive = zipfile.ZipFile(config.imgsZIP, 'r')
+ except IOError:
+ archive = None
+
+--
+2.6.0
+
diff --git a/games-util/pyfa/pyfa-1.12.0.ebuild b/games-util/pyfa/pyfa-1.15.0.ebuild
index 8f2241416a..76dac888c1 100644
--- a/games-util/pyfa/pyfa-1.12.0.ebuild
+++ b/games-util/pyfa/pyfa-1.15.0.ebuild
@@ -63,7 +63,7 @@ src_install() {
pyfa_py_install() {
local packagedir=$(python_get_sitedir)/${PN}
insinto "${packagedir}"
- doins -r eos gui icons service config*.py __init__.py gpl.txt
+ doins -r eos gui icons service utils config*.py __init__.py gpl.txt
[[ -e info.py ]] && doins info.py # only in zip releases
doins "${BUILD_DIR}/configforced.py"
python_doscript "${BUILD_DIR}/pyfa"
diff --git a/games-util/pyfa/pyfa-9999.ebuild b/games-util/pyfa/pyfa-9999.ebuild
index 8f2241416a..5e11d005ab 100644
--- a/games-util/pyfa/pyfa-9999.ebuild
+++ b/games-util/pyfa/pyfa-9999.ebuild
@@ -15,7 +15,7 @@ LICENSE="GPL-3+ LGPL-2.1+ CC-BY-2.5 free-noncomm"
SLOT="0"
if [[ ${PV} = 9999 ]]; then
EGIT_REPO_URI="https://github.com/DarkFenX/Pyfa.git"
- inherit git-2
+ inherit git-r3
KEYWORDS=""
else
SRC_URI="https://github.com/DarkFenX/Pyfa/archive/v${PV}.tar.gz -> pyfa-${PV}.tar.gz"
@@ -25,34 +25,34 @@ IUSE="+graph"
RDEPEND="dev-python/python-dateutil[${PYTHON_USEDEP}]
dev-python/sqlalchemy[${PYTHON_USEDEP}]
- dev-python/wxpython:2.8[${PYTHON_USEDEP}]
+ dev-python/wxpython:3.0[${PYTHON_USEDEP}]
graph? (
dev-python/matplotlib[wxwidgets,${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}] )
${PYTHON_DEPS}"
-DEPEND="app-arch/unzip"
+DEPEND="app-arch/zip"
-S=${WORKDIR}/Pyfa-${PV}
+[[ ${PV} = 9999 ]] || S=${WORKDIR}/Pyfa-${PV}
src_prepare() {
# get rid of CRLF line endings introduced in 1.1.10 so patches work
edos2unix config.py pyfa.py service/settings.py
- # make staticPath settable from configforced again
- epatch "${FILESDIR}/${PN}-1.1.20-staticPath.patch"
+ # load gameDB and images from separate staticdata directory
+ epatch "${FILESDIR}/${PN}-1.15.1-staticdata.patch"
# do not try to save exported html to python sitedir
epatch "${FILESDIR}/${PN}-1.1.8-html-export-path.patch"
# fix import path in the main script for systemwide installation
- epatch "${FILESDIR}/${PN}-1.1.11-import-pyfa.patch"
+ epatch "${FILESDIR}/${PN}-1.15.1-import-pyfa.patch"
touch __init__.py
pyfa_make_configforced() {
mkdir -p "${BUILD_DIR}" || die
sed -e "s:%%SITEDIR%%:$(python_get_sitedir):" \
-e "s:%%EPREFIX%%:${EPREFIX}:" \
- "${FILESDIR}/configforced.py" > "${BUILD_DIR}/configforced.py"
+ "${FILESDIR}/configforced-1.15.1.py" > "${BUILD_DIR}/configforced.py"
sed -e "s:%%SITEDIR%%:$(python_get_sitedir):" \
pyfa.py > "${BUILD_DIR}/pyfa"
}
@@ -63,7 +63,7 @@ src_install() {
pyfa_py_install() {
local packagedir=$(python_get_sitedir)/${PN}
insinto "${packagedir}"
- doins -r eos gui icons service config*.py __init__.py gpl.txt
+ doins -r eos gui service utils config*.py __init__.py
[[ -e info.py ]] && doins info.py # only in zip releases
doins "${BUILD_DIR}/configforced.py"
python_doscript "${BUILD_DIR}/pyfa"
@@ -72,12 +72,19 @@ src_install() {
python_foreach_impl pyfa_py_install
insinto /usr/share/${PN}
- doins -r staticdata
+ doins eve.db
+
+ einfo "Compressing images ..."
+ pushd imgs > /dev/null || die
+ zip -r imgs.zip * || die "zip failed"
+ doins imgs.zip
+ popd > /dev/null || die
+
dodoc README.md
insinto /usr/share/icons/hicolor/32x32/apps
- doins icons/pyfa.png
+ doins imgs/gui/pyfa.png
insinto /usr/share/icons/hicolor/64x64/apps
- newins icons/pyfa64.png pyfa.png
+ newins imgs/gui/pyfa64.png pyfa.png
domenu "${FILESDIR}/${PN}.desktop"
}