diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libdovi/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libdovi/default.nix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libdovi/default.nix b/nixpkgs/pkgs/development/libraries/libdovi/default.nix new file mode 100644 index 000000000000..e8b4bbc88bf3 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libdovi/default.nix @@ -0,0 +1,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 + cargo cbuild -j $NIX_BUILD_CORES --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec} + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + cargo cinstall -j $NIX_BUILD_CORES --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec} + runHook postInstall + ''; + + checkPhase = '' + runHook preCheck + 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 ]; + }; +} |