@@ -0,0 +1,42 @@
1+{ stdenv, fetchFromGitHub, fetchpatch
2+, cmake, halide
3+, libpng, libjpeg, libtiff, libraw
4+}:
5+
6+stdenv.mkDerivation rec {
7+ pname = "hdr-plus-unstable";
8+ version = "2020-10-29";
9+
10+ src = fetchFromGitHub {
11+ owner = "timothybrooks";
12+ repo = "hdr-plus";
13+ rev = "132bd73ccd4eaef9830124605c93f06a98607cfa";
14+ sha256 = "1n49ggrppf336p7n510kapzh376791bysxj3f33m3bdzksq360ps";
15+ };
16+
17+ patches = [
18+ # PR #70, fixes incompatibility with Halide 10.0.0
19+ (fetchpatch {
20+ url = "https://github.com/timothybrooks/hdr-plus/pull/70/commits/077e1a476279539c72e615210762dca27984c57b.patch";
21+ sha256 = "1sg2l1bqs2smpfpy4flwg86fzhcc4yf7zx998v1bfhim43yyrx59";
22+ })
23+ ];
24+
25+ nativeBuildInputs = [ cmake ];
26+
27+ buildInputs = [ halide libpng libjpeg libtiff libraw ];
28+
29+ installPhase = ''
30+ for bin in hdrplus stack_frames; do
31+ install -Dm755 $bin $out/bin/$bin
32+ done
33+ '';
34+
35+ meta = with stdenv.lib; {
36+ description = "Burst photography pipeline based on Google's HDR+";
37+ homepage = "https://www.timothybrooks.com/tech/hdr-plus/";
38+ license = licenses.mit;
39+ maintainers = with maintainers; [ OPNA2608 ];
40+ platforms = platforms.all;
41+ };
42+}