Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
sso
Commits
3dd9b40a
Commit
3dd9b40a
authored
Jul 23, 2018
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the Python module pip-installable
parent
14478bf7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
src/python/Makefile.am
src/python/Makefile.am
+1
-0
src/python/setup.py
src/python/setup.py
+13
-3
No files found.
src/python/Makefile.am
View file @
3dd9b40a
...
...
@@ -2,6 +2,7 @@ include $(top_srcdir)/Makefile.defs
PYTHON_BUILD_ARGS
:=
--plat-name
=
$(
shell
$(srcdir)
/crosscompileargs
)
PYTHON_SETUP_PY
=
env
\
BUILD_MODULE
=
y
\
SSO_LIB_DIR
=
$(top_builddir)
/src/sso/.libs
\
SRCDIR
=
$(srcdir)
BUILDDIR
=
$(builddir)
\
$(PYTHON)
setup.py
...
...
src/python/setup.py
View file @
3dd9b40a
...
...
@@ -7,11 +7,21 @@ BUILDDIR = os.getenv('BUILDDIR', SRCDIR)
SSO_LIB_DIR
=
os
.
getenv
(
'SSO_LIB_DIR'
,
'.'
)
libsso_srcdir
=
os
.
path
.
join
(
SRCDIR
,
'..'
)
setup
(
name
=
'libsso'
,
ext_modules
=
[
Extension
(
'sso._sso_c'
,
[
'sso/sso.i'
],
# If BUILD_MODULE is not defined, bundle libsso into the Python
# extension so that this package is pip-installable directly.
ext_sources
=
[
'sso/sso.i'
]
libraries
=
[
'sso'
]
if
not
os
.
getenv
(
'BUILD_MODULE'
):
ext_sources
.
extend
(
os
.
path
.
join
(
libsso_srcdir
,
'sso'
,
x
)
for
x
in
[
'base64.c'
,
'randombytes.c'
,
'sso.c'
,
'tweetnacl.c'
,
])
libraries
=
[]
setup
(
name
=
'sso'
,
ext_modules
=
[
Extension
(
'sso._sso_c'
,
ext_sources
,
swig_opts
=
[
'-c++'
,
'-modern'
,
'-I'
+
libsso_srcdir
],
include_dirs
=
[
libsso_srcdir
],
libraries
=
[
'sso'
]
,
libraries
=
libraries
,
library_dirs
=
[
SSO_LIB_DIR
],
)],
package_dir
=
{
'sso'
:
'sso'
},
...
...
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