From b1aa4012d1bbee9cbd8f670a34ea9093aec6e075 Mon Sep 17 00:00:00 2001 From: Grissess Date: Mon, 29 Jul 2019 21:03:58 -0400 Subject: [PATCH] Allow library path to be specified in env This helps people who have this installed in non-standard paths (e.g., for a Nix environment). The default here only seems valid for a very typical autoconf setup with PREFIX=/usr/local. --- pylibhackrf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylibhackrf.py b/pylibhackrf.py index 63d76f8..d3f8c01 100644 --- a/pylibhackrf.py +++ b/pylibhackrf.py @@ -13,7 +13,7 @@ logging.basicConfig() logger = logging.getLogger('HackRf Core') logger.setLevel(logging.DEBUG) -libhackrf = CDLL('/usr/local/lib/libhackrf.so') +libhackrf = CDLL(os.environ.get('LIBHACKRF', '/usr/local/lib/libhackrf.so')) def enum(*sequential, **named): enums = dict(zip(sequential, range(len(sequential))), **named) @@ -535,4 +535,4 @@ class HackRf(object): bytes2 = bytes[0:size * 2] iq.real, iq.imag = bytes2[::2], bytes2[1::2] iq /= 128.0 - return iq \ No newline at end of file + return iq