1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-26 07:31:20 +00:00
nixpkgs/pkgs/development/libraries/gsm/default.nix
R. RyanTM fb5fbbe29e gsm: 1.0.17 -> 1.0.18
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.

This update was made based on information from https://repology.org/metapackage/gsm/versions.

These checks were done:

- built on NixOS
- ran ‘/nix/store/99q2w40pn8n5mihvg5ar9jwlzafpp9gl-gsm-1.0.18/bin/toast -h’ got 0 exit code
- ran ‘/nix/store/99q2w40pn8n5mihvg5ar9jwlzafpp9gl-gsm-1.0.18/bin/toast help’ got 0 exit code
- ran ‘/nix/store/99q2w40pn8n5mihvg5ar9jwlzafpp9gl-gsm-1.0.18/bin/tcat -h’ got 0 exit code
- ran ‘/nix/store/99q2w40pn8n5mihvg5ar9jwlzafpp9gl-gsm-1.0.18/bin/tcat help’ got 0 exit code
- ran ‘/nix/store/99q2w40pn8n5mihvg5ar9jwlzafpp9gl-gsm-1.0.18/bin/untoast -h’ got 0 exit code
- ran ‘/nix/store/99q2w40pn8n5mihvg5ar9jwlzafpp9gl-gsm-1.0.18/bin/untoast help’ got 0 exit code
- found 1.0.18 with grep in /nix/store/99q2w40pn8n5mihvg5ar9jwlzafpp9gl-gsm-1.0.18
- directory tree listing: https://gist.github.com/af6b37d2f0a0b0757d66e91dce102967
2018-05-07 03:59:01 -07:00

54 lines
1.7 KiB
Nix

{ stdenv, fetchurl
, staticSupport ? false # Compile statically (support for packages that look for the static object)
}:
let
inherit (stdenv) isDarwin;
inherit (stdenv.lib) optional optionalString;
in
stdenv.mkDerivation rec {
name = "gsm-${version}";
version = "1.0.18";
src = fetchurl {
url = "http://www.quut.com/gsm/${name}.tar.gz";
sha256 = "041amvpz8cvxykl3pwqldrzxligmmzcg8ncdnxbg32rlqf3q1xh4";
};
patchPhase = ''
# Fix include directory
sed -e 's,$(GSM_INSTALL_ROOT)/inc,$(GSM_INSTALL_ROOT)/include/gsm,' -i Makefile
'' + optionalString (!staticSupport) (
(if isDarwin then ''
# Build dylib on Darwin
sed -e 's,libgsm.a,libgsm.dylib,' -i Makefile
sed -e 's,$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS),$(LD) -o $(LIBGSM) -dynamiclib -install_name $(GSM_INSTALL_ROOT)/$(LIBGSM) $(GSM_OBJECTS) -lc,' -i Makefile
'' else ''
# Build ELF shared object by default
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
'') + ''
# Remove line that is unused when building shared libraries
sed -e 's,$(RANLIB) $(LIBGSM),,' -i Makefile
''
);
makeFlags = [
"SHELL=${stdenv.shell}"
"INSTALL_ROOT=$(out)"
] ++ optional stdenv.cc.isClang "CC=clang";
preInstall = "mkdir -p $out/{bin,lib,man/man1,man/man3,include/gsm}";
parallelBuild = false;
meta = with stdenv.lib; {
description = "Lossy speech compression codec";
homepage = http://www.quut.com/gsm/;
license = licenses.bsd2;
maintainers = with maintainers; [ codyopel raskin ];
platforms = platforms.unix;
};
}