Files
MINGW-packages/mingw-w64-python-netaddr/PKGBUILD
J. Peter Mugaas e2a5ff5900 Numerous packages to verify python-pbr (#4329)
* Numerous packages to verify python-pbr
Please note that this only ONE part of a long chain of packages that seem to depend upon eachother for building and validation including some stuff that is already in MINGW-W64 PKGBUILD’s such as setuptools and pbr as well as some other stuff.  The idea is build something that’s good enough to build everything else in hopefully manner including some stuff such as opencv, eigen, vtm numerous gnome packages, and who knows what else.  I may have made mistakes and numerous omissios so please bear with me.
mingw-w64-python2-subprocess32 - 0.6.0
mingw-w64-python-pyperclip - 1.6.4
mingw-w64-python-pyreadline - 2.1
mingw-w64-python2-cmd2 - 0.8.6
mingw-w64-python3-cmd2 – 0.9.4
mingw-w64-python-stevedore – 1.29.0
mingw-w64-python-unicodecsv – 0.14.1
mingw-w64-python-pytest-forked – 0.2 cliff-2.13.0-1
mingw-w64-python-pytest-xdist – 1.23.0
mingw-w64-python-execnet – 1.50
mingw-w64-python-testrepository – 0.20
mingw-w64-python-testresources – 2.0.1
mingw-w64-python-cliff - cliff-2.13.0
mingw-w64-python-voluptuous – 0.15.1

* python-hacking - 1.1.0

* More necessary packages for tests and afix for nose and sphinx.
Also tried to fix most mentioned previous except for "testrepository"  That was deliberate because it refers to the name of a package.

* Numerous modules that I built for testins stestr thare useful elesewhere.
I also updated sqlchemy and decorator to the latest versions.
Some times the testing here may not work but I'm hoping to lay more solid groundwork and quite a bit can be conibalized by others for fixing things already in git.

* Remove Python2 dependency for python3 package.

* python-jsonschemea - 2.6.0 - make sure .EXE works.  Added dependency on python2-functools32
python2-functutils32 - 3.2.3-2 - new package required for jsonshcemas Python2 version.
Verified this with PIP.

* python-matplotlib - require backports.functools_lru_cache
backports.functools_lru_cache - 1.5 - new package requried for python-maplotlib in Python2 - verified with PIP
2018-09-04 08:07:33 +03:00

165 lines
6.0 KiB
Bash

# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>.
_realname=netaddr
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.7.19
pkgrel=1
pkgdesc="Pure Python network address representation and manipulation library (mingw-w64)"
arch=('any')
url='https://github.com/drkjam/netaddr'
license=('BSD')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-sphinx"
"${MINGW_PACKAGE_PREFIX}-python2-sphinx"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest"
"${MINGW_PACKAGE_PREFIX}-python2-pytest")
options=('staticlibs' 'strip' '!debug')
source=(${_realname}-${pkgver}.tar.gz::https://github.com/drkjam/${_realname}/archive/${_realname}-${pkgver}.tar.gz
fix-${pkgver}-python3.patch
pep479-return-instead-of-raise-StopIteration.patch)
sha512sums=('f07fb4de08aef4925dbc429b4ee93b25855273f083405d4e763c2fbc996ee35b09b87b10117040b073d45ac9f51512083116883ff48216e68aa1e429f83d5278'
'8db4e6cbaf03b95092561dfcf881616920da2ab45f205d8bd29f1f6e9e7681a7d591c0a52dbdb772a41cac0b42d643c2dafcad22a659524a35cb6b06dd98d38d'
'ff4b46184cc98c360ba377a72ead48a64fd78477080c7061652f79dc44d7b6803111cee885502b7d98e08d66d440e7b9afd65faa97674b2c487a2ba78e684e9d')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
del_file_exists() {
for _fname in "$@"
do
if [ -f $_fname ]; then
rm -rf $_fname
fi
done
}
# =========================================== #
prepare() {
cd "${srcdir}"
pushd "${_realname}-${_realname}-${pkgver}"
sed -r 's|#!/usr/bin/env python||g' -i netaddr/eui/ieee.py netaddr/ip/iana.py
apply_patch_with_msg "fix-${pkgver}-python3.patch" \
"pep479-return-instead-of-raise-StopIteration.patch"
popd
for builddir in python{2,3}-build-${CARCH}; do
rm -rf ${builddir} | true
cp -r "${_realname}-${_realname}-${pkgver}" "${builddir}"
done
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}
# Note that build() is sometimes skipped because it's done in
# the packages setup.py install for simplicity if you can do so.
# but sometimes, you want to do a check before install which would
# also trigger the build.
build() {
for pver in {2,3}; do
msg "Python ${pver} build for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
${MINGW_PREFIX}/bin/python${pver} setup.py build
cd docs
make text
# make man
done
}
check() {
msg "Python 2 test for ${CARCH}"
cd "${srcdir}/python2-build-${CARCH}"
LC_ALL='en_US.UTF-8' ${MINGW_PREFIX}/bin/py.test2
msg "Python 3 test for ${CARCH}"
cd "${srcdir}/python3-build-${CARCH}"
LC_ALL='en_US.UTF-8' ${MINGW_PREFIX}/bin/py.test
}
package_python3-netaddr() {
depends=("${MINGW_PACKAGE_PREFIX}-python3")
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-ipython: netaddr interractive command support")
#This package install is needed for .fixups with .EXE's
#in the bit directory. The install files "python-exe-installs"
#and should be renamed to your _realname .
install=${_realname}3-${CARCH}.install
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}" --optimize=1 --skip-build
install -Dm 644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE"
install -Dm 644 README.md "${pkgdir}${MINGW_PREFIX}/share/doc/python3-${_realname}/README.md"
install -Dm 644 docs/build/text/* -t "${pkgdir}${MINGW_PREFIX}/share/doc/python3-${_realname}/"
# install -Dm 644 docs/build/man/netaddr.1 "${pkgdir}${MINGW_PREFIX}/share/man/man1/netaddr.1"
# This entire section should be removed if the package does NOT install
# anything in the /mingw*/bin directory.
### begin section ###
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*; do
sed -e "s|/usr/bin/env |${MINGW_PREFIX}/bin/|g" \
-e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f}
done
#### end section ####
}
package_python2-netaddr() {
depends=("${MINGW_PACKAGE_PREFIX}-python2")
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-ipython: netaddr interractive command supprt")
install=${_realname}2-${CARCH}.install
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}" --optimize=1 --skip-build
install -Dm 644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE"
install -Dm 644 README.md "${pkgdir}${MINGW_PREFIX}/share/doc/python2-${_realname}/README.md"
install -Dm 644 docs/build/text/* -t "${pkgdir}${MINGW_PREFIX}/share/doc/python2-${_realname}/"
# install -Dm 644 docs/build/man/netaddr.1 "${pkgdir}${MINGW_PREFIX}/share/man/man1/netaddr.1"
# This entire section should be removed if the package does NOT install
# anything in the /mingw*/bin directory.
### begin section ###
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*; do
sed -e "s|python[^3]|python|" \
-e "s|/usr/bin/env |${MINGW_PREFIX}/bin/|g" \
-e "s|${PREFIX_WIN}|${MINGW_PREFIX}/|g" -i ${_f}
done
for f in netaddr; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}
done
#### end section ####
}
package_mingw-w64-i686-python2-netaddr() {
package_python2-netaddr
}
package_mingw-w64-i686-python3-netaddr() {
package_python3-netaddr
}
package_mingw-w64-x86_64-python2-netaddr() {
package_python2-netaddr
}
package_mingw-w64-x86_64-python3-netaddr() {
package_python3-netaddr
}