Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
f2fec475
Commit
f2fec475
authored
May 27, 2016
by
Aleksandr Mezin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-lxc: search for lxc library and headers using pkg-config
Signed-off-by:
Aleksandr Mezin
<
mezin.alexander@gmail.com
>
parent
00d98acd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
Makefile.am
src/python-lxc/Makefile.am
+1
-1
setup.py
src/python-lxc/setup.py
+39
-0
No files found.
src/python-lxc/Makefile.am
View file @
f2fec475
...
@@ -10,7 +10,7 @@ INSTALL_OPTS := install --prefix=$(prefix) --no-compile $(DISTSETUPOPTS)
...
@@ -10,7 +10,7 @@ INSTALL_OPTS := install --prefix=$(prefix) --no-compile $(DISTSETUPOPTS)
CALL_SETUP_PY
:=
cd
@srcdir@
&&
$(PYTHON)
setup.py build
-b
@abs_builddir@/build
CALL_SETUP_PY
:=
cd
@srcdir@
&&
$(PYTHON)
setup.py build
-b
@abs_builddir@/build
all
:
all
:
$(CALL_SETUP_PY)
build_ext
-I
@abs_top_srcdir@/src
-L
@abs_top_builddir@/src/lxc
$(CALL_SETUP_PY)
build_ext
-I
@abs_top_srcdir@/src
-L
@abs_top_builddir@/src/lxc
--no-pkg-config
install
:
install
:
if
[
-z
"
$(DESTDIR)
"
]
;
then
\
if
[
-z
"
$(DESTDIR)
"
]
;
then
\
...
...
src/python-lxc/setup.py
View file @
f2fec475
...
@@ -22,7 +22,45 @@
...
@@ -22,7 +22,45 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA
# USA
import
os
import
subprocess
from
distutils.core
import
setup
,
Extension
from
distutils.core
import
setup
,
Extension
from
distutils.command.build_ext
import
build_ext
as
BuildExtCommand
class
LxcBuildExtCommand
(
BuildExtCommand
):
user_options
=
BuildExtCommand
.
user_options
+
[
(
'no-pkg-config'
,
None
,
"don't use pkg-config to detect include/library paths"
)
]
def
initialize_options
(
self
):
super
(
LxcBuildExtCommand
,
self
)
.
initialize_options
()
self
.
no_pkg_config
=
False
def
build_extensions
(
self
):
if
not
self
.
no_pkg_config
:
pkg_config_executable
=
os
.
environ
.
get
(
'PKG_CONFIG_EXECUTABLE'
,
'pkg-config'
)
def
get_pkg_config_var
(
name
):
args
=
[
pkg_config_executable
,
'--variable'
,
name
,
'lxc'
]
output
=
subprocess
.
check_output
(
args
,
universal_newlines
=
True
)
return
output
.
rstrip
(
'
\n
'
)
try
:
includedir
=
get_pkg_config_var
(
'includedir'
)
libdir
=
get_pkg_config_var
(
'libdir'
)
self
.
compiler
.
add_include_dir
(
includedir
)
self
.
compiler
.
add_library_dir
(
libdir
)
except
subprocess
.
CalledProcessError
:
pass
super
(
LxcBuildExtCommand
,
self
)
.
build_extensions
()
setup
(
name
=
'_lxc'
,
setup
(
name
=
'_lxc'
,
...
@@ -31,4 +69,5 @@ setup(name='_lxc',
...
@@ -31,4 +69,5 @@ setup(name='_lxc',
packages
=
[
'lxc'
],
packages
=
[
'lxc'
],
package_dir
=
{
'lxc'
:
'lxc'
},
package_dir
=
{
'lxc'
:
'lxc'
},
ext_modules
=
[
Extension
(
'_lxc'
,
sources
=
[
'lxc.c'
],
libraries
=
[
'lxc'
])],
ext_modules
=
[
Extension
(
'_lxc'
,
sources
=
[
'lxc.c'
],
libraries
=
[
'lxc'
])],
cmdclass
=
{
'build_ext'
:
LxcBuildExtCommand
},
)
)
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