1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, autoreconfHook
6, pkg-config
7, libexif
8, popt
9, libintl
10}:
11
12stdenv.mkDerivation rec {
13 pname = "exif";
14 version = "0.6.22";
15
16 src = fetchFromGitHub {
17 owner = "libexif";
18 repo = pname;
19 rev = "${pname}-${builtins.replaceStrings ["."] ["_"] version}-release";
20 sha256 = "1xlb1gdwxm3rmw7vlrynhvjp9dkwmvw23mxisdbdmma7ah2nda3i";
21 };
22
23 patches = [
24 (fetchpatch {
25 name = "CVE-2021-27815.part-1.patch";
26 url = "https://github.com/libexif/exif/commit/f6334d9d32437ef13dc902f0a88a2be0063d9d1c.patch";
27 sha256 = "0mfx7l8w3w1c2mn5h5d6s7gdfyd91wnml8v0f19v5sdn70hx5aa4";
28 })
29 (fetchpatch {
30 name = "CVE-2021-27815.part-2.patch";
31 url = "https://github.com/libexif/exif/commit/eb84b0e3c5f2a86013b6fcfb800d187896a648fa.patch";
32 sha256 = "11lyvy20maisiyhxgxvm85v5l5ba7p0bpd4m0g4ryli32mrwwy0l";
33 })
34 ];
35
36 nativeBuildInputs = [ autoreconfHook pkg-config ];
37 buildInputs = [ libexif popt libintl ];
38
39 meta = with lib; {
40 homepage = "https://libexif.github.io";
41 description = "A utility to read and manipulate EXIF data in digital photographs";
42 platforms = platforms.unix;
43 license = licenses.lgpl21Plus;
44 };
45}