# Maintainer: Butui Hu pkgname=itk-snap-nightly-bin _pkgname=itk-snap pkgver=3.8.0.r4.8ad549e8 _pkgver=3.8.0 pkgrel=1 pkgdesc='A software application used to segment structures in 3D medical images (nightly build)' arch=('x86_64') url='https://www.itksnap.org' license=('GPL') depends=( 'curl' 'glib2' ) makedepends=( 'gendesk' 'git' ) provides=(itk-snap=${pkgver}) conflicts=('itk-snap') source=( "${_pkgname}-git::git+https://git.code.sf.net/p/itk-snap/src" "${_pkgname}.tar.gz::https://sourceforge.net/projects/itk-snap/files/itk-snap/Nightly/itksnap-nightly-master-Linux-gcc64.tar.gz" "${_pkgname}.png::https://sourceforge.net/p/itk-snap/src/ci/master/tree/GUI/Qt/Resources/logo_square.png?format=raw" ) sha512sums=('SKIP' '9e5d4964e182303f1aacb207ed23e00a9421c79e678d3185d6740036f321380a5afbb915f5758f0e870232751a84bf6e958d5cddc86a021b81b50372ff510a97' '7d7866a4f28ee645cf4a454488d197a776475d2959d0f9d4d34cf534f34a73ffbb1b92430518f36948b4c25b736990693be07dd345600ed8292e526e2846fca1') noextract=("${_pkgname}.tar.gz") pkgver() { cd "${srcdir}/${_pkgname}-git" printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g' | sed 's/^v//')" } prepare() { # manually extract tarball due to their unpredicted name mkdir "${srcdir}/${_pkgname}" tar xvf "${srcdir}/${_pkgname}.tar.gz" -C "${srcdir}/${_pkgname}" --strip-components 1 echo "Creating desktop file" gendesk -f -n --pkgname ${_pkgname} \ --pkgdesc "${pkgdesc}" \ --categories "Education;Graphics;Science;DataVisualization;MedicalSoftware;Viewer" \ --icon "${_pkgname}" \ --exec "itksnap" } package() { install -d "${pkgdir}/usr" for item in $(ls "${srcdir}/${_pkgname}"); do mv -v "${srcdir}/${_pkgname}/${item}" "${pkgdir}/usr" done install -Dm644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop" install -Dm644 "${srcdir}/${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png" } # vim:set ts=2 sw=2 et: