mingw-w64-python-pygments - hard-code python interpretter to make sure the approapriate classes are used. Do fixups at install time. (#3402)

This commit is contained in:
J. Peter Mugaas
2018-02-16 14:27:16 -05:00
committed by Алексей
parent e7b4265ee2
commit 9aa8d673d2
5 changed files with 67 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

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