Add recipe for musepack.

This commit is contained in:
Adrien Destugues
2014-09-13 17:53:04 +02:00
parent ba7cf24959
commit 48856d9db2
2 changed files with 243 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
SUMMARY="Musepack SV8 libraries and utilities"
DESCRIPTION="Musepack or MPC is an open source lossy audio codec, specifically \
optimized for transparent compression of stereo audio at bitrates of 160180 \
(manual set allows bitrates up to 320) kbit/s. It was formerly known as \
MPEGplus, MPEG+ or MP+.
"
ARCHITECTURES="x86_gcc2"
REVISION="1"
HOMEPAGE="https://www.musepack.net"
LICENSE="
BSD (3-clause)
GNU LGPL v2.1
"
COPYRIGHT="
1997-2011 Andree Buschmann, Frank Klemm
"
SRC_URI="http://files.musepack.net/source/musepack_src_r475.tar.gz"
SOURCE_DIR="musepack_src_r475"
PROVIDES="
musepack_tools = $portVersion
cmd:mpc2sv8
cmd:mpcchap
cmd:mpccut
cmd:mpcdec
cmd:mpcenc
cmd:mpcgain
cmd:wavcmp
lib:libmpcdec
"
REQUIRES="
haiku >= $haikuVersion
lib:libcuefile
lib:libreplaygain
"
BUILD_REQUIRES="
devel:libreplaygain
devel:libcuefile
"
BUILD_PREREQUIRES="
haiku_devel >= $haikuVersion
cmd:cmake
cmd:gcc
cmd:make
"
PROVIDES_devel="
musepack_tools_devel = $portVersion
devel:libmpcdec
"
REQUIRES_devel="
musepack_tools == $portVersion base
"
BUILD()
{
cmake . -DCMAKE_INSTALL_PREFIX=$prefix \
-DCUEFILE_INCLUDE_DIR=/system/develop/headers \
-DREPLAY_GAIN_INCLUDE_DIR=/system/develop/headers
make $jobArgs
}
INSTALL()
{
make install
mkdir -p $developDir
mv $prefix/include $includeDir
rm -r $includeDir/mpc/.svn
mkdir -p $libDir
cp libmpcdec/libmpcdec.so $libDir/libmpcdec.so
prepareInstalledDevelLib libmpcdec
packageEntries devel $developDir
}
TEST()
{
make check
}

View File

@@ -0,0 +1,156 @@
From 239693cbb2e5f09448d2a9c6c700613a654ca043 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 13 Sep 2014 17:52:12 +0200
Subject: Haiku and gcc2 fixes.
diff --git a/mpc2sv8/CMakeLists.txt b/mpc2sv8/CMakeLists.txt
index eea0df0..694a391 100755
--- a/mpc2sv8/CMakeLists.txt
+++ b/mpc2sv8/CMakeLists.txt
@@ -24,10 +24,6 @@ if(WIN32)
target_link_libraries(mpc2sv8 winmm)
endif(WIN32)
-if(NOT MSVC)
-target_link_libraries(mpc2sv8 m)
-endif(NOT MSVC)
-
if(CMAKE_SYSTEM_NAME STREQUAL OpenBSD)
target_link_libraries(mpc2sv8 ossaudio)
endif(CMAKE_SYSTEM_NAME STREQUAL OpenBSD)
diff --git a/mpcchap/CMakeLists.txt b/mpcchap/CMakeLists.txt
index 743d5b6..7b379d5 100755
--- a/mpcchap/CMakeLists.txt
+++ b/mpcchap/CMakeLists.txt
@@ -23,8 +23,4 @@ endif(SHARED)
target_link_libraries(mpcchap mpcenc_static)
target_link_libraries(mpcchap ${CUEFILE_LIBRARY})
-if(NOT MSVC)
-target_link_libraries(mpcchap m)
-endif(NOT MSVC)
-
install(TARGETS mpcchap RUNTIME DESTINATION bin)
diff --git a/mpccut/CMakeLists.txt b/mpccut/CMakeLists.txt
index 7d15ce2..1c35147 100755
--- a/mpccut/CMakeLists.txt
+++ b/mpccut/CMakeLists.txt
@@ -20,8 +20,4 @@ endif(SHARED)
target_link_libraries(mpccut mpcenc_static)
-if(NOT MSVC)
-target_link_libraries(mpccut m)
-endif(NOT MSVC)
-
install(TARGETS mpccut RUNTIME DESTINATION bin)
diff --git a/mpcdec/CMakeLists.txt b/mpcdec/CMakeLists.txt
index da3123f..404711c 100755
--- a/mpcdec/CMakeLists.txt
+++ b/mpcdec/CMakeLists.txt
@@ -12,10 +12,6 @@ endif(MSVC)
add_executable(mpcdec_cmd mpcdec.c)
-if(NOT MSVC)
-target_link_libraries(mpcdec_cmd m)
-endif(NOT MSVC)
-
target_link_libraries(mpcdec_cmd wavformat_static)
if(SHARED)
diff --git a/mpcenc/CMakeLists.txt b/mpcenc/CMakeLists.txt
index f16824a..d3321b8 100755
--- a/mpcenc/CMakeLists.txt
+++ b/mpcenc/CMakeLists.txt
@@ -18,10 +18,6 @@ if(WIN32)
target_link_libraries(mpcenc winmm)
endif(WIN32)
-if(NOT MSVC)
-target_link_libraries(mpcenc m)
-endif(NOT MSVC)
-
if(CMAKE_SYSTEM_NAME STREQUAL OpenBSD)
target_link_libraries(mpcenc ossaudio)
endif(CMAKE_SYSTEM_NAME STREQUAL OpenBSD)
diff --git a/mpcenc/keyboard.c b/mpcenc/keyboard.c
index 6522b97..a8c81b1 100755
--- a/mpcenc/keyboard.c
+++ b/mpcenc/keyboard.c
@@ -17,6 +17,7 @@
*/
#include "mpcenc.h"
+#include <sys/time.h>
#if defined _WIN32 || defined __TURBOC__
diff --git a/mpcgain/CMakeLists.txt b/mpcgain/CMakeLists.txt
index 5445faf..1c125de 100755
--- a/mpcgain/CMakeLists.txt
+++ b/mpcgain/CMakeLists.txt
@@ -25,8 +25,4 @@ else(SHARED)
target_link_libraries(mpcgain mpcdec_static)
endif(SHARED)
-if(NOT MSVC)
-target_link_libraries(mpcgain m)
-endif(NOT MSVC)
-
install(TARGETS mpcgain RUNTIME DESTINATION bin)
diff --git a/mpcgain/mpcgain.c b/mpcgain/mpcgain.c
index d367fff..eb804f1 100755
--- a/mpcgain/mpcgain.c
+++ b/mpcgain/mpcgain.c
@@ -77,8 +77,8 @@ static mpc_inline MPC_SAMPLE_FORMAT max_abs(MPC_SAMPLE_FORMAT a, MPC_SAMPLE_FORM
static MPC_SAMPLE_FORMAT analyze_get_max(MPC_SAMPLE_FORMAT * sample_buffer, int sample_nb)
{
- Float_t left_samples[MPC_FRAME_LENGTH * sizeof(Float_t)];
- Float_t right_samples[MPC_FRAME_LENGTH * sizeof(Float_t)];
+ float_t left_samples[MPC_FRAME_LENGTH * sizeof(float_t)];
+ float_t right_samples[MPC_FRAME_LENGTH * sizeof(float_t)];
MPC_SAMPLE_FORMAT max = 0;
int i;
diff --git a/wavcmp/wavcmp.c b/wavcmp/wavcmp.c
index 702a352..f4b61b6 100755
--- a/wavcmp/wavcmp.c
+++ b/wavcmp/wavcmp.c
@@ -45,6 +45,7 @@ main(int argc, char **argv)
int is_wav_output;
int err;
int total_samples, total_diff;
+ t_wav_input_file_callback wavi_fc;
if(4 < argc && argc < 3)
{
@@ -52,7 +53,6 @@ main(int argc, char **argv)
return 0;
}
- t_wav_input_file_callback wavi_fc;
memset(&wav_in_1, 0, sizeof wav_in_1);
wavi_fc.m_read = wav_read;
wavi_fc.m_user_data = fopen(argv[1], "rb");
@@ -102,6 +102,7 @@ main(int argc, char **argv)
{
short sample_buff[2][512];
unsigned int samples[2];
+ int i = 0;
samples[0] = waveformat_input_process_int16(& wav_in_1, sample_buff[0], 512);
samples[1] = waveformat_input_process_int16(& wav_in_2, sample_buff[1], 512);
@@ -109,7 +110,6 @@ main(int argc, char **argv)
if (samples[0] != samples[1] || samples[0] == 0)
break;
- int i = 0;
for( ; i < samples[0]; i++) {
sample_buff[0][i] -= sample_buff[1][i];
if (sample_buff[0][i]) {
--
1.8.3.4