2023-02-16 17:41:37 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, pkg-config
|
|
|
|
, vips
|
|
|
|
}:
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "imaginary";
|
|
|
|
version = "1.2.4";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "h2non";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-oEkFoZMaNNJPMisqpIneeLK/sA23gaTWJ4nqtDHkrwA=";
|
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
patches = [
|
|
|
|
# add -return-size flag recommend by Nextcloud
|
|
|
|
# https://github.com/h2non/imaginary/pull/382
|
|
|
|
(fetchpatch {
|
|
|
|
name = "return-width-and-height-of-generated-images.patch";
|
|
|
|
url = "https://github.com/h2non/imaginary/commit/cfbf8d724cd326e835dfcb01e7224397c46037d3.patch";
|
|
|
|
hash = "sha256-TwZ5WU5g9LXrenpfY52jYsc6KsEt2fjDq7cPz6ILlhA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
vendorHash = "sha256-BluY6Fz4yAKJ/A9aFuPPsgQN9N/5yd8g8rDfIZeYz5U=";
|
|
|
|
|
|
|
|
buildInputs = [ vips ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X main.Version=${version}"
|
|
|
|
];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://fly.io/docs/app-guides/run-a-global-image-service";
|
|
|
|
changelog = "https://github.com/h2non/${pname}/releases/tag/v${version}";
|
|
|
|
description = "Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing";
|
|
|
|
license = licenses.mit;
|
2023-02-16 17:41:37 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda urandom ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "imaginary";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
}
|