commit c40560399daa6c5aa7d651d708526fb8b3c3bb5b
Author: Andrea Musuruane <musuruan(a)gmail.com>
Date: Fri Jul 15 22:31:53 2016 +0200
Updated to new upstream release
- Updated URL
- Added Debian man page
- Updated Debian patches
- Moved icons in %{_datadir}/icons/hicolor
.gitignore | 1 +
Nestopia-1.36-nesntsc.patch | 14 ---
Nestopia-1.45-format-security.patch | 14 ---
Nestopia-1.47-buildflags.patch | 20 ++++
Nestopia-1.47-format-security.patch | 13 +++
...n.patch => Nestopia-1.47-install-location.patch | 31 +-----
Nestopia-1.47-use-system-nes_ntsc.patch | 35 +++++++
Nestopia-1.47-use-system-zlib.patch | 14 +++
Nestopia.spec | 90 ++++++++++++++----
nestopia.6 | 105 +++++++++++++++++++++
sources | 2 +-
11 files changed, 267 insertions(+), 72 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5903e7f..3189e2e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
nestopia-1.45.tgz
+/nestopia-1.47.tgz
diff --git a/Nestopia-1.47-buildflags.patch b/Nestopia-1.47-buildflags.patch
new file mode 100644
index 0000000..88365cf
--- /dev/null
+++ b/Nestopia-1.47-buildflags.patch
@@ -0,0 +1,20 @@
+Description: Preserve externally-provided build flags
+Author: Stephen Kitt <skitt(a)debian.org>
+
+--- a/Makefile
++++ b/Makefile
+@@ -2,12 +2,12 @@
+ CXX ?= c++
+ CXXFLAGS ?= -O3
+ CPPFLAGS += -DNST_PRAGMA_ONCE
+-CFLAGS = $(shell sdl2-config --cflags)
++CFLAGS += $(shell sdl2-config --cflags)
+
+ INCLUDES = -Isource
+ WARNINGS = -Wno-write-strings
+
+-LDFLAGS = -Wl,--as-needed
++LDFLAGS += -Wl,--as-needed
+ LIBS = -lstdc++ -lm -lz
+ LIBS += $(shell sdl2-config --libs)
+
diff --git a/Nestopia-1.47-format-security.patch b/Nestopia-1.47-format-security.patch
new file mode 100644
index 0000000..e5c322e
--- /dev/null
+++ b/Nestopia-1.47-format-security.patch
@@ -0,0 +1,13 @@
+Description: Use a format specifier with gtk_message_dialog_new
+Author: Stephen Kitt <skitt(a)debian.org>
+
+--- a/source/unix/gtkui/gtkui.cpp
++++ b/source/unix/gtkui/gtkui.cpp
+@@ -438,6 +438,7 @@
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK,
++ "%s",
+ message);
+ gtk_dialog_run(GTK_DIALOG(messagewindow));
+ gtk_widget_destroy(messagewindow);
diff --git a/Nestopia-1.45-install-location.patch b/Nestopia-1.47-install-location.patch
similarity index 71%
rename from Nestopia-1.45-install-location.patch
rename to Nestopia-1.47-install-location.patch
index 9336c47..df1af36 100644
--- a/Nestopia-1.45-install-location.patch
+++ b/Nestopia-1.47-install-location.patch
@@ -1,34 +1,13 @@
Description: Install to FHS-compliant locations and handle DESTDIR
Author: Stephen Kitt <skitt(a)debian.org>
---- nestopia.orig/Makefile
-+++ nestopia/Makefile
-@@ -4,8 +4,8 @@
- # By R. Danbrook 2012
- #
-
--CC = @gcc
--CXX = @g++
-+CC = gcc
-+CXX = g++
- CFLAGS ?= -O3 -g3
- CXXFLAGS ?= -O3 -g3
- CPPFLAGS += -DNST_PRAGMA_ONCE_SUPPORT -D_SZ_ONE_DIRECTORY
-@@ -36,8 +36,8 @@
- CPPFLAGS += -DBSD
- endif
-
--PREFIX = /usr/local
--BINDIR = $(PREFIX)/bin
-+PREFIX = /usr
-+BINDIR = $(PREFIX)/bin
- DATADIR = $(PREFIX)/share/nestopia
-
- # OpenGL Support
-@@ -190,15 +190,16 @@
- $(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LIBS)
+--- a/Makefile
++++ b/Makefile
+@@ -395,16 +395,16 @@
+ $(CC) $(LDFLAGS) $^ $(LIBS) -o $(BIN)
install:
+- mkdir -p $(BINDIR)
- mkdir -p $(DATADIR)/icons
- mkdir -p $(PREFIX)/share/pixmaps
- install -m 0755 $(BIN) $(BINDIR)
diff --git a/Nestopia-1.47-use-system-nes_ntsc.patch
b/Nestopia-1.47-use-system-nes_ntsc.patch
new file mode 100644
index 0000000..9527e01
--- /dev/null
+++ b/Nestopia-1.47-use-system-nes_ntsc.patch
@@ -0,0 +1,35 @@
+diff -durN nestopia-1.47.orig/Makefile nestopia-1.47/Makefile
+--- nestopia-1.47.orig/Makefile 2016-01-10 03:07:59.000000000 +0100
++++ nestopia-1.47/Makefile 2016-04-24 18:16:51.276901269 +0200
+@@ -374,7 +374,7 @@
+
+ # Core rules
+ objs/core/%.o: source/core/%.cpp
+- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
++ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -Isource/nes_ntsc -c $< -o $@
+
+ # Interface rules
+ objs/unix/%.o: source/unix/%.cpp
+diff -durN nestopia-1.47.orig/source/core/NstVideoFilterNtscCfg.cpp
nestopia-1.47/source/core/NstVideoFilterNtscCfg.cpp
+--- nestopia-1.47.orig/source/core/NstVideoFilterNtscCfg.cpp 2016-01-10
03:07:11.000000000 +0100
++++ nestopia-1.47/source/core/NstVideoFilterNtscCfg.cpp 2016-04-24 17:44:04.532308362
+0200
+@@ -34,7 +34,6 @@
+ #endif
+
+ #define NES_NTSC_NO_BLITTERS
+-#include "../nes_ntsc/nes_ntsc.inl"
+
+ #ifdef _MSC_VER
+ #pragma warning( pop )
+diff -durN nestopia-1.47.orig/source/core/NstVideoFilterNtsc.hpp
nestopia-1.47/source/core/NstVideoFilterNtsc.hpp
+--- nestopia-1.47.orig/source/core/NstVideoFilterNtsc.hpp 2016-01-10 03:07:11.000000000
+0100
++++ nestopia-1.47/source/core/NstVideoFilterNtsc.hpp 2016-04-24 17:44:27.816274653 +0200
+@@ -25,7 +25,7 @@
+ #ifndef NST_VIDEO_FILTER_NTSC_H
+ #define NST_VIDEO_FILTER_NTSC_H
+
+-#include "../nes_ntsc/nes_ntsc.h"
++#include <nes_ntsc.h>
+
+ #ifdef NST_PRAGMA_ONCE
+ #pragma once
diff --git a/Nestopia-1.47-use-system-zlib.patch b/Nestopia-1.47-use-system-zlib.patch
new file mode 100644
index 0000000..1090eaf
--- /dev/null
+++ b/Nestopia-1.47-use-system-zlib.patch
@@ -0,0 +1,14 @@
+Description: Use system zlib
+Author: Sérgio Benjamim <sergio_br2(a)yahoo.com.br>
+
+--- a/source/core/NstZlib.cpp
++++ b/source/core/NstZlib.cpp
+@@ -37,7 +37,7 @@
+
+ #endif
+
+- #include "../zlib/zlib.h"
++ #include <zlib.h>
+
+ #endif
+
diff --git a/Nestopia.spec b/Nestopia.spec
index 91d3794..494cbfc 100644
--- a/Nestopia.spec
+++ b/Nestopia.spec
@@ -1,29 +1,34 @@
%global realname nestopia
Name: Nestopia
-Version: 1.45
-Release: 2%{?dist}
+Version: 1.47
+Release: 1%{?dist}
Summary: A portable open source NES/Famicom emulator
License: GPLv2+
-URL:
http://0ldsk00l.ca/nestopia.html
+URL:
http://0ldsk00l.ca/nestopia/
Source0:
http://downloads.sourceforge.net/nestopiaue/%{version}/%{realname}-%{vers...
+# Debian man page
+Source1: %{realname}.6
# Install to FHS-compliant locations and handle DESTDIR
-Patch0: %{name}-1.45-install-location.patch
+Patch0: %{name}-1.47-install-location.patch
# Use a format specifier with gtk_message_dialog_new
-Patch1: %{name}-1.45-format-security.patch
+Patch1: %{name}-1.47-format-security.patch
+# Preserve externally-provided build flags
+Patch2: %{name}-1.47-buildflags.patch
+# Use system zlib
+Patch3: %{name}-1.47-use-system-zlib.patch
# Use system nes_ntsc
-Patch2: Nestopia-1.36-nesntsc.patch
+Patch4: %{name}-1.47-use-system-nes_ntsc.patch
BuildRequires: gtk3-devel
-BuildRequires: SDL-devel >= 1.2.12
-BuildRequires: alsa-lib-devel
+BuildRequires: SDL2-devel
BuildRequires: libarchive-devel
BuildRequires: zlib-devel
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: nes_ntsc-devel
-BuildRequires: pkgconfig
+BuildRequires: libao-devel
BuildRequires: desktop-file-utils
Requires: hicolor-icon-theme
@@ -35,38 +40,89 @@ full support for software that do mid-scanline and other timing
trickery.
%prep
%setup -q -n %{realname}-%{version}
-
%patch0 -p1
%patch1 -p1
-%patch2 -p0
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+
+# Link system nes_ntsc lib
+sed -i 's/ -lz/ -lz -lnes_ntsc/' Makefile
# Fix end-of-line encoding
sed -i 's/\r//' changelog.txt
-# Clean up sources
-rm -rf dll lib source/kaillera source/unrar
+# Remove bundled libs
+rm -rf source/zlib
+rm -rf source/nes_ntsc/{*.c,*.inl,demo_impl.h,nes_ntsc.h,nes_ntsc_impl.h}
%build
+# Wordaround FTBFS with GCC 6
+%global optflags %{optflags} -std=gnu++98
+
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
# It does not compile with smp_mflags
make
%install
-make install DESTDIR=%{buildroot}
+export PREFIX="%{_prefix}"
+export BINDIR="%{_bindir}"
+%make_install
# Validate desktop file
desktop-file-validate \
- $RPM_BUILD_ROOT%{_datadir}/applications/%{realname}.desktop
+ %{buildroot}%{_datadir}/applications/%{realname}.desktop
+
+# Move icon into %%{_datadir}/icons/hicolor/
+install -d %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
+mv %{buildroot}%{_datadir}/pixmaps/%{realname}.svg \
+ %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
+
+# Install icons
+for i in 32 48 64 96 128; do
+ install -d %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
+ install -p -m 644 source/unix/icons/%{realname}${i}.png \
+ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{realname}.png
+done
+
+# Install man page
+install -d %{buildroot}%{_mandir}/man6
+install -p -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man6/
+
+
+%post
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
+
+%postun
+if [ $1 -eq 0 ] ; then
+ /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
+
+%posttrans
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
%files
%{_bindir}/%{realname}
%{_datadir}/%{realname}
-%{_datadir}/pixmaps/%{realname}.svg
+%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/applications/%{realname}.desktop
-%doc changelog.txt COPYING README.unix readme.html
+%{_mandir}/man6/*
+%license COPYING
+%doc AUTHORS changelog.txt README.md README.unix readme.html
%changelog
+* Sun Apr 24 2016 Andrea Musuruane <musuruan(a)gmail.com> - 1.47-1
+- Updated to new upstream release
+- Updated URL
+- Added Debian man page
+- Updated Debian patches
+- Moved icons in %%{_datadir}/icons/hicolor
+
* Sun Aug 31 2014 Sérgio Basto <sergio(a)serjux.com> - 1.45-2
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
diff --git a/nestopia.6 b/nestopia.6
new file mode 100644
index 0000000..1ec17e3
--- /dev/null
+++ b/nestopia.6
@@ -0,0 +1,105 @@
+.\" Hey, EMACS: -*- nroff -*-
+.TH NESTOPIA 6 "August 11, 2011"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+nestopia \- Nintento Entertainment System / Famicom emulator
+.SH SYNOPSIS
+.B nestopia
+.IR game
+.SH DESCRIPTION
+This manual page documents briefly the
+.B nestopia
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+.B nestopia
+is an emulator for the Nintento Entertainment System. It can execute
+programs intended for the NES console.
+.SH OPTIONS
+.B nestopia
+has no command\-line options; use the provided GUI to configure it.
+.SH KEYBOARD CONTROLS
+The default controls are as follows:
+.IP Up
+Player 1 up
+.IP Down
+Player 1 down
+.IP Left
+Player one left
+.IP Right
+Player one right
+.IP ,
+Player one A
+.IP .
+Player one B
+.IP 1
+Player one start
+.IP 2
+Player one select
+.IP "Keypad 8"
+Player two up
+.IP "Keypad 2"
+Player two down
+.IP "Keypad 4"
+Player two left
+.IP "Keypad 6"
+Player two right
+.IP "Keypad /"
+Player two A
+.IP "Keypad *"
+Player two B
+.IP "Keypad Enter"
+Player two start
+.IP "Keypad +"
+Player two select
+.IP F1
+Save movie
+.IP F2
+Load movie
+.IP F3
+Stop recording movie
+.IP F4
+Reset
+.IP F5
+Flip disk
+.IP F7
+Save
+.IP F8
+Load
+.IP Escape
+Stop
+.IP Backspace
+Rewind
+.IP \\
+Fast forward
+.IP 7
+Quick save 1
+.IP 8
+Quick save 2
+.IP 9
+Quick load 1
+.IP 0
+Quick load 2
+.IP 5
+Coin 1
+.IP 6
+Coin 2
+.SH AUTHOR
+nestopia was written by Martin Freij and ported to Linux by
+R. Belmont. It is now maintained by R. Danbrook.
+.PP
+This manual page was written by Stephen Kitt <skitt(a)debian.org>,
+for the Debian project (and may be used by others).
diff --git a/sources b/sources
index 0af38ef..5ac330e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-efef045895b8eaa78ed537dbb17c04f7 nestopia-1.45.tgz
+426c22ba9d9f7a5ece227bbe1de25982 nestopia-1.47.tgz