2022-03-10 19:12:11 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, cmake
|
|
|
|
, libjpeg
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libyuv";
|
|
|
|
version = "1787"; # Defined in: include/libyuv/version.h
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://chromium.googlesource.com/libyuv/libyuv.git";
|
|
|
|
rev = "eb6e7bb63738e29efd82ea3cf2a115238a89fa51"; # refs/heads/stable
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-DtRYoaAXb9ZD2OLiKbzKzH5vzuu+Lzu4eHaDgPB9hjU=";
|
2022-03-10 19:12:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
# NEON does not work on aarch64, we disable it
|
|
|
|
cmakeFlags = lib.optionals stdenv.isAarch64 ["-DCMAKE_CXX_FLAGS=-DLIBYUV_DISABLE_NEON"];
|
|
|
|
|
|
|
|
buildInputs = [ libjpeg ];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [
|
|
|
|
./link-library-against-libjpeg.patch
|
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://chromium.googlesource.com/libyuv/libyuv";
|
|
|
|
description = "Open source project that includes YUV scaling and conversion functionality";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "yuvconvert";
|
2022-10-21 18:38:19 +00:00
|
|
|
platforms = platforms.unix;
|
2022-03-10 19:12:11 +00:00
|
|
|
maintainers = with maintainers; [ leixb ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|