1 |
commit: 9f9517df68bb4bbfaa308342630fc67f054af7ea |
2 |
Author: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 7 02:38:40 2015 +0000 |
4 |
Commit: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 7 02:42:49 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f9517df |
7 |
|
8 |
games-util/pyfa: update live ebuild |
9 |
|
10 |
Update patches for upstream code changes, update dependencies, install |
11 |
images in a compressed zip since upstream code now allows it, and switch |
12 |
to git-r3.eclass. |
13 |
|
14 |
Gentoo-Bug: 562080 |
15 |
Reported-by: Captain Crutches |
16 |
Package-Manager: portage-2.2.22 |
17 |
|
18 |
games-util/pyfa/files/configforced-1.15.1.py | 4 ++ |
19 |
.../pyfa/files/pyfa-1.15.1-import-pyfa.patch | 27 ++++++++++ |
20 |
games-util/pyfa/files/pyfa-1.15.1-staticdata.patch | 61 ++++++++++++++++++++++ |
21 |
games-util/pyfa/pyfa-9999.ebuild | 31 ++++++----- |
22 |
4 files changed, 111 insertions(+), 12 deletions(-) |
23 |
|
24 |
diff --git a/games-util/pyfa/files/configforced-1.15.1.py b/games-util/pyfa/files/configforced-1.15.1.py |
25 |
new file mode 100644 |
26 |
index 0000000..51fcb95 |
27 |
--- /dev/null |
28 |
+++ b/games-util/pyfa/files/configforced-1.15.1.py |
29 |
@@ -0,0 +1,4 @@ |
30 |
+# Gentoo-specific settings |
31 |
+pyfaPath = u'%%SITEDIR%%/pyfa' |
32 |
+gameDB = u'%%EPREFIX%%/usr/share/pyfa/eve.db' |
33 |
+imgsZIP = u'%%EPREFIX%%/usr/share/pyfa/imgs.zip' |
34 |
|
35 |
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 |
36 |
new file mode 100644 |
37 |
index 0000000..f29b75d |
38 |
--- /dev/null |
39 |
+++ b/games-util/pyfa/files/pyfa-1.15.1-import-pyfa.patch |
40 |
@@ -0,0 +1,27 @@ |
41 |
+From 6c7b6ab7d1aae47d3a3f72a7951c7de294be2917 Mon Sep 17 00:00:00 2001 |
42 |
+From: Alexandre Rostovtsev <tetromino@g.o> |
43 |
+Date: Tue, 6 Oct 2015 22:16:38 -0400 |
44 |
+Subject: [PATCH] Append $(python_get_sitedir)/pyfa to import path |
45 |
+ |
46 |
+Ensures that pyfa's import statements continue to work for systemwide |
47 |
+installation. |
48 |
+--- |
49 |
+ pyfa.py | 2 ++ |
50 |
+ 1 file changed, 2 insertions(+) |
51 |
+ |
52 |
+diff --git a/pyfa.py b/pyfa.py |
53 |
+index 8189918..7b81f10 100755 |
54 |
+--- a/pyfa.py |
55 |
++++ b/pyfa.py |
56 |
+@@ -20,6 +20,8 @@ |
57 |
+ |
58 |
+ import sys |
59 |
+ import re |
60 |
++import os |
61 |
++sys.path.append(os.path.join("%%SITEDIR%%", "pyfa")) |
62 |
+ import config |
63 |
+ |
64 |
+ |
65 |
+-- |
66 |
+2.6.0 |
67 |
+ |
68 |
|
69 |
diff --git a/games-util/pyfa/files/pyfa-1.15.1-staticdata.patch b/games-util/pyfa/files/pyfa-1.15.1-staticdata.patch |
70 |
new file mode 100644 |
71 |
index 0000000..8b8fa91 |
72 |
--- /dev/null |
73 |
+++ b/games-util/pyfa/files/pyfa-1.15.1-staticdata.patch |
74 |
@@ -0,0 +1,61 @@ |
75 |
+From c7bb5210ce9feebb753734b5c581acca9f5c9d06 Mon Sep 17 00:00:00 2001 |
76 |
+From: Alexandre Rostovtsev <tetromino@g.o> |
77 |
+Date: Tue, 6 Oct 2015 21:37:44 -0400 |
78 |
+Subject: [PATCH] make gameDB and imgs.zip paths settable from configforced |
79 |
+ |
80 |
+--- |
81 |
+ config.py | 10 +++++++++- |
82 |
+ gui/bitmapLoader.py | 2 +- |
83 |
+ 2 files changed, 10 insertions(+), 2 deletions(-) |
84 |
+ |
85 |
+diff --git a/config.py b/config.py |
86 |
+index 4072236..a9e71ee 100644 |
87 |
+--- a/config.py |
88 |
++++ b/config.py |
89 |
+@@ -28,6 +28,7 @@ pyfaPath = None |
90 |
+ savePath = None |
91 |
+ saveDB = None |
92 |
+ gameDB = None |
93 |
++imgsZIP = None |
94 |
+ |
95 |
+ |
96 |
+ class StreamToLogger(object): |
97 |
+@@ -66,6 +67,7 @@ def defPaths(): |
98 |
+ global savePath |
99 |
+ global saveDB |
100 |
+ global gameDB |
101 |
++ global imgsZIP |
102 |
+ global saveInRoot |
103 |
+ |
104 |
+ if debug: |
105 |
+@@ -117,7 +119,13 @@ def defPaths(): |
106 |
+ # The database where the static EVE data from the datadump is kept. |
107 |
+ # This is not the standard sqlite datadump but a modified version created by eos |
108 |
+ # maintenance script |
109 |
+- gameDB = os.path.join(pyfaPath, "eve.db") |
110 |
++ gameDB = getattr(configforced, "gameDB", None) |
111 |
++ if gameDB is None: |
112 |
++ gameDB = os.path.join(pyfaPath, "eve.db") |
113 |
++ |
114 |
++ imgsZIP = getattr(configforced, "imgsZIP", None) |
115 |
++ if imgsZIP is None: |
116 |
++ imgsZIP = os.path.join(pyfaPath, "imgs.zip") |
117 |
+ |
118 |
+ ## DON'T MODIFY ANYTHING BELOW ## |
119 |
+ import eos.config |
120 |
+diff --git a/gui/bitmapLoader.py b/gui/bitmapLoader.py |
121 |
+index 45026be..02985c1 100644 |
122 |
+--- a/gui/bitmapLoader.py |
123 |
++++ b/gui/bitmapLoader.py |
124 |
+@@ -31,7 +31,7 @@ except ImportError: |
125 |
+ class BitmapLoader(): |
126 |
+ |
127 |
+ try: |
128 |
+- archive = zipfile.ZipFile(os.path.join(config.pyfaPath, 'imgs.zip'), 'r') |
129 |
++ archive = zipfile.ZipFile(config.imgsZIP, 'r') |
130 |
+ except IOError: |
131 |
+ archive = None |
132 |
+ |
133 |
+-- |
134 |
+2.6.0 |
135 |
+ |
136 |
|
137 |
diff --git a/games-util/pyfa/pyfa-9999.ebuild b/games-util/pyfa/pyfa-9999.ebuild |
138 |
index 76dac88..5e11d00 100644 |
139 |
--- a/games-util/pyfa/pyfa-9999.ebuild |
140 |
+++ b/games-util/pyfa/pyfa-9999.ebuild |
141 |
@@ -15,7 +15,7 @@ LICENSE="GPL-3+ LGPL-2.1+ CC-BY-2.5 free-noncomm" |
142 |
SLOT="0" |
143 |
if [[ ${PV} = 9999 ]]; then |
144 |
EGIT_REPO_URI="https://github.com/DarkFenX/Pyfa.git" |
145 |
- inherit git-2 |
146 |
+ inherit git-r3 |
147 |
KEYWORDS="" |
148 |
else |
149 |
SRC_URI="https://github.com/DarkFenX/Pyfa/archive/v${PV}.tar.gz -> pyfa-${PV}.tar.gz" |
150 |
@@ -25,34 +25,34 @@ IUSE="+graph" |
151 |
|
152 |
RDEPEND="dev-python/python-dateutil[${PYTHON_USEDEP}] |
153 |
dev-python/sqlalchemy[${PYTHON_USEDEP}] |
154 |
- dev-python/wxpython:2.8[${PYTHON_USEDEP}] |
155 |
+ dev-python/wxpython:3.0[${PYTHON_USEDEP}] |
156 |
graph? ( |
157 |
dev-python/matplotlib[wxwidgets,${PYTHON_USEDEP}] |
158 |
dev-python/numpy[${PYTHON_USEDEP}] ) |
159 |
${PYTHON_DEPS}" |
160 |
-DEPEND="app-arch/unzip" |
161 |
+DEPEND="app-arch/zip" |
162 |
|
163 |
-S=${WORKDIR}/Pyfa-${PV} |
164 |
+[[ ${PV} = 9999 ]] || S=${WORKDIR}/Pyfa-${PV} |
165 |
|
166 |
src_prepare() { |
167 |
# get rid of CRLF line endings introduced in 1.1.10 so patches work |
168 |
edos2unix config.py pyfa.py service/settings.py |
169 |
|
170 |
- # make staticPath settable from configforced again |
171 |
- epatch "${FILESDIR}/${PN}-1.1.20-staticPath.patch" |
172 |
+ # load gameDB and images from separate staticdata directory |
173 |
+ epatch "${FILESDIR}/${PN}-1.15.1-staticdata.patch" |
174 |
|
175 |
# do not try to save exported html to python sitedir |
176 |
epatch "${FILESDIR}/${PN}-1.1.8-html-export-path.patch" |
177 |
|
178 |
# fix import path in the main script for systemwide installation |
179 |
- epatch "${FILESDIR}/${PN}-1.1.11-import-pyfa.patch" |
180 |
+ epatch "${FILESDIR}/${PN}-1.15.1-import-pyfa.patch" |
181 |
touch __init__.py |
182 |
|
183 |
pyfa_make_configforced() { |
184 |
mkdir -p "${BUILD_DIR}" || die |
185 |
sed -e "s:%%SITEDIR%%:$(python_get_sitedir):" \ |
186 |
-e "s:%%EPREFIX%%:${EPREFIX}:" \ |
187 |
- "${FILESDIR}/configforced.py" > "${BUILD_DIR}/configforced.py" |
188 |
+ "${FILESDIR}/configforced-1.15.1.py" > "${BUILD_DIR}/configforced.py" |
189 |
sed -e "s:%%SITEDIR%%:$(python_get_sitedir):" \ |
190 |
pyfa.py > "${BUILD_DIR}/pyfa" |
191 |
} |
192 |
@@ -63,7 +63,7 @@ src_install() { |
193 |
pyfa_py_install() { |
194 |
local packagedir=$(python_get_sitedir)/${PN} |
195 |
insinto "${packagedir}" |
196 |
- doins -r eos gui icons service utils config*.py __init__.py gpl.txt |
197 |
+ doins -r eos gui service utils config*.py __init__.py |
198 |
[[ -e info.py ]] && doins info.py # only in zip releases |
199 |
doins "${BUILD_DIR}/configforced.py" |
200 |
python_doscript "${BUILD_DIR}/pyfa" |
201 |
@@ -72,12 +72,19 @@ src_install() { |
202 |
python_foreach_impl pyfa_py_install |
203 |
|
204 |
insinto /usr/share/${PN} |
205 |
- doins -r staticdata |
206 |
+ doins eve.db |
207 |
+ |
208 |
+ einfo "Compressing images ..." |
209 |
+ pushd imgs > /dev/null || die |
210 |
+ zip -r imgs.zip * || die "zip failed" |
211 |
+ doins imgs.zip |
212 |
+ popd > /dev/null || die |
213 |
+ |
214 |
dodoc README.md |
215 |
insinto /usr/share/icons/hicolor/32x32/apps |
216 |
- doins icons/pyfa.png |
217 |
+ doins imgs/gui/pyfa.png |
218 |
insinto /usr/share/icons/hicolor/64x64/apps |
219 |
- newins icons/pyfa64.png pyfa.png |
220 |
+ newins imgs/gui/pyfa64.png pyfa.png |
221 |
domenu "${FILESDIR}/${PN}.desktop" |
222 |
} |