python: setup.py only copies source if prebuilt libs are not existent

test2
Nguyen Anh Quynh 10 years ago
parent e00bb43e25
commit 00eb3dea4f
  1. 18
      bindings/python/Makefile
  2. 3
      bindings/python/setup.py

@ -44,15 +44,33 @@ install_cython:
mv $(OBJDIR)/build/lib/python/capstone/* capstone
cd $(OBJDIR) && python setup_cython.py build -b ./tmp install
# build Python package with source
sdist:
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
python setup.py sdist
# build Python package with source
sdist3:
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
python3 setup.py sdist
# build Python package with prebuilt core
sdist_bin:
rm -rf src/
python setup.py sdist
# build Python package with prebuilt core
sdist3_bin:
rm -rf src/
python3 setup.py sdist
clean:
rm -rf $(OBJDIR) src/
rm -f capstone/*.so
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
TESTS = test.py test_detail.py test_arm.py test_arm64.py test_mips.py test_ppc.py

@ -66,6 +66,9 @@ class custom_sdist(sdist):
"""Reshuffle files for distribution."""
def run(self):
# if prebuilt libraries are existent, then do not copy source
if os.path.exists(PATH_LIB64) and os.path.exists(PATH_LIB32):
return
copy_sources()
return sdist.run(self)

Loading…
Cancel
Save