base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / li / libfreeaptx / package.nix
blob7a59cde8433e780150546b5ee668e0c7d0a1ca67
1 { lib, stdenv, fetchFromGitHub }:
3 stdenv.mkDerivation rec {
4   pname = "libfreeaptx";
5   version = "0.1.1";
7   src = fetchFromGitHub {
8     owner = "iamthehorker";
9     repo = pname;
10     rev = version;
11     sha256 = "sha256-eEUhOrKqb2hHWanY+knpY9FBEnjkkFTB+x6BZgMBpbo=";
12   };
14   outputs = [ "out" "dev" ];
16   postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
17     substituteInPlace Makefile \
18       --replace '-soname' '-install_name' \
19       --replace 'lib$(NAME).so' 'lib$(NAME).dylib'
20   '';
22   makeFlags = [
23     "PREFIX=${placeholder "out"}"
24     # disable static builds
25     "ANAME="
26     "AOBJECTS="
27     "STATIC_UTILITIES="
28   ];
30   enableParallelBuilding = true;
32   postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
33     install_name_tool -change libfreeaptx.dylib.0 $out/lib/libfreeaptx.dylib.0 $out/bin/freeaptxdec
34     install_name_tool -change libfreeaptx.dylib.0 $out/lib/libfreeaptx.dylib.0 $out/bin/freeaptxenc
35     install_name_tool -id $out/lib/libfreeaptx.dylib $out/lib/libfreeaptx.dylib
36     install_name_tool -id $out/lib/libfreeaptx.dylib.0 $out/lib/libfreeaptx.dylib.0
37   '';
39   meta = with lib; {
40     description = "Free Implementation of Audio Processing Technology codec (aptX)";
41     license = licenses.lgpl21Plus;
42     homepage = "https://github.com/iamthehorker/libfreeaptx";
43     platforms = platforms.unix;
44     maintainers = with maintainers; [ kranzes ];
45   };