mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
mpg321: new recipe for a commandline mp3 player (#932)
Adding new recipe for mpg321, a simple and lightweight commandline mp3 player.
This commit is contained in:
committed by
fbrosson
parent
2751973202
commit
bb650ff109
71
media-sound/mpg321/mpg321-0.3.2.recipe
Normal file
71
media-sound/mpg321/mpg321-0.3.2.recipe
Normal file
@@ -0,0 +1,71 @@
|
||||
SUMMARY="A simple and lightweight command line MP3 Player"
|
||||
DESCRIPTION="mpg321 is a very popular command-line mp3 player. mpg321 is used \
|
||||
for frontends, as an mp3 player and as an mp3 to wave file decoder (primarily \
|
||||
for use with CD-recording software)."
|
||||
HOMEPAGE="http://mpg321.sourceforge.net/"
|
||||
COPYRIGHT="2001 Joe Drew
|
||||
2006-2012 Nanakos Chrysostomos"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://downloads.sourceforge.net/mpg321/mpg321_$portVersion.orig.tar.gz"
|
||||
CHECKSUM_SHA256="056fcc03e3f5c5021ec74bb5053d32c4a3b89b4086478dcf81adae650eac284e"
|
||||
SOURCE_DIR="mpg321-$portVersion-orig"
|
||||
PATCHES="mpg321-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
|
||||
|
||||
if [ "$targetArchitecture" != x86_gcc2 ]; then
|
||||
commandBinDir=$binDir
|
||||
else
|
||||
commandBinDir=$prefix/bin
|
||||
fi
|
||||
|
||||
PROVIDES="
|
||||
mpg321$secondaryArchSuffix = $portVersion
|
||||
cmd:mpg321 = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libao$secondaryArchSuffix
|
||||
lib:libid3tag$secondaryArchSuffix
|
||||
lib:libmad$secondaryArchSuffix
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libao$secondaryArchSuffix
|
||||
devel:libid3tag$secondaryArchSuffix
|
||||
devel:libmad$secondaryArchSuffix
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:aclocal
|
||||
cmd:autoreconf
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
autoreconf -fi
|
||||
runConfigure ./configure \
|
||||
--enable-mpg123-symlink=NO \
|
||||
--enable-alsa=NO \
|
||||
LIBS=-lnetwork
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install \
|
||||
bindir=$commandBinDir \
|
||||
datadir=$dataDir \
|
||||
mandir=$manDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
make check
|
||||
}
|
||||
103
media-sound/mpg321/patches/mpg321-0.3.2.patchset
Normal file
103
media-sound/mpg321/patches/mpg321-0.3.2.patchset
Normal file
@@ -0,0 +1,103 @@
|
||||
From fe24ad2d395ffecfafc39e24db00eb3253e13ed7 Mon Sep 17 00:00:00 2001
|
||||
From: raefaldhia <raefaldhiamartya@gmail.com>
|
||||
Date: Sat, 17 Dec 2016 12:18:33 +0700
|
||||
Subject: Add compatibility to build on haiku
|
||||
|
||||
|
||||
diff --git a/mpg321.c b/mpg321.c
|
||||
index 19282bb..e728d7e 100644
|
||||
--- a/mpg321.c
|
||||
+++ b/mpg321.c
|
||||
@@ -47,7 +47,6 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/sem.h>
|
||||
-#include <sys/shm.h>
|
||||
|
||||
#include <getopt.h> /* GNU getopt is needed, so I included it */
|
||||
#include "mpg321.h"
|
||||
@@ -614,56 +613,7 @@ int main(int argc, char *argv[])
|
||||
goto out;
|
||||
//exit(EXIT_FAILURE);
|
||||
}
|
||||
-
|
||||
- /* Shared Memory */
|
||||
- mem_key = ftok(argv[0],1);
|
||||
- shm_id = shmget(mem_key,buffer_size * sizeof(output_frame), IPC_CREAT | S_IREAD | S_IWRITE);
|
||||
- if(shm_id == -1)
|
||||
- {
|
||||
- perror("Cannot initialize shared buffer");
|
||||
- goto out;
|
||||
- //exit(EXIT_FAILURE);
|
||||
- }
|
||||
- Output_Queue = shmat(shm_id,NULL,0);
|
||||
- if(*(int *)Output_Queue == -1)
|
||||
- {
|
||||
- perror("Error while attaching shared buffer to mad_decoder");
|
||||
- if(shmctl(shm_id,IPC_RMID,NULL))
|
||||
- perror("Cannot destroy shared buffer");
|
||||
- goto out;
|
||||
- //exit(EXIT_FAILURE);
|
||||
- }
|
||||
- static int n;
|
||||
- for(n=0;n<buffer_size;n++)
|
||||
- {
|
||||
- memset((Output_Queue+n)->data,'\0',4608);
|
||||
- memset((Output_Queue+n)->time,'\0',80);
|
||||
- (Output_Queue+n)->length = 0;
|
||||
- (Output_Queue+n)->seconds = 0;
|
||||
- (Output_Queue+n)->num_frames = 0;
|
||||
- }
|
||||
|
||||
- frames_key = ftok(argv[0],2);
|
||||
- frames_id = shmget(frames_key,buffer_size * sizeof(decoded_frames), IPC_CREAT | S_IREAD | S_IWRITE);
|
||||
- if(frames_id == -1)
|
||||
- {
|
||||
- perror("Cannot initialize shared frames counter");
|
||||
- goto out;
|
||||
- //exit(EXIT_FAILURE);
|
||||
- }
|
||||
- Decoded_Frames = shmat(frames_id,NULL,0);
|
||||
- if(*(int *)Decoded_Frames == -1)
|
||||
- {
|
||||
- perror("Error while attaching shared frames counter to mad_decoder");
|
||||
- if(shmctl(frames_id,IPC_RMID,NULL))
|
||||
- perror("Cannot destroy shared frames counter");
|
||||
- goto out;
|
||||
- //exit(EXIT_FAILURE);
|
||||
- }
|
||||
-
|
||||
- Decoded_Frames->is_http = 0;
|
||||
- Decoded_Frames->is_file = 0;
|
||||
-
|
||||
}
|
||||
else {
|
||||
ao_initialize();
|
||||
@@ -1187,12 +1137,6 @@ out:
|
||||
perror("Error while waiting for output process to exit");
|
||||
if(semctl(semarray,0,IPC_RMID) == -1)
|
||||
perror("Error while destroying semaphores");
|
||||
- if(shmdt(Output_Queue) == -1)
|
||||
- perror("Error while detaching shared buffer");
|
||||
- if(shmctl(shm_id,IPC_RMID,NULL))
|
||||
- perror("Cannot destroy shared buffer");
|
||||
- if(shmctl(frames_id,IPC_RMID,NULL))
|
||||
- perror("Cannot destroy shared buffer");
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
diff --git a/options.c b/options.c
|
||||
index dae001e..3ba0f91 100644
|
||||
--- a/options.c
|
||||
+++ b/options.c
|
||||
@@ -312,7 +312,6 @@ void parse_options(int argc, char *argv[], playlist *pl)
|
||||
case 'I':
|
||||
/* We only try to get high priority. If it fails (just as
|
||||
mpg123 does when run as a user), that's fine */
|
||||
- setpriority(PRIO_PROCESS, getpid(), -20);
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
--
|
||||
2.7.0
|
||||
|
||||
Reference in New Issue
Block a user