Commit 5f4325f90f492392a1418a8045dd71d13d7d04d2

Authored by Marcin Woliński
1 parent 99ad40a3

_morfeusz2.abi3.so na Linuksie

Biblioteka łącząca Morfeusza z Pythonem 3 jest teraz oznaczana jako
zależna od ABI stabilnego dla Pythonów 3, a nie konkretnej wersji
Pythona. Dzięki temu będzie działać z (jak dotychczas) dowolnym
Pythonem 3.

Niestety wygląda, że pod Windows trzeba zlinkować z konkretnym
libpython3x.dll ☹, więc muszą być osobne paczki.
CMakeLists.txt
... ... @@ -4,7 +4,7 @@ project (Morfeusz)
4 4  
5 5 set (Morfeusz_VERSION_MAJOR 1)
6 6 set (Morfeusz_VERSION_MINOR 9)
7   -set (Morfeusz_VERSION_PATCH 19)
  7 +set (Morfeusz_VERSION_PATCH 20)
8 8 set (Morfeusz_VERSION "${Morfeusz_VERSION_MAJOR}.${Morfeusz_VERSION_MINOR}.${Morfeusz_VERSION_PATCH}")
9 9 set (Morfeusz_LIB_VERSION "${Morfeusz_VERSION}")
10 10 if (BUILT_ON)
... ...
morfeusz/const.cpp
... ... @@ -14,7 +14,7 @@ namespace morfeusz {
14 14 extern const char FILESYSTEM_PATH_SEPARATOR = '/';
15 15  
16 16 extern const std::string COPYRIGHT_TEXT =
17   - "Copyright © 2014–2020 by Institute of Computer Science, Polish Academy of\n\
  17 + "Copyright © 2014–2021 by Institute of Computer Science, Polish Academy of\n\
18 18 Science\n\
19 19 \n\
20 20 All rights reserved.\n\
... ...
morfeusz/wrappers/python3/setup.py.in
... ... @@ -2,10 +2,16 @@
2 2 from setuptools import setup, Extension
3 3  
4 4 morfeusz2 = Extension('_morfeusz2',
5   - libraries=['morfeusz2'],
6   - library_dirs=['${CMAKE_CURRENT_BINARY_DIR}/../..'],
7   - include_dirs=['${CMAKE_CURRENT_SOURCE_DIR}/../..', '${PROJECT_BINARY_DIR}'],
8   - sources=['${SWIG_PYTHON_OUTFILE_CXX}'])
  5 + libraries=['morfeusz2'],
  6 + library_dirs=['${CMAKE_CURRENT_BINARY_DIR}/../..'],
  7 + include_dirs=['${CMAKE_CURRENT_SOURCE_DIR}/../..',
  8 + '${PROJECT_BINARY_DIR}'],
  9 + sources=['${SWIG_PYTHON_OUTFILE_CXX}'],
  10 + #
  11 + # The .so name will include curent ABI number
  12 + # (abi3) instead of cp38-cp38-linux_x86_64 (thus
  13 + # can be used by multiple versions of Python3):
  14 + py_limited_api=True)
9 15  
10 16 if __name__ == '__main__':
11 17 setup(name='morfeusz2',
... ... @@ -13,6 +19,6 @@ if __name__ == '__main__':
13 19 author_email='${CPACK_PACKAGE_CONTACT}',
14 20 description='Python3 bindings for Morfeusz',
15 21 version='${PY3MORFEUSZ_VERSION}',
16   - package_dir={ '': '${CMAKE_CURRENT_BINARY_DIR}'},
17   - py_modules = ['morfeusz2'],
18   - ext_modules = [morfeusz2])
  22 + package_dir={'': '${CMAKE_CURRENT_BINARY_DIR}'},
  23 + py_modules=['morfeusz2'],
  24 + ext_modules=[morfeusz2])
... ...