Files
nixpkgs/pkgs/by-name/li/libyuv/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

69 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchgit,
cmake,
libjpeg,
gtest,
}:
stdenv.mkDerivation {
pname = "libyuv";
version = "1908"; # Defined in: include/libyuv/version.h
src = fetchgit {
url = "https://chromium.googlesource.com/libyuv/libyuv.git";
rev = "b7a857659f8485ee3c6769c27a3e74b0af910746"; # upstream does not do tagged releases
hash = "sha256-4Irs+hlAvr6v5UKXmKHhg4IK3cTWdsFWxt1QTS0rizU=";
};
patches = [
# Fixes wrong byte order in ARGBToRGB565DitherRow_C on big-endian
./dither-honour-byte-order.patch
];
nativeBuildInputs = [
cmake
];
cmakeFlags = [
"-DUNIT_TEST=ON"
];
buildInputs = [
libjpeg
gtest
];
postPatch = ''
mkdir -p $out/lib/pkgconfig
cp ${./yuv.pc} $out/lib/pkgconfig/libyuv.pc
substituteInPlace $out/lib/pkgconfig/libyuv.pc \
--replace "@PREFIX@" "$out" \
--replace "@VERSION@" "$version"
'';
# [==========] 3454 tests from 8 test suites ran.
# [ PASSED ] 3376 tests.
# [ FAILED ] 78 tests
doCheck = !stdenv.hostPlatform.isLoongArch64;
checkPhase = ''
runHook preCheck
./libyuv_unittest
runHook postCheck
'';
meta = with lib; {
homepage = "https://chromium.googlesource.com/libyuv/libyuv";
description = "Open source project that includes YUV scaling and conversion functionality";
mainProgram = "yuvconvert";
platforms = platforms.unix;
maintainers = with maintainers; [ leixb ];
license = licenses.bsd3;
};
}