2024-06-20 14:57:18 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
gitUpdater,
|
|
|
|
meson,
|
|
|
|
python3,
|
|
|
|
ninja,
|
|
|
|
fixedPoint ? false,
|
|
|
|
withCustomModes ? true,
|
|
|
|
withIntrinsics ? stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isx86,
|
|
|
|
withAsm ? false,
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
# tests
|
|
|
|
ffmpeg-headless,
|
|
|
|
testers,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libopus";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.5.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-04-21 15:54:59 +00:00
|
|
|
url = "https://downloads.xiph.org/releases/opus/opus-${finalAttrs.version}.tar.gz";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-ZcHS94ufL7IAgsOMvkfJUa1YOTRYduRpQWEu6H+afOE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
2023-08-04 22:07:22 +00:00
|
|
|
# Some tests time out easily on slower machines
|
|
|
|
./test-timeout.patch
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs meson/
|
|
|
|
'';
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
python3
|
|
|
|
ninja
|
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
(lib.mesonBool "fixed-point" fixedPoint)
|
|
|
|
(lib.mesonBool "custom-modes" withCustomModes)
|
|
|
|
(lib.mesonEnable "intrinsics" withIntrinsics)
|
|
|
|
(lib.mesonEnable "rtcd" (withIntrinsics || withAsm))
|
|
|
|
(lib.mesonEnable "asm" withAsm)
|
|
|
|
(lib.mesonEnable "docs" false)
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
doCheck = !stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isAarch32; # test_unit_LPC_inv_pred_gain fails
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gitUpdater {
|
|
|
|
url = "https://gitlab.xiph.org/xiph/opus.git";
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
|
|
|
|
|
|
|
tests = {
|
|
|
|
inherit ffmpeg-headless;
|
|
|
|
|
|
|
|
pkg-config = testers.hasPkgConfigModules {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
moduleNames = [ "opus" ];
|
|
|
|
};
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Open, royalty-free, highly versatile audio codec";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://opus-codec.org/";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://gitlab.xiph.org/xiph/opus/-/releases/v${finalAttrs.version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
maintainers = with lib.maintainers; [ getchoo jopejoe1 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|