Merge pull request #319175 from getchoo/pkgs/rav1e/adopt

rav1e: adopt; modernize
This commit is contained in:
Weijia Wang 2024-06-14 23:12:30 +02:00 committed by GitHub
commit 0dd1d656e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 29 deletions

View File

@ -1,16 +1,18 @@
{ lib
, rust
, stdenv
, rustPlatform
, fetchCrate
, pkg-config
, cargo-c
, libgit2
, nasm
, zlib
, libiconv
, Security
, buildPackages
{
lib,
rust,
stdenv,
rustPlatform,
fetchCrate,
pkg-config,
cargo-c,
darwin,
libgit2,
libiconv,
nasm,
testers,
zlib,
rav1e,
}:
rustPlatform.buildRustPackage rec {
@ -19,22 +21,26 @@ rustPlatform.buildRustPackage rec {
src = fetchCrate {
inherit pname version;
sha256 = "sha256-Db7qb7HBAy6lniIiN07iEzURmbfNtuhmgJRv7OUagUM=";
hash = "sha256-Db7qb7HBAy6lniIiN07iEzURmbfNtuhmgJRv7OUagUM=";
};
cargoHash = "sha256-VyQ6n2kIJ7OjK6Xlf0T0GNsBvgESRETzKZDZzAn8ZuY=";
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [ cargo-c libgit2 nasm ];
buildInputs = [
zlib
] ++ lib.optionals stdenv.isDarwin [
libiconv
Security
nativeBuildInputs = [
cargo-c
libgit2
nasm
];
buildInputs =
[ zlib ]
++ lib.optionals stdenv.isDarwin [
libiconv
darwin.apple_sdk.frameworks.Security
];
# Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library
# and linking it with cctools ld64.
postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) ''
@ -43,7 +49,7 @@ rustPlatform.buildRustPackage rec {
checkType = "debug";
postBuild = ''
postBuild = ''
${rust.envVars.setEnv} cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
'';
@ -51,7 +57,11 @@ rustPlatform.buildRustPackage rec {
${rust.envVars.setEnv} cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
'';
meta = with lib; {
passthru = {
tests.version = testers.testVersion { package = rav1e; };
};
meta = {
description = "Fastest and safest AV1 encoder";
longDescription = ''
rav1e is an AV1 video encoder. It is designed to eventually cover all use
@ -61,8 +71,8 @@ rustPlatform.buildRustPackage rec {
'';
homepage = "https://github.com/xiph/rav1e";
changelog = "https://github.com/xiph/rav1e/releases/tag/v${version}";
license = licenses.bsd2;
maintainers = [ ];
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ getchoo ];
mainProgram = "rav1e";
};
}

View File

@ -6218,10 +6218,6 @@ with pkgs;
rainloop-community
rainloop-standard;
rav1e = callPackage ../tools/video/rav1e {
inherit (darwin.apple_sdk.frameworks) Security;
};
raven-reader = callPackage ../applications/networking/newsreaders/raven-reader { };
razergenie = libsForQt5.callPackage ../applications/misc/razergenie { };