49 lines
1.6 KiB
Bash
49 lines
1.6 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
# Contributor: Ray Donnelly <mingw.android@gmail.com>
|
|
|
|
_pyname=Pygments
|
|
_realname=pygments
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=2.4.2
|
|
pkgrel=3
|
|
pkgdesc="Python syntax highlighter (mingw-w64)"
|
|
arch=('any')
|
|
license=('BSD')
|
|
url="http://pygments.org/"
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
|
|
source=("https://pypi.org/packages/source/P/Pygments/${_pyname}-${pkgver}.tar.gz")
|
|
install=${_realname}3-${CARCH}.install
|
|
noextract=("${_pyname}-${pkgver}.tar.gz")
|
|
sha256sums=('881c4c157e45f30af185c1ffe8d549d48ac9127433f2c380c24b84572ad66297')
|
|
|
|
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
|
|
|
|
rm -rf python3-build-${CARCH} | true
|
|
cp -r ${_pyname}-${pkgver} python3-build-${CARCH}
|
|
}
|
|
|
|
check() {
|
|
msg "Python 3 test for ${CARCH}"
|
|
cd "${srcdir}/python3-build-${CARCH}"
|
|
${MINGW_PREFIX}/bin/python3 setup.py check
|
|
}
|
|
|
|
package() {
|
|
local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX})
|
|
|
|
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
|
|
|
|
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE"
|
|
|
|
# fix python command in files
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
|
|
sed -e "s|${_mingw_prefix}|${MINGW_PREFIX}|g" -i ${_f}
|
|
done
|
|
}
|