diff --git a/mingw-w64-python-cliff/01-requirements-cmd2.patch b/mingw-w64-python-cliff/01-requirements-cmd2.patch new file mode 100644 index 0000000000..e5deabf11c --- /dev/null +++ b/mingw-w64-python-cliff/01-requirements-cmd2.patch @@ -0,0 +1,12 @@ +--- cliff-3.1.0/requirements.txt 2020-03-27 05:38:14.000000000 +0900 ++++ patched-cliff-3.1.0/requirements.txt 2020-04-07 23:06:36.679325600 +0900 +@@ -2,7 +2,8 @@ + # of appearance. Changing the order has an impact on the overall integration + # process, which may cause wedges in the gate later. + pbr!=2.1.0,>=2.0.0 # Apache-2.0 +-cmd2>=0.8.0,!=0.8.3,<0.9.0 # MIT ++cmd2!=0.8.3,<0.9.0;python_version<'3.0' # MIT ++cmd2!=0.8.3;python_version>='3.0' # MIT + PrettyTable<0.8,>=0.7.2 # BSD + pyparsing>=2.1.0 # MIT + six>=1.10.0 # MIT diff --git a/mingw-w64-python-cliff/02-cmd2-interactive.py.patch b/mingw-w64-python-cliff/02-cmd2-interactive.py.patch new file mode 100644 index 0000000000..6937143c76 --- /dev/null +++ b/mingw-w64-python-cliff/02-cmd2-interactive.py.patch @@ -0,0 +1,22 @@ +--- cliff-3.1.0/cliff/interactive.py 2020-03-27 05:38:14.000000000 +0900 ++++ patched-cliff-3.1.0/cliff/interactive.py 2020-04-07 23:08:05.421503100 +0900 +@@ -175,9 +175,16 @@ class InteractiveApp(cmd2.Cmd): + statement.parsed.args = ' '.join(sub_argv) + else: + # cmd2 >= 0.9.1 uses shlex and gives us a Statement. +- statement.command = cmd_name +- statement.argv = [cmd_name] + sub_argv +- statement.args = ' '.join(statement.argv) ++ statement = cmd2.Statement(' '.join(sub_argv), ++ raw=statement.raw, ++ command=cmd_name, ++ arg_list=sub_argv, ++ multiline_command=statement.multiline_command, ++ terminator=statement.terminator, ++ suffix=statement.suffix, ++ pipe_to=statement.pipe_to, ++ output=statement.output, ++ output_to=statement.output_to) + return statement + + def cmdloop(self): diff --git a/mingw-w64-python-cliff/PKGBUILD b/mingw-w64-python-cliff/PKGBUILD index d34f1a0fd7..534468db45 100644 --- a/mingw-w64-python-cliff/PKGBUILD +++ b/mingw-w64-python-cliff/PKGBUILD @@ -27,8 +27,12 @@ makedepends=('git' # "${MINGW_PACKAGE_PREFIX}-python-oslosphinx" # "${MINGW_PACKAGE_PREFIX}-python-testscenarios") options=('staticlibs' 'strip' '!debug') -source=("${_realname}-${pkgver}.tar.gz::https://github.com/openstack/cliff/archive/${pkgver}.tar.gz") -sha512sums=('e65af5ec08df4d7586a1d6821acd283e568227bffee2e5ed8bb40d9f6d4fb17d83fcafc0f1a8ef4293ff7cd2f9e204db35198e58ff7e35d566ffcc03eed5740b') +source=("${_realname}-${pkgver}.tar.gz::https://github.com/openstack/cliff/archive/${pkgver}.tar.gz" + "01-requirements-cmd2.patch" + "02-cmd2-interactive.py.patch") +sha256sums=('1fc2631b980f1a0a78c42f4f933d47f7220dd441b5da6946362020a590e93f32' + '52fea9bc186ce7e9f13aff719080c4392ce17ebbae6910ac218f08c7d16515ba' + '2d40a800084ebf4958f7c6d81ae7a4951b864481de8dfd17eb48343de3c0baed') # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -50,11 +54,14 @@ del_file_exists() { # =========================================== # prepare() { - cd "${srcdir}" -# pushd "${_realname}-${pkgver}" -# apply_patch_with_msg 0001-A-really-important-fix.patch \ -# 0002-A-less-important-fix.patch -# popd + cd "${srcdir}"/${_realname}-${pkgver} + apply_patch_with_msg \ + 01-requirements-cmd2.patch \ + 02-cmd2-interactive.py.patch +} + +build() { + msg "Python build for ${CARCH}" rm -rf python-build-${CARCH} | true cp -r "${_realname}-${pkgver}" "python-build-${CARCH}" @@ -62,10 +69,7 @@ prepare() { # Set version for setuptools_scm export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver} export PBR_VERSION=${pkgver} -} - -build() { - msg "Python build for ${CARCH}" + cd "${srcdir}/python-build-${CARCH}" ${MINGW_PREFIX}/bin/python setup.py build }