2013-04-15 22:57:00 +00:00
|
|
|
##
|
2013-04-23 20:24:30 +00:00
|
|
|
## This file is part of the libsigrok project.
|
2013-04-15 22:57:00 +00:00
|
|
|
##
|
|
|
|
## Copyright (C) 2013 Martin Ling <martin-sigrok@earth.li>
|
|
|
|
##
|
|
|
|
## This program is free software: you can redistribute it and/or modify
|
|
|
|
## it under the terms of the GNU General Public License as published by
|
|
|
|
## the Free Software Foundation, either version 3 of the License, or
|
|
|
|
## (at your option) any later version.
|
|
|
|
##
|
|
|
|
## This program is distributed in the hope that it will be useful,
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
## GNU General Public License for more details.
|
|
|
|
##
|
|
|
|
## You should have received a copy of the GNU General Public License
|
|
|
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
##
|
2013-04-15 19:01:07 +00:00
|
|
|
|
2013-04-17 02:50:27 +00:00
|
|
|
from setuptools import setup, find_packages, Extension
|
2013-04-15 19:01:07 +00:00
|
|
|
import subprocess
|
|
|
|
|
2013-04-19 16:41:44 +00:00
|
|
|
sr_includes, sr_lib_dirs, sr_libs, (sr_version,) = [
|
|
|
|
subprocess.check_output(
|
|
|
|
["pkg-config", option, "libsigrok"]).decode().rstrip().split(' ')
|
|
|
|
for option in
|
|
|
|
("--cflags-only-I", "--libs-only-L", "--libs-only-l", "--modversion")]
|
2013-04-15 19:01:07 +00:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name = 'libsigrok',
|
2013-04-17 02:50:27 +00:00
|
|
|
namespace_packages = ['sigrok'],
|
|
|
|
packages = find_packages(),
|
2013-04-15 19:01:07 +00:00
|
|
|
version = sr_version,
|
|
|
|
description = "libsigrok API wrapper",
|
|
|
|
ext_modules = [
|
2013-04-17 02:50:27 +00:00
|
|
|
Extension('sigrok.core._lowlevel',
|
|
|
|
sources = ['sigrok/core/lowlevel.i'],
|
2013-04-17 13:01:19 +00:00
|
|
|
swig_opts = ['-threads'] + sr_includes,
|
2013-04-19 16:30:44 +00:00
|
|
|
include_dirs = [i[2:] for i in sr_includes],
|
2013-04-19 16:41:44 +00:00
|
|
|
library_dirs = [l[2:] for l in sr_lib_dirs],
|
|
|
|
libraries = [l[2:] for l in sr_libs]
|
2013-04-15 19:01:07 +00:00
|
|
|
)
|
|
|
|
],
|
|
|
|
)
|