summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD92
1 files changed, 48 insertions, 44 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d85f4a02b1d3..d913a8d4c14f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,55 +1,59 @@
-# Maintainer: Afnan Enayet <afnan at afnan.io>
+# Maintainer: Eric Engestrom <aur@engestrom.ch>
+# Contributor: Afnan Enayet <afnan at afnan.io>
-pkgname=hdrview-git
-provides=('hdrview')
_pkgname=hdrview
-pkgver=269.8436cf9
-pkgrel=3
-pkgdesc='HDRView is a simple research-oriented high-dynamic range image viewer with an emphasis on examining and comparing images, and including minimalistic tonemapping capabilities'
-url='https://bitbucket.org/wkjarosz/hdrview'
-arch=('x86_64')
-license=('BSD')
-makedepends=('cmake' 'git')
-depends=('zlib')
-sha256sums=('SKIP'
- '29450b60ca46062663ec603a0b68f8500cf882761654f756b81afb368845fdc5')
-
-source=('git+https://bitbucket.org/wkjarosz/hdrview.git'
- 'hdrview-git.patch')
+pkgname=$_pkgname-git
+pkgver=1.7.1
+pkgrel=1
+pkgdesc='High dynamic range (HDR) image viewer and comparison tool'
+url='https://github.com/wkjarosz/hdrview'
+arch=(x86_64)
+license=(BSD)
+makedepends=(git cmake ninja)
+depends=(zlib)
+source=("git+$url")
+sha256sums=('SKIP')
+provides=(hdrview)
+conflicts=(hdrview)
pkgver() {
- cd ${_pkgname}
- printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
-}
-
-prepare() {
- cd ${_pkgname}
-
- # Apply patch to make sure missing icons paths aren't used
- patch --forward --strip=1 --input=${srcdir}/hdrview-git.patch
-
- # The preferred method of working with submodules in the AUR guidelines
- # doesn't seem to work recursively, so we use the "naive" method instead
- git submodule update --init --recursive
+ git -C $_pkgname describe --tags --abbrev=10 | sed 's/^v//; s/-/+/; s/-/./'
}
build() {
- cd ${_pkgname}
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
- make -j$(nproc)
+ cmake -S $_pkgname -B build \
+ -G Ninja \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Release
+ cmake --build build
}
package() {
- # Create directories for icons, metadata
- mkdir -p ${pkgdir}/usr/bin
- mkdir -p ${pkgdir}/usr/share/applications
- mkdir -p ${pkgdir}/usr/share/icons/hicolor/512x512/apps
- mkdir -p ${pkgdir}/usr/share/icons/hicolor/256x256/apps
- mkdir -p ${pkgdir}/usr/share/icons/hicolor/128x128/apps
- mkdir -p ${pkgdir}/usr/share/icons/hicolor/64x64/apps
- mkdir -p ${pkgdir}/usr/share/icons/hicolor/32x32/apps
- mkdir -p ${pkgdir}/usr/share/icons/hicolor/16x16/apps
- make -C ${_pkgname}/build DESTDIR="${pkgdir}/" install
+ DESTDIR="$pkgdir" cmake --install build
+
+ # Fixup desktop file
+ sed \
+ -e 's/Exec=hdrview/Exec=HDRView/' \
+ -e 's/Icon=hdrview.png/Icon=hdrview/' \
+ -i "$pkgdir"/usr/share/applications/hdrview.desktop
+
+ # Project installs a copy of its own deps as well
+ for dep in Imath OpenEXR
+ do
+ rm -r "$pkgdir"/usr/include/$dep/
+ rm -r "$pkgdir"/usr/lib/cmake/$dep/
+ rm "$pkgdir"/usr/lib/pkgconfig/$dep.pc
+ done
+
+ # These don't have a filename trivially derived from the dep name, but
+ # the project doesn't have any static lib of its own so let's just
+ # blindly remove any.
+ rm "$pkgdir"/usr/lib/lib*.a
+
+ # Raise an error in case there's every anything else added (either
+ # a new dep, or the project starts shipping libs)
+ rmdir "$pkgdir"/usr/include/
+ rmdir "$pkgdir"/usr/lib/cmake/
+ rmdir "$pkgdir"/usr/lib/pkgconfig/
+ rmdir "$pkgdir"/usr/lib/
}