[game-data-packager] 01/07: build new binary package doom2-masterlevels #776279

Alexandre Detiste detiste-guest at moszumanska.debian.org
Thu Mar 26 15:15:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

detiste-guest pushed a commit to branch master
in repository game-data-packager.

commit 2432cbfc286ba7856eed9992d519f907a8aa8acd
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Wed Mar 18 10:38:28 2015 +0100

    build new binary package doom2-masterlevels #776279
    
    starting these levels manually is really a pain
    one has to lookup the correct map number for
    each .wad
---
 .gitignore                         |   1 +
 Makefile                           |   3 +-
 data/doom2.yaml                    |   2 +
 debian/changelog                   |   2 +
 debian/control                     |  19 +++-
 debian/copyright                   |   1 +
 debian/doom2-masterlevels.install  |   1 +
 debian/doom2-masterlevels.manpages |   1 +
 debian/rules                       |   2 +
 doc/doom2-masterlevels.6           |  24 +++++
 runtime/doom2-masterlevels.desktop |   9 ++
 runtime/doom2-masterlevels.py      | 197 +++++++++++++++++++++++++++++++++++++
 12 files changed, 259 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 609a123..33ae78f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
 /debian/*.debhelper.log
 /debian/*.substvars
 /debian/game-data-packager/
+/debian/doom2-masterlevels/
 /out/
 __pycache__/
 *.deb
diff --git a/Makefile b/Makefile
index ce607a2..dbb9196 100644
--- a/Makefile
+++ b/Makefile
@@ -62,13 +62,12 @@ clean:
 	rm -f ./out/*.png
 	rm -f ./out/*.svgz
 	rm -f ./out/*.json
-	rm -f ./out/*.yaml
 	rm -rf game_data_packager/__pycache__
 	for d in $(DIRS); do [ ! -d "$$d" ]  || rmdir "$$d"; done
 
 check:
 	LC_ALL=C GDP_UNINSTALLED=1 PYTHONPATH=. python3 -m game_data_packager.check_syntax
-	LC_ALL=C pyflakes3 game_data_packager/*.py game_data_packager/*/*.py || :
+	LC_ALL=C pyflakes3 game_data_packager/*.py game_data_packager/*/*.py runtime/*.py || :
 
 # Requires additional setup, so not part of "make check"
 manual-check:
diff --git a/data/doom2.yaml b/data/doom2.yaml
index c3e778e..685405f 100644
--- a/data/doom2.yaml
+++ b/data/doom2.yaml
@@ -47,6 +47,8 @@ packages:
     steam:
       id: 9160
       path: "common/Master Levels of Doom"
+    debian:
+      recommends: doom2-masterlevels
     install_to: usr/share/games/doom
     install:
     - attack.wad
diff --git a/debian/changelog b/debian/changelog
index be1c3d7..c68fda5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ game-data-packager (41) UNRELEASED; urgency=medium
   * fix LGeneral
   * fix Descent 1 Demo download, add assert
   * recommends gargoyle-free | frotz for Z-code text games
+  * generate new binary package 'doom2-masterlevels',
+    a GUI launcher for use with doom2-masterlevels-wad (Closes: #776279)
 
  -- Simon McVittie <smcv at debian.org>  Tue, 17 Mar 2015 11:51:58 +0100
 
diff --git a/debian/control b/debian/control
index f110353..3178856 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,6 @@ Build-Depends:
  dh-python,
  fakeroot,
  imagemagick,
- m4,
  pyflakes,
  python3,
  python3-debian,
@@ -76,3 +75,21 @@ Description: Installer for game data files
   * Theme Hospital
   * Tyrian
   * Wolfenstein 3D, Spear of Destiny and Return to Castle Wolfenstein
+
+Package: doom2-masterlevels
+Depends: chocolate-doom | doom-engine,
+	doom2-masterlevels-wad,
+	python3,
+	python3-gi,
+	gir1.2-gtk-3.0,
+	${python3:Depends},
+	${misc:Depends},
+Architecture: all
+Multi-Arch: foreign
+Description: graphical launcher for DOOM II Master Levels
+ This tool is graphical interface that let you
+ choose one of DOOM II's Master Levels, read it's description
+ and start it with the engine of your choice.
+ .
+ This replicates doomit.exe functionality
+ that was shipped with the game.
diff --git a/debian/copyright b/debian/copyright
index ff25a62..cb841f6 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -15,6 +15,7 @@ License: GPL-2
 Files:
  game_data_packager/*.py
  game_data_packager/*/*.py
+ runtime/*
 Copyright:
  © 2014-2015 Simon McVittie
  © 2015 Alexandre Detiste
diff --git a/debian/doom2-masterlevels.install b/debian/doom2-masterlevels.install
new file mode 100644
index 0000000..0a313f1
--- /dev/null
+++ b/debian/doom2-masterlevels.install
@@ -0,0 +1 @@
+runtime/doom2-masterlevels.desktop usr/share/applications
diff --git a/debian/doom2-masterlevels.manpages b/debian/doom2-masterlevels.manpages
new file mode 100644
index 0000000..b86947d
--- /dev/null
+++ b/debian/doom2-masterlevels.manpages
@@ -0,0 +1 @@
+doc/doom2-masterlevels.6
diff --git a/debian/rules b/debian/rules
index 65ca632..91b0774 100755
--- a/debian/rules
+++ b/debian/rules
@@ -27,6 +27,8 @@ override_dh_auto_clean:
 override_dh_install:
 	dh_install
 	echo 'GAME_PACKAGE_VERSION = """$(DEB_VERSION)"""' > debian/game-data-packager/usr/share/games/game-data-packager/game_data_packager/version.py
+	install -D -m755 runtime/doom2-masterlevels.py debian/doom2-masterlevels/usr/games/doom2-masterlevels
+	install -D -m644 out/doom-common.png debian/doom2-masterlevels/usr/share/pixmaps/doom2-masterlevels.png
 
 override_dh_installdocs:
 	dh_installdocs -XTODO
diff --git a/doc/doom2-masterlevels.6 b/doc/doom2-masterlevels.6
new file mode 100644
index 0000000..44f6d35
--- /dev/null
+++ b/doc/doom2-masterlevels.6
@@ -0,0 +1,24 @@
+.TH doom2-master-levels 6 2015-04-18
+
+.SH NAME
+doom2\-masterlevels \- graphical launcher for DOOM II Master Levels
+.
+.SH SYNOPSIS
+.B doom2\-masterlevels
+
+.SH DESCRIPTION
+This tool is graphical interface that let you
+choose one of DOOM II's Master Levels, read it's description
+and start it with the engine of your choice.
+
+.SH OPTIONS
+This tool is not realy meant to be run from the command line
+and take no option; you may want to call
+.B doom
+directly instead if you want to pass some custom option.
+
+.SH SEE ALSO
+\fIdoom\fP(6)
+
+.SH AUTHOR
+Copyright \(co 2015 Alexandre Detiste \fI<alexandre at detiste.be>\fP
diff --git a/runtime/doom2-masterlevels.desktop b/runtime/doom2-masterlevels.desktop
new file mode 100644
index 0000000..cb95511
--- /dev/null
+++ b/runtime/doom2-masterlevels.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Doom 2: Master Levels
+GenericName=First Person Shooter Game
+Exec=doom2-masterlevels
+Icon=doom2-masterlevels
+Terminal=false
+Type=Application
+Categories=Game
+Keywords=launcher;doomit
diff --git a/runtime/doom2-masterlevels.py b/runtime/doom2-masterlevels.py
new file mode 100755
index 0000000..9ff3bf1
--- /dev/null
+++ b/runtime/doom2-masterlevels.py
@@ -0,0 +1,197 @@
+#!/usr/bin/python3
+# encoding=utf-8
+#
+# Copyright © 2015 Alexandre Detiste <alexandre at detiste.be>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# You can find the GPL license text on a Debian system under
+# /usr/share/common-licenses/GPL-2
+
+import gi
+import os
+import subprocess
+
+gi.require_version('Gtk', '3.0')
+from gi.repository import Gtk, Pango
+
+map = None
+# wad : (warp, longname,  'http://doomwiki.org/wiki/' + url)
+levels = {
+    'attack.wad':   ( 1, 'Attack'                                 , 'MAP01:_Attack_(Master_Levels)'),
+    'blacktwr.wad': (25, 'Black Tower'                            , 'MAP25:_Black_Tower_(Master_Levels)'),
+    'bloodsea.wad': ( 7, 'Bloodsea Keep'                          , 'MAP07:_Bloodsea_Keep_(Master_Levels)'),
+    'canyon.wad':   ( 1, 'Canyon'                                 , 'MAP01:_Canyon_(Master_Levels)'),
+    'catwalk.wad':  ( 1, 'The Catwalk'                            , 'MAP01:_The_Catwalk_(Master_Levels)'),
+    'combine.wad':  ( 1, 'The Combine'                            , 'MAP01:_The_Combine_(Master_Levels)'),
+    'fistula.wad':  ( 1, 'The Fistula'                            , 'MAP01:_The_Fistula_(Master_Levels)'),
+    'garrison.wad': ( 1, 'The Garrison'                           , 'MAP01:_The_Garrison_(Master_Levels)'),
+    'geryon.wad':   ( 8, 'Geryon: 6th Canto of Inferno'           , 'MAP08:_Geryon_(Master_Levels)'),
+    'mephisto.wad': ( 7, "Mephisto's Maosoleum"                   , "MAP07:_Mephisto%27s_Maosoleum_(Master_Levels)"),
+    'manor.wad':    ( 1, 'Titan Manor'                            , 'MAP01:_Titan_Manor_(Master_Levels)'),
+    'minos.wad':    ( 5, "Minos' Judgement: 4th Canto of Inferno" , "MAP05:_Minos%27_Judgement_(Master_Levels)"),
+    'nessus.wad':   ( 7, 'Nessus: 5th Canto of Inferno'           , "MAP07:_Nessus_(Master_Levels)"),
+    'paradox.wad':  ( 1, 'Paradox'                                , 'MAP01:_Paradox_(Master_Levels)'),
+    'subspace.wad': ( 1, 'Subspace'                               , 'MAP01:_Subspace_(Master_Levels)'),
+    'subterra.wad': ( 1, 'Subterra'                               , 'MAP01:_Subterra_(Master_Levels)'),
+    'teeth.wad':    (31, 'The Express Elevator to Hell'           , 'MAP31:_The_Express_Elevator_to_Hell_-_teeth.wad_(Master_Levels)'),
+    'teeth.wad*':   (32, 'Bad Dream'                              , 'MAP32:_Bad_Dream_-_teeth.wad_(Master_Levels)'),
+    'ttrap.wad':    ( 1, 'Trapped on Titan'                       , 'MAP01:_Trapped_on_Titan_(Master_Levels)'),
+    'vesperas.wad': ( 9, 'Vesperas: 7th Canto of Inferno'         , 'MAP09:_Vesperas_(Master_Levels)'),
+    'virgil.wad':   ( 3, "Virgil's Lead: 3rd Canto of Inferno"    , "MAP03:_Virgil%27s_Lead_(Master_Levels)"),
+}
+
+window = Gtk.Window()
+window.set_default_size(1020, 800)
+window.connect("destroy", lambda q: Gtk.main_quit())
+
+grid = Gtk.Grid()
+grid.set_row_spacing(5)
+grid.set_column_spacing(5)
+window.add(grid)
+
+# level list
+games = Gtk.ListStore(str, int)
+description = dict()
+for wad in sorted(levels.keys()):
+     game = os.path.splitext(os.path.basename(wad))[0]
+     games.append([game, levels[wad][0] ])
+     txt = '/usr/share/doc/doom2-masterlevels-wad/%s.txt' % game
+     try:
+         with open(txt, 'r', encoding='latin1') as f:
+             description[game] = f.read()
+     except (PermissionError, FileNotFoundError):
+         description[game] = "failed to read " + txt
+
+treeview = Gtk.TreeView(model=games)
+grid.attach(treeview, 0, 0, 1, 6)
+
+treeviewcolumn = Gtk.TreeViewColumn("Wad")
+treeview.append_column(treeviewcolumn)
+cellrenderertext = Gtk.CellRendererText()
+treeviewcolumn.pack_start(cellrenderertext, True)
+treeviewcolumn.add_attribute(cellrenderertext, "text", 0)
+
+treeviewcolumn = Gtk.TreeViewColumn("Map")
+treeview.append_column(treeviewcolumn)
+cellrenderertext = Gtk.CellRendererText()
+treeviewcolumn.pack_start(cellrenderertext, True)
+treeviewcolumn.add_attribute(cellrenderertext, "text", 1)
+
+def tooltip_query(treeview, x, y, mode, tooltip):
+    path = treeview.get_path_at_pos(x, y - 30) # FIXME
+    if path:
+       treepath, column = path[:2]
+       model = treeview.get_model()
+       iter = model.get_iter(treepath)
+       tooltip.set_text(levels[ model[iter][0] + '.wad' ][1])
+    return True
+
+treeview.connect("query-tooltip", tooltip_query)
+treeview.set_tooltip_column(0)
+
+
+# header
+label = Gtk.Label()
+label.set_markup("<span size='xx-large'>Doom II Master Levels</span>")
+grid.attach(label, 1, 0, 1, 1)
+
+logo = Gtk.Image()
+logo.set_from_file('/usr/share/pixmaps/doom2-masterlevels.png')
+grid.attach(logo, 2, 0, 1, 1)
+
+# description
+scrolledwindow = Gtk.ScrolledWindow()
+scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+grid.attach(scrolledwindow, 1, 1, 2, 1)
+
+textbuffer = Gtk.TextBuffer()
+textbuffer.set_text('Please select a map from the list on the left')
+
+textview = Gtk.TextView(buffer=textbuffer)
+textview.set_vexpand(True)
+textview.set_hexpand(True)
+textview.set_property('editable', False)
+textview.modify_font(Pango.FontDescription('Monospace 11'))
+scrolledwindow.add(textview)
+
+# difficulty
+difflabel = Gtk.Label("Choose your difficulty")
+grid.attach(difflabel, 1, 2, 2, 1)
+
+diffgrid = Gtk.Grid()
+diffradio = Gtk.RadioButton(group=None, label="1)  I'm too young to die")
+diffgrid.attach(diffradio, 0, 0, 1, 1)
+for diff in ["2)  Hey, Not too Rough",
+             "3)  Hurt me plenty",
+             "4)  Ultra Violence",
+             "5)  Nightmare!"]:
+    radiobutton = Gtk.RadioButton(group=diffradio, label=diff)
+    if diff[0] == '3':
+        radiobutton.set_active(True)
+    diffgrid.attach(radiobutton, 0, int(diff[0]), 1, 1)
+grid.attach(diffgrid, 1, 3, 2, 1)
+
+# engine
+label = Gtk.Label("Choose your engine")
+grid.attach(label, 1, 4, 2, 1)
+radiogrid = Gtk.Grid()
+default = os.readlink('/etc/alternatives/doom')
+radiobuttonDefault = Gtk.RadioButton(group=None, label="%s (default)" % default)
+radiogrid.attach(radiobuttonDefault, 0, 0, 1, 1)
+i = 1
+proc = subprocess.Popen(['update-alternatives', '--list', 'doom'], stdout=subprocess.PIPE, universal_newlines=True)
+
+for alternative in proc.stdout:
+    alternative = alternative.strip()
+    if alternative == default:
+        continue
+    radiobutton = Gtk.RadioButton(group=radiobuttonDefault, label=alternative)
+    i += 1
+    radiogrid.attach(radiobutton, 0, i, i, 1)
+grid.attach(radiogrid, 1, 5, 2, 1)
+
+
+# Run !
+button1 = Gtk.Button(label="Run")
+grid.attach(button1, 1, 6, 1, 1)
+button2 = Gtk.Button(label="Exit")
+grid.attach(button2, 2, 6, 1, 1)
+
+def select_game(event):
+    global game, map
+    (model, pathlist) = treeview.get_selection().get_selected_rows()
+    for path in pathlist:
+        tree_iter = model.get_iter(path)
+        game = model.get_value(tree_iter,0)
+        map = model.get_value(tree_iter,1)
+        textbuffer.set_text(description[game])
+
+def run_game(event):
+    for button in diffradio.get_group():
+        if button.get_active():
+            difficulty = button.get_label()[0]
+            break
+    for button in radiobuttonDefault.get_group():
+        if button.get_active():
+            engine = button.get_label().split(' ')[0]
+            break
+    if 'doomsday' in engine:
+        engine = 'doomsday -game doom2'
+    if map:
+        os.system('%s -file /usr/share/games/doom/%s.wad -warp %s -skill %s' % (engine, game, map, difficulty))
+
+treeview.connect("cursor-changed", select_game)
+button1.connect("clicked", run_game)
+button2.connect("clicked", Gtk.main_quit)
+
+window.show_all()
+
+Gtk.main()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list