python: fix another conflict when merging pypi to v3

This commit is contained in:
Nguyen Tan Cong 2015-01-28 11:54:02 +07:00 committed by Nguyen Anh Quynh
parent 8d4a78cd83
commit 3e605a00ac
1 changed files with 12 additions and 3 deletions

View File

@ -4,17 +4,22 @@ import os
import platform
import shutil
import stat
import sys
from distutils import log
from distutils import dir_util
from distutils.command.build_clib import build_clib
from distutils.command.sdist import sdist
from distutils.core import setup
from distutils.sysconfig import get_python_lib
VERSION = '3.0'
SYSTEM = platform.system().lower()
SITE_PACKAGES = os.path.join(get_python_lib(), "capstone")
SHARED_LIB_EXTENSION = "dylib" if (SYSTEM == "darwin") else "so"
class LazyList(list):
"""A list which re-evaluates each time.
@ -102,6 +107,8 @@ class custom_build_clib(build_clib):
os.chdir("src")
# platform description refers at https://docs.python.org/2/library/sys.html#sys.platform
if SYSTEM == "linux2" or SYSTEM == "darwin":
os.chmod("make.sh", stat.S_IREAD|stat.S_IEXEC)
os.system("BUILD_CORE_ONLY=yes ./make.sh")
@ -133,4 +140,6 @@ setup(
sources=LazyList(get_sources)
),
)],
data_files=[(SITE_PACKAGES, ["src/libcapstone.%s" % SHARED_LIB_EXTENSION])],
)