[pkg-fgfs-crew] [flightgear] 03/03: Apply patch by Rebecca Palmer (incl. update to 2.12.1)
Markus Wanner
markus_wanner-guest at moszumanska.debian.org
Tue Jan 21 21:35:05 UTC 2014
This is an automated email from the git hooks/post-receive script.
markus_wanner-guest pushed a commit to branch master
in repository flightgear.
commit 20673a23f75a394c9cfe911fa697a52a6e899a8a
Author: Markus Wanner <markus at bluegap.ch>
Date: Tue Jan 21 22:33:48 2014 +0100
Apply patch by Rebecca Palmer (incl. update to 2.12.1)
* New upstream release.
* Install the icons (based on code by Saikrishna Arcot).
(Not a complete fix for 713924/LP908153 as it only
sets the menu/Dash icon, not the running window's icon,
but better than nothing).
* Disable screensaver while running. Closes: LP#793599.
* Remove outdated README.Debian.
* Fix Terrasync rounding error.
* Always set Terrasync directory.
---
debian/README.Debian | 11 --
debian/changelog | 18 ++-
debian/control | 5 +-
debian/flightgear.desktop | 2 +-
debian/patches/screensaver-control.diff | 217 +++++++++++++++++++++++++++++
debian/patches/series | 3 +
debian/patches/terrasync-directory.diff | 25 ++++
debian/patches/terrasync-fix-rounding.diff | 17 +++
debian/rules | 8 ++
9 files changed, 289 insertions(+), 17 deletions(-)
diff --git a/debian/README.Debian b/debian/README.Debian
deleted file mode 100644
index b33bd4c..0000000
--- a/debian/README.Debian
+++ /dev/null
@@ -1,11 +0,0 @@
-Flight Gear for Debian
-----------------------
-
-Start Flight Gear with fgfs.
-
-Additional scenery is available at http://www.flightgear.org/.
-The tile files should be unpacked into /usr/share/games/FlightGear/Scenery.
-The scenery files include a SharedModels.tgz, which may have extra/updated
-models used in some scenery tiles. Unpack this into /usr/share/games/FlightGear.
-
- -- Ove Kaaven <ovek at arcticnet.no>
diff --git a/debian/changelog b/debian/changelog
index 380952d..758a9b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,13 +1,25 @@
-flightgear (2.12.0-2) UNRELEASED; urgency=low
+flightgear (2.12.1-1) UNRELEASED; urgency=low
+ [ Markus Wanner ]
* Adjust B-D to allow building on kfreebsd-*. Closes: #724686.
* Add patch update-manpage.diff featuring some corrections for the fgfs
- manpage. Closes: 556362.
+ manpage. Closes: #556362.
* Drop unnecessary man page for gl-info. Closes: #698308.
* Drop README.Linux: it's outdated to the point of uselessness.
Closes: #574173.
- -- Markus Wanner <markus at bluegap.ch> Mon, 30 Sep 2013 20:30:44 +0200
+ [ Rebecca Palmer ]
+ * New upstream release.
+ * Install the icons (based on code by Saikrishna Arcot).
+ (Not a complete fix for 713924/LP908153 as it only
+ sets the menu/Dash icon, not the running window's icon,
+ but better than nothing).
+ * Disable screensaver while running. Closes: LP#793599.
+ * Remove outdated README.Debian.
+ * Fix Terrasync rounding error.
+ * Always set Terrasync directory.
+
+ -- Markus Wanner <markus at bluegap.ch> Tue, 21 Jan 2014 22:31:02 +0100
flightgear (2.12.0-1) experimental; urgency=low
diff --git a/debian/control b/debian/control
index 027f1e3..db8e5dd 100644
--- a/debian/control
+++ b/debian/control
@@ -17,7 +17,8 @@ Build-Depends: debhelper (>= 9.20120417), libx11-dev, libxext-dev,
libsimgear-dev (>= 2.12.0~),
libsqlite3-dev,
libudev-dev [linux-any],
- libusbhid-dev [kfreebsd-any]
+ libusbhid-dev [kfreebsd-any],
+ libdbus-1-dev
Standards-Version: 3.9.4
Homepage: http://www.flightgear.org/
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/flightgear.git
@@ -25,7 +26,7 @@ Vcs-Git: git://anonscm.debian.org/collab-maint/flightgear.git
Package: flightgear
Architecture: any
-Depends: flightgear-data-all (>= 2.12.0~), ${shlibs:Depends},
+Depends: flightgear-data-all (>= 2.12.1~), ${shlibs:Depends},
${misc:Depends}
Description: Flight Gear Flight Simulator
FlightGear Flight Simulator (often shortened to FlightGear or FGFS)
diff --git a/debian/flightgear.desktop b/debian/flightgear.desktop
index 610381e..64caf95 100644
--- a/debian/flightgear.desktop
+++ b/debian/flightgear.desktop
@@ -9,4 +9,4 @@ Categories=Game;Simulation;
Comment=A flight simulator
Comment[pt]=Simulação de Vôo
Keywords=
-Icon=
+Icon=fgfs
diff --git a/debian/patches/screensaver-control.diff b/debian/patches/screensaver-control.diff
new file mode 100644
index 0000000..646d554
--- /dev/null
+++ b/debian/patches/screensaver-control.diff
@@ -0,0 +1,217 @@
+Description: Disable idle detection while running
+Bug-Ubuntu: https://launchpad.net/bugs/793599
+Author: Rebecca Palmer
+Forwarded: https://gitorious.org/fg/flightgear/merge_requests/1576
+
+As neither GNOME's nor KDE's screen locker monitors the joystick,
+they may blank/lock the screen while FlightGear is in use.
+This uses their DBus interface to turn them off.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3806ea0..f3540fb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -110,6 +110,7 @@ IF(APPLE)
+ list(APPEND PLATFORM_LIBS ${COCOA_LIBRARY} ${CORESERVICES_LIBRARY})
+
+ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
++ set(USE_DBUS_DEFAULT 1)
+ find_package(UDev)
+
+ if(UDEV_FOUND)
+@@ -141,6 +142,7 @@ option(ENABLE_RTI
+ option(ENABLE_PROFILE "Set to ON to build FlightGear with gperftools profiling support" OFF)
+ option(JPEG_FACTORY "Set to ON to build FlightGear with JPEG-factory support" OFF)
+ option(SYSTEM_SQLITE "Set to ON to build FlightGear with the system's SQLite3 library" OFF)
++option(USE_DBUS "Set to ON to build FlightGear with DBus screensaver interaction (default on Linux)" ${USE_DBUS_DEFAULT})
+
+ # additional utilities
+ option(ENABLE_FGADMIN "Set to ON to build the FGADMIN application (default)" ON)
+@@ -242,6 +244,23 @@ endif (SYSTEM_SQLITE)
+ # Sqlite always depends on the threading lib
+ list(APPEND SQLITE3_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
+
++## DBus setup
++
++if (USE_DBUS)
++ include(FindPkgConfig)
++ if (PKG_CONFIG_FOUND)
++ pkg_check_modules(DBUS dbus-1)
++ endif (PKG_CONFIG_FOUND) #if we don't have pkg-config, assume we don't have libdbus-1-dev either http://packages.debian.org/sid/libdbus-1-dev
++ if (DBUS_FOUND)
++ set(HAVE_DBUS 1)
++ message(STATUS "Using DBus")
++ include_directories( ${DBUS_INCLUDE_DIRS})
++ else()
++ message(STATUS "DBus not found, screensaver control disabled")
++ endif (DBUS_FOUND)
++else()
++endif (USE_DBUS)
++
+ find_package(PLIB REQUIRED puaux pu js fnt)
+
+ if (EMBEDDED_SIMGEAR)
+diff --git a/src/Include/config_cmake.h.in b/src/Include/config_cmake.h.in
+index 7f3ee6a..1485016 100644
+--- a/src/Include/config_cmake.h.in
++++ b/src/Include/config_cmake.h.in
+@@ -40,3 +40,5 @@
+ #cmakedefine FG_JPEG_SERVER
+
+ #cmakedefine SYSTEM_SQLITE
++
++#cmakedefine HAVE_DBUS
+diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt
+index aeade6a..9167ec9 100644
+--- a/src/Main/CMakeLists.txt
++++ b/src/Main/CMakeLists.txt
+@@ -23,6 +23,7 @@ set(SOURCES
+ util.cxx
+ positioninit.cxx
+ subsystemFactory.cxx
++ screensaver_control.cxx
+ ${RESOURCE_FILE}
+ )
+
+@@ -40,6 +41,7 @@ set(HEADERS
+ util.hxx
+ positioninit.hxx
+ subsystemFactory.hxx
++ screensaver_control.hxx
+ )
+
+ get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
+@@ -92,6 +94,9 @@ endif()
+ target_link_libraries(fgfs JSBSim)
+ endif()
+
++if(USE_DBUS)
++ target_link_libraries(fgfs ${DBUS_LIBRARIES})
++endif()
+ if(FG_HAVE_GPERFTOOLS)
+ include_directories(${GooglePerfTools_INCLUDE_DIR})
+ target_link_libraries(fgfs ${GooglePerfTools_LIBRARIES})
+diff --git a/src/Main/main.cxx b/src/Main/main.cxx
+index f64e0d3..40af6e2 100644
+--- a/src/Main/main.cxx
++++ b/src/Main/main.cxx
+@@ -65,6 +65,7 @@
+ #include "fg_os.hxx"
+ #include "fg_props.hxx"
+ #include "positioninit.hxx"
++#include "screensaver_control.hxx"
+ #include "subsystemFactory.hxx"
+
+ using namespace flightgear;
+@@ -365,6 +366,9 @@ int fgMainInit( int argc, char **argv ) {
+
+ fgOutputSettings();
+
++ //try to disable the screensaver
++ fgOSDisableScreensaver();
++
+ // pass control off to the master event handler
+ int result = fgOSMainLoop();
+
+diff --git a/src/Main/screensaver_control.cxx b/src/Main/screensaver_control.cxx
+new file mode 100644
+index 0000000..0af20eb
+--- /dev/null
++++ b/src/Main/screensaver_control.cxx
+@@ -0,0 +1,66 @@
++// screensaver_control.cxx -- disable the screensaver
++//
++// Written by Rebecca Palmer, December 2013.
++//
++// Copyright (C) 2013 Rebecca Palmer
++//
++// 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. See the GNU
++// General Public License for more details.
++//
++// You should have received a copy of the GNU General Public License
++// along with this program; if not, write to the Free Software
++// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++//
++// $Id$
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++#ifdef HAVE_DBUS
++#include <dbus/dbus.h>//Uses the low-level libdbus rather than GDBus/QtDBus to avoid adding more dependencies than necessary. http://dbus.freedesktop.org/doc/api/html/index.html
++#endif
++/** Attempt to disable the screensaver.
++*
++* Screensavers/powersavers often do not monitor the joystick, and it is hence advisable to disable them while FlightGear is running.
++* This function always exists, but currently only actually does anything on Linux, where it will disable gnome-screensaver/kscreensaver until FlightGear exits.
++*
++* The following might be useful to anyone wishing to add Windows support:
++* http://msdn.microsoft.com/en-us/library/windows/desktop/aa373233%28v=vs.85%29.aspx
++* http://msdn.microsoft.com/en-us/library/windows/desktop/aa373208%28v=vs.85%29.aspx (While this documentation says it only disables powersave, it is elsewhere reported to also disable screensaver)
++* http://msdn.microsoft.com/en-us/library/windows/desktop/dd405534%28v=vs.85%29.aspx
++*/
++void fgOSDisableScreensaver()
++{
++#ifdef HAVE_DBUS
++ DBusConnection *dbus_connection;
++ DBusMessage *dbus_inhibit_screenlock;
++ unsigned int window_id=1000;//fake-it doesn't seem to care
++ unsigned int inhibit_idle=8;//8=idle inhibit flag
++ const char *app_name="org.flightgear";
++ const char *inhibit_reason="Uses joystick input";
++
++ dbus_connection=dbus_bus_get(DBUS_BUS_SESSION,NULL);
++ dbus_connection_set_exit_on_disconnect(dbus_connection,FALSE);//Don't close us if we lose the DBus connection
++
++ //Two possible interfaces; we send on both, as that is easier than trying to determine which will work
++ //GNOME: https://people.gnome.org/~mccann/gnome-session/docs/gnome-session.html
++ dbus_inhibit_screenlock=dbus_message_new_method_call("org.gnome.SessionManager","/org/gnome/SessionManager","org.gnome.SessionManager","Inhibit");
++ dbus_message_append_args(dbus_inhibit_screenlock,DBUS_TYPE_STRING,&app_name,DBUS_TYPE_UINT32,&window_id,DBUS_TYPE_STRING,&inhibit_reason,DBUS_TYPE_UINT32,&inhibit_idle,DBUS_TYPE_INVALID);
++ dbus_connection_send(dbus_connection,dbus_inhibit_screenlock,NULL);
++
++ //KDE, GNOME 3.6+: http://standards.freedesktop.org/idle-inhibit-spec/0.1/re01.html
++ dbus_inhibit_screenlock=dbus_message_new_method_call("org.freedesktop.ScreenSaver","/ScreenSaver","org.freedesktop.ScreenSaver","Inhibit");
++ dbus_message_append_args(dbus_inhibit_screenlock,DBUS_TYPE_STRING,&app_name,DBUS_TYPE_STRING,&inhibit_reason,DBUS_TYPE_INVALID);
++ dbus_connection_send(dbus_connection,dbus_inhibit_screenlock,NULL);
++ dbus_connection_flush(dbus_connection);
++ //Currently ignores the reply; it would need to read it if we wanted to determine whether we've succeeded and/or allow explicitly re-enabling the screensaver
++ //Don't disconnect, that ends the inhibition
++#endif
++}
+diff --git a/src/Main/screensaver_control.hxx b/src/Main/screensaver_control.hxx
+new file mode 100644
+index 0000000..5f68145
+--- /dev/null
++++ b/src/Main/screensaver_control.hxx
+@@ -0,0 +1,24 @@
++// screensaver_control.hxx -- disable the screensaver
++//
++// Written by Rebecca Palmer, December 2013.
++//
++// Copyright (C) 2013 Rebecca Palmer
++//
++// 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. See the GNU
++// General Public License for more details.
++//
++// You should have received a copy of the GNU General Public License
++// along with this program; if not, write to the Free Software
++// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++//
++// $Id$
++
++
++void fgOSDisableScreensaver();
diff --git a/debian/patches/series b/debian/patches/series
index b72b0a0..f561d4e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,4 @@
update-manpage.diff
+screensaver-control.diff
+terrasync-directory.diff
+terrasync-fix-rounding.diff
diff --git a/debian/patches/terrasync-directory.diff b/debian/patches/terrasync-directory.diff
new file mode 100644
index 0000000..7815fdb
--- /dev/null
+++ b/debian/patches/terrasync-directory.diff
@@ -0,0 +1,25 @@
+Description: Always set Terrasync directory
+Author: Rebecca Palmer
+Bug-Debian: http://bugs.debian.org/252899
+Forwarded: https://gitorious.org/fg/flightgear/merge_requests/52
+
+This was previously done only if Terrasync was on, but this made it impossible
+to use the GUI dialog to turn it on for the first time in a fresh install
+--- flightgear-2.12.1.orig/src/Main/options.cxx
++++ flightgear-2.12.1/src/Main/options.cxx
+@@ -2041,7 +2041,6 @@ void Options::processOptions()
+ }
+
+ // terrasync directory fixup
+- if (fgGetBool("/sim/terrasync/enabled")) {
+ string terrasyncDir = fgGetString("/sim/terrasync/scenery-dir");
+ if (terrasyncDir.empty()) {
+ SGPath p(globals->get_fg_home());
+@@ -2058,6 +2057,7 @@ void Options::processOptions()
+ dd.create(0700);
+ }
+
++ if (fgGetBool("/sim/terrasync/enabled")) {
+ const string_list& scenery_paths(globals->get_fg_scenery());
+ if (std::find(scenery_paths.begin(), scenery_paths.end(), terrasyncDir) == scenery_paths.end()) {
+ // terrasync dir is not in the scenery paths, add it
diff --git a/debian/patches/terrasync-fix-rounding.diff b/debian/patches/terrasync-fix-rounding.diff
new file mode 100644
index 0000000..e7236da
--- /dev/null
+++ b/debian/patches/terrasync-fix-rounding.diff
@@ -0,0 +1,17 @@
+Description: Fix Terrasync rounding error
+Author: Rebecca Palmer
+Bug-Debian: http://bugs.debian.org/252899
+Forwarded: not-needed
+
+Pass the lat/long rounded down (as used in tile names and expected by terrasync, e.g. 40.7,-90.4 -> w091n40), instead of the default rounded-towards-0 (40.7,-90.4 -> w090n40).
+--- flightgear-2.12.1.orig/src/Scenery/tilemgr.cxx
++++ flightgear-2.12.1/src/Scenery/tilemgr.cxx
+@@ -382,7 +382,7 @@ void FGTileMgr::schedule_tiles_at(const
+ scheduled_visibility = range_m;
+ schedule_needed(current_bucket, range_m);
+ if (_terra_sync)
+- _terra_sync->schedulePosition(latitude,longitude);
++ _terra_sync->schedulePosition(floor(latitude),floor(longitude));
+ }
+ // save bucket
+ previous_bucket = current_bucket;
diff --git a/debian/rules b/debian/rules
index 5b0f5a2..27a26dd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -50,6 +50,14 @@ override_dh_auto_install:
# Remove empty directories
find $(CURDIR)/debian/flightgear -type d -empty -delete
+# Install icons
+ dh_installdirs --package=flightgear usr/share/pixmaps
+ cp -a icons/fg-48.png debian/flightgear/usr/share/pixmaps/fgfs.png
+ for size in 16 32 48 64 128 ; do \
+ dh_installdirs --package=flightgear usr/share/icons/hicolor/$${size}x$${size}/apps ; \
+ cp -a icons/fg-$$size.png debian/flightgear/usr/share/icons/hicolor/$${size}x$${size}/apps/fgfs.png ; \
+ done
+
override_dh_installdocs:
dh_installdocs
cp docs-mini/* debian/flightgear/usr/share/doc/flightgear || true
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/flightgear.git
More information about the pkg-fgfs-crew
mailing list