Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools_dso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
setuptools_dso
Commits
333c60b1
Commit
333c60b1
authored
Jul 07, 2018
by
Michael Davidsaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup
parent
f74fa4b9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
setup.py
setup.py
+4
-0
src/setuptools_dso/dsocmd.py
src/setuptools_dso/dsocmd.py
+12
-8
No files found.
setup.py
View file @
333c60b1
...
...
@@ -11,6 +11,7 @@ and packaging them for distribution. eg. for use by python extensions.
If you have to ask "why", then keep moving along. There is nothing for you to see here.
"""
,
url
=
'https://github.com/mdavidsaver/setuptools_dso'
,
author
=
'Michael Davidsaver'
,
author_email
=
'mdavidsaver@gmail.com'
,
...
...
@@ -19,6 +20,9 @@ If you have to ask "why", then keep moving along. There is nothing for you to s
'Development Status :: 4 - Beta'
,
'Programming Language :: Python :: 2.7'
,
'Programming Language :: Python :: 3'
,
'Intended Audience :: Developers'
,
'Topic :: Software Development :: Libraries :: Python Modules'
,
'Topic :: System :: Archiving :: Packaging'
,
],
python_requires
=
'>=2.7'
,
...
...
src/setuptools_dso/dsocmd.py
View file @
333c60b1
...
...
@@ -67,10 +67,6 @@ class build_dso(Command):
(
'force'
,
'force'
),
)
# MSVC build puts .lib in build/temp.*
# others put .so in build/lib.*
self
.
lib_temp
=
self
.
build_temp
if
sys
.
platform
==
"win32"
else
self
.
build_lib
self
.
dsos
=
self
.
distribution
.
x_dsos
def
run
(
self
):
...
...
@@ -169,10 +165,16 @@ class build_dso(Command):
if
sys
.
platform
==
'darwin'
:
# we always want to produce relocatable (movable) binaries
# TODO: this only works when library and extension are in the same directory
extra_args
.
extend
([
'-install_name'
,
'@loader_path/%s'
%
os
.
path
.
basename
(
solib
)])
elif
sys
.
platform
!=
"win32"
and
baselib
!=
solib
:
extra_args
.
extend
([
'-Wl,-h,%s'
%
os
.
path
.
basename
(
solib
)])
if
sys
.
platform
==
"win32"
:
# The .lib is considered "temporary" for extensions, but not for us
# so we pass export_symbols=None and put it along side the .dll
extra_args
.
append
(
'/IMPLIB:%s.lib'
%
(
os
.
path
.
splitext
(
outlib
)[
0
]))
extra_args
.
extend
(
dso
.
extra_link_args
or
[])
language
=
dso
.
language
or
self
.
compiler
.
detect_language
(
sources
)
...
...
@@ -183,7 +185,7 @@ class build_dso(Command):
library_dirs
=
library_dirs
,
runtime_library_dirs
=
dso
.
runtime_library_dirs
,
extra_postargs
=
extra_args
,
export_symbols
=
[],
#self.get_export_symbols(dso)
,
export_symbols
=
None
,
#debug=self.debug,
build_temp
=
self
.
build_temp
,
target_lang
=
language
)
...
...
@@ -202,10 +204,10 @@ class build_ext(_build_ext):
# MSVC build puts .lib in build/temp.*
# others put .so in build/lib.*
self
.
lib_temp
=
self
.
build_temp
if
sys
.
platform
==
"win32"
else
self
.
build_lib
#
self.lib_temp = self.build_temp if sys.platform == "win32" else self.build_lib
self
.
include_dirs
=
massage_dir_list
(
self
.
build_temp
,
self
.
include_dirs
or
[])
self
.
library_dirs
=
massage_dir_list
(
self
.
lib_temp
,
self
.
library_dirs
or
[])
self
.
library_dirs
=
massage_dir_list
(
self
.
build_lib
,
self
.
library_dirs
or
[])
def
run
(
self
):
self
.
run_command
(
'build_dso'
)
...
...
@@ -215,12 +217,14 @@ class build_ext(_build_ext):
def
build_extension
(
self
,
ext
):
ext
.
include_dirs
=
massage_dir_list
(
self
.
build_temp
,
ext
.
include_dirs
or
[])
ext
.
library_dirs
=
massage_dir_list
(
self
.
lib_temp
,
ext
.
library_dirs
or
[])
ext
.
library_dirs
=
massage_dir_list
(
self
.
build_lib
,
ext
.
library_dirs
or
[])
ext
.
extra_link_args
=
ext
.
extra_link_args
or
[]
if
platform
.
system
()
==
'Linux'
:
ext
.
extra_link_args
.
extend
([
'-Wl,-rpath,$ORIGIN'
])
elif
sys
.
platform
==
'darwin'
:
pass
# TODO: avoid otool games with: -dylib_file <install_name>:@loader_path/<my_rel_path>
# the Darwin linker errors if given non-existant directories :(
[
self
.
mkpath
(
D
)
for
D
in
ext
.
library_dirs
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment