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