python-tifffile: add post_install scripts

This commit is contained in:
Miloš Komarčević
2021-01-29 10:44:50 +01:00
parent d8c532d667
commit c340cd5db2
3 changed files with 40 additions and 3 deletions

View File

@@ -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=" \

View File

@@ -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
}

View File

@@ -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
}