summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD33
-rw-r--r--nosefart-2.9-pulseaudio-mls.patch219
3 files changed, 20 insertions, 249 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8eed5a9e2bf2..d5fcbaee693a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,13 @@
pkgbase = nosefart
- pkgdesc = NES sound format player
- pkgver = 2.9
- pkgrel = 3
- url = http://nosefart.sourceforge.net/
+ pkgdesc = NES sound format (nsf) player
+ pkgver = 3.3
+ pkgrel = 0
+ url = https://github.com/RiedleroD/nosefart
arch = x86_64
arch = i686
license = GPL2
- depends = libpulse
- source = https://downloads.sourceforge.net/nosefart/nosefart-2.9-mls.tar.bz2
- source = nosefart-2.9-pulseaudio-mls.patch
- sha256sums = 43fa05190cc6a62f30662dcb65768413a77a73962961e520ccd9245cd3e35a39
- sha256sums = 67518573195c11b0826b2c6a3243a136fb128902bdabf13e77687d917ba9f97d
+ depends = sdl2
+ source = nosefart-3.3.zip::https://github.com/RiedleroD/nosefart/archive/refs/tags/3.3.zip
+ sha256sums = 3ac217c9f85bafc797fb2a584b8acf140507855db10e2dd6a6da1249da76fac3
pkgname = nosefart
-
diff --git a/PKGBUILD b/PKGBUILD
index ee0fbe164b3c..e0c7489b99f5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,37 +1,30 @@
-# Maintainer: Alexander Rødseth <rodseth@gmail.com>
+# Maintainer: Riedler <dev@riedler.wien>
+# Contributor: David Birks <david@tellus.space>
+# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Alexander Bachler Jansson <alexander.bachler.jansson@gmail.com>
# Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org>
# Contributor: Simon Morgan <simon@16hz.net>
pkgname=nosefart
-pkgver=2.9
-pkgrel=3
-pkgdesc='NES sound format player'
+pkgver=3.3
+pkgrel=0
+pkgdesc='NES sound format (nsf) player'
arch=('x86_64' 'i686')
-url='http://nosefart.sourceforge.net/'
-depends=('libpulse')
+url='https://github.com/RiedleroD/nosefart'
+depends=('sdl2')
license=('GPL2')
-source=("https://downloads.sourceforge.net/nosefart/nosefart-$pkgver-mls.tar.bz2"
- 'nosefart-2.9-pulseaudio-mls.patch')
-sha256sums=('43fa05190cc6a62f30662dcb65768413a77a73962961e520ccd9245cd3e35a39'
- '67518573195c11b0826b2c6a3243a136fb128902bdabf13e77687d917ba9f97d')
-
-prepare() {
- cd "$pkgname-$pkgver-mls"
-
- patch -p1 -i ../nosefart-2.9-pulseaudio-mls.patch
-}
-
+source=("nosefart-$pkgver.zip::https://github.com/RiedleroD/nosefart/archive/refs/tags/$pkgver.zip")
+sha256sums=('3ac217c9f85bafc797fb2a584b8acf140507855db10e2dd6a6da1249da76fac3')
build() {
- cd "$pkgname-$pkgver-mls"
+ cd "$pkgname-$pkgver"
make WANT_DEBUG=FALSE
}
package() {
- cd "$pkgname-$pkgver-mls"
+ cd "$pkgname-$pkgver"
- make PREFIX="$pkgdir/usr" install
+ make PREFIX="$pkgdir/usr" install WANT_DEBUG=FALSE
}
# vim:set ts=2 sw=2 et:
diff --git a/nosefart-2.9-pulseaudio-mls.patch b/nosefart-2.9-pulseaudio-mls.patch
deleted file mode 100644
index 70b03480c336..000000000000
--- a/nosefart-2.9-pulseaudio-mls.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-diff -rupN nosefart-2.9-mls/Makefile nosefart-2.9-pulseaudio-mls/Makefile
---- nosefart-2.9-mls/Makefile 2013-05-10 21:38:51.000000000 +0200
-+++ nosefart-2.9-pulseaudio-mls/Makefile 2014-06-28 03:07:43.520316254 +0200
-@@ -2,7 +2,7 @@
- # Configuration
-
- CC = gcc
--CFLAGS =
-+CFLAGS = -lpulse -lpulse-simple
- LDFLAGS = -lm
- PREFIX = /usr
- WANT_DEBUG=TRUE
-diff -rupN nosefart-2.9-mls/src/linux/main_linux.c nosefart-2.9-pulseaudio-mls/src/linux/main_linux.c
---- nosefart-2.9-mls/src/linux/main_linux.c 2013-05-10 21:37:49.000000000 +0200
-+++ nosefart-2.9-pulseaudio-mls/src/linux/main_linux.c 2014-06-28 02:53:13.660348144 +0200
-@@ -18,6 +18,7 @@ UNIX systems */
- #include <sys/ioctl.h>
- #include <sys/types.h>
- #include <sys/soundcard.h>
-+#include <pulse/simple.h>
- #include <sys/stat.h>
-
- #include "types.h"
-@@ -57,6 +58,16 @@ static int bufferSize;
- static unsigned char *buffer = 0, *bufferPos = 0;
- static int audiofd;
-
-+pa_simple *audio = NULL;
-+pa_sample_spec audiospec = {
-+ .format = PA_SAMPLE_U8,
-+ .rate = 44100,
-+ .channels = 1
-+};
-+
-+int paerror;
-+
-+
- static int * plimit_frames = NULL;
- static int shm_id;
-
-@@ -182,12 +193,13 @@ void handle_auto_calc(char * filename, i
-
- /* HAS ROOT PERMISSIONS -- BE CAREFUL */
- /* Open up the DSP, then drop the root permissions */
--static void open_hardware(const char *device)
-+//static void open_hardware(const char *device)
-+static void open_hardware()
- {
- struct stat status;
-
- /* Open the file (with root permissions, if we have them) */
-- if(-1 == (audiofd = open(device, O_WRONLY, 0)))
-+/* if(-1 == (audiofd = open(device, O_WRONLY, 0)))
- {
- switch(errno)
- {
-@@ -199,10 +211,30 @@ static void open_hardware(const char *de
- exit(1);
- }
- }
-+*/
-+ if ( bits == 8 ) {
-+ audiospec.format = PA_SAMPLE_U8;
-+ } else {
-+ audiospec.format = PA_SAMPLE_S16LE;
-+ }
-+
-+ audiospec.channels = 1;
-+ audiospec.rate = freq;
-+
-+ audio = pa_simple_new(NULL, // Default server
-+ "nosefart", // appname
-+ PA_STREAM_PLAYBACK,
-+ NULL, // Default device
-+ "Music", // Stream description
-+ &audiospec, // Sample format
-+ NULL, // Use default channel map
-+ NULL, // Use default buffering attributes.
-+ NULL // Ignore error code.
-+ );
-
- /* For safety, we should check that device is, in fact, a device.
- `nosefart -d /etc/passwd MegaMan2.nsf` wouldn't sound so pretty. */
-- if(-1 == fstat(audiofd, &status))
-+ /* if(-1 == fstat(audiofd, &status))
- {
- switch(errno)
- {
-@@ -217,15 +249,18 @@ static void open_hardware(const char *de
- printf("Unable to stat %s.\n", device);
- exit(1);
- }
-- }
-+ }*/
- /* if it's not a char device and it's not /dev/dsp */
- /* The second check is because when run with esddsp, /dev/dsp
- doesn't show up as a char device. The original author (Matthew Conte) seems
- to have thought that esddsp should work without this hack. Is doing this
- bad? --Matthew Strait */
-- if( !S_ISCHR(status.st_mode) && strcmp("/dev/dsp", device))
-+/* if( !S_ISCHR(status.st_mode) && strcmp("/dev/dsp", device))
- {
-- printf("%s is not a character device.\n", device);
-+ printf("%s is not a character device.\n", device);*/
-+
-+ if ( audio == NULL ) {
-+ printf("Could not connect to Pulseaudio server.\n");
- exit(1);
- }
-
-@@ -233,14 +268,19 @@ static void open_hardware(const char *de
- if(geteuid() != getuid()) setuid(getuid());
- }
-
-+
- /* Configure the DSP */
-+/* This function used to perform the various ioctls on /dev/dsp
-+ * when written for OSS. Device is largely configured when opened
-+ * under pulseaudio. -- kjotte 14Mar2009
-+ */
- static void init_hardware(void)
- {
- int stereo = 0;
- int param, retval, logDataSize;
- int format;
-
-- switch(bits)
-+/* switch(bits)
- {
- case 8:
- format = AFMT_U8;
-@@ -252,12 +292,12 @@ static void init_hardware(void)
- printf("Bad sample depth: %i\n", bits);
- exit(1);
- }
--
-+ */
- /* sound buffer */
- dataSize = freq / nsf->playback_rate * (bits / 8);
-
- /* Configure the DSP */
-- logDataSize = -1;
-+ /* logDataSize = -1;
- while((1 << ++logDataSize) < dataSize);
- param = 0x10000 | logDataSize + 4;
- retval = ioctl(audiofd, SNDCTL_DSP_SETFRAGMENT, &param);
-@@ -294,8 +334,10 @@ static void init_hardware(void)
- printf("Unable to get buffer size\n");
- exit(1);
- }
-+*/
- /* set up our data buffer */
-- bufferSize = param;
-+// bufferSize = param;
-+ bufferSize = (int)pa_frame_size(&audiospec);
- buffer = malloc((bufferSize / dataSize + 1) * dataSize);
- bufferPos = buffer;
- memset(buffer, 0, bufferSize);
-@@ -304,7 +346,8 @@ static void init_hardware(void)
- /* close what we've opened */
- static void close_hardware(void)
- {
-- close(audiofd);
-+ // close(audiofd);
-+ pa_simple_free(audio);
- free(buffer);
- buffer = 0;
- bufferSize = 0;
-@@ -319,7 +362,7 @@ static void show_help(void)
- printf("\t-h \tHelp\n");
- printf("\t-v \tVersion information\n");
- printf("\n\t-t x\tStart playing track x (default: 1)\n");
-- printf("\n\t-d x\tUse device x (default: /dev/dsp)\n");
-+ //printf("\n\t-d x\tUse device x (default: /dev/dsp)\n");
- printf("\t-s x\tPlay at x times the normal speed.\n");
- printf("\t-f x\tUse x sampling rate (default: 44100)\n");
- printf("\t-B x\tUse sample size of x bits (default: 8)\n");
-@@ -554,7 +597,8 @@ static void play(char * filename, int tr
- if(bufferPos >= buffer + bufferSize)
- {
- if(frames >= starting_frame)
-- write(audiofd, buffer, bufferPos - buffer);
-+ //write(audiofd, buffer, bufferPos - buffer);
-+ pa_simple_write(audio,buffer,bufferPos-buffer,&paerror);
- bufferPos = buffer;
- }
-
-@@ -581,7 +625,7 @@ static void close_nsf_file(void)
- /* HAS ROOT PERMISSIONS -- BE CAREFUL */
- int main(int argc, char **argv)
- {
-- char *device = "/dev/dsp";
-+ //char *device = "/dev/dsp";
- char *filename;
- int track = 1;
- int done = 0;
-@@ -611,10 +655,10 @@ int main(int argc, char **argv)
- case 'v':
- show_info();
- break;
-- case 'd':
-+ /* case 'd':
- device = malloc( strlen(optarg) + 1 );
- strcpy(device, optarg);
-- break;
-+ break;*/
- case 't':
- track = strtol(optarg, 0, 10);
- break;
-@@ -672,7 +716,8 @@ int main(int argc, char **argv)
- }
- /* open_hardware uses, then discards, root permissions */
- if(!justdisplayinfo)
-- open_hardware(device);
-+ //open_hardware(device);
-+ open_hardware();
-
- load_nsf_file(filename);
-