From 806ff157c6e28622dce74eff5c9598c5da81e11d Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 16 Apr 2025 00:19:33 +0200 Subject: [PATCH] ferrishot: init at 0.1.0 --- pkgs/by-name/fe/ferrishot/package.nix | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 pkgs/by-name/fe/ferrishot/package.nix diff --git a/pkgs/by-name/fe/ferrishot/package.nix b/pkgs/by-name/fe/ferrishot/package.nix new file mode 100644 index 000000000000..618813ba8b3d --- /dev/null +++ b/pkgs/by-name/fe/ferrishot/package.nix @@ -0,0 +1,72 @@ +{ + lib, + stdenv, + rustPlatform, + fetchFromGitHub, + makeBinaryWrapper, + writableTmpDirAsHomeHook, + libGL, + libX11, + libxkbcommon, + libxcb, + wayland, + nix-update-script, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "ferrishot"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "nik-rev"; + repo = "ferrishot"; + tag = "v${finalAttrs.version}"; + hash = "sha256-1jKwbhn85KcIQrSakWTIfxPso7VZuuvPrUbTCF1NerM="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-NPReNHKOS4PQIt2lmY5w19lVHPDjznR9gv5vHDXyqaI="; + + nativeBuildInputs = + [ + makeBinaryWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # error: unable to open output file '/homeless-shelter/.cache/clang/ModuleCache/354UBE8EJRBZ3/Cocoa-31YYBL2V1XGQP.pcm': 'No such file or directory' + writableTmpDirAsHomeHook + ]; + + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ + libxcb + ]; + + postInstall = + let + runtimeDeps = + [ + libGL + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libxkbcommon + wayland + ]; + in + '' + wrapProgram $out/bin/ferrishot \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDeps}" + ''; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + description = "Screenshot app written in Rust"; + homepage = "https://github.com/nik-rev/ferrishot"; + changelog = "https://github.com/nik-rev/ferrishot/blob/v${finalAttrs.version}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + mainProgram = "ferrishot"; + }; +})