Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit e7a7e11

Browse files
authored
Merge pull request #11 from paulproteus/add-exclusions-support
Add exclusions similar to Python-Apple-support
2 parents ea1d44d + fc4cc94 commit e7a7e11

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

3.7.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,12 @@ RUN cd rubicon-java-${RUBICON_JAVA_VERSION} && \
198198
RUN mv rubicon-java-${RUBICON_JAVA_VERSION}/build/librubicon.so $JNI_LIBS
199199
RUN mkdir -p /opt/python-build/app/libs/ && mv rubicon-java-${RUBICON_JAVA_VERSION}/build/rubicon.jar $APPROOT/app/libs/
200200

201-
# Create output artifacts.
201+
# Create rubicon.zip and pythonhome.zip for this CPU architecture, filtering
202+
# pythonhome.zip using pythonhome-excludes to remove the CPython test suite, etc.
202203
ENV ASSETS_DIR $APPROOT/app/src/main/assets/
203204
ARG COMPRESS_LEVEL
204-
RUN mkdir -p "$ASSETS_DIR" && cd "$PYTHON_INSTALL_DIR" && zip -$COMPRESS_LEVEL -q "$ASSETS_DIR"/pythonhome.${TARGET_ABI_SHORTNAME}.zip -r .
205+
ADD 3.7.pythonhome-excludes /opt/python-build/
206+
RUN mkdir -p "$ASSETS_DIR" && cd "$PYTHON_INSTALL_DIR" && zip -x@/opt/python-build/3.7.pythonhome-excludes -$COMPRESS_LEVEL -q "$ASSETS_DIR"/pythonhome.${TARGET_ABI_SHORTNAME}.zip -r .
205207
RUN cd rubicon-java-${RUBICON_JAVA_VERSION} && zip -$COMPRESS_LEVEL -q "$ASSETS_DIR"/rubicon.zip -r rubicon
206208

207209
RUN apt-get update -qq && apt-get -qq install rsync

3.7.excludes

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# You can add patterns to this file to remove them
2+
# from the Python-Android-support.zip file. Note that
3+
# if you are removing files from the Python standard library,
4+
# you need to use the 3.7.pythonhome-excludes file.
5+
#
6+
# Examples:
7+
#
8+
# libs/*/libssl*
9+
# libs/*/libcrypto*
10+
#
11+
# These lines would remove OpenSSL. The libs/ directory contains
12+
# JNI libraries for the Android app. The first asterisk is needed
13+
# to match the pattern in all Android ABIs. The second asterisk
14+
# is present for convenience, to avoid having to specify the full
15+
# OpenSSL library name.
16+
#
17+
# libs/*/*xz*
18+
#
19+
# This line would remove the "xz" compression library. This might
20+
# be appropriate if you don't use that compression format in your
21+
# code.

3.7.pythonhome-excludes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is used by `zip -i@this_file` in `Dockerfile` on
2+
# each architecture to filter the Python standard library we
3+
# distribute.
4+
lib/python*/config-*
5+
lib/python*/ctypes/test/*
6+
lib/python*/curses/*
7+
lib/python*/distutils/tests/*
8+
lib/python*/ensurepip/*
9+
lib/python*/idlelib/*
10+
lib/python*/lib2to3/tests/*
11+
lib/python*/site-packages/*
12+
lib/python*/sqlite3/test/*
13+
lib/python*/test/*
14+
lib/python*/tkinter/*
15+
lib/python*/turtle.py
16+
lib/python*/turtledemo/*
17+
lib/python*/wsgiref/*

3.7.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function main() {
190190
# Make a ZIP file.
191191
fix_permissions
192192
pushd build/3.7/app > /dev/null
193-
zip -r -"${COMPRESS_LEVEL}" "../../../dist/Python-3.7-Android-support${BUILD_TAG}.zip" .
193+
zip -x@../../../3.7.excludes -r -"${COMPRESS_LEVEL}" "../../../dist/Python-3.7-Android-support${BUILD_TAG}.zip" .
194194
popd
195195
}
196196

0 commit comments

Comments
 (0)