Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OBITools3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
20
Issues
20
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
dc88181e
Commit
dc88181e
authored
Apr 12, 2019
by
Eric Coissac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a --cobitools3 options to setup.py
parent
2f60e91d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
1 deletions
+57
-1
setup.py
setup.py
+57
-1
No files found.
setup.py
View file @
dc88181e
...
...
@@ -14,6 +14,58 @@ import os.path
from
distutils
import
log
from
distutils.extension
import
Extension
from
distutils.dist
import
Distribution
as
ori_Distribution
class
Distribution
(
ori_Distribution
):
def
__init__
(
self
,
attrs
=
None
):
self
.
cobitools3
=
attrs
[
'cobitools3'
]
ori_Distribution
.
__init__
(
self
,
attrs
)
self
.
global_options
.
insert
(
0
,(
'cobitools3'
,
None
,
"intall location of the C library"
))
from
distutils.command.build
import
build
as
build_ori
from
distutils.core
import
Command
class
build_clib
(
Command
):
user_options
=
[]
def
initialize_options
(
self
):
self
.
clib_dir
=
self
.
distribution
.
cobitools3
def
finalize_options
(
self
):
if
self
.
clib_dir
is
None
:
self
.
clib_dir
=
get_python_lib
()
def
run
(
self
):
log
.
info
(
"Build the build/cobject directory"
)
try
:
os
.
mkdir
(
"build"
)
except
OSError
:
pass
try
:
os
.
mkdir
(
"build/cobject"
)
except
OSError
:
pass
oldwd
=
os
.
getcwd
()
os
.
chdir
(
"build/cobject"
)
install_clibdir_option
=
"-DPYTHONLIB:STRING='
%
s'"
%
self
.
clib_dir
log
.
info
(
"Run CMake"
)
subprocess
.
call
([
'cmake'
,
install_clibdir_option
,
'../../src'
])
log
.
info
(
"Compile the shared C library"
)
subprocess
.
call
([
'make'
,
'install'
])
# temporary fix but should be in src
os
.
chdir
(
oldwd
)
class
build
(
build_ori
):
def
run
(
self
):
self
.
run_command
(
"build_clib"
)
build_ori
.
run
(
self
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
"python"
))
def
findPackage
(
root
,
base
=
None
):
...
...
@@ -73,7 +125,7 @@ REQUIRES = ['Cython>=0.24',
os
.
environ
[
'CFLAGS'
]
=
'-O3 -Wall -I "src" -I "src/libecoPCR" -I "src/libjson"'
#install_dependencies(REQUIRES)
RunMake
()
#
RunMake()
from
Cython.Build
import
cythonize
...
...
@@ -133,6 +185,10 @@ setup(name=PACKAGE,
license
=
LICENSE
,
url
=
URL
,
ext_modules
=
xx
,
distclass
=
Distribution
,
cmdclass
=
{
'build'
:
build
,
'build_clib'
:
build_clib
},
cobitools3
=
get_python_lib
(),
packages
=
findPackage
(
'python'
),
package_dir
=
{
""
:
"python"
},
scripts
=
[
'scripts/obi'
]
...
...
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