Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / servers / imaginary / default.nix
blob4632647ed93e2e7b902e90635544566f9a03f409
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , fetchpatch
5 , pkg-config
6 , vips
7 }:
9 buildGoModule rec {
10   pname = "imaginary";
11   version = "1.2.4";
13   src = fetchFromGitHub {
14     owner = "h2non";
15     repo = pname;
16     rev = "v${version}";
17     hash = "sha256-oEkFoZMaNNJPMisqpIneeLK/sA23gaTWJ4nqtDHkrwA=";
18   };
20   patches = [
21     # add -return-size flag recommend by Nextcloud
22     # https://github.com/h2non/imaginary/pull/382
23     (fetchpatch {
24       name = "return-width-and-height-of-generated-images.patch";
25       url = "https://github.com/h2non/imaginary/commit/cfbf8d724cd326e835dfcb01e7224397c46037d3.patch";
26       hash = "sha256-TwZ5WU5g9LXrenpfY52jYsc6KsEt2fjDq7cPz6ILlhA=";
27     })
28   ];
30   vendorHash = "sha256-BluY6Fz4yAKJ/A9aFuPPsgQN9N/5yd8g8rDfIZeYz5U=";
32   buildInputs = [ vips ];
34   nativeBuildInputs = [ pkg-config ];
36   ldflags = [
37     "-s"
38     "-w"
39     "-X main.Version=${version}"
40   ];
42   __darwinAllowLocalNetworking = true;
44   meta = with lib; {
45     homepage = "https://fly.io/docs/app-guides/run-a-global-image-service";
46     changelog = "https://github.com/h2non/${pname}/releases/tag/v${version}";
47     description = "Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing";
48     license = licenses.mit;
49     maintainers = with maintainers; [ dotlambda urandom ];
50     mainProgram = "imaginary";
51   };