2021-10-01 09:20:50 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitea
|
|
|
|
, rustPlatform
|
|
|
|
, makeWrapper
|
|
|
|
, protobuf
|
|
|
|
, Security
|
|
|
|
, imagemagick
|
|
|
|
, ffmpeg
|
|
|
|
, exiftool
|
2022-01-25 03:21:06 +00:00
|
|
|
, nixosTests
|
2021-10-01 09:20:50 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "pict-rs";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.4.0";
|
2021-10-01 09:20:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "git.asonix.dog";
|
|
|
|
owner = "asonix";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-1WNd7Ei21g01S5ko6y+uyhHP+xlGtnrwU8MLMxnW3P8=";
|
2021-10-01 09:20:50 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoHash = "sha256-xD2LvB0xBDAShp4k4VnnhnOWowhU/0OKvkEzI6RzuJY=";
|
2021-10-01 09:20:50 +00:00
|
|
|
|
|
|
|
# needed for internal protobuf c wrapper library
|
|
|
|
PROTOC = "${protobuf}/bin/protoc";
|
|
|
|
PROTOC_INCLUDE = "${protobuf}/include";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/pict-rs" \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ imagemagick ffmpeg exiftool ]}"
|
|
|
|
'';
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) pict-rs; };
|
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|