From ec9c3c75123d4be7a027551dae97af3b0534d60e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Nov 18 2013 13:23:25 +0000 Subject: Add a patch from upstream fixing crash on intro vid (rhbz#1031621) - Add an appdata file (rhbz#1031611) --- diff --git a/0001-Work-around-Java-crash-when-stopping-opening-video.patch b/0001-Work-around-Java-crash-when-stopping-opening-video.patch new file mode 100644 index 0000000..312f401 --- /dev/null +++ b/0001-Work-around-Java-crash-when-stopping-opening-video.patch @@ -0,0 +1,83 @@ +From 6c0fb53d12447f6c14ce75d8eb9edcf08402c2d0 Mon Sep 17 00:00:00 2001 +From: Mike Pope +Date: Sun, 22 Sep 2013 21:49:21 +0930 +Subject: [PATCH] Work around Java crash when stopping opening video. + +--- + src/net/sf/freecol/client/gui/Canvas.java | 10 ++++++++- + .../freecol/client/gui/video/VideoComponent.java | 24 ++++++++++++++++++++++ + 2 files changed, 33 insertions(+), 1 deletion(-) + +diff --git a/src/net/sf/freecol/client/gui/Canvas.java b/src/net/sf/freecol/client/gui/Canvas.java +index d4116f0..9f429bd 100644 +--- a/src/net/sf/freecol/client/gui/Canvas.java ++++ b/src/net/sf/freecol/client/gui/Canvas.java +@@ -931,7 +931,16 @@ public final class Canvas extends JDesktopPane { + if (frame != null && frame != comp) { + frame.dispose(); + } else { +- super.remove(comp); ++ // Java 1.7.0 as seen on Fedora with: ++ // Java version: 1.7.0_40 ++ // Java WM version: 24.0-b56 ++ // crashes here deep in the java libraries. ++ try { ++ super.remove(comp); ++ } catch (Exception e) { ++ logger.warning("Java crash"); ++ e.printStackTrace(); ++ } + } + repaint(updateBounds.x, updateBounds.y, updateBounds.width, updateBounds.height); + } +diff --git a/src/net/sf/freecol/client/gui/video/VideoComponent.java b/src/net/sf/freecol/client/gui/video/VideoComponent.java +index 189f4a8..d368248 100644 +--- a/src/net/sf/freecol/client/gui/video/VideoComponent.java ++++ b/src/net/sf/freecol/client/gui/video/VideoComponent.java +@@ -23,6 +23,8 @@ import java.awt.Insets; + import java.awt.event.MouseListener; + import java.util.LinkedList; + import java.util.List; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + import javax.swing.JPanel; + import javax.swing.border.Border; +@@ -38,6 +40,8 @@ import com.fluendo.player.Cortado; + */ + public class VideoComponent extends JPanel { + ++ private static final Logger logger = Logger.getLogger(VideoComponent.class.getName()); ++ + private final Cortado applet; + private List videoListeners = new LinkedList(); + +@@ -136,4 +140,25 @@ public class VideoComponent extends JPanel { + private Border createBorder() { + return FreeColImageBorder.imageBorder; + } ++ ++ // Override Component ++ ++ /** ++ * {@inheritDoc} ++ */ ++ public void removeNotify() { ++ applet.stop(); ++ applet.destroy(); ++ ++ // Java 1.7.0 as seen on Fedora with: ++ // Java version: 1.7.0_40 ++ // Java WM version: 24.0-b56 ++ // crashes here deep in the java libraries. ++ try { ++ super.removeNotify(); ++ } catch (Exception e) { ++ logger.warning("Mystery crash" + e); ++ e.printStackTrace(); ++ } ++ } + } +-- +1.8.4.2 + diff --git a/freecol.appdata.xml b/freecol.appdata.xml new file mode 100644 index 0000000..a046341 --- /dev/null +++ b/freecol.appdata.xml @@ -0,0 +1,28 @@ + + + freecol.desktop + CC0 + +

+ The FreeCol team aims to create an Open Source version of Colonization (released under the GPL). + At first we'll try to make an exact clone of Colonization. + The visuals will be brought up to date with more recent standards but will remain clean, simple and functional. + Certain new 'features' will be implemented but the gameplay and the rules will be exactly the same as the original game. + Examples of modern features are: an isometric map and multiplayer support. +

+

+ This clone will be developed incrementally and result in FreeCol 1.0.0 which will be an almost exact Colonization clone. + Incremental development basically means that we'll add features one at a time. + This allows us to have a running program at all times and also to release an unfinished but working game once in a while. +

+

+ Once FreeCol 1.0.0 is finished we'll start working towards FreeCol 2.0.0. + FreeCol 2 will go beyond the original Colonization and will have many new features, it will be an implementation of our (and our users') image of what Colonization 2 would have been. +

+
+ http://www.freecol.org/ + + http://www.freecol.org/images/screen-0.8.0-large.jpg + + freecol-developers@lists.sourceforge.net +
diff --git a/freecol.sh b/freecol.sh index 791b8f4..21125e1 100644 --- a/freecol.sh +++ b/freecol.sh @@ -12,7 +12,7 @@ set_javacmd check_java_env set_jvm_dirs -CLASSPATH=`build-classpath freecol commons-cli cortado jogg jorbis miglayout vorbisspi tritonus/tritonus_share` +CLASSPATH=`build-classpath freecol commons-cli cortado jogg jorbis miglayout` MAIN_CLASS="net.sf.freecol.FreeCol" set_options "-Xmx512M -Xincgc -Dsun.java2d.pmoffscreen=false" diff --git a/freecol.spec b/freecol.spec index e66e393..2886025 100644 --- a/freecol.spec +++ b/freecol.spec @@ -7,7 +7,7 @@ Name: freecol Version: 0.10.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Turn-based multi-player strategy game Group: Amusements/Games License: GPL+ @@ -15,9 +15,12 @@ URL: http://www.freecol.org/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}-src.zip Source1: %{name}.sh Source2: %{name}.desktop +Source3: freecol.appdata.xml Patch0: freecol-no-classpath-in-MF.patch # texlive makeindex disallows absolute paths, and file= gets turned into one Patch1: freecol-fix-makeindex-invocation.patch +# patch from upstream git +Patch2: 0001-Work-around-Java-crash-when-stopping-opening-video.patch BuildRequires: ant xml-commons-apis xml-commons-resolver BuildRequires: tetex-tex4ht desktop-file-utils fontpackages-devel BuildRequires: apache-commons-cli cortado jorbis miglayout @@ -69,6 +72,7 @@ project to include most accented latin characters. %setup -q -n %{name} %patch0 -p1 %patch1 -p1 +%patch2 -p1 # freecol normally builds against copies shipped with the source. Remove these # and symlink to the system versions of these. rm jars/* @@ -88,6 +92,7 @@ mkdir -p $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_javadir} mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name} mkdir -p $RPM_BUILD_ROOT%{_mandir}/man6 +mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scalable/apps @@ -117,6 +122,8 @@ desktop-file-install \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ %{SOURCE2} +install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/appdata + %post touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : @@ -137,6 +144,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/%{name} %{_javadir}/%{name}.jar %{_mandir}/man6/%{name}.6.gz +%{_datadir}/appdata %{_datadir}/applications/*%{name}.desktop %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg @@ -153,6 +161,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Mon Nov 18 2013 Hans de Goede - 0.10.7-3 +- Add a patch from upstream fixing crash on intro vid (rhbz#1031621) +- Add an appdata file (rhbz#1031611) + * Sat Aug 10 2013 Hans de Goede - 0.10.7-2 - Drop vorbisspi and tritonus Requires, since 0.10.7 freecol no longer needs these