diff --git a/mingw-w64-python-pygments/PKGBUILD b/mingw-w64-python-pygments/PKGBUILD index 6f5362e1b9..5a3c4d92d7 100644 --- a/mingw-w64-python-pygments/PKGBUILD +++ b/mingw-w64-python-pygments/PKGBUILD @@ -6,7 +6,7 @@ _realname=pygments pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}") pkgver=2.2.0 -pkgrel=1 +pkgrel=2 pkgdesc="Python syntax highlighter (mingw-w64)" arch=('any') license=('BSD') @@ -21,7 +21,7 @@ prepare() { # workaround for symlink issue tar -xf ${_pyname}-${pkgver}.tar.gz || true cp ${_pyname}-${pkgver}/scripts/debug_lexer.py ${_pyname}-${pkgver}/scripts/find_error.py - for builddir in python{2,3}-build; do + for builddir in python{2,3}-build-${CARCH}; do rm -rf $builddir | true cp -r ${_pyname}-${pkgver} $builddir done @@ -37,7 +37,7 @@ prepare() { check() { for pver in {2,3}; do msg "Python ${pver} test for ${CARCH}" - cd "${srcdir}/python${pver}-build" + cd "${srcdir}/python${pver}-build-${CARCH}" ${MINGW_PREFIX}/bin/python${pver} setup.py check done } @@ -47,7 +47,7 @@ package_python3-pygments() { local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX}) - cd "${srcdir}/python3-build" + cd "${srcdir}/python3-build-${CARCH}" MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ ${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" -O1 @@ -55,7 +55,7 @@ package_python3-pygments() { # fix python command in files for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do - sed -e "s|${_mingw_prefix}/bin/|/usr/bin/env |g" -i ${_f} + sed -e "s|${_mingw_prefix}|${MINGW_PREFIX}|g" -i ${_f} done } @@ -64,13 +64,13 @@ package_python2-pygments() { local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX}) - cd "${srcdir}/python2-build" + cd "${srcdir}/python2-build-${CARCH}" MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" -O1 # fix python command in files for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do - sed -e "s|${_mingw_prefix}/bin/|/usr/bin/env |g" -i ${_f} + sed -e "s|${_mingw_prefix}|${MINGW_PREFIX}|g" -i ${_f} done for f in pygmentize; do @@ -86,17 +86,21 @@ package_python2-pygments() { } package_mingw-w64-i686-python2-pygments() { + install=${_realname}2-${CARCH}.install package_python2-pygments } package_mingw-w64-i686-python3-pygments() { + install=${_realname}3-${CARCH}.install package_python3-pygments } package_mingw-w64-x86_64-python2-pygments() { + install=${_realname}2-${CARCH}.install package_python2-pygments } package_mingw-w64-x86_64-python3-pygments() { + install=${_realname}3-${CARCH}.install package_python3-pygments } diff --git a/mingw-w64-python-pygments/pygments2-i686.install b/mingw-w64-python-pygments/pygments2-i686.install new file mode 100644 index 0000000000..72deb2b412 --- /dev/null +++ b/mingw-w64-python-pygments/pygments2-i686.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in pygmentize2; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-pygments/pygments2-x86_64.install b/mingw-w64-python-pygments/pygments2-x86_64.install new file mode 100644 index 0000000000..0b335612fa --- /dev/null +++ b/mingw-w64-python-pygments/pygments2-x86_64.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in pygmentize2; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-pygments/pygments3-i686.install b/mingw-w64-python-pygments/pygments3-i686.install new file mode 100644 index 0000000000..a40ee22bb3 --- /dev/null +++ b/mingw-w64-python-pygments/pygments3-i686.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in pygmentize; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-pygments/pygments3-x86_64.install b/mingw-w64-python-pygments/pygments3-x86_64.install new file mode 100644 index 0000000000..ed75d5412b --- /dev/null +++ b/mingw-w64-python-pygments/pygments3-x86_64.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in pygmentize; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +}