Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
core
Commits
5e36a37d
Verified
Commit
5e36a37d
authored
Feb 14, 2021
by
Tobias WEBER
Browse files
cleanup script for py distro
parent
2fc26cc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
setup_mac/clean_py.sh
0 → 100755
View file @
5e36a37d
#!/bin/bash
#
# @date 16-dec-2020
# @author Tobias Weber <tweber@ill.fr>
# @license GPLv2
#
# cleans up the python distribution
#
PRG
=
"takin.app"
# remove cached files
find
${
PRG
}
/Contents/Frameworks/Python.framework
-type
d
-name
"__pycache__"
-exec
rm
-rfv
{}
\;
find
${
PRG
}
/Contents/Frameworks/Python.framework
-type
f
-name
"*.pyc"
-exec
rm
-fv
{}
\;
# remove tcl/tk
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/libtk
*
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/libtcl
*
rm
-rfv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/tcl8
*
rm
-rfv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/tk8
*
rm
-rfv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/itcl4
*
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/pkgconfig/tcl.pc
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/tcl
*
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/tcl
*
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/tk
*
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/pkgconfig/tk.pc
rm
-rfv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.9/tkinter
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.9/lib-dynload/_tkinter
*
.so
rm
-fv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/lib/Tk
*
# remove non-needed site packages
pushd
${
PRG
}
/Contents
ln
-sf
Frameworks/Python.framework/Versions/Current/lib/python3.9/site-packages
popd
rm
-rfv
${
PRG
}
/Contents/site-packages/setuptools
*
rm
-rfv
${
PRG
}
/Contents/site-packages/pip
*
rm
-rfv
${
PRG
}
/Contents/site-packages/easy
*
rm
-rfv
${
PRG
}
/Contents/site-packages/pkg_resources
# strip libraries
find
${
PRG
}
/Contents/Frameworks/Python.framework
-name
"*.so"
-exec
strip
-v
{}
\;
-print
find
${
PRG
}
/Contents/Frameworks/Python.framework
-name
"*.dylib"
-exec
strip
-v
{}
\;
-print
# app
rm
-rfv
${
PRG
}
/Contents/Frameworks/Python.framework/Versions/Current/Resources/Python.app
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment