blob: cf1a9a561f37544833ea7ab3f6db3e802234ceb6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
{ lib
, rustPlatform
, fetchCrate
, cargo-c
, rust
, stdenv
}:
let
rustTargetPlatformSpec = rust.toRustTargetSpec stdenv.hostPlatform;
in
rustPlatform.buildRustPackage rec {
pname = "libdovi";
version = "3.1.2";
src = fetchCrate {
pname = "dolby_vision";
inherit version;
hash = "sha256-eLmGswgxtmqGc9f8l/9qvwSm+8bi06q+Ryvo7Oyr7s0=";
};
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';
nativeBuildInputs = [ cargo-c ];
buildPhase = ''
runHook preBuild
${rust.envVars.setEnv} cargo cbuild -j $NIX_BUILD_CORES --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec}
runHook postBuild
'';
installPhase = ''
runHook preInstall
${rust.envVars.setEnv} cargo cinstall -j $NIX_BUILD_CORES --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec}
runHook postInstall
'';
checkPhase = ''
runHook preCheck
${rust.envVars.setEnv} cargo ctest -j $NIX_BUILD_CORES --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec}
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 ];
};
}
|