summary refs log tree commit diff
path: root/pkgs/development/libraries/gsm/default.nix
blob: 31be86ee13ecd7f48bd04736116f69080f3bb219 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
x@{builderDefsPackage
  , ...}:
builderDefsPackage
(a :
let
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
    [];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    baseName="gsm";
    version="1.0.13";
    name="${baseName}-${version}";
    url="http://www.quut.com/gsm/${name}.tar.gz";
    hash="1bcjl2h60gvr1dc5a963h3vnz9zl6n8qrfa3qmb2x3229lj1iiaj";
  };
in
rec {
  src = a.fetchurl {
    url = sourceInfo.url;
    sha256 = sourceInfo.hash;
  };

  inherit (sourceInfo) name version;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["createDirs" "setVars" "doMakeInstall"];

  createDirs = a.fullDepEntry ''
    mkdir -p "$out/"{bin,lib,share/man,share/info,include/gsm}
  '' ["minInit" "defEnsureDir"];

  setVars = a.noDepEntry ''
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
  '';

  makeFlags = [
    ''INSTALL_ROOT="$out"''
    ''GSM_INSTALL_INC="$out/include/gsm"''
  ];

  meta = {
    description = "A GSM codec library";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms;
      linux;
    license = a.lib.licenses.free;
  };
  passthru = {
    updateInfo = {
      downloadPage = "http://www.quut.com/gsm/";
    };
  };
}) x