Skip to content

Commit 82a2c5c

Browse files
committed
Add AppStream data, bump size of included sgt-launcher.png to be AppStream compliant
1 parent 7d9e539 commit 82a2c5c

File tree

5 files changed

+74
-4
lines changed

5 files changed

+74
-4
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- Copyright 2017 Sean Davis <[email protected]> -->
3+
<component type="desktop-application">
4+
​ <id>sgt-launcher.desktop</id>
5+
​ <metadata_license>CC0-1.0</metadata_license>
6+
​ <project_license>GPL-3.0+</project_license>
7+
​ <name>SGT Puzzles Collection</name>
8+
​ <_summary>Launcher for Simon Tatham's Portable Puzzle Collection</_summary>
9+
10+
​ <description>
11+
​ <_p>SGT Puzzles Collection is a simple-to-use launcher for Simon Tatham's Portable Puzzle Collection.</_p>
12+
​ <_p>The collection is presented as a related but diverse set of logic games. Each game is displayed in the launcher window with simplified controls.</_p>
13+
​ </description>
14+
15+
​ <screenshots>
16+
​ <screenshot type="default">
17+
​ <_caption>The launcher window</_caption>
18+
​ <image>https://screenshots.smdavis.us/sgt-launcher/sgt-launcher-01.png</image>
19+
​ </screenshot>
20+
​ <screenshot>
21+
<_caption>Playing a short game of Galaxies</_caption>
22+
​ <image>https://screenshots.smdavis.us/sgt-launcher/sgt-launcher-02.png</image>
23+
​ </screenshot>
24+
​ </screenshots>
25+
26+
​ <url type="homepage">https://launchpad.net/sgt-launcher</url>
27+
28+
​ <provides>
29+
​ <binary>sgt-launcher</binary>
30+
​ </provides>
31+
32+
​ <releases>
33+
​ <release version="0.2.2" date="2017-01-28">
34+
​ <description>
35+
​ <_p>Non-existent launchers are no longer displayed. The application launcher now links to the correct binary.</_p>
36+
​ </description>
37+
​ </release>
38+
​ </releases>
39+
​</component>

data/media/sgt-launcher.png

271 Bytes
Loading

po/sgt-launcher.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2017-01-28 13:02-0500\n"
11+
"POT-Creation-Date: 2017-01-28 16:20-0500\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"

setup.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import os
1818
import sys
19+
import subprocess
1920

2021
from gi.repository import GLib
2122

@@ -191,6 +192,34 @@ def update_desktop_file(filename, script_path):
191192
sys.exit(1)
192193

193194

195+
def write_appdata_file(filename_in):
196+
filename_out = filename_in.rstrip('.in')
197+
cmd = ["intltool-merge", "-x", "-d", "po", filename_in, filename_out]
198+
print(" ".join(cmd))
199+
subprocess.call(cmd, shell=False)
200+
201+
202+
def remove_appdata_in(root, target_data):
203+
appdata_directory = os.path.normpath(
204+
os.path.join(root, target_data, 'share', 'sgt-launcher',
205+
'appdata'))
206+
if not os.path.exists(appdata_directory):
207+
return
208+
209+
appdata_in = os.path.join(appdata_directory,
210+
"sgt-launcher.appdata.xml.in")
211+
if os.path.exists(appdata_in):
212+
os.remove(appdata_in)
213+
214+
if len(os.listdir(appdata_directory)) == 0:
215+
print(("Removing empty directory: %s" % appdata_directory))
216+
os.rmdir(appdata_directory)
217+
218+
219+
# Update AppData with latest translations first.
220+
write_appdata_file("data/appdata/sgt-launcher.appdata.xml.in")
221+
222+
# Build the replacement launchers
194223
build_launchers()
195224

196225

@@ -247,10 +276,11 @@ def run(self):
247276
print(("Desktop File: %s\n" % desktop_file))
248277
move_icon_file(self.root, target_data, self.prefix)
249278
update_desktop_file(desktop_file, script_path)
279+
remove_appdata_in(self.root, target_data)
250280

251281
DistUtilsExtra.auto.setup(
252282
name='sgt-launcher',
253-
version='0.2.1',
283+
version='0.2.2',
254284
license='GPL-3+',
255285
author='Sean Davis',
256286
author_email='[email protected]',
@@ -261,7 +291,8 @@ def run(self):
261291
url='https://launchpad.net/sgt-launcher',
262292
data_files=[
263293
('games', ['bin/sgt-launcher']),
264-
('share/man/man1', ['sgt-launcher.1'])
294+
('share/man/man1', ['sgt-launcher.1']),
295+
('share/appdata', ['data/appdata/sgt-launcher.appdata.xml'])
265296
],
266297
cmdclass={'install': InstallAndUpdateDataDirectory}
267298
)

sgtlauncher_lib/sgtlauncherconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# files). By default, this is ../data, relative your trunk layout
2424
__sgtlauncher_data_directory__ = '../data/'
2525
__license__ = 'GPL-3+'
26-
__version__ = '0.2.1'
26+
__version__ = '0.2.2'
2727

2828
import os # nopep8
2929

0 commit comments

Comments
 (0)