From 631d1ca7978dfa1ad6106c9e9c385ff23292ac6b Mon Sep 17 00:00:00 2001 From: Juergen Buchmueller Date: Wed, 31 Aug 2016 09:57:45 +0200 Subject: [PATCH] mame: update to 0.177 --- srcpkgs/mame/patches/enable-gcc4.patch | 17 +++++ .../mame/patches/fix-std_istream_swap.patch | 66 +++++++++++++++++++ .../mame/patches/fix-std_min_constexpr.patch | 14 ++++ srcpkgs/mame/template | 6 +- 4 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/mame/patches/enable-gcc4.patch create mode 100644 srcpkgs/mame/patches/fix-std_istream_swap.patch create mode 100644 srcpkgs/mame/patches/fix-std_min_constexpr.patch diff --git a/srcpkgs/mame/patches/enable-gcc4.patch b/srcpkgs/mame/patches/enable-gcc4.patch new file mode 100644 index 00000000000..6c10b397e18 --- /dev/null +++ b/srcpkgs/mame/patches/enable-gcc4.patch @@ -0,0 +1,17 @@ +With some patches removing c++14 stuff, our gcc-4.9.4 can still +be used to compile MAME. It's about time we get gcc-5.4.0 ready +for Void Linux. + +--- scripts/genie.lua 2016-08-31 03:47:01.000000000 +0200 ++++ scripts/genie.lua 2016-08-31 07:53:29.475819768 +0200 +@@ -970,8 +970,8 @@ + } + end + else +- if (version < 50000) then +- print("GCC version 5.0 or later needed") ++ if (version < 40900) then ++ print("GCC version 4.9 or later needed") + os.exit(-1) + end + buildoptions { diff --git a/srcpkgs/mame/patches/fix-std_istream_swap.patch b/srcpkgs/mame/patches/fix-std_istream_swap.patch new file mode 100644 index 00000000000..bfaf638dce7 --- /dev/null +++ b/srcpkgs/mame/patches/fix-std_istream_swap.patch @@ -0,0 +1,66 @@ +The template swap() implementation does not compile with gcc-4.9.4, +but fortunately it is not yet used anywhere in the code, thus just +rip it out. + +--- src/lib/util/vecstream.h 2016-08-31 03:47:01.000000000 +0200 ++++ src/lib/util/vecstream.h 2016-08-31 08:46:11.374477157 +0200 +@@ -107,15 +107,6 @@ + setup(); + } + +- void swap(basic_vectorbuf &that) +- { +- using std::swap; +- std::basic_streambuf::swap(that); +- swap(m_mode, that.m_mode); +- swap(m_storage, that.m_storage); +- swap(m_threshold, that.m_threshold); +- } +- + void reserve(typename vector_type::size_type size) + { + if ((m_mode & std::ios_base::out) && (m_storage.capacity() < size)) +@@ -327,8 +318,6 @@ + void vec(const vector_type &content) { rdbuf()->vec(content); } + void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); } + +- void swap(basic_ivectorstream &that) { std::basic_istream::swap(that); rdbuf()->swap(*that.rdbuf()); } +- + private: + basic_vectorbuf m_rdbuf; + }; +@@ -350,8 +339,6 @@ + void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); } + basic_ovectorstream &reserve(typename vector_type::size_type size) { rdbuf()->reserve(size); return *this; } + +- void swap(basic_ovectorstream &that) { std::basic_ostream::swap(that); rdbuf()->swap(*that.rdbuf()); } +- + private: + basic_vectorbuf m_rdbuf; + }; +@@ -373,8 +360,6 @@ + void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); } + basic_vectorstream &reserve(typename vector_type::size_type size) { rdbuf()->reserve(size); return *this; } + +- void swap(basic_vectorstream &that) { std::basic_iostream::swap(that); rdbuf()->swap(*that.rdbuf()); } +- + private: + basic_vectorbuf m_rdbuf; + }; +@@ -386,16 +371,6 @@ + typedef basic_vectorstream vectorstream; + typedef basic_vectorstream wvectorstream; + +-template +-void swap(basic_vectorbuf &a, basic_vectorbuf &b) { a.swap(b); } +- +-template +-void swap(basic_ivectorstream &a, basic_ivectorstream &b) { a.swap(b); } +-template +-void swap(basic_ovectorstream &a, basic_ovectorstream &b) { a.swap(b); } +-template +-void swap(basic_vectorstream &a, basic_vectorstream &b) { a.swap(b); } +- + extern template class basic_ivectorstream; + extern template class basic_ivectorstream; + extern template class basic_ovectorstream; diff --git a/srcpkgs/mame/patches/fix-std_min_constexpr.patch b/srcpkgs/mame/patches/fix-std_min_constexpr.patch new file mode 100644 index 00000000000..d818fa0bbf6 --- /dev/null +++ b/srcpkgs/mame/patches/fix-std_min_constexpr.patch @@ -0,0 +1,14 @@ +With gcc-4.9.4 libstdc++ std::min() is not a constexpr as required +by c++14 conforming compilers. Replace std::min with a conditional. + +--- src/devices/video/poly.h 2016-08-31 03:47:01.000000000 +0200 ++++ src/devices/video/poly.h 2016-08-31 07:56:47.483694756 +0200 +@@ -224,7 +224,7 @@ + // internal array types + typedef poly_array polygon_array; + typedef poly_array<_ObjectData, _MaxPolys + 1> objectdata_array; +- typedef poly_array unit_array; ++ typedef poly_array unit_array; + + // round in a cross-platform consistent manner + inline INT32 round_coordinate(_BaseType value) diff --git a/srcpkgs/mame/template b/srcpkgs/mame/template index a3f52bb6d54..a874f7afb08 100644 --- a/srcpkgs/mame/template +++ b/srcpkgs/mame/template @@ -1,6 +1,6 @@ # Template file for 'mame' pkgname=mame -version=0176 +version=0177 revision=1 wrksrc="mame-mame${version}" homepage="http://mamedev.org" @@ -8,7 +8,7 @@ distfiles="https://github.com/mamedev/mame/archive/mame${version}.tar.gz" short_desc="The Multiple Arcade Machine Emulator" maintainer="Jürgen Buchmüller " license="GPL-2" -checksum=e8837ae9c21ac6ca289c0214747a6d7ff7cc4683b9426377f42cda318fddcb25 +checksum=4c4a0d8cd00dac82773ed883394254916a8160e81715b593c61e0812f5b44ddd hostmakedepends="perl pkg-config python automoc4" makedepends="libstdc++-devel SDL2_ttf-devel $(vopt_if qt qt5-devel) lua-devel @@ -21,7 +21,7 @@ case "$XBPS_TARGET_MACHINE" in i686*) nodebug=yes esac -CXXFLAGS="-DUSE_INTERNAL_CBEGIN_CEND=1 -I${XBPS_CROSS_BASE}/usr/include/lua5.3" +CXXFLAGS="-std=c++14 -DUSE_INTERNAL_CBEGIN_CEND=1 -I${XBPS_CROSS_BASE}/usr/include/lua5.3" LDFLAGS="-Wl,-fuse-ld=gold" build_options="qt"