forked from v-finance/cross-python
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bitbucket-pipelines.yml
43 lines (42 loc) · 2.11 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This is a sample build configuration for Python.
# Check our guides at https://confluence.atlassian.com/x/x4UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: ubuntu:18.04
pipelines:
default:
- step:
script:
# install deps
- dpkg --add-architecture i386
- apt-get update
- apt-get --assume-yes install software-properties-common apt-transport-https wget gnupg zip git python3-pip build-essential ninja-build
- pip3 install meson
# get libffi
- wget https://github.com/libffi/libffi/releases/download/v3.3-rc2/libffi-3.3-rc2.tar.gz
# prepare cpython code
- git clone -b 3.8 --single-branch https://github.com/python/cpython.git cpython
# native build
- meson -Dsource=cpython builddir
- ninja -C builddir
# mingw build 64 bit
- wget https://dl.winehq.org/wine-builds/Release.key
- apt-key add Release.key
# apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
# apt-get update
# apt-get install -y --allow-unauthenticated winehq-stable
- apt-get install -y wine-development mingw-w64
- meson -Dsource=cpython --cross-file cross-files/x86_64-w64-mingw32.txt builddir-x86_64-w64-mingw32 --prefix="${PWD}/x86_64-w64-mingw32"
- ninja -C builddir-x86_64-w64-mingw32 install
- cd x86_64-w64-mingw32; zip ../python-3.8-x86_64-w64-mingw32.zip -r *; cd ..
# mingw build 32 bit
- tar xzvf libffi-3.3-rc2.tar.gz
- cd libffi-3.3-rc2; ./configure --host=i686-w64-mingw32; cd ..
- cd libffi-3.3-rc2; make install; cd ..
- meson -Dsource=cpython --cross-file cross-files/i686-w64-mingw32.txt builddir-i686-w64-mingw32 --prefix="${PWD}/i686-w64-mingw32"
- ninja -C builddir-i686-w64-mingw32 install
# create a package
- cd i686-w64-mingw32; zip ../python-3.8-i686-w64-mingw32.zip -r *; cd ..
artifacts:
- "*.zip"