nixpkgs/pkgs/servers/web-apps/pict-rs/default.nix
2024-02-11 05:45:49 +00:00

48 lines
1.1 KiB
Nix

{ stdenv
, lib
, fetchFromGitea
, rustPlatform
, makeWrapper
, protobuf
, darwin
, imagemagick
, ffmpeg
, exiftool
, nixosTests
}:
rustPlatform.buildRustPackage rec {
pname = "pict-rs";
version = "0.5.6";
src = fetchFromGitea {
domain = "git.asonix.dog";
owner = "asonix";
repo = pname;
rev = "v${version}";
sha256 = "sha256-YK31z7tFRxLuf3C8ojDIV+mYHvK0dlV8zLHJoWjPzIU=";
};
cargoHash = "sha256-W6pDWjalyBBqFmm4uZDDTRvTWiwogdOeXbdazz4uM3s=";
# needed for internal protobuf c wrapper library
PROTOC = "${protobuf}/bin/protoc";
PROTOC_INCLUDE = "${protobuf}/include";
nativeBuildInputs = [ makeWrapper ];
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks ];
postInstall = ''
wrapProgram "$out/bin/pict-rs" \
--prefix PATH : "${lib.makeBinPath [ imagemagick ffmpeg exiftool ]}"
'';
passthru.tests = { inherit (nixosTests) pict-rs; };
meta = with lib; {
description = "A simple image hosting service";
homepage = "https://git.asonix.dog/asonix/pict-rs";
license = with licenses; [ agpl3Plus ];
maintainers = with maintainers; [ happysalada ];
};
}