2015-02-09 01:16:54 +00:00
|
|
|
{ stdenv, fetchurl }:
|
2011-06-07 15:42:24 +01:00
|
|
|
|
2015-02-09 01:16:54 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "gsm-${version}";
|
|
|
|
version = "1.0.13";
|
2011-06-07 15:42:24 +01:00
|
|
|
|
2015-02-09 01:16:54 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.quut.com/gsm/${name}.tar.gz";
|
|
|
|
sha256 = "1bcjl2h60gvr1dc5a963h3vnz9zl6n8qrfa3qmb2x3229lj1iiaj";
|
|
|
|
};
|
2011-06-07 15:42:24 +01:00
|
|
|
|
2015-02-14 02:04:03 +00:00
|
|
|
patchPhase = ''
|
|
|
|
# Fix include directory
|
2015-02-09 15:30:10 +00:00
|
|
|
sed -e 's,$(GSM_INSTALL_ROOT)/inc,$(GSM_INSTALL_ROOT)/include/gsm,' -i Makefile
|
2015-02-14 02:04:03 +00:00
|
|
|
|
2015-02-09 01:16:54 +00:00
|
|
|
makeFlags="$makeFlags INSTALL_ROOT=$out"
|
2015-02-14 02:04:03 +00:00
|
|
|
|
|
|
|
# Build shared library instead of static
|
|
|
|
sed -e 's,-c -O2 -DNeedFunctionPrototypes=1,-c -O2 -fPIC -DNeedFunctionPrototypes=1,' -i Makefile
|
|
|
|
sed -e 's,libgsm.a,libgsm.so,' -i Makefile
|
|
|
|
sed -e 's/$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)/$(LD) -shared -Wl,-soname,libgsm.so -o $(LIBGSM) $(GSM_OBJECTS) -lc/' -i Makefile
|
|
|
|
sed -e 's,$(RANLIB) $(LIBGSM),,' -i Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
''SHELL=${stdenv.shell}''
|
|
|
|
];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/"{bin,lib,man/man1,man/man3,include/gsm}
|
2011-06-07 15:42:24 +01:00
|
|
|
'';
|
|
|
|
|
2015-02-10 17:51:54 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-fPIC";
|
|
|
|
|
2015-02-09 01:16:54 +00:00
|
|
|
parallelBuild = false;
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2011-06-07 15:42:24 +01:00
|
|
|
meta = {
|
2015-02-09 01:16:54 +00:00
|
|
|
description = "Lossy speech compression codec";
|
|
|
|
homepage = http://www.quut.com/gsm/;
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ codyopel raskin ];
|
|
|
|
platforms = platforms.all;
|
2011-06-07 15:42:24 +01:00
|
|
|
};
|
2015-02-09 01:16:54 +00:00
|
|
|
}
|