Reduce filesystem size

This commit is contained in:
Michael Droettboom 2018-03-21 10:45:25 -04:00
parent ddd0a73b85
commit 7e6754902c
2 changed files with 28 additions and 6 deletions

View File

@ -63,19 +63,22 @@ root/.built: \
$(CPYTHONLIB) \
$(NUMPY_LIBS) \
src/lazy_import.py \
src/sitecustomize.py
src/sitecustomize.py \
remove_modules.txt
[ -d root ] && rm -rf root
mkdir -p root/lib
cp -a $(CPYTHONLIB)/ root/lib
( \
cd root/lib/python$(PYMINOR); \
rm -fr test distutils ensurepip idlelib __pycache__ tkinter; \
)
cp -a numpy/build/numpy $(SITEPACKAGES)
rm -fr $(SITEPACKAGES)/numpy/distutils
mkdir $(SITEPACKAGES)/lazy_import
cp src/lazy_import.py $(SITEPACKAGES)
cp src/sitecustomize.py $(SITEPACKAGES)
( \
cd root/lib/python$(PYMINOR); \
rm -fr `cat ../../../remove_modules.txt`; \
rm encodings/cp*.py; \
rm encodings/mac_*.py; \
find -type d -name __pycache__ -prune -exec rm -rf {} \; \
)
touch root/.built

19
remove_modules.txt Normal file
View File

@ -0,0 +1,19 @@
_osx_support.py
asyncio
ctypes
curses
dbm
distutils
ensurepip
idlelib
lib2to3
multiprocessing
socket.py
sqlite3
subprocess.py
test
threading.py
tkinter
turtle.py
turtledemo
venv