Skip to content

Commit 06baa9a

Browse files
Fix patch command and ensure patch is installed (CQ-1519)
1 parent 9173a5a commit 06baa9a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/build-conquest-python.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ jobs:
8181
${{ needs.setup.outputs.python }} --version
8282
${{ needs.setup.outputs.python }} -m pip install --upgrade pip wheel setuptools
8383
84+
- name: Install patch
85+
run: |
86+
if [[ "${{ needs.setup.outputs.runson }}" == "ubuntu-latest" ]]; then
87+
if [[ -f /etc/rocky-release ]]; then
88+
sudo dnf install -y patch
89+
else
90+
sudo apt update && sudo apt install -y patch
91+
fi
92+
fi
93+
8494
- name: Build conquest python
8595
run: |
8696
output=$(${{ needs.setup.outputs.python }} build_conquest_python.py | grep Creating | tail -n 1)

build_conquest_python.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,9 @@ def main():
761761
# Patch Pyinstaller to fix https://github.com/pyinstaller/pyinstaller/issues/5540
762762
# The actual fix for this isn't in any of the 3.x versions, and 4.x onwards require Python 3 :(
763763
if Package().linux:
764-
command = ["patch", "-i", os.path.join(os.path.dirname(os.path.abspath(__file__)), "pyinstaller.patch")]
765-
package_path = ConquestPythonPackage().python_base_directory / 'lib' / 'python2.7' / 'site-packages'
764+
command = ["patch", "-p1", "-i", os.path.join(os.path.dirname(os.path.abspath(__file__)), "pyinstaller.patch")]
765+
print(f"Applying patch with {' '.join(command)}")
766+
package_path = ConquestPythonPackage().python_base_directory / "lib" / "python2.7" / "site-packages"
766767
subprocess.run(command, cwd=package_path)
767768

768769
if not Package().windows:

0 commit comments

Comments
 (0)