2021-08-06 12:33:04 +02:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libfreeaptx";
|
|
|
|
version = "0.1.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "iamthehorker";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-eEUhOrKqb2hHWanY+knpY9FBEnjkkFTB+x6BZgMBpbo=";
|
|
|
|
};
|
|
|
|
|
2022-05-20 20:56:56 +02:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
2022-05-19 06:20:00 +02:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace '-soname' '-install_name' \
|
|
|
|
--replace 'lib$(NAME).so' 'lib$(NAME).dylib'
|
2022-05-20 20:56:56 +02:00
|
|
|
'';
|
2022-05-19 06:20:00 +02:00
|
|
|
|
2021-08-06 12:33:04 +02:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
# disable static builds
|
|
|
|
"ANAME="
|
|
|
|
"AOBJECTS="
|
|
|
|
"STATIC_UTILITIES="
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-05-20 20:56:56 +02:00
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
2022-05-19 06:20:00 +02:00
|
|
|
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
|
2022-05-20 20:56:56 +02:00
|
|
|
'';
|
2022-05-19 06:20:00 +02:00
|
|
|
|
2021-08-06 12:33:04 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Free Implementation of Audio Processing Technology codec (aptX)";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
homepage = "https://github.com/iamthehorker/libfreeaptx";
|
2022-05-19 06:20:00 +02:00
|
|
|
platforms = platforms.unix;
|
2021-08-06 12:33:04 +02:00
|
|
|
maintainers = with maintainers; [ kranzes ];
|
|
|
|
};
|
|
|
|
}
|