2023-04-12 12:48:02 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchCrate
|
|
|
|
, cargo-c
|
|
|
|
, rust
|
|
|
|
, stdenv
|
|
|
|
}:
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "libdovi";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "3.3.0";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
src = fetchCrate {
|
|
|
|
pname = "dolby_vision";
|
|
|
|
inherit version;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-224fX+9klmWVoakU+XM7HrGa4iP4xsBJtn+686cH0qc=";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
ln -s ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cargo-c ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2023-11-16 04:20:00 +00:00
|
|
|
${rust.envVars.setEnv} cargo cbuild -j $NIX_BUILD_CORES --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
|
2023-04-12 12:48:02 +00:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2023-11-16 04:20:00 +00:00
|
|
|
${rust.envVars.setEnv} cargo cinstall -j $NIX_BUILD_CORES --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
|
2023-04-12 12:48:02 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2023-11-16 04:20:00 +00:00
|
|
|
${rust.envVars.setEnv} cargo ctest -j $NIX_BUILD_CORES --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
|
2023-04-12 12:48:02 +00:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "C library for Dolby Vision metadata parsing and writing";
|
|
|
|
homepage = "https://crates.io/crates/dolby_vision";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ kranzes ];
|
|
|
|
};
|
|
|
|
}
|