From 7e6754902c7cfcc21edd9a3e41765cc13903bea9 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 21 Mar 2018 10:45:25 -0400 Subject: [PATCH] Reduce filesystem size --- Makefile | 15 +++++++++------ remove_modules.txt | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 remove_modules.txt diff --git a/Makefile b/Makefile index 0d4830987..3f1921d75 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/remove_modules.txt b/remove_modules.txt new file mode 100644 index 000000000..2b29b5d60 --- /dev/null +++ b/remove_modules.txt @@ -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