From ec598c90c4b6b89b5cf6cfa0e3deef09d1b7270c8b87d6184f4d992e52b39dde Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 28 Dec 2016 19:58:31 +0000 Subject: [PATCH] - Restore basepk3.diff for proper search order OBS-URL: https://build.opensuse.org/package/show/games:tools/slade?expand=0&rev=4 --- basepk3.diff | 30 ++++++++++++++++++++++++++++++ slade.changes | 7 ++++++- slade.spec | 35 ++++++++++++++++++----------------- wxChar.patch | 23 ++++++++++++++++------- 4 files changed, 70 insertions(+), 25 deletions(-) create mode 100644 basepk3.diff diff --git a/basepk3.diff b/basepk3.diff new file mode 100644 index 0000000..b009158 --- /dev/null +++ b/basepk3.diff @@ -0,0 +1,30 @@ +From: Jan Engelhardt + +Search for the resource file in /usr/share/slade, and prefer ~/.slade +over anything else. +(DIR_RES is /usr/share/appinfo according to wxWidgets, +which is not used in Linux distros.) +--- + src/Archive/ArchiveManager.cpp | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +Index: SLADE-3.1.1.4/src/Archive/ArchiveManager.cpp +=================================================================== +--- SLADE-3.1.1.4.orig/src/Archive/ArchiveManager.cpp ++++ SLADE-3.1.1.4/src/Archive/ArchiveManager.cpp +@@ -138,14 +138,12 @@ bool ArchiveManager::init() + } + + // Find slade3.pk3 directory +- string dir_slade_pk3 = appPath("slade.pk3", DIR_RES); ++ string dir_slade_pk3 = appPath("slade.pk3", DIR_USER); + if (!wxFileExists(dir_slade_pk3)) + dir_slade_pk3 = appPath("slade.pk3", DIR_DATA); + if (!wxFileExists(dir_slade_pk3)) + dir_slade_pk3 = appPath("slade.pk3", DIR_APP); + if (!wxFileExists(dir_slade_pk3)) +- dir_slade_pk3 = appPath("slade.pk3", DIR_USER); +- if (!wxFileExists(dir_slade_pk3)) + dir_slade_pk3 = "slade.pk3"; + + // Open slade.pk3 diff --git a/slade.changes b/slade.changes index d95a96e..c1a28b9 100644 --- a/slade.changes +++ b/slade.changes @@ -1,9 +1,14 @@ +------------------------------------------------------------------- +Wed Dec 28 19:57:42 UTC 2016 - jengelh@inai.de + +- Restore basepk3.diff for proper search order + ------------------------------------------------------------------- Mon Dec 19 05:19:27 UTC 2016 - luke.nukem.jones@gmail.com - Update to version 3.1.1.4 - Remove patch basepk3.diff -- Add patch wxWidgets.diff +- Add patch wxChar.diff + Corrects an issue with conversion from wxString to wxChar in column sort diff --git a/slade.spec b/slade.spec index 8a99975..64a517b 100644 --- a/slade.spec +++ b/slade.spec @@ -23,16 +23,16 @@ Summary: An editor for DOOM maps and WAD/PK3 archives License: GPL-2.0+ Group: Amusements/Games/3D/Shoot Url: https://github.com/sirjuddington/SLADE -Source0: https://github.com/sirjuddington/%{name}/archive/SLADE-%{version}.tar.gz -Source1: slade.desktop -# PATCH-FIX-UPSTREAM Fix conversion from wxString to wxChar when using wxWidgets >= 3.0.2 -Patch0: wxChar.patch +Source: https://github.com/sirjuddington/%name/archive/SLADE-%version.tar.gz +Source2: slade.desktop +Patch1: basepk3.diff +Patch2: wxChar.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: ImageMagick BuildRequires: cmake BuildRequires: freeimage-devel BuildRequires: ftgl-devel BuildRequires: gcc-c++ -BuildRequires: ImageMagick BuildRequires: sfml2-devel BuildRequires: update-desktop-files BuildRequires: wxWidgets-3_0-devel @@ -50,29 +50,30 @@ game-specific formats, and even convert between some of them, or from/to other generic formats such as PNG. %prep -%setup -qn SLADE-3.1.1.4 -%patch0 -p1 +%setup -qn SLADE-%version +%patch -P 1 -P 2 -p1 %build %cmake -DUSE_WEBKIT_STARTPAGE=ON make %{?_smp_mflags} %install -install -Dm755 build/slade %{buildroot}%{_bindir}/slade -install -Dm644 build/slade.pk3 %{buildroot}%{_datadir}/slade3/slade.pk3 +b="%buildroot" +install -Dm755 build/slade "$b/%_bindir/slade" +install -Dm644 build/slade.pk3 "$b/%_datadir/slade3/slade.pk3" -convert build/msvc/slade.ico[0] -alpha on %{name}.png -install -D -p -m 644 %{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png +convert "build/msvc/slade.ico[0]" -alpha on "%name.png" +install -Dpm0644 "%name.png" "$b/%_datadir/pixmaps/%name.png" pushd misc for txtfile in detect_functions.txt old-simage-formats.txt stuff.txt udmf11.txt \ udmf_zdoom.txt usdf.txt usdf_zdoom.txt do - install -Dm644 $txtfile %{buildroot}%{_datadir}/slade3/misc/$txtfile + install -Dm644 $txtfile "$b/%_datadir/slade3/misc/$txtfile" done popd -install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop +install -Dm644 "%_sourcedir/slade.desktop" "$b/%_datadir/applications/%name.desktop" %post %desktop_database_post @@ -83,9 +84,9 @@ install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop %files %defattr(-,root,root) %doc gpl-2.0.txt README.md -%{_bindir}/slade -%{_datadir}/slade3/ -%{_datadir}/pixmaps/%{name}.png -%{_datadir}/applications/%{name}.desktop +%_bindir/slade +%_datadir/slade3/ +%_datadir/pixmaps/%name.png +%_datadir/applications/%name.desktop %changelog diff --git a/wxChar.patch b/wxChar.patch index 8d1cd95..b79509c 100644 --- a/wxChar.patch +++ b/wxChar.patch @@ -1,17 +1,26 @@ -diff --git a/src/UI/Lists/ArchiveEntryList.cpp b/src/UI/Lists/ArchiveEntryList.cpp -index 4c1ad82..e7cbe1c 100644 ---- a/src/UI/Lists/ArchiveEntryList.cpp -+++ b/src/UI/Lists/ArchiveEntryList.cpp -@@ -581,8 +581,10 @@ bool ArchiveEntryList::entrySort(long left, long right) +From: Luke Jones +Date: Mon, 19 Dec 2016 21:33:56 +0000 + +Fix conversion from wxString to wxChar when using wxWidgets >= 3.0.2 + +--- + src/UI/Lists/ArchiveEntryList.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +Index: SLADE-3.1.1.4/src/UI/Lists/ArchiveEntryList.cpp +=================================================================== +--- SLADE-3.1.1.4.orig/src/UI/Lists/ArchiveEntryList.cpp ++++ SLADE-3.1.1.4/src/UI/Lists/ArchiveEntryList.cpp +@@ -584,8 +584,10 @@ bool ArchiveEntryList::entrySort(long le result = 0; // Name sort - else if (ael_current->col_name >= 0 && ael_current->col_name == lv_current->sortColumn()) - result = le->getName().CompareTo(re->getName(), string::ignoreCase); + else if (ael_current->col_name >= 0 && ael_current->col_name == lv_current->sortColumn()) { -+ const wxChar* reName = re->getName().c_str(); ++ const wxChar *reName = re->getName().c_str(); + result = le->getName().CompareTo(reName, string::ignoreCase); -+ } ++ } // Other (default) sort else