# Description: A powerful cross-platform raw image processing program
# URL: https://rawtherapee.com/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: fftw gtkmm3 lcms2 lensfun libcanberra libiptcdata librsvg libwebp tdb

name=rawtherapee
version=5.9
release=1
source=(https://github.com/Beep6581/RawTherapee/releases/download/$version/$name-$version.tar.xz)

build() {
    #-D WITH_LTO=ON \
  cmake -S $name-$version -B build -G Ninja \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
    -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
    -D BUILD_SHARED=ON \
    -Wno-dev
  cmake --build build
  DESTDIR=$PKG cmake --install build

  rm -r $PKG/usr/share/doc
  find $PKG/usr/share \(\
    -iname '*README*' -o \
    -iname '*AUTHORS*' \
    \) -exec rm -r '{}' \+
}
