2021-09-29 02:43:07 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitea
|
|
|
|
, rustPlatform
|
|
|
|
, makeWrapper
|
|
|
|
, protobuf
|
2023-07-16 08:24:02 +00:00
|
|
|
, darwin
|
2021-09-29 02:43:07 +00:00
|
|
|
, imagemagick
|
|
|
|
, ffmpeg
|
|
|
|
, exiftool
|
2022-01-23 20:08:10 +00:00
|
|
|
, nixosTests
|
2021-09-29 02:43:07 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "pict-rs";
|
2024-03-05 13:30:57 +00:00
|
|
|
version = "0.5.7";
|
2021-09-29 02:43:07 +00:00
|
|
|
|
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "git.asonix.dog";
|
|
|
|
owner = "asonix";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-03-05 13:30:57 +00:00
|
|
|
sha256 = "sha256-MBV92+mu41ulT6wuzTGbobbspoQA0hNbRIiISol0n48=";
|
2021-09-29 02:43:07 +00:00
|
|
|
};
|
|
|
|
|
2024-03-05 13:30:57 +00:00
|
|
|
cargoHash = "sha256-p7s/gs+sMXR1l08C81tY4K3oV9fWgm07C0nRGspfoR8=";
|
2021-09-29 02:43:07 +00:00
|
|
|
|
|
|
|
# needed for internal protobuf c wrapper library
|
|
|
|
PROTOC = "${protobuf}/bin/protoc";
|
|
|
|
PROTOC_INCLUDE = "${protobuf}/include";
|
|
|
|
|
2021-09-29 08:58:20 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2023-07-16 08:24:02 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks ];
|
2021-09-29 02:43:07 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/pict-rs" \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ imagemagick ffmpeg exiftool ]}"
|
|
|
|
'';
|
|
|
|
|
2022-01-23 20:08:10 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) pict-rs; };
|
|
|
|
|
2021-09-29 02:43:07 +00:00
|
|
|
meta = with lib; {
|
2021-09-29 08:58:20 +00:00
|
|
|
description = "A simple image hosting service";
|
2021-09-29 02:43:07 +00:00
|
|
|
homepage = "https://git.asonix.dog/asonix/pict-rs";
|
|
|
|
license = with licenses; [ agpl3Plus ];
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
};
|
|
|
|
}
|