From c340cd5db2fd78fe9d5e97d02492a630eaecbd43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= Date: Fri, 29 Jan 2021 10:44:50 +0100 Subject: [PATCH] python-tifffile: add post_install scripts --- mingw-w64-python-tifffile/PKGBUILD | 15 ++++++++++++--- mingw-w64-python-tifffile/tifffile-i686.install | 14 ++++++++++++++ mingw-w64-python-tifffile/tifffile-x86_64.install | 14 ++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 mingw-w64-python-tifffile/tifffile-i686.install create mode 100644 mingw-w64-python-tifffile/tifffile-x86_64.install diff --git a/mingw-w64-python-tifffile/PKGBUILD b/mingw-w64-python-tifffile/PKGBUILD index 3192762b0a..dc661735bb 100644 --- a/mingw-w64-python-tifffile/PKGBUILD +++ b/mingw-w64-python-tifffile/PKGBUILD @@ -5,8 +5,8 @@ _realname=tifffile pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") pkgver=2021.1.14 -pkgrel=1 -pkgdesc='Read and write image data from and to TIFF files (mingw-w64)' +pkgrel=2 +pkgdesc="Read and write image data from and to TIFF files (mingw-w64)" arch=('any') url="https://github.com/cgohlke/tifffile" license=('BSD-3-Clause') @@ -15,11 +15,14 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools") optdepends=("${MINGW_PACKAGE_PREFIX}-python-imagecodecs: required only for encoding or decoding LZW, JPEG, etc." "${MINGW_PACKAGE_PREFIX}-python-matplotlib: required only for plotting" "${MINGW_PACKAGE_PREFIX}-python-lxml: required only for validating and printing XML") +install=${_realname}-${CARCH}.install +options=('staticlibs' 'strip' '!debug') source=("https://files.pythonhosted.org/packages/source/${_realname:0:1}/${_realname}/${_realname}-${pkgver}.tar.gz") sha256sums=('a5f8caaf672dab0dc8b2609b61d4fd23c6b6fe7e9df38750d4c872962a080ba9') prepare() { - cd "$srcdir" + cd "${srcdir}" + rm -rf python-build-${CARCH} | true cp -r "${_realname}-${pkgver}" "python-build-${CARCH}" } @@ -30,6 +33,12 @@ build() { ${MINGW_PREFIX}/bin/python setup.py build } +check() { + msg "Python test for ${CARCH}" + cd "${srcdir}/python-build-${CARCH}" + ${MINGW_PREFIX}/bin/python setup.py check --strict +} + package() { cd "${srcdir}/python-build-${CARCH}" MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ diff --git a/mingw-w64-python-tifffile/tifffile-i686.install b/mingw-w64-python-tifffile/tifffile-i686.install new file mode 100644 index 0000000000..c6515c6f5e --- /dev/null +++ b/mingw-w64-python-tifffile/tifffile-i686.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in lsm2bin tiffcomment tifffile; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i ${_prefix}/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-tifffile/tifffile-x86_64.install b/mingw-w64-python-tifffile/tifffile-x86_64.install new file mode 100644 index 0000000000..740b46f03c --- /dev/null +++ b/mingw-w64-python-tifffile/tifffile-x86_64.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in lsm2bin tiffcomment tifffile; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i ${_prefix}/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +}