Skip to content

Commit

Permalink
qmake|Snowberry: Launcher script and .desktop file respect config.pri
Browse files Browse the repository at this point in the history
The launch-doomsday script and the .desktop file for starting the script
are now generated by qmake so that their contents reflect the directories
configured in config.pri. (patch by vvv1)

Added the configuration variable PYTHON for manually specifying which
Python interpreter to use. The default (not specified) assumes that
Python can be found on the system path.
  • Loading branch information
skyjake committed Mar 8, 2012
1 parent de6b747 commit 7b3bda1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 26 deletions.
4 changes: 2 additions & 2 deletions distrib/linux/doomsday-engine.desktop
Expand Up @@ -3,8 +3,8 @@ Encoding=UTF-8
Name=Doomsday Engine
Comment=Doom/Heretic/Hexen with enhanced graphics
Categories=Game;ActionGame;
Exec=/usr/bin/launch-doomsday
Exec=BIN_DIR/launch-doomsday
Terminal=false
Type=Application
Icon=/usr/share/doomsday/snowberry/graphics/snowberry.png
Icon=SB_DIR/graphics/snowberry.png

10 changes: 0 additions & 10 deletions distrib/platform_release.py
Expand Up @@ -248,16 +248,6 @@ def linux_release():

os.chdir(LAUNCH_DIR)

# Generate a launcher script.
f = file('linux/launch-doomsday', 'wt')
print >> f, """#!/usr/bin/python
import os, sys
os.chdir('/usr/share/doomsday/snowberry')
sys.path += '.'
import snowberry"""
f.close()

def clean_products():
# Remove previously built deb packages.
os.system('rm -f ../doomsday*.deb ../doomsday*.changes ../doomsday*.tar.gz ../doomsday*.dsc')
Expand Down
30 changes: 20 additions & 10 deletions doomsday/build/build.pro
Expand Up @@ -10,7 +10,7 @@ include(../config.pri)

# Update the PK3 files.
deng_packres {
system(cd $$PWD/scripts/ && python packres.py --quiet \"$$OUT_PWD/..\")
system(cd $$PWD/scripts/ && $$PYTHON packres.py --quiet \"$$OUT_PWD/..\")
}

# Install the launcher.
Expand Down Expand Up @@ -51,17 +51,27 @@ deng_snowberry {
$${SB_ROOT}/plugins/wizard.py
plugins.path = $$SB_DIR/plugins

# Include the launch script if it exists.
LAUNCHER = ../../distrib/linux/launch-doomsday
exists($$LAUNCHER) {
launch.files = $$LAUNCHER
launch.path = $$DENG_BIN_DIR
INSTALLS += launch
# Make may not have yet created the output directory at this point.
system(mkdir -p \"$$OUT_PWD\")

message(Installing the launch-doomsday script.)
}
# Generate a script for starting the laucher.
LAUNCH_FILE = launch-doomsday
!system(sed \"s:PYTHON:$$PYTHON:; s:SB_DIR:$$SB_DIR:\" \
<\"../../distrib/linux/$$LAUNCH_FILE\" \
>\"$$OUT_PWD/$$LAUNCH_FILE\" && \
chmod 755 \"$$OUT_PWD/$$LAUNCH_FILE\"): error(Can\'t build $$LAUNCH_FILE)
launch.files = $$OUT_PWD/$$LAUNCH_FILE
launch.path = $$DENG_BIN_DIR

INSTALLS += conf plugins sb
# Generate a .desktop file for the applications menu.
DESKTOP_FILE = doomsday-engine.desktop
!system(sed \"s:BIN_DIR:$$DENG_BIN_DIR:; s:SB_DIR:$$SB_DIR:\" \
<\"../../distrib/linux/$$DESKTOP_FILE\" \
>\"$$OUT_PWD/$$DESKTOP_FILE\"): error(Can\'t build $$DESKTOP_FILE)
desktop.files = $$OUT_PWD/$$DESKTOP_FILE
desktop.path = $$PREFIX/share/applications

INSTALLS += conf plugins sb launch desktop
}

deng_aptunstable {
Expand Down
17 changes: 17 additions & 0 deletions doomsday/config.pri
Expand Up @@ -8,6 +8,10 @@
# NOTE: The PREFIX option should always be specified on the qmake command
# line, as it is checked before config_user.pri is read.
#
# User-definable variables:
# PREFIX Install prefix for Unix (specify on qmake command line)
# PYTHON Path of the Python interpreter binary
#
# CONFIG options for Doomsday:
# - deng_32bitonly Only do a 32-bit build (no 64-bit)
# - deng_aptstable Include the stable apt repository .list
Expand Down Expand Up @@ -166,6 +170,19 @@ exists(config_user.pri) {
include(config_user.pri)
}

# System Tools ---------------------------------------------------------------

# See if Python is overridden.
isEmpty(PYTHON) {
unix:!macx {
exists(/usr/bin/python): PYTHON = /usr/bin/python
exists(/usr/local/bin/python): PYTHON = /usr/local/bin/python
}
# Assume user has python on the path.
echo(Using Python on system path.)
PYTHON = python
}

# Apply deng_* Configuration -------------------------------------------------

deng_nofixedasm {
Expand Down
5 changes: 1 addition & 4 deletions doomsday/engine/engine.pro
Expand Up @@ -663,7 +663,7 @@ win32 {
}
else:unix:!macx {
# Generic Unix installation.
INSTALLS += target data startupdata startupgfx startupfonts desktop readme
INSTALLS += target data startupdata startupgfx startupfonts readme

target.path = $$DENG_BIN_DIR

Expand All @@ -672,9 +672,6 @@ else:unix:!macx {
startupfonts.path = $$DENG_DATA_DIR/fonts
startupgfx.path = $$DENG_DATA_DIR/graphics

desktop.files = ../../distrib/linux/doomsday-engine.desktop
desktop.path = $$PREFIX/share/applications

readme.files = ../doc/output/doomsday.6
readme.path = $$PREFIX/share/man/man6
}

0 comments on commit 7b3bda1

Please sign in to comment.