Loading pkgs/by-name/li/libiio/cmake-fix-libxml2-find-package.patch +6 −6 Original line number Diff line number Diff line diff --color -ur a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt 2022-06-02 02:57:01.503340155 +0300 +++ b/CMakeLists.txt 2022-06-02 02:54:33.726941188 +0300 @@ -378,7 +378,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index d5313c50..0ef102bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -408,7 +408,7 @@ if (WITH_XML_BACKEND) # So, try first to find the CMake module provided by libxml2 package, then fallback # on the CMake's FindLibXml2.cmake module (which can lack some definition, especially # in static build case). - find_package(LibXml2 QUIET NO_MODULE) - find_package(LibXml2 QUIET NO_MODULE NO_SYSTEM_ENVIRONMENT_PATH) + find_package(LibXml2 QUIET MODULE) if(DEFINED LIBXML2_VERSION_STRING) set(LIBXML2_FOUND ON) set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) Seulement dans b: good.patch pkgs/by-name/li/libiio/hardcode-library-path.patch +11 −30 Original line number Diff line number Diff line diff --git a/bindings/python/iio.py b/bindings/python/iio.py index 5306daa..f8962ee 100644 index b91260cc..04bcfa7f 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@" @@ -218,13 +218,7 @@ _ChannelPtr = _POINTER(_Channel) _BufferPtr = _POINTER(_Buffer) _DataFormatPtr = _POINTER(DataFormat) -if "Windows" in _system(): - _iiolib = "libiio.dll" -else: - # Non-windows, possibly Posix system - _iiolib = "iio" - -_lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True) +_lib = _cdll(_iiolib, use_errno=True, use_last_error=True) +_lib = _cdll("@libiio@", 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: pkgs/by-name/li/libiio/package.nix +18 −10 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { pname = "libiio"; version = "0.24"; version = "0.26"; outputs = [ "out" Loading @@ -29,13 +29,15 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "analogdevicesinc"; repo = "libiio"; rev = "v${version}"; sha256 = "sha256-c5HsxCdp1cv5BGTQ/8dc8J893zk9ntbfAudLpqoQ1ow="; tag = "v${version}"; hash = "sha256-nrpGccj9Q3S9wYs0/dHC3YAy5ZvTiPiSUtPY6r5WlaE="; }; # Revert after https://github.com/NixOS/nixpkgs/issues/125008 is # fixed properly patches = [ ./cmake-fix-libxml2-find-package.patch ]; patches = [ ./cmake-fix-libxml2-find-package.patch ]; nativeBuildInputs = [ Loading Loading @@ -79,8 +81,7 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace libiio.rules.cmakein \ --replace /bin/sh ${runtimeShell} patchShebangs libiio.rules.cmakein '' + lib.optionalString pythonSupport '' # Hardcode path to the shared library into the bindings. Loading @@ -92,11 +93,18 @@ stdenv.mkDerivation rec { moveToOutput ${python3.sitePackages} "$python" ''; meta = with lib; { nativeInstallCheckInputs = lib.optionals pythonSupport [ python3.pkgs.pythonImportsCheckHook ]; pythonImportsCheck = [ "iio" ]; meta = { changelog = "https://github.com/analogdevicesinc/libiio/releases/tag/${src.tag}"; description = "API for interfacing with the Linux Industrial I/O Subsystem"; homepage = "https://github.com/analogdevicesinc/libiio"; license = licenses.lgpl21Plus; platforms = platforms.linux ++ platforms.darwin; maintainers = with maintainers; [ thoughtpolice ]; license = lib.licenses.lgpl21Plus; platforms = lib.platforms.linux ++ lib.platforms.darwin; maintainers = with lib.maintainers; [ thoughtpolice ]; }; } Loading
pkgs/by-name/li/libiio/cmake-fix-libxml2-find-package.patch +6 −6 Original line number Diff line number Diff line diff --color -ur a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt 2022-06-02 02:57:01.503340155 +0300 +++ b/CMakeLists.txt 2022-06-02 02:54:33.726941188 +0300 @@ -378,7 +378,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index d5313c50..0ef102bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -408,7 +408,7 @@ if (WITH_XML_BACKEND) # So, try first to find the CMake module provided by libxml2 package, then fallback # on the CMake's FindLibXml2.cmake module (which can lack some definition, especially # in static build case). - find_package(LibXml2 QUIET NO_MODULE) - find_package(LibXml2 QUIET NO_MODULE NO_SYSTEM_ENVIRONMENT_PATH) + find_package(LibXml2 QUIET MODULE) if(DEFINED LIBXML2_VERSION_STRING) set(LIBXML2_FOUND ON) set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) Seulement dans b: good.patch
pkgs/by-name/li/libiio/hardcode-library-path.patch +11 −30 Original line number Diff line number Diff line diff --git a/bindings/python/iio.py b/bindings/python/iio.py index 5306daa..f8962ee 100644 index b91260cc..04bcfa7f 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@" @@ -218,13 +218,7 @@ _ChannelPtr = _POINTER(_Channel) _BufferPtr = _POINTER(_Buffer) _DataFormatPtr = _POINTER(DataFormat) -if "Windows" in _system(): - _iiolib = "libiio.dll" -else: - # Non-windows, possibly Posix system - _iiolib = "iio" - -_lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True) +_lib = _cdll(_iiolib, use_errno=True, use_last_error=True) +_lib = _cdll("@libiio@", 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:
pkgs/by-name/li/libiio/package.nix +18 −10 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { pname = "libiio"; version = "0.24"; version = "0.26"; outputs = [ "out" Loading @@ -29,13 +29,15 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "analogdevicesinc"; repo = "libiio"; rev = "v${version}"; sha256 = "sha256-c5HsxCdp1cv5BGTQ/8dc8J893zk9ntbfAudLpqoQ1ow="; tag = "v${version}"; hash = "sha256-nrpGccj9Q3S9wYs0/dHC3YAy5ZvTiPiSUtPY6r5WlaE="; }; # Revert after https://github.com/NixOS/nixpkgs/issues/125008 is # fixed properly patches = [ ./cmake-fix-libxml2-find-package.patch ]; patches = [ ./cmake-fix-libxml2-find-package.patch ]; nativeBuildInputs = [ Loading Loading @@ -79,8 +81,7 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace libiio.rules.cmakein \ --replace /bin/sh ${runtimeShell} patchShebangs libiio.rules.cmakein '' + lib.optionalString pythonSupport '' # Hardcode path to the shared library into the bindings. Loading @@ -92,11 +93,18 @@ stdenv.mkDerivation rec { moveToOutput ${python3.sitePackages} "$python" ''; meta = with lib; { nativeInstallCheckInputs = lib.optionals pythonSupport [ python3.pkgs.pythonImportsCheckHook ]; pythonImportsCheck = [ "iio" ]; meta = { changelog = "https://github.com/analogdevicesinc/libiio/releases/tag/${src.tag}"; description = "API for interfacing with the Linux Industrial I/O Subsystem"; homepage = "https://github.com/analogdevicesinc/libiio"; license = licenses.lgpl21Plus; platforms = platforms.linux ++ platforms.darwin; maintainers = with maintainers; [ thoughtpolice ]; license = lib.licenses.lgpl21Plus; platforms = lib.platforms.linux ++ lib.platforms.darwin; maintainers = with lib.maintainers; [ thoughtpolice ]; }; }