diff options
author | spider-mario | 2020-10-15 21:15:31 +0200 |
---|---|---|
committer | spider-mario | 2020-10-15 21:15:31 +0200 |
commit | 41229f681eabd525e228b65c66bf65d8c2b30815 (patch) | |
tree | d508ce810d87a1d688e49612c158b6410520b225 | |
download | aur-hdr-plus-git.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 45 | ||||
-rw-r--r-- | fixes.patch | 143 | ||||
-rw-r--r-- | unneeded-dependencies.patch | 19 |
4 files changed, 228 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..ec835c822403 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = hdr-plus-git + pkgdesc = Burst photography pipeline based on Google’s HDR+ + pkgver = r212.09890d7 + pkgrel = 1 + url = https://github.com/timothybrooks/hdr-plus + arch = x86_64 + license = custom:MIT + makedepends = git + makedepends = cmake + depends = libraw + depends = halide + provides = hdr-plus + source = git+https://github.com/timothybrooks/hdr-plus.git + source = fixes.patch + source = unneeded-dependencies.patch + b2sums = SKIP + b2sums = e3bd4e1469685097da68e74bad02bc61671d41461400586168800dcaff395428b8b3b363457ed40d3c1f20626d180d24efac1be4ffe4b90e4d500b2979bb9c90 + b2sums = 33f1faf4ef2ac7df32e399d212a60b97b9e4099517f69522860262d50889e3bb8c867c359f72992cbeec89524377db9c11abd293e6eba0a4b2c6d341a54d660a + +pkgname = hdr-plus-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..586696c4fa98 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: spider-mario <spidermario@free.fr> +pkgname=hdr-plus-git +pkgver=r212.09890d7 +pkgrel=1 +pkgdesc="Burst photography pipeline based on Google’s HDR+" +arch=('x86_64') +url="https://github.com/timothybrooks/hdr-plus" +license=('custom:MIT') +depends=('libraw' 'halide') +makedepends=('git' 'cmake') +provides=('hdr-plus') +source=('git+https://github.com/timothybrooks/hdr-plus.git' + 'fixes.patch' + 'unneeded-dependencies.patch') +b2sums=('SKIP' + 'e3bd4e1469685097da68e74bad02bc61671d41461400586168800dcaff395428b8b3b363457ed40d3c1f20626d180d24efac1be4ffe4b90e4d500b2979bb9c90' + '33f1faf4ef2ac7df32e399d212a60b97b9e4099517f69522860262d50889e3bb8c867c359f72992cbeec89524377db9c11abd293e6eba0a4b2c6d341a54d660a') + +pkgver() { + cd hdr-plus + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd hdr-plus + git apply -3 "$srcdir"/fixes.patch + git apply -3 "$srcdir"/unneeded-dependencies.patch +} + +build() { + mkdir -p build + cd build + cmake "$srcdir"/hdr-plus + make +} + +package() { + cd build + for executable in hdrplus stack_frames; do + install -Dm755 "$executable" "$pkgdir/usr/bin/$executable" + done + + cd "$srcdir"/hdr-plus + install -Dm644 LICENSE.md "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE.md +} diff --git a/fixes.patch b/fixes.patch new file mode 100644 index 000000000000..fd0b93c3417a --- /dev/null +++ b/fixes.patch @@ -0,0 +1,143 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4be369..6c57cfa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,9 +8,9 @@ include("macro.cmake") + set(CMAKE_CXX_STANDARD 11) + + # Define dependencies +-link_halide() + link_libtiff() + ++find_package(Halide REQUIRED) + find_package(ZLIB REQUIRED) + find_package(PNG REQUIRED) + find_package(JPEG REQUIRED) +@@ -27,36 +27,28 @@ set(header_files + src/dngwriter.h + src/LibRaw2DngConverter.h) + +-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${HALIDE_DISTRIB_DIR}/include ${HALIDE_DISTRIB_DIR}/tools ${RAW2DNG_INCLUDE_DIRS}) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${RAW2DNG_INCLUDE_DIRS}) + include_directories(${CMAKE_BINARY_DIR}/genfiles) + + set(HALIDE_TARGET "") + set(HALIDE_TARGET_FEATURES "") +-halide_library(hdrplus_pipeline +- SRCS src/hdrplus_pipeline_generator.cpp src/align.cpp src/merge.cpp src/finish.cpp src/util.cpp +- # GENERATOR_DEPS # We don't have any yet +- GENERATOR_NAME hdrplus_pipeline +- # GENERATOR_ARGS # We don't have any yet +- FUNCTION_NAME hdrplus_pipeline +- # HALIDE_TARGET ${HALIDE_TARGET} # TODO: add option with custom HALIDE_TARGET +- # HALIDE_TARGET_FEATURES ${HALIDE_TARGET_FEATURES} # TODO: add option with custom HALIDE_TARGET +- # EXTRA_OUTPUTS "stmt;html;schedule") # uncomment for extra output ++add_executable(hdrplus_pipeline_generator ++ src/hdrplus_pipeline_generator.cpp src/align.cpp src/merge.cpp src/finish.cpp src/util.cpp + ) ++target_link_libraries(hdrplus_pipeline_generator Halide::Generator) ++add_halide_library(hdrplus_pipeline FROM hdrplus_pipeline_generator) + +-halide_library(align_and_merge +- SRCS src/align_and_merge_generator.cpp src/align.cpp src/merge.cpp src/util.cpp +- GENERATOR_NAME align_and_merge +- FUNCTION_NAME align_and_merge +- # HALIDE_TARGET ${HALIDE_TARGET} # TODO: add option with custom HALIDE_TARGET +- # HALIDE_TARGET_FEATURES ${HALIDE_TARGET_FEATURES} # TODO: add option with custom HALIDE_TARGET +- # EXTRA_OUTPUTS "stmt;html;schedule") # uncomment for extra output ++add_executable(align_and_merge_generator ++ src/align_and_merge_generator.cpp src/align.cpp src/merge.cpp src/util.cpp + ) ++target_link_libraries(align_and_merge_generator Halide::Generator) ++add_halide_library(align_and_merge FROM align_and_merge_generator) + + + add_executable(hdrplus bin/HDRPlus.cpp ${src_files}) + add_dependencies(hdrplus hdrplus_pipeline) +-target_link_libraries(hdrplus hdrplus_pipeline Halide png ${LIBRAW_LIBRARY} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY}) ++target_link_libraries(hdrplus hdrplus_pipeline Halide::Halide png ${LIBRAW_LIBRARY} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY}) + + add_executable(stack_frames bin/stack_frames.cpp ${src_files}) + add_dependencies(stack_frames align_and_merge) +-target_link_libraries(stack_frames Halide align_and_merge ${LIBRAW_LIBRARY} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY}) ++target_link_libraries(stack_frames Halide::Halide align_and_merge ${LIBRAW_LIBRARY} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY}) +diff --git a/bin/HDRPlus.cpp b/bin/HDRPlus.cpp +index f2b8683..2a5be35 100644 +--- a/bin/HDRPlus.cpp ++++ b/bin/HDRPlus.cpp +@@ -8,7 +8,7 @@ + #include <include/stb_image_write.h> + + #include <src/Burst.h> +-#include <hdrplus_pipeline/hdrplus_pipeline.h> ++#include "hdrplus_pipeline.h" + + /* + * HDRPlus Class -- Houses file I/O, defines pipeline attributes and calls +diff --git a/bin/stack_frames.cpp b/bin/stack_frames.cpp +index 666c56f..b9d570e 100644 +--- a/bin/stack_frames.cpp ++++ b/bin/stack_frames.cpp +@@ -7,7 +7,7 @@ + + #include <src/Burst.h> + +-#include <align_and_merge/align_and_merge.h> ++#include "align_and_merge.h" + + Halide::Runtime::Buffer<uint16_t> align_and_merge(Halide::Runtime::Buffer<uint16_t> burst) { + if (burst.channels() < 2) { +diff --git a/macro.cmake b/macro.cmake +index 0c5c2bb..ece5e2e 100644 +--- a/macro.cmake ++++ b/macro.cmake +@@ -1,16 +1,5 @@ + cmake_minimum_required(VERSION 3.10) + +-macro(link_halide) +- if("${HALIDE_DISTRIB_DIR}" STREQUAL " ") +- message(FATAL_ERROR "Specify HALIDE_DISTRIB_DIR variable in the cmake options.") +- endif() +- find_package(Threads) # fix dynamic linking for halide +- set(HALIDE_DISTRIB_USE_STATIC_LIBRARY OFF) +- include(${HALIDE_DISTRIB_DIR}/halide.cmake) +- include_directories(${HALIDE_DISTRIB_DIR}/include ${HALIDE_DISTRIB_DIR}/tools) +- link_directories(${HALIDE_DISTRIB_DIR}/lib ${HALIDE_DISTRIB_DIR}/bin) +-endmacro() +- + macro(link_libtiff) + # Link as follows: + # target_link_libraries(TARGET ${TIFF_LIBRARIES}) +diff --git a/src/util.cpp b/src/util.cpp +index 9c984f0..a31f1bc 100644 +--- a/src/util.cpp ++++ b/src/util.cpp +@@ -3,6 +3,7 @@ + #include "Halide.h" + #include <vector> + #include <algorithm> ++#include <sstream> + + using namespace Halide; + using namespace Halide::ConciseCasts; +@@ -37,7 +38,7 @@ Func box_down2(Func input, std::string name) { + Func gauss_down4(Func input, std::string name) { + + Func output(name); +- Buffer<uint32_t> k(5, 5, "gauss_down4_kernel"); ++ Buffer<uint32_t> k(5, 5, "gauss_down4_kernel_" + name); + k.translate({-2, -2}); + + Var x, y, n; +@@ -115,7 +116,10 @@ Func gauss_7x7(Func input, std::string name) { + + // gaussian kernel + +- Buffer<float> k(7, "gauss_7x7_kernel"); ++ static int i = 0; ++ std::ostringstream buffer_name; ++ buffer_name << "gauss_7x7_kernel_" << name << ++i; ++ Buffer<float> k(7, buffer_name.str()); + k.translate({-3}); + + Var x; diff --git a/unneeded-dependencies.patch b/unneeded-dependencies.patch new file mode 100644 index 000000000000..7214c03e778b --- /dev/null +++ b/unneeded-dependencies.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6c57cfa..e654d6b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,8 +12,6 @@ link_libtiff() + + find_package(Halide REQUIRED) + find_package(ZLIB REQUIRED) +-find_package(PNG REQUIRED) +-find_package(JPEG REQUIRED) + find_library(LIBRAW_LIBRARY NAMES raw raw_r) + + set(src_files +@@ -51,4 +49,4 @@ target_link_libraries(hdrplus hdrplus_pipeline Halide::Halide png ${LIBRAW_LIBRA + + add_executable(stack_frames bin/stack_frames.cpp ${src_files}) + add_dependencies(stack_frames align_and_merge) +-target_link_libraries(stack_frames Halide::Halide align_and_merge ${LIBRAW_LIBRARY} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY}) ++target_link_libraries(stack_frames Halide::Halide align_and_merge ${LIBRAW_LIBRARY} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY}) |