Skip to content

Commit

Permalink
Merge pull request #173689 from marsam/fix-libfreeaptx-darwin
Browse files Browse the repository at this point in the history
libfreeaptx: fix build on darwin
  • Loading branch information
marsam authored May 20, 2022
2 parents a503ec6 + 152765c commit c4998c7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkgs/development/libraries/libfreeaptx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-eEUhOrKqb2hHWanY+knpY9FBEnjkkFTB+x6BZgMBpbo=";
};

postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace Makefile \
--replace '-soname' '-install_name' \
--replace 'lib$(NAME).so' 'lib$(NAME).dylib'
'';

makeFlags = [
"PREFIX=${placeholder "out"}"
# disable static builds
Expand All @@ -21,11 +27,18 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

postInstall = lib.optionalString stdenv.isDarwin ''
install_name_tool -change libfreeaptx.dylib.0 $out/lib/libfreeaptx.dylib.0 $out/bin/freeaptxdec
install_name_tool -change libfreeaptx.dylib.0 $out/lib/libfreeaptx.dylib.0 $out/bin/freeaptxenc
install_name_tool -id $out/lib/libfreeaptx.dylib $out/lib/libfreeaptx.dylib
install_name_tool -id $out/lib/libfreeaptx.dylib.0 $out/lib/libfreeaptx.dylib.0
'';

meta = with lib; {
description = "Free Implementation of Audio Processing Technology codec (aptX)";
license = licenses.lgpl21Plus;
homepage = "https://github.com/iamthehorker/libfreeaptx";
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ kranzes ];
};
}

0 comments on commit c4998c7

Please sign in to comment.