pkgsrc-WIP-changes archive

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

cultivation: add new package



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Mon Mar 18 14:24:53 2024 +0100
Changeset:	51f1cedbe13a3680bf6609eb23619418f6eb68d4

Modified Files:
	Makefile
Added Files:
	cultivation/DESCR
	cultivation/Makefile
	cultivation/PLIST
	cultivation/TODO
	cultivation/distinfo
	cultivation/patches/patch-Makefile.GnuLinux
	cultivation/patches/patch-gameSource_sound_MusicPlayer.cpp
	cultivation/patches/patch-gameSource_sound_SoundEffectsBank.cpp
	cultivation/patches/patch-gameSource_sound_SoundPlayer.cpp
	cultivation/patches/patch-gameSource_sound_SoundPlayer.h

Log Message:
cultivation: add new package

Compiles & installs, needs testing.

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

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

diffstat:
 Makefile                                           |  1 +
 cultivation/DESCR                                  |  9 +++++
 cultivation/Makefile                               | 36 ++++++++++++++++++
 cultivation/PLIST                                  |  2 +
 cultivation/TODO                                   |  1 +
 cultivation/distinfo                               | 10 +++++
 cultivation/patches/patch-Makefile.GnuLinux        | 21 +++++++++++
 .../patches/patch-gameSource_sound_MusicPlayer.cpp | 29 ++++++++++++++
 .../patch-gameSource_sound_SoundEffectsBank.cpp    | 14 +++++++
 .../patches/patch-gameSource_sound_SoundPlayer.cpp | 44 ++++++++++++++++++++++
 .../patches/patch-gameSource_sound_SoundPlayer.h   | 26 +++++++++++++
 11 files changed, 193 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index afd7c809f4..2b9829b3b6 100644
--- a/Makefile
+++ b/Makefile
@@ -583,6 +583,7 @@ SUBDIR+=	cubature
 SUBDIR+=	cuelang
 SUBDIR+=	cufflinks
 SUBDIR+=	cufflinks-2.2.1
+SUBDIR+=	cultivation
 SUBDIR+=	cup
 SUBDIR+=	cut-and-run
 SUBDIR+=	cvc3
diff --git a/cultivation/DESCR b/cultivation/DESCR
new file mode 100644
index 0000000000..96c8e0f96a
--- /dev/null
+++ b/cultivation/DESCR
@@ -0,0 +1,9 @@
+Cultivation is a game about a community of gardeners growing food
+for themselves in a shared space.
+
+Cultivation is quite different from most other games. It is a social
+simulation, and the primary form of conflict is over land and plant
+resources---there is no shooting, but there are plenty of angry
+looks. It is also an evolution simulation. Within the world of
+Cultivation, you can explore a virtually infinite spectrum of
+different plant and gardener varieties.
diff --git a/cultivation/Makefile b/cultivation/Makefile
new file mode 100644
index 0000000000..8412753ab3
--- /dev/null
+++ b/cultivation/Makefile
@@ -0,0 +1,36 @@
+# $NetBSD$
+
+DISTNAME=	Cultivation_9_UnixSource
+PKGNAME=	cultivation-9
+CATEGORIES=	games
+MASTER_SITES=	https://sourceforge.net/projects/cultivation/files/cultivation/v9/
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://cultivation.sourceforge.net/
+COMMENT=	Game about a community of gardeners
+#LICENSE=	# TODO: (see mk/license.mk)
+
+USE_LANGUAGES=	c c++
+
+WRKSRC=		${WRKDIR}/${DISTNAME}/game2
+
+HAS_CONFIGURE=		yes
+CONFIGURE_ARGS+=	--linux
+#MAKE_FILE=		Makefile.GnuLinux
+
+BUILD_DIRS=	${WRKSRC}/gameSource
+
+USE_TOOLS+=	gmake pkg-config
+
+INSTALLATION_DIRS=	bin
+
+#pre-build:
+#	${RM} -rf ${WRKDIR}/${DISTNAME}/minorGems/sound/portaudio/pa_common
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/gameSource/Cultivation ${DESTDIR}${PREFIX}/bin
+
+.include "../../graphics/freeglut/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../audio/portaudio/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/cultivation/PLIST b/cultivation/PLIST
new file mode 100644
index 0000000000..6598090345
--- /dev/null
+++ b/cultivation/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD$
+bin/Cultivation
diff --git a/cultivation/TODO b/cultivation/TODO
new file mode 100644
index 0000000000..4c4675e92e
--- /dev/null
+++ b/cultivation/TODO
@@ -0,0 +1 @@
+Try this out on a machine with sound.
diff --git a/cultivation/distinfo b/cultivation/distinfo
new file mode 100644
index 0000000000..9af0875a0e
--- /dev/null
+++ b/cultivation/distinfo
@@ -0,0 +1,10 @@
+$NetBSD$
+
+BLAKE2s (Cultivation_9_UnixSource.tar.gz) = 7164d4acbb397889f39be965777a5b5b3dbbcb54922d17ed4b940cb1ac27c1ed
+SHA512 (Cultivation_9_UnixSource.tar.gz) = 23ac06bee73ed3dce3647ac27c0de05c19907f62688731fb8e713b3f940c61c476914157804833c43a5f4a2be5384dc1836fab52cff6f0c96607b2634ff79a85
+Size (Cultivation_9_UnixSource.tar.gz) = 1280596 bytes
+SHA1 (patch-Makefile.GnuLinux) = b26b3822d413fa063e36ef64d1bdd3ca0bd0b09a
+SHA1 (patch-gameSource_sound_MusicPlayer.cpp) = e2063de9ba1e75bdc70e1ccdef9d44d5592f4b43
+SHA1 (patch-gameSource_sound_SoundEffectsBank.cpp) = 70be67b4dbc979e5bcba822326dca2a510e9ba59
+SHA1 (patch-gameSource_sound_SoundPlayer.cpp) = 6f10031a6aea9ac71372aad381fc06d455058e3b
+SHA1 (patch-gameSource_sound_SoundPlayer.h) = 1cd5509df26e69e82a9aa3fd6d528bafbb30f76c
diff --git a/cultivation/patches/patch-Makefile.GnuLinux b/cultivation/patches/patch-Makefile.GnuLinux
new file mode 100644
index 0000000000..effc4c50a6
--- /dev/null
+++ b/cultivation/patches/patch-Makefile.GnuLinux
@@ -0,0 +1,21 @@
+$NetBSD$
+
+Use portaudio from pkgsrc.
+
+--- Makefile.GnuLinux.orig	2010-05-25 22:29:56.000000000 +0000
++++ Makefile.GnuLinux
+@@ -15,12 +15,12 @@
+ ##
+ 
+ 
+-PLATFORM_COMPILE_FLAGS = -DLINUX
++PLATFORM_COMPILE_FLAGS = -DLINUX `pkg-config --cflags portaudio-2.0`
+ 
+ 
+ # various GL and X windows  librariesneeded for linux
+ # also need portaudio library (which in turn needs pthreads)
+-PLATFORM_LINK_FLAGS = -L/usr/X11R6/lib -lGL -lglut -lGLU -lX11 ${PORT_AUDIO_PATH}/lib/libportaudio.a -lpthread -lpng
++PLATFORM_LINK_FLAGS = `pkg-config --libs libpng` `pkg-config --libs portaudio-2.0` -L/usr/X11R6/lib -lGL -lglut -lGLU -lX11 -lportaudio -lpthread -lpng
+ 
+ 
+ # All platforms but OSX support g++ and need no linker hacks
diff --git a/cultivation/patches/patch-gameSource_sound_MusicPlayer.cpp b/cultivation/patches/patch-gameSource_sound_MusicPlayer.cpp
new file mode 100644
index 0000000000..34d97d370b
--- /dev/null
+++ b/cultivation/patches/patch-gameSource_sound_MusicPlayer.cpp
@@ -0,0 +1,29 @@
+$NetBSD$
+
+Adapt for portaudio19.
+From Debian.
+
+--- gameSource/sound/MusicPlayer.cpp.orig	2006-09-19 17:46:11.000000000 +0000
++++ gameSource/sound/MusicPlayer.cpp
+@@ -112,13 +112,14 @@ SoundSamples *MusicPlayer::getMoreMusic(
+ 
+     // get parts and positions of gardeners
+     int numParts = 0;
+-    Vector3D **positions =
+-        globalWorld->getAllGardenerPositions( &numParts );
+-    MusicPart **musicParts =
+-        globalWorld->getAllGardenerMusicParts( &numParts );
+-    double *volumeModifiers =
+-        globalWorld->getAllGardenerMusicVolumeModifiers( &numParts );
+-
++    Vector3D **positions = NULL;
++    MusicPart **musicParts = NULL;
++    double *volumeModifiers = NULL;
++    if ( globalWorld ){
++        positions = globalWorld->getAllGardenerPositions( &numParts );
++        musicParts = globalWorld->getAllGardenerMusicParts( &numParts );
++        volumeModifiers = globalWorld->getAllGardenerMusicVolumeModifiers( &numParts );
++    }
+     
+     // get center position from current player position
+     Vector3D *centerPosition = new Vector3D( &globalPlayerCurrentPosition );
diff --git a/cultivation/patches/patch-gameSource_sound_SoundEffectsBank.cpp b/cultivation/patches/patch-gameSource_sound_SoundEffectsBank.cpp
new file mode 100644
index 0000000000..d535d887cf
--- /dev/null
+++ b/cultivation/patches/patch-gameSource_sound_SoundEffectsBank.cpp
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Add math.h for M_PI.
+
+--- gameSource/sound/SoundEffectsBank.cpp.orig	2024-03-18 13:22:28.191496060 +0000
++++ gameSource/sound/SoundEffectsBank.cpp
+@@ -5,6 +5,7 @@
+  * Created.
+  */
+ 
++#include <math.h>
+ 
+ #include "SoundEffectsBank.h"
+ 
diff --git a/cultivation/patches/patch-gameSource_sound_SoundPlayer.cpp b/cultivation/patches/patch-gameSource_sound_SoundPlayer.cpp
new file mode 100644
index 0000000000..efed92f4db
--- /dev/null
+++ b/cultivation/patches/patch-gameSource_sound_SoundPlayer.cpp
@@ -0,0 +1,44 @@
+$NetBSD$
+
+Adapt for portaudio19.
+From Debian.
+
+--- gameSource/sound/SoundPlayer.cpp.orig	2006-10-02 22:29:43.000000000 +0000
++++ gameSource/sound/SoundPlayer.cpp
+@@ -52,9 +52,11 @@
+ 
+ 
+ // callback passed into portaudio
+-static int portaudioCallback( void *inputBuffer, void *outputBuffer,
++int portaudioCallback( const void *inputBuffer, void *outputBuffer,
+                               unsigned long framesPerBuffer,
+-                              PaTimestamp outTime, void *userData ) {
++                              const PaStreamCallbackTimeInfo *outTime,
++                              PaStreamCallbackFlags statusFlags,
++                              void *userData ) {
+ 
+ 
+     SoundPlayer *player = (SoundPlayer *)userData;
+@@ -157,21 +159,13 @@ SoundPlayer::SoundPlayer( int inSampleRa
+ 
+     if( error == paNoError ) {
+     
+-        error = Pa_OpenStream(
++        error = Pa_OpenDefaultStream(
+             &mAudioStream,
+-            paNoDevice,// default input device 
+             0,              // no input 
+-            paFloat32,  // 32 bit floating point input 
+-            NULL,
+-            Pa_GetDefaultOutputDeviceID(),
+             2,          // stereo output 
+             paFloat32,      // 32 bit floating point output 
+-            NULL,
+             mSampleRate,
+             1024,   // frames per buffer
+-            0,    // number of buffers, if zero then use default minimum 
+-            paClipOff, // we won't output out of range samples so
+-                       // don't bother clipping them 
+             portaudioCallback,
+             (void *)this );  // pass self-pointer to callback function
+         
diff --git a/cultivation/patches/patch-gameSource_sound_SoundPlayer.h b/cultivation/patches/patch-gameSource_sound_SoundPlayer.h
new file mode 100644
index 0000000000..a23e4ea6c7
--- /dev/null
+++ b/cultivation/patches/patch-gameSource_sound_SoundPlayer.h
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Adapt for portaudio19.
+From Debian.
+
+--- gameSource/sound/SoundPlayer.h.orig	2006-10-02 22:29:43.000000000 +0000
++++ gameSource/sound/SoundPlayer.h
+@@ -52,8 +52,7 @@
+ #include "SoundFilter.h"
+ #include "PlayableSound.h"
+ 
+-#include "minorGems/sound/portaudio/pa_common/portaudio.h"
+-#include "minorGems/sound/portaudio/pablio/pablio.h"
++#include <portaudio.h>
+ 
+ 
+ #include "minorGems/util/SimpleVector.h"
+@@ -240,7 +239,7 @@ class SoundPlayer {
+         char mFadingIn;
+         int mNumFadeFramesRemaining;
+         
+-        PortAudioStream *mAudioStream;
++        PaStream *mAudioStream;
+ 
+         // realtime sounds that should be mixed into the next to-speaker call
+         SimpleVector<PlayableSound *> *mRealtimeSounds;


Home | Main Index | Thread Index | Old Index