From 8548e345e644e7eeaaa55bbf3fc5726d7c682d08 Mon Sep 17 00:00:00 2001 From: "J. Peter Mugaas" Date: Wed, 9 Jan 2019 02:32:32 -0500 Subject: [PATCH] Python2 django (#4823) * django fixes django-admin now works in the bash shell. added optional depends upon python-bcrypt and python-argon2_cffi for password support. python-argon2_cffi package was included in a previous PR. * Remove duplicatee entry. --- mingw-w64-python2-django/PKGBUILD | 11 ++++++++--- mingw-w64-python2-django/django2-i686.install | 14 ++++++++++++++ mingw-w64-python2-django/django2-x86_64.install | 14 ++++++++++++++ mingw-w64-python3-django/PKGBUILD | 14 ++++++++++---- mingw-w64-python3-django/django3-i686.install | 14 ++++++++++++++ mingw-w64-python3-django/django3-x86_64.install | 14 ++++++++++++++ 6 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 mingw-w64-python2-django/django2-i686.install create mode 100644 mingw-w64-python2-django/django2-x86_64.install create mode 100644 mingw-w64-python3-django/django3-i686.install create mode 100644 mingw-w64-python3-django/django3-x86_64.install diff --git a/mingw-w64-python2-django/PKGBUILD b/mingw-w64-python2-django/PKGBUILD index c6ded9aa3c..9a2ed9732a 100644 --- a/mingw-w64-python2-django/PKGBUILD +++ b/mingw-w64-python2-django/PKGBUILD @@ -7,13 +7,15 @@ _realname=django pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}") pkgver=1.11.13 -pkgrel=1 +pkgrel=2 pkgdesc="A high-level Python Web framework that encourages rapid development and clean design (mingw-w64)" arch=('any') url='http://www.djangoproject.com/' license=('BSD') makedepends=("${MINGW_PACKAGE_PREFIX}-python2" "${MINGW_PACKAGE_PREFIX}-python2-pytz" + "${MINGW_PACKAGE_PREFIX}-python2-bcrypt" + "${MINGW_PACKAGE_PREFIX}-python2-argon2_cffi" "${MINGW_PACKAGE_PREFIX}-python2-setuptools") options=('staticlibs' 'strip' '!debug') source=("Django-$pkgver.tar.gz"::"https://www.djangoproject.com/download/$pkgver/tarball/") @@ -66,7 +68,10 @@ package() { depends=("${MINGW_PACKAGE_PREFIX}-python2" "${MINGW_PACKAGE_PREFIX}-python2-pytz") optdepends=("${MINGW_PACKAGE_PREFIX}-python2-mysql: for MySQL backend" - "${MINGW_PACKAGE_PREFIX}-python2-psycopg2: for PostgreSQL backend") + "${MINGW_PACKAGE_PREFIX}-python2-psycopg2: for PostgreSQL backend" + "${MINGW_PACKAGE_PREFIX}-python2-bcrypt: for bcrypt support" + "${MINGW_PACKAGE_PREFIX}-python2-argon2_cffi: for Argon2 support") + 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} \ @@ -80,7 +85,7 @@ package() { local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) # fix python command in files for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do - sed -e "s|${PREFIX_WIN}/bin/|/usr/bin/env |g" -i ${_f} + sed -e "s|${PREFIX_WIN}/bin/|${MINGW_PREFIX}/bin/|g" -i ${_f} done # for Python2 packages, you want to rename some stuff from the bin directory diff --git a/mingw-w64-python2-django/django2-i686.install b/mingw-w64-python2-django/django2-i686.install new file mode 100644 index 0000000000..bb7848d20e --- /dev/null +++ b/mingw-w64-python2-django/django2-i686.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in django-admin2; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python2-django/django2-x86_64.install b/mingw-w64-python2-django/django2-x86_64.install new file mode 100644 index 0000000000..5e116e3e5e --- /dev/null +++ b/mingw-w64-python2-django/django2-x86_64.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in django-admin2; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python3-django/PKGBUILD b/mingw-w64-python3-django/PKGBUILD index f8587d3a21..87616f10b5 100644 --- a/mingw-w64-python3-django/PKGBUILD +++ b/mingw-w64-python3-django/PKGBUILD @@ -6,13 +6,16 @@ _realname=django pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") pkgver=2.1.4 -pkgrel=1 +pkgrel=2 pkgdesc="A high-level Python Web framework that encourages rapid development and clean design (mingw-w64)" arch=('any') url='http://www.djangoproject.com/' license=('BSD') makedepends=("${MINGW_PACKAGE_PREFIX}-python3" - "${MINGW_PACKAGE_PREFIX}-python2-setuptools") + "${MINGW_PACKAGE_PREFIX}-python3-bcrypt" + "${MINGW_PACKAGE_PREFIX}-python3-argon2_cffi" + "${MINGW_PACKAGE_PREFIX}-python3-pytz" + "${MINGW_PACKAGE_PREFIX}-python3-setuptools") options=('staticlibs' 'strip' '!debug') source=("Django-${pkgver}.tar.gz"::"https://www.djangoproject.com/download/${pkgver}/tarball/") sha512sums=('a2dc6fb7514f8d79aff98aeb0bd0edb1ede36ed2368e553fded8b58765092d6a2efcf2e9429bb9c7d2c16d466e46a9ff18aaf5911a7dd868f42569c1e82831aa') @@ -57,7 +60,10 @@ build() { package() { depends=("${MINGW_PACKAGE_PREFIX}-python3" "${MINGW_PACKAGE_PREFIX}-python3-pytz") - optdepends=("${MINGW_PACKAGE_PREFIX}-python3-psycopg2: for PostgreSQL backend") + optdepends=("${MINGW_PACKAGE_PREFIX}-python3-psycopg2: for PostgreSQL backend" + "${MINGW_PACKAGE_PREFIX}-python3-bcrypt: for bcrypt support" + "${MINGW_PACKAGE_PREFIX}-python3-argon2_cffi: for Argon2 support") + install=${_realname}3-${CARCH}.install cd "${srcdir}/python3-build-${CARCH}" MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ @@ -72,7 +78,7 @@ package() { local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) # fix python command in files for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do - sed -e "s|${PREFIX_WIN}/bin/|/usr/bin/env |g" -i ${_f} + sed -e "s|${PREFIX_WIN}/bin/|${MINGW_PREFIX}/bin/|g" -i ${_f} done #### end section #### diff --git a/mingw-w64-python3-django/django3-i686.install b/mingw-w64-python3-django/django3-i686.install new file mode 100644 index 0000000000..4ada8d69e0 --- /dev/null +++ b/mingw-w64-python3-django/django3-i686.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in django-admin django-admin3; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python3-django/django3-x86_64.install b/mingw-w64-python3-django/django3-x86_64.install new file mode 100644 index 0000000000..339ef89912 --- /dev/null +++ b/mingw-w64-python3-django/django3-x86_64.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in django-admin django-admin3; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +}