aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch')
-rw-r--r--nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch b/nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch
new file mode 100644
index 00000000000..dad35851cdc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch
@@ -0,0 +1,38 @@
+diff --git a/bindings/python/iio.py b/bindings/python/iio.py
+index 5306daa..f8962ee 100644
+--- a/bindings/python/iio.py
++++ b/bindings/python/iio.py
+@@ -229,9 +229,9 @@ if "Windows" in _system():
+ _iiolib = "libiio.dll"
+ else:
+ # Non-windows, possibly Posix system
+- _iiolib = "iio"
++ _iiolib = "@libiio@"
+
+-_lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True)
++_lib = _cdll(_iiolib, use_errno=True, use_last_error=True)
+
+ _get_backends_count = _lib.iio_get_backends_count
+ _get_backends_count.restype = c_uint
+diff --git a/bindings/python/setup.py.cmakein b/bindings/python/setup.py.cmakein
+index cd14e2e..516c409 100644
+--- a/bindings/python/setup.py.cmakein
++++ b/bindings/python/setup.py.cmakein
+@@ -62,7 +62,7 @@ class InstallWrapper(install):
+ _iiolib = "libiio.dll"
+ else:
+ # Non-windows, possibly Posix system
+- _iiolib = "iio"
++ _iiolib = "@libiio@"
+ try:
+ import os
+
+@@ -72,7 +72,7 @@ class InstallWrapper(install):
+ fulllibpath = find_recursive(destdir, "libiio.so")
+ _lib = _cdll(fulllibpath, use_errno=True, use_last_error=True)
+ else:
+- _lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True)
++ _lib = _cdll(_iiolib, use_errno=True, use_last_error=True)
+ if not _lib._name:
+ raise OSError
+ except OSError: