forked from pymupdf/PyMuPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
72 lines (69 loc) · 3.7 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from distutils.core import setup, Extension
import sys, os
# check the platform
if sys.platform.startswith('linux'):
module = Extension('fitz._fitz', # name of the module
['fitz/fitz_wrap.c'], # C source file
include_dirs=[ # we need the path of the MuPDF and zlib headers
'/usr/include/mupdf',
'/usr/local/include/mupdf',
'/usr/local/thirdparty/zlib',
],
#library_dirs=['<mupdf_and_3rd_party_libraries_dir>'],
libraries=[
'mupdf',
'mupdfthird',
# 'jbig2dec', 'openjp2', 'jpeg', 'freetype',
# 'crypto', #openssl is required by mupdf on archlinux
], # the libraries to link with
)
elif sys.platform.startswith('darwin'):
module = Extension('fitz._fitz', # name of the module
['fitz/fitz_wrap.c'], # C source file
# this are directories containing mupdf's and zlib's header files
include_dirs=['/usr/local/include/mupdf', '/usr/local/include'],
library_dirs=['/usr/local/lib'],
libraries=['mupdf', 'mupdfthird']
)
else:
#===============================================================================
# This will build / set up PyMuPDF under Windows.
# For details consult the documentation.
#===============================================================================
module = Extension('fitz._fitz',
include_dirs=[ # we need the path of the MuPDF's headers
'./mupdf/include',
'./mupdf/include/mupdf',
'./mupdf/thirdparty/zlib',
],
libraries=[ # these are needed in Windows
'libmupdf', 'libresources',
'libthirdparty',
],
extra_link_args=['/NODEFAULTLIB:MSVCRT'],
# x86 dir of libmupdf.lib etc.
library_dirs=['./mupdf/platform/win32/Release'],
# x64 dir of libmupdf.lib etc.
#library_dirs=['./mupdf/platform/win32/x64/Release'],
sources=['./fitz/fitz_wrap.c',])
setup(name = 'PyMuPDF',
version = "1.13.12",
description = 'Python bindings for the PDF rendering library MuPDF',
classifiers = ['Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Programming Language :: C',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Utilities'],
url = 'https://github.com/rk700/PyMuPDF',
author = 'Ruikai Liu',
author_email = '[email protected]',
license = 'GPLv3+',
ext_modules = [module],
py_modules = ['fitz.fitz', 'fitz.utils'])