From 93a9e4d7a17f7feade59c1fbf78a2d9b78812702 Mon Sep 17 00:00:00 2001 From: liberodark Date: Fri, 17 Jan 2025 15:05:55 +0100 Subject: [PATCH] rav1d: init at 1.0.0 --- pkgs/by-name/ra/rav1d/package.nix | 63 +++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 pkgs/by-name/ra/rav1d/package.nix diff --git a/pkgs/by-name/ra/rav1d/package.nix b/pkgs/by-name/ra/rav1d/package.nix new file mode 100644 index 000000000000..192732b0fcaa --- /dev/null +++ b/pkgs/by-name/ra/rav1d/package.nix @@ -0,0 +1,63 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + nasm, + meson, + ninja, + pkg-config, + + nix-update-script, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "rav1d"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "memorysafety"; + repo = "rav1d"; + tag = "v${finalAttrs.version}"; + hash = "sha256-8Moj3v7cxPluzNPmOmGhYuz/Qh48BnBjN7Vt4f8aY2o="; + }; + + cargoHash = "sha256-M0j0zgDqElhG3Jgetjx2sL3rxLrShK0zTMmOXwNxBEI="; + + nativeBuildInputs = [ + nasm + ]; + + # Tests are using meson + # https://github.com/memorysafety/rav1d/tree/v1.0.0?tab=readme-ov-file#running-tests + nativeCheckInputs = [ + meson + ninja + pkg-config + ]; + + checkPhase = + let + cargoTarget = rustPlatform.cargoInstallHook.targetSubdirectory; + in + '' + runHook preCheck + + patchShebangs .github/workflows/test.sh + .github/workflows/test.sh -r target/${cargoTarget}/release/dav1d + + runHook postCheck + ''; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + description = "AV1 cross-platform decoder, Rust port of dav1d"; + homepage = "https://github.com/memorysafety/rav1d"; + changelog = "https://github.com/memorysafety/rav1d/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ liberodark ]; + mainProgram = "dav1d"; + }; +})