summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/li/libraw/package.nix
blob: 7923d64d7e00e1e8f3bdac1eae616b7023681e52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
  lib,
  stdenv,
  fetchFromGitHub,
  autoreconfHook,
  lcms2,
  pkg-config,

  # for passthru.tests
  hdrmerge,
  imagemagick,
  python3,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "libraw";
  version = "0.22.1";

  src = fetchFromGitHub {
    owner = "LibRaw";
    repo = "LibRaw";
    tag = finalAttrs.version;
    hash = "sha256-1Q2u9v1yOzXchUGvZvbLKk506xATjMb421H2sBZURZs=";
  };

  outputs = [
    "out"
    "lib"
    "dev"
    "doc"
  ];

  propagatedBuildInputs = [ lcms2 ];

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
  ];

  enableParallelBuilding = true;

  postPatch = lib.optionalString stdenv.hostPlatform.isFreeBSD ''
    substituteInPlace libraw*.pc.in --replace-fail -lstdc++ ""
  '';

  passthru.tests = {
    inherit imagemagick hdrmerge;
    inherit (python3.pkgs) rawkit;
  };

  meta = {
    description = "Library for reading RAW files obtained from digital photo cameras (CRW/CR2, NEF, RAF, DNG, and others)";
    homepage = "https://www.libraw.org/";
    license = with lib.licenses; [
      cddl
      lgpl2Plus
    ];
    platforms = lib.platforms.unix;
  };
})