pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

osmose: update to 0.9.96 and overhaul a number of things



Module Name:	pkgsrc-wip
Committed By:	Dean Matzkov <bapabooiee%gmail.com@localhost>
Pushed By:	bapa
Date:		Tue Feb 23 16:48:06 2016 -0700
Changeset:	54bc2e9f04a79ff09a26500735a695b68a16bb3d

Modified Files:
	osmose/Makefile
	osmose/PLIST
	osmose/TODO
	osmose/distinfo
Added Files:
	osmose/patches/patch-EmulationThread.h
	osmose/patches/patch-Osmose-0-9-96-QT.pro
	osmose/patches/patch-OsmoseCore.cpp
	osmose/patches/patch-OsmoseCore.h
	osmose/patches/patch-OsmoseGUI.cpp
	osmose/patches/patch-OsmoseGUI.h
	osmose/patches/patch-QOsmoseConfiguration.h
Removed Files:
	osmose/patches/patch-aa
	osmose/patches/patch-ab
	osmose/patches/patch-ac

Log Message:
osmose: update to 0.9.96 and overhaul a number of things

1) Osmose’s 0.8.0 source archive is nowhere to be found, and
   it took quite a bit of effort to find Osmose-0-9-96-QT.zip,
   so the version had to be bumped out of necessity.

2) Specify the LICENSE as gnu-gpl-v3.

3) Osmose switched from SDL to Qt, so Qt has been hooked in.

4) The old patches have been removed sinced they didn't apply
   cleanly.

5) Patch an error related to pthreads, and add -lpthread.

6) Osmose also uses a few Linux-specific libraries such as
   Linux Joystick and ALSA, so their usage has been #ifdef’d out.

   It’s far from ideal, and probably breaks a few things, but it’d
   take a lot of work to replace them with platform-neutral libraries.

This is still very much a work-in-progress, but at the very least Osmose
now compiles and can run SMS ROMs seemingly without any issues.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=54bc2e9f04a79ff09a26500735a695b68a16bb3d

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 osmose/Makefile                             | 27 ++++++++++------
 osmose/PLIST                                |  4 +--
 osmose/TODO                                 | 11 +++++--
 osmose/distinfo                             | 17 ++++++----
 osmose/patches/patch-EmulationThread.h      | 12 +++++++
 osmose/patches/patch-Osmose-0-9-96-QT.pro   | 45 ++++++++++++++++++++++++++
 osmose/patches/patch-OsmoseCore.cpp         | 40 +++++++++++++++++++++++
 osmose/patches/patch-OsmoseCore.h           | 25 +++++++++++++++
 osmose/patches/patch-OsmoseGUI.cpp          | 49 +++++++++++++++++++++++++++++
 osmose/patches/patch-OsmoseGUI.h            | 30 ++++++++++++++++++
 osmose/patches/patch-QOsmoseConfiguration.h | 27 ++++++++++++++++
 osmose/patches/patch-aa                     | 13 --------
 osmose/patches/patch-ab                     | 22 -------------
 osmose/patches/patch-ac                     | 32 -------------------
 14 files changed, 267 insertions(+), 87 deletions(-)

diffs:
diff --git a/osmose/Makefile b/osmose/Makefile
index 8cb4aac..c6a551c 100644
--- a/osmose/Makefile
+++ b/osmose/Makefile
@@ -1,26 +1,33 @@
-# $NetBSD: Makefile,v 1.2 2012/10/03 21:29:14 asau Exp $
+# $NetBSD$
 #
-
-DISTNAME=	Osmose_0-8-0_src
-PKGNAME=	osmose-0.8.0
+DISTNAME=	Osmose-${PKGVERSION_NOREV:S/./-/g}-QT
+PKGNAME=	osmose-0.9.96
 CATEGORIES=	emulators
-MASTER_SITES=	http://bcz.emu-france.com/osmose/
+MASTER_SITES=	http://bcz.asterope.fr/osmose/
 EXTRACT_SUFX=	.zip
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=	http://bcz.emu-france.com/index.htm
 COMMENT=	Sega Master System/Game Gear emulator
+LICENSE=	gnu-gpl-v3
 
-WRKSRC=		${WRKDIR}/Osmose
+USE_TOOLS+=	gmake
 USE_LANGUAGES=	c c++
 
 INSTALLATION_DIRS=	bin
+INSTALLATION_DIRS+=	share/doc/${PKGBASE}
+
+QMAKE=${QTDIR}/bin/qmake
+
+do-configure:
+	cd ${WRKSRC} && \
+	env QTDIR=${QTDIR} ${QMAKE}
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/osmose ${DESTDIR}${PREFIX}/bin
-	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/osmose
-	${INSTALL_DATA} ${WRKSRC}/readme.txt ${DESTDIR}${PREFIX}/share/doc/osmose
+	${INSTALL_PROGRAM} ${WRKSRC}/${DISTNAME} ${DESTDIR}${PREFIX}/bin/osmose
+	${INSTALL_DATA} ${WRKSRC}/Readme.txt ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
 
-.include "../../devel/SDL/buildlink3.mk"
+.include "../../x11/qt4-libs/buildlink3.mk"
+.include "../../x11/qt4-tools/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/osmose/PLIST b/osmose/PLIST
index d500c48..f69708c 100644
--- a/osmose/PLIST
+++ b/osmose/PLIST
@@ -1,3 +1,3 @@
-@comment $NetBSD: PLIST,v 1.2 2009/10/11 10:45:03 thomasklausner Exp $
+@comment $NetBSD$
 bin/osmose
-share/doc/osmose/readme.txt
+share/doc/osmose/Readme.txt
diff --git a/osmose/TODO b/osmose/TODO
index ceb1160..4f94698 100644
--- a/osmose/TODO
+++ b/osmose/TODO
@@ -1,2 +1,9 @@
-Awfully awfully slow -- massive frameskipping on a fast machine
-(1 in 100 displayed).
+Osmose uses Linux-only libraries for dealing with sound and
+joystick input, so they've been gutted so that Osmose can at
+least compile and run.
+
+The Preferences screen also seems to be broken, and the File
+Select window acts a bit funny too.
+
+At the very least, ROMs seem to load and run fine, as well as
+as the rest of the UI controls. Not seeing any performance issues.
diff --git a/osmose/distinfo b/osmose/distinfo
index 9e336e6..9f951ec 100644
--- a/osmose/distinfo
+++ b/osmose/distinfo
@@ -1,8 +1,13 @@
 $NetBSD: distinfo,v 1.1.1.1 2006/12/13 18:34:02 thomasklausner Exp $
 
-SHA1 (Osmose_0-8-0_src.zip) = 5eb4a64002bd52e2a235faa0c21a46f8315f1d3d
-RMD160 (Osmose_0-8-0_src.zip) = c88dd515689a5a243e92dee93e0a8ef4d4b51bcb
-Size (Osmose_0-8-0_src.zip) = 332579 bytes
-SHA1 (patch-aa) = a5875ae5b9cb31aa7f0592d99211ffa3749ace0b
-SHA1 (patch-ab) = 93b260b12d6b830ea57e0d22b3b67e0aa2c3b76e
-SHA1 (patch-ac) = 114838b9b0d7bc78d56ecf4fff362f0fcbabfc81
+SHA1 (Osmose-0-9-96-QT.zip) = 49f41e3babb4e48e8b0f095533a13e3ba2e1d97a
+RMD160 (Osmose-0-9-96-QT.zip) = bacdebb2e077e3e08b51c973da3f52fe8f582d67
+SHA512 (Osmose-0-9-96-QT.zip) = 0c2b8ec71edd567afdbee7d7347be2a854cd424c37daec4336987e749bd325739c6d7294213e5ed988b3dd4af11d548afd5601c0e6e74b27e481559b085c9e19
+Size (Osmose-0-9-96-QT.zip) = 194671 bytes
+SHA1 (patch-EmulationThread.h) = 2acf9935b6068f940c9d12beba13aca6a818c093
+SHA1 (patch-Osmose-0-9-96-QT.pro) = 725547b5d2c0bf9015ca9ac1a02b54fc1661fe58
+SHA1 (patch-OsmoseCore.cpp) = 384adc7aa8ae61ff256a27bcfe1b04f086b025e2
+SHA1 (patch-OsmoseCore.h) = f678a6ee0ed688d71a3061c80077cd86c9274f4e
+SHA1 (patch-OsmoseGUI.cpp) = ef0e611dc2c2bbb70ad26a4f57317b56c51cb07d
+SHA1 (patch-OsmoseGUI.h) = e8dc4130c0ab33c9854566ee8012ab09f1fbb9a5
+SHA1 (patch-QOsmoseConfiguration.h) = 8d194c2c685ca8f189b7435ee94d5026ca1238c9
diff --git a/osmose/patches/patch-EmulationThread.h b/osmose/patches/patch-EmulationThread.h
new file mode 100644
index 0000000..c37863d
--- /dev/null
+++ b/osmose/patches/patch-EmulationThread.h
@@ -0,0 +1,12 @@
+$NetBSD$
+--- EmulationThread.h.orig	2011-06-06 14:39:18.000000000 +0000
++++ EmulationThread.h
+@@ -33,7 +33,7 @@
+ 
+ #include <iostream>
+ #include <sys/time.h>
+-#include <QThread>
++#include <QtCore/QThread>
+ #include <QReadWriteLock>
+ #include "QGLImage.h"
+ #include "OsmoseConfigurationFile.h"
diff --git a/osmose/patches/patch-Osmose-0-9-96-QT.pro b/osmose/patches/patch-Osmose-0-9-96-QT.pro
new file mode 100644
index 0000000..b54cacf
--- /dev/null
+++ b/osmose/patches/patch-Osmose-0-9-96-QT.pro
@@ -0,0 +1,45 @@
+$NetBSD$
+
+Add -lpthread, and remove Linux Joystick and ALSA-related stuff from
+the build.
+
+--- Osmose-0-9-96-QT.pro.orig	2011-04-30 13:23:22.000000000 +0000
++++ Osmose-0-9-96-QT.pro
+@@ -6,12 +6,11 @@ TEMPLATE = app
+ TARGET = 
+ DEPENDPATH += . cpu osmose unzip
+ INCLUDEPATH += . cpu osmose unzip
+-LIBS += -lz -lasound
++LIBS += -lz -lpthread
+ QT+=opengl
+ 
+ # Input
+ HEADERS += EmulationThread.h \
+-           Joystick.h \
+            KeyMapper.h \
+            OsmoseConfigurationFile.h \
+            OsmoseEmulationThread.h \
+@@ -40,7 +39,6 @@ HEADERS += EmulationThread.h \
+            osmose/SmsDebugger.h \
+            osmose/SmsEnvironment.h \
+            osmose/SN76489.h \
+-           osmose/SoundThread.h \
+            osmose/VDP.h \
+            osmose/VDP_GG.h \
+            osmose/Version.h \
+@@ -50,7 +48,6 @@ HEADERS += EmulationThread.h \
+            unzip/unzip.h
+ FORMS += Configuration.ui LogWindow.ui
+ SOURCES += EmulationThread.cpp \
+-           Joystick.cpp \
+            KeyMapper.cpp \
+            main.cpp \
+            OsmoseConfigurationFile.cpp \
+@@ -80,7 +77,6 @@ SOURCES += EmulationThread.cpp \
+            osmose/RomSpecificOption.cpp \
+            osmose/SmsEnvironment.cpp \
+            osmose/SN76489.cpp \
+-           osmose/SoundThread.cpp \
+            osmose/VDP.cpp \
+            osmose/VDP_GG.cpp \
+            osmose/WaveWriter.cpp \
diff --git a/osmose/patches/patch-OsmoseCore.cpp b/osmose/patches/patch-OsmoseCore.cpp
new file mode 100644
index 0000000..dc0467b
--- /dev/null
+++ b/osmose/patches/patch-OsmoseCore.cpp
@@ -0,0 +1,40 @@
+$NetBSD$
+
+--- osmose/OsmoseCore.cpp.orig	2011-06-06 15:24:54.000000000 +0000
++++ osmose/OsmoseCore.cpp
+@@ -108,6 +108,7 @@ OsmoseCore::OsmoseCore(const char *rom_f
+ 
+     if (emu_opt.sound == true)
+     {
++#ifdef USE_SOUND
+ 		try
+ 		{
+ 			sndThread = new SoundThread("plughw:0,0", p->getFIFOSoundBuffer());
+@@ -122,6 +123,7 @@ OsmoseCore::OsmoseCore(const char *rom_f
+ 			sndThread = NULL;
+ 			emu_opt.sound = false;
+ 		}
++#endif // USE_SOUND
+ 	}
+ }
+ 
+@@ -131,7 +133,9 @@ OsmoseCore::OsmoseCore(const char *rom_f
+ OsmoseCore::~OsmoseCore()
+ {
+ 	if (wavW != NULL) delete wavW;
++#ifdef USE_SOUND
+ 	if (sndThread != NULL) delete sndThread;
++#endif
+ 	save_bbr();	/* Save Battery backed memory if needed. */
+ 	delete v;
+ 	delete mem;
+@@ -218,7 +222,9 @@ void OsmoseCore::run_frame()
+         if (!p->getFIFOSoundBuffer()->spaceAvailable())
+         {
+             snd_started = true;
++#ifdef USE_SOUND
+ 			sndThread->resume();	
++#endif
+         }
+     }
+ 
diff --git a/osmose/patches/patch-OsmoseCore.h b/osmose/patches/patch-OsmoseCore.h
new file mode 100644
index 0000000..3c58076
--- /dev/null
+++ b/osmose/patches/patch-OsmoseCore.h
@@ -0,0 +1,25 @@
+$NetBSD$
+
+--- osmose/OsmoseCore.h.orig	2011-06-06 15:25:26.000000000 +0000
++++ osmose/OsmoseCore.h
+@@ -56,7 +56,10 @@
+ #include "TGAWriter.h"
+ #include "QLogWindow.h"
+ #include "Pthreadcpp.h"
++
++#ifdef USE_SOUND
+ #include "SoundThread.h"
++#endif
+ 
+ using namespace std;
+ 
+@@ -136,7 +139,9 @@ class OsmoseCore : public DebugEventThro
+         void save_bbr();				// Save Battery Backed Ram.
+         
+         void displayTiles(unsigned int *s, VDP *vd, int tile, int x, int y);
++#ifdef USE_SOUND
+ 		SoundThread *sndThread;
++#endif
+ 		OsmoseConfigurationFile *configuration;
+ 		pthread_mutex_t *osmose_core_mutex;
+ };
diff --git a/osmose/patches/patch-OsmoseGUI.cpp b/osmose/patches/patch-OsmoseGUI.cpp
new file mode 100644
index 0000000..074a2e1
--- /dev/null
+++ b/osmose/patches/patch-OsmoseGUI.cpp
@@ -0,0 +1,49 @@
+$NetBSD$
+
+Fix pthread-related build errors.
+
+--- OsmoseGUI.cpp.orig	2011-06-06 15:07:12.000000000 +0000
++++ OsmoseGUI.cpp
+@@ -40,7 +40,9 @@ OsmoseGUI::OsmoseGUI(QWidget * parent, Q
+ 	rom_name = NULL;
+ 	osmoseCore = NULL;
+ 	saveStateSlot = 0;
+-	osmose_core_mutex = PTHREAD_MUTEX_INITIALIZER;
++
++	pthread_mutex_t osmose_core_mutex;
++	pthread_mutex_init(&osmose_core_mutex, NULL);
+ 
+ 	QLogWindow::getInstance()->appendLog("Starting Osmose emulator.");
+ 		
+@@ -347,6 +349,7 @@ OsmoseGUI::OsmoseGUI(QWidget * parent, Q
+ 	}
+ 	
+ 	/* Try to find a Joystick*/
++#ifdef USE_JOYSTICK
+ 	js0 = NULL;
+ 	try
+ 	{
+@@ -363,6 +366,7 @@ OsmoseGUI::OsmoseGUI(QWidget * parent, Q
+ 		msg = msg + ").";
+ 		QLogWindow::getInstance()->appendLog(msg);
+ 	}
++#endif // USE_JOYSTICK
+ 	
+ 	// Enable Drop events.
+ 	setAcceptDrops(true);	
+@@ -381,6 +385,7 @@ OsmoseGUI::~OsmoseGUI()
+ 
+ void OsmoseGUI::configure()
+ {
++#ifdef USE_JOYSTICK
+ 	QOsmoseConfiguration *configWindow;
+ 
+ 	if (js0 == NULL)
+@@ -394,6 +399,7 @@ void OsmoseGUI::configure()
+ 	}
+ 	configWindow->exec();
+ 	if (js0 != NULL) js0->setListener(this);
++#endif
+ }
+ 
+ void OsmoseGUI::sizeX1()
diff --git a/osmose/patches/patch-OsmoseGUI.h b/osmose/patches/patch-OsmoseGUI.h
new file mode 100644
index 0000000..00e0bcf
--- /dev/null
+++ b/osmose/patches/patch-OsmoseGUI.h
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- OsmoseGUI.h.orig	2011-06-06 15:07:18.000000000 +0000
++++ OsmoseGUI.h
+@@ -49,11 +49,14 @@
+ #include "OsmoseCore.h"
+ #include "MemoryMapper.h"
+ #include "QLogWindow.h"
++
++#ifdef USE_JOYSTICK
+ #include "Joystick.h"
++#endif // USE_JOYSTICK
+ 
+ #define MENU_HEIGHT	20
+ 
+-class OsmoseGUI : public QMainWindow, JoystickListener
++class OsmoseGUI : public QMainWindow
+ {
+ 	Q_OBJECT;
+ 	
+@@ -131,7 +134,9 @@ private:
+ 	void updateMachineMenu();
+ 	void loadTheROM(QString name);
+ 	bool isFullscreen;
++#ifdef USE_JOYSTICK
+ 	Joystick *js0;
++#endif
+ };
+ 
+ #endif	// OsmoseGUI
diff --git a/osmose/patches/patch-QOsmoseConfiguration.h b/osmose/patches/patch-QOsmoseConfiguration.h
new file mode 100644
index 0000000..00ba6e3
--- /dev/null
+++ b/osmose/patches/patch-QOsmoseConfiguration.h
@@ -0,0 +1,27 @@
+$NetBSD$
+
+--- QOsmoseConfiguration.h.orig	2011-06-06 15:07:54.000000000 +0000
++++ QOsmoseConfiguration.h
+@@ -36,7 +36,11 @@
+ #include <QMessageBox>
+ #include "ui_Configuration.h"
+ #include "KeyMapper.h"
++
++#ifdef USE_JOYSTICK
+ #include "Joystick.h"
++#endif
++
+ #include "OsmoseConfigurationFile.h"
+ 
+ class KeyGrabber : public QDialog
+@@ -53,7 +57,9 @@ protected:
+ 	unsigned int keyPressed;
+ };
+ 
+-class QOsmoseConfiguration : public QDialog, public JoystickListener, private Ui::Configuration
++class QOsmoseConfiguration :
++	public QDialog,
++	private Ui::Configuration
+ {
+ 
+ Q_OBJECT
diff --git a/osmose/patches/patch-aa b/osmose/patches/patch-aa
deleted file mode 100644
index a1ec9a4..0000000
--- a/osmose/patches/patch-aa
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-aa,v 1.1.1.1 2006/12/13 18:34:02 thomasklausner Exp $
-
---- PrecisionTimer.h.orig	2006-11-06 12:08:38.000000000 +0100
-+++ PrecisionTimer.h
-@@ -39,7 +39,7 @@ using namespace std;
- #include <iostream>
- #ifndef _RDTSC_TIMER_H
- #define _RDTSC_TIMER_H
--#ifdef linux
-+#ifdef __USE_UNIX98
-     #define PORTABLE_SLEEP_FUNC  sleep( s );
-     #include <unistd.h>
- #else
diff --git a/osmose/patches/patch-ab b/osmose/patches/patch-ab
deleted file mode 100644
index 8212c9d..0000000
--- a/osmose/patches/patch-ab
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-ab,v 1.1.1.1 2006/12/13 18:34:02 thomasklausner Exp $
-
---- SmsDebugger.cpp.orig	2006-11-20 20:41:30.000000000 +0100
-+++ SmsDebugger.cpp
-@@ -37,7 +37,7 @@ SmsDebugger::SmsDebugger()
- void SmsDebugger::enter()
- {
-     char *line;
--    size_t n_byte = 256;
-+    size_t n_byte = 8192;
-     char cmd[32];
-     int param1;
-     int param2;
-@@ -52,7 +52,7 @@ void SmsDebugger::enter()
- 
- 	    cout << endl << "Cmd:";
- 	    line = (char *) malloc(n_byte+1);
--	    getline(&line,&n_byte,stdin);
-+	    fgets(line,n_byte,stdin);
- 	    par_nbr = sscanf(line,"%s %x %x %x", cmd, &param1, &param2, &param3);
- 	    free(line);
- 	    switch(par_nbr)
diff --git a/osmose/patches/patch-ac b/osmose/patches/patch-ac
deleted file mode 100644
index 0e7f167..0000000
--- a/osmose/patches/patch-ac
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-ac,v 1.1.1.1 2006/12/13 18:34:02 thomasklausner Exp $
-
---- Makefile.orig	2006-11-22 12:13:01.000000000 +0000
-+++ Makefile
-@@ -1,6 +1,7 @@
- #Zlib
- Z_LIB_DIR=  ./zlib/
--Z_LIB    =  $(Z_LIB_DIR)libz.a
-+#Z_LIB    =  $(Z_LIB_DIR)libz.a
-+Z_LIB    =  -lz
- 
- #unzip based on zlib.
- UNZIP_DIR=  ./unzip/
-@@ -54,8 +55,8 @@ OSM_EXE         =  osmose
- 
- # Compiler/Linker Flags
- # add -O3 to CFLAGS for speedup -pg on LFLAGS and CFLAGS for gprof
--CFLAGS =  -Wall -D__USE_UNIX98 -O3
--LFLAGS =  -lSDL
-+CFLAGS +=  -Wall -D__USE_UNIX98 -O3
-+LFLAGS +=  -lSDL
- AFLAGS =  -f elf
- CC  = g++
- C_COMP = gcc
-@@ -98,7 +99,6 @@ miniclean:
- 	rm -f *.o core $(OSM_EXE)
- 
- libs:
--	cd $(Z_LIB_DIR) && make libz.a
- 	cd $(UNZIP_DIR) && make unzip.a
- 
- 


Home | Main Index | Thread Index | Old Index