1 { lib, stdenv, fetchFromGitHub }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
8 owner = "iamthehorker";
11 sha256 = "sha256-eEUhOrKqb2hHWanY+knpY9FBEnjkkFTB+x6BZgMBpbo=";
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'
23 "PREFIX=${placeholder "out"}"
24 # disable static builds
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
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 ];