Arch PKGBUILD for darktable with R5 Mark II support

I tried to make my life a bit easier so I played with the AUR PKGBUILD for darktable-git and modified it with my needed changes.

Fortunately Github makes it quite easy to extract patch files from pull requests, by just adding .patch to the URL. So I downloaded my PRs as patch files and modified the above PKGBUILD to my needs. I changed the URL to my LibRaw tree, but this didn’t work out. So I download it separately and overwrite the files after initializing. Pointers how to overcome this are very much welcome.

I also changed the PKGBUILD to use the build.sh script as this is much faster on my end.

So to build darktable-git with R5m2 support I used the following:

# Maintainer: pitbuster <felipe.contreras.s@gmail.com>
# Contributor: Marco44 <cousinmarc at gmail dot com>
# Contributor: Sarkasper <echo a2FzcGVyLm1lbnRlbkBnbXguY29tCg== | base64 -d>
# Contributor: Christian Himpel <chressie at gmail dot com>
# Contributor: Johannes Hanika  <hanatos at gmail dot com>
# Contributor: Kevin Brubeck Unhammer <unhammer at member dot fsf dot org>
# Contributor: orbisvicis <orbisvicis at gmail dot com>
pkgname=darktable-git
_gitname=darktable
pkgver=4.9.0.r1180.gc0fc86c232
pkgrel=1
pkgdesc="A virtual lighttable and darkroom for photographers"
arch=('i686' 'x86_64')
url=http://www.darktable.org/
license=('GPL3')
depends=(
  pugixml libjpeg-turbo colord-gtk libgphoto2 openexr lensfun iso-codes zlib
  exiv2 openjpeg2 graphicsmagick lua osm-gps-map libsecret openmp gmic libavif
  jasper libjxl
)
optdepends=(
  'dcraw: base curve script'
  'perl-image-exiftool: base curve script'
  'imagemagick: base curve and noise profile scripts'
  'ghostscript: noise profile script'
  'gnuplot: noise profile script'
)
makedepends=(
  git cmake intltool desktop-file-utils llvm clang portmidi
  python-jsonschema libwebp perl-image-exiftool libxslt)
conflicts=(darktable)
provides=(darktable)
#install=darktable.install
options=(!emptydirs !libtool)
source=(
  'git+https://github.com/darktable-org/darktable.git'
  'OpenCL-Headers.git::git+https://github.com/KhronosGroup/OpenCL-Headers.git'
  'LibRaw.git::git+https://github.com/piratenpanda/LibRaw---R5m2-support-for-darktable.git'
  'libxcf.git::git+https://github.com/houz/libxcf.git'
  'rawspeed.git::git+https://github.com/darktable-org/rawspeed.git'
  'whereami::git+https://github.com/gpakosz/whereami'
)
md5sums=(
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
)

pkgver() {
  cd $_gitname
  tools/get_git_version_string.sh | sed 's/+/.r/;s/~/./;s/-dirty//'
}

prepare() {
  cd $_gitname
  git config submodule.src/external/OpenCL.url "$srcdir/OpenCL-Headers.git"
  git config submodule.src/external/LibRaw.url "$srcdir/LibRaw.git"
  git config submodule.src/external/libxcf.url "$srcdir/libxcf.git"
  git config submodule.src/external/rawspeed.url "$srcdir/rawspeed.git"
  git config submodule.src/external/whereami.url "$srcdir/whereami"
  # We will individually update submodules to avoid downloading integration tests
  git -c protocol.file.allow=always submodule update --init src/external/rawspeed
  git -c protocol.file.allow=always submodule update --init --recursive src/external/OpenCL
  git -c protocol.file.allow=always submodule update --init --recursive src/external/LibRaw
  git -c protocol.file.allow=always submodule update --init --recursive src/external/libxcf
  git -c protocol.file.allow=always submodule update --init --recursive src/external/whereami
  patch -Np1 -i ../../camera_support.patch
  patch -Np1 -i ../../noiseprofile.patch
  patch -Np1 -i ../../whitebalance_presets.patch
  yes | cp -rf ../LibRaw.git/* src/external/LibRaw 
}

build() {
  cd $_gitname
  ./build.sh --prefix /usr --build-type Release 
}

package() {
  cd $_gitname
  make -C build DESTDIR=$pkgdir install
  ln -s darktable/libdarktable.so "${pkgdir}"/usr/lib/libdarktable.so
}

Kommentare

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert