linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / libiio / hardcode-library-path.patch
blobdad35851cdc6c57ab7e88a02f370a2c4b7f626c9
1 diff --git a/bindings/python/iio.py b/bindings/python/iio.py
2 index 5306daa..f8962ee 100644
3 --- a/bindings/python/iio.py
4 +++ b/bindings/python/iio.py
5 @@ -229,9 +229,9 @@ if "Windows" in _system():
6 _iiolib = "libiio.dll"
7 else:
8 # Non-windows, possibly Posix system
9 - _iiolib = "iio"
10 + _iiolib = "@libiio@"
12 -_lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True)
13 +_lib = _cdll(_iiolib, use_errno=True, use_last_error=True)
15 _get_backends_count = _lib.iio_get_backends_count
16 _get_backends_count.restype = c_uint
17 diff --git a/bindings/python/setup.py.cmakein b/bindings/python/setup.py.cmakein
18 index cd14e2e..516c409 100644
19 --- a/bindings/python/setup.py.cmakein
20 +++ b/bindings/python/setup.py.cmakein
21 @@ -62,7 +62,7 @@ class InstallWrapper(install):
22 _iiolib = "libiio.dll"
23 else:
24 # Non-windows, possibly Posix system
25 - _iiolib = "iio"
26 + _iiolib = "@libiio@"
27 try:
28 import os
30 @@ -72,7 +72,7 @@ class InstallWrapper(install):
31 fulllibpath = find_recursive(destdir, "libiio.so")
32 _lib = _cdll(fulllibpath, use_errno=True, use_last_error=True)
33 else:
34 - _lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True)
35 + _lib = _cdll(_iiolib, use_errno=True, use_last_error=True)
36 if not _lib._name:
37 raise OSError
38 except OSError: