2021-10-01 09:20:50 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitea
|
|
|
|
, rustPlatform
|
|
|
|
, makeWrapper
|
|
|
|
, protobuf
|
2023-08-04 22:07:22 +00:00
|
|
|
, darwin
|
2021-10-01 09:20:50 +00:00
|
|
|
, 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";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "0.5.16";
|
2021-10-01 09:20:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "git.asonix.dog";
|
|
|
|
owner = "asonix";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
sha256 = "sha256-q0h+H3260CSpZemVuyaiwSHDi8yKXUX8Df9ih3IzAWo=";
|
2021-10-01 09:20:50 +00:00
|
|
|
};
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
cargoHash = "sha256-lMnJyiKhO7fGrjHkyZjheN0w7GgVs7Jnszw1KXo7vTg=";
|
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 ];
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.Security;
|
2021-10-01 09:20:50 +00:00
|
|
|
|
|
|
|
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; {
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin;
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Simple image hosting service";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pict-rs";
|
2021-10-01 09:20:50 +00:00
|
|
|
homepage = "https://git.asonix.dog/asonix/pict-rs";
|
|
|
|
license = with licenses; [ agpl3Plus ];
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
};
|
|
|
|
}
|