From 903e6a4ff524fd4969b6d6eb6575e283a9a79154 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Thu, 12 Dec 2024 00:42:44 +0100 Subject: [PATCH] fotema: init at 2.4.1 --- pkgs/by-name/fo/fotema/package.nix | 101 +++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 pkgs/by-name/fo/fotema/package.nix diff --git a/pkgs/by-name/fo/fotema/package.nix b/pkgs/by-name/fo/fotema/package.nix new file mode 100644 index 0000000000000..14f9a8ebd2bc2 --- /dev/null +++ b/pkgs/by-name/fo/fotema/package.nix @@ -0,0 +1,101 @@ +{ + lib, + clangStdenv, + fetchFromGitHub, + rustPlatform, + + meson, + ninja, + pkg-config, + cargo, + rustc, + appstream, + desktop-file-utils, + glib, + gtk4, + libglycin, + wrapGAppsHook4, + + libadwaita, + openssl, + ffmpeg, + onnxruntime, + libshumate, + opencv, + libseccomp, + glycin-loaders, + + nix-update-script, +}: +# Apparently `bindgenHook` + `libclang` is not enough. +# opencv-binding-generator *really* wants to execute `clang` itself... +clangStdenv.mkDerivation (finalAttrs: { + pname = "fotema"; + version = "2.4.1"; + + src = fetchFromGitHub { + owner = "blissd"; + repo = "fotema"; + tag = "v${finalAttrs.version}"; + hash = "sha256-+fo3g4+dtZlOVpHW0W0ZSBEi5fIR/c1aGAJHVysjJUY="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (finalAttrs) pname version src; + hash = "sha256-WBKEjNyItMTpkBalLf6OUrbeUiSw6lWO5adR8l4q/bY="; + }; + + nativeBuildInputs = [ + meson + ninja + pkg-config + rustPlatform.cargoSetupHook + rustPlatform.bindgenHook + cargo + rustc + appstream + desktop-file-utils # `desktop-file-validate` + glib # `glib-compile-schemas` + gtk4 # `gtk-update-icon-cache` + wrapGAppsHook4 + libglycin.patchVendorHook + ]; + + buildInputs = [ + libadwaita + openssl + ffmpeg + onnxruntime + libshumate + opencv + libseccomp + libglycin.setupHook + glycin-loaders + ]; + + strictDeps = true; + + env = { + OPENSSL_NO_VENDOR = true; + # Use system OnnxRuntime + ORT_LIB_LOCATION = "${onnxruntime}/lib"; + ORT_STRATEGY = "system"; + }; + + preFixup = '' + gappsWrapperArgs+=( + --set ORT_DYLIB_PATH "${onnxruntime}/lib/libonnxruntime.so" + ) + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Photo gallery for Linux"; + homepage = "https://github.com/blissd/fotema"; + license = with lib.licenses; [ gpl3Plus ]; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ pluiedev ]; + mainProgram = "fotema"; + }; +})