From 1f0067a2c735fede7cf3a709652154ce1c33eccb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 12 Nov 2019 01:10:50 +0100 Subject: [PATCH] Attempt to fix Windows build of Python module. --- setup.py | 17 ++++++++++++++++- version.sh | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c24926061..fbc76ad56 100644 --- a/setup.py +++ b/setup.py @@ -265,6 +265,20 @@ class Config(object): "-std=c++11", # because we use unordered_map/unordered_set ] + def data_files(self): + """ + Gets the data files to add + """ + if platform.system() == "Windows": + bits = os.getenv("KLAYOUT_BITS") + return [ os.path.join(bits, "zlib", "bin", "zlib.dll"), + os.path.join(bits, "ptw", "bin", "pthreadVCE2.dll"), + os.path.join(bits, "expat", "bin", "expat.dll"), + os.path.join(bits, "curl", "bin", "libcurl.dll"), + os.getenv("KLAYOUT_MSVCRT") ] + else: + return [] + def libraries(self, mod): """ Gets the libraries to add @@ -550,7 +564,8 @@ if __name__ == '__main__': # Optional classifiers "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", ], - url='https://github.com/klayoutmatthias/klayout', + url='https://github.com/klayout/klayout', packages=find_packages('src/pymod/distutils_src'), + data_files=[('lib\\site-packages\\',config.data_files())], # https://github.com/pypa/setuptools/issues/405 package_dir={'': 'src/pymod/distutils_src'}, # https://github.com/pypa/setuptools/issues/230 ext_modules=[_tl, _gsi, _pya, _db, _lib, _rdb] + db_plugins + [tl, db, lib, rdb]) diff --git a/version.sh b/version.sh index 2b19e1d68..d980ab7c4 100644 --- a/version.sh +++ b/version.sh @@ -5,7 +5,7 @@ KLAYOUT_VERSION="0.26.1" # The version used for PyPI (don't use variables here!) -KLAYOUT_VERSION="0.26.1r1" +KLAYOUT_PYPI_VERSION="0.26.1r1" # The build date KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d")