From 2c3667a195aa3788f734bdebe8d36ca406645be4 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Jan 30 2016 22:17:04 +0000 Subject: Update to a later upstream - Drop upstreamed patches - Fix a crash on startup (rh #1299186) --- diff --git a/.gitignore b/.gitignore index 908e0f4..a110770 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ numptyphysics.tar.gz numptyphysics-levels-2008-09-27.tar.gz /harmattan-numptyphysics-a22cde2.tar.gz /numptyphysics-4837e29715af9ebf7cb5d764b67bfc0890b76089.tar.gz +/numptyphysics-c0abd473857106cd13459fe04f4444099e0d0b59.tar.gz diff --git a/0001-glaserl-fix-build.patch b/0001-glaserl-fix-build.patch deleted file mode 100644 index 6f2adf1..0000000 --- a/0001-glaserl-fix-build.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fa266d32d1dcc8b5474e62cc55441cbe4ca6e84d Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Fri, 20 Feb 2015 15:10:26 +0100 -Subject: [PATCH] glaserl: fix build - -Quote CFLAGS so that more than a single flag can be used. ---- - mk/glaserl.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mk/glaserl.mk b/mk/glaserl.mk -index ac30cc5..ecc5227 100644 ---- a/mk/glaserl.mk -+++ b/mk/glaserl.mk -@@ -5,7 +5,7 @@ GLASERL_LIBRARY := libglaserl.a - - LOCAL_LIBS += $(GLASERL_SOURCE)/$(GLASERL_LIBRARY) - $(GLASERL_SOURCE)/$(GLASERL_LIBRARY): -- CFLAGS=$(CFLAGS) $(MAKE) -C $(GLASERL_SOURCE) $(GLASERL_LIBRARY) -+ CFLAGS='$(CFLAGS)' $(MAKE) -C $(GLASERL_SOURCE) $(GLASERL_LIBRARY) - - ADDITIONAL_DISTCLEAN_TARGETS += glaserl_distclean - glaserl_distclean: --- -2.1.0 - diff --git a/0001-sdl2-look-for-libGL.so.1-in-the-correct-directory.patch b/0001-sdl2-look-for-libGL.so.1-in-the-correct-directory.patch deleted file mode 100644 index 8aa3f62..0000000 --- a/0001-sdl2-look-for-libGL.so.1-in-the-correct-directory.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 07a3b81f13764d538a247028e907dc1b9233c0e6 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Fri, 20 Feb 2015 13:58:27 +0100 -Subject: [PATCH] sdl2: look for libGL.so.1 in the correct directory - -It's /usr/lib64 on some Linux distros and architecture combinations (or even -/usr/lib/arch-id, according to file-hierarchy(7)). - -7d6c7efdabcf970d9b59b85ac3e4f545450fcd1f ---- - platform/sdl2/platform.in | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/platform/sdl2/platform.in b/platform/sdl2/platform.in -index e6d24e2..56b656d 100644 ---- a/platform/sdl2/platform.in -+++ b/platform/sdl2/platform.in -@@ -9,11 +9,16 @@ add_pkgconfig(SDL2_image) - add_pkgconfig(SDL2_ttf) - add_pkgconfig(gio-2.0) - -+LIBDIR = $(shell systemd-path system-library-arch) -+ifeq ($(LIBDIR),) -+LIBDIR = /usr/lib -+endif -+ - # OpenGL library - ifeq ($(shell uname),Darwin) - LIBS += -framework OpenGL - else --ifneq ($(wildcard /usr/lib/libGL.so.1),) -+ifneq ($(wildcard $(LIBDIR)/libGL.so.1),) - add_pkgconfig(gl) - else - add_pkgconfig(glesv2) --- -2.1.0 - diff --git a/dead.package b/dead.package deleted file mode 100644 index 657b1bd..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -No longer runs, upstream has vanished. diff --git a/numptyphysics-qsort.patch b/numptyphysics-qsort.patch new file mode 100644 index 0000000..766eca2 --- /dev/null +++ b/numptyphysics-qsort.patch @@ -0,0 +1,96 @@ +From 90c4730557ec437ddc9abaac0afa59a616e575a3 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Sat, 30 Jan 2016 23:07:11 +0100 +Subject: [PATCH] SortableVector: avoid qsort()ing C++ objects + +That's a sin to memcpy() a non-primitive type such as std::string. With +the current GCC libstdc++ implementation std::string inlines and copying +them directly causes no end of mayhem. + +Valgrind just waved goodbye and exited through an open window. +--- + src/Levels.cpp | 22 ++++++++++++++++++---- + src/Levels.h | 11 ++++++----- + 2 files changed, 24 insertions(+), 9 deletions(-) + +diff --git a/src/Levels.cpp b/src/Levels.cpp +index 2579fcf..40c8fd2 100644 +--- a/src/Levels.cpp ++++ b/src/Levels.cpp +@@ -100,15 +100,29 @@ compare_names(const std::string &a, const std::string &b) + } + + int +-LevelDesc::compare(const LevelDesc *a, const LevelDesc *b) ++LevelDesc::compare(LevelDesc a, LevelDesc b) + { +- return compare_names(a->file, b->file); ++ return compare_names(a.file, b.file); ++} ++ ++void ++LevelDesc::swap(LevelDesc &a, LevelDesc &b) ++{ ++ std::swap(a.file, b.file); + } + + int +-Collection::compare(const Collection *a, const Collection *b) ++Collection::compare(Collection a, Collection b) ++{ ++ return compare_names(a.name, b.name); ++} ++ ++void ++Collection::swap(Collection &a, Collection &b) + { +- return compare_names(a->name, b->name); ++ std::swap(a.file, b.file); ++ std::swap(a.name, b.name); ++ std::swap(a.levels, b.levels); + } + + Levels::Levels(std::vector dirs) +diff --git a/src/Levels.h b/src/Levels.h +index aafe521..75e69cc 100644 +--- a/src/Levels.h ++++ b/src/Levels.h +@@ -20,7 +20,7 @@ + #include + #include + #include +-#include ++#include + + template + class SortableVector : public std::vector { +@@ -29,8 +29,7 @@ class SortableVector : public std::vector { + + void sort() + { +- qsort(std::vector::data(), std::vector::size(), sizeof(T), +- (int (*)(const void *, const void *))T::compare); ++ std::sort(std::vector().begin(), std::vector().end(), T::compare); + } + }; + +@@ -45,7 +44,8 @@ struct LevelDesc { + { + } + +- static int compare(const LevelDesc *a, const LevelDesc *b); ++ static int compare(LevelDesc a, LevelDesc b); ++ void swap(LevelDesc &a, LevelDesc &b); + + std::string file; + }; +@@ -65,7 +65,8 @@ struct Collection { + { + } + +- static int compare(const Collection *a, const Collection *b); ++ static int compare(Collection a, Collection b); ++ void swap(Collection &a, Collection &b); + + std::string file; + std::string name; diff --git a/numptyphysics.spec b/numptyphysics.spec index 65e6c37..0e139a9 100644 --- a/numptyphysics.spec +++ b/numptyphysics.spec @@ -1,20 +1,17 @@ -%global commit 4837e29715af9ebf7cb5d764b67bfc0890b76089 +%global commit c0abd473857106cd13459fe04f4444099e0d0b59 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: numptyphysics # Last known version number Version: 0.4 -Release: 0.8.20140108git%{shortcommit}%{?dist} +Release: 0.8.20151231git%{shortcommit}%{?dist} Summary: A crayon-drawing based physics puzzle game Group: Amusements/Games License: GPLv3+ URL: http://thp.io/2015/numptyphysics/ Source0: https://github.com/thp/numptyphysics/archive/%{commit}/%{name}-%{commit}.tar.gz -# https://github.com/thp/numptyphysics/pull/6 -Patch0: 0001-sdl2-look-for-libGL.so.1-in-the-correct-directory.patch -# https://github.com/thp/numptyphysics/pull/7 -Patch1: 0001-glaserl-fix-build.patch +Patch0: https://patch-diff.githubusercontent.com/raw/thp/numptyphysics/pull/17.patch#/%{name}-qsort.patch BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(SDL2_image) BuildRequires: pkgconfig(SDL2_ttf) @@ -32,8 +29,7 @@ the little yellow thing. %prep %setup -q -n %{name}-%{commit} -%patch0 -p1 -b .opengl -%patch1 -p1 -b .cflags +%patch0 -p1 %build @@ -54,6 +50,11 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/numptyphysics.desktop %changelog +* Sat Jan 30 2016 Lubomir Rintel - 0.4-0.8.20151231gitc0abd47 +- Update to a later upstream +- Drop upstreamed patches +- Fix a crash on startup (rh #1299186) + * Wed Jun 17 2015 Fedora Release Engineering - 0.4-0.8.20140108git4837e29 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/sources b/sources index f6b8af7..142fc9c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0f08ddfe5516ec682a420c2626ac1324 numptyphysics-4837e29715af9ebf7cb5d764b67bfc0890b76089.tar.gz +a202587dcc9d42899f979a0d8df65d83 numptyphysics-c0abd473857106cd13459fe04f4444099e0d0b59.tar.gz