mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 04:50:21 +00:00
soapyuhd: fix build (#568744)
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
From 8b86a301540566dad533119a4d3fc6ec721e08ab Mon Sep 17 00:00:00 2001
|
||||
From: Martin Pluskal <martin@pluskal.org>
|
||||
Date: Thu, 18 Jun 2026 19:47:28 +0200
|
||||
Subject: [PATCH] Include <boost/lexical_cast.hpp> explicitly
|
||||
|
||||
UHDSoapyDevice.cpp and SoapyUHDDevice.cpp use boost::lexical_cast but
|
||||
relied on it being pulled in transitively by another boost header.
|
||||
Recent Boost no longer does so, breaking the build with
|
||||
'lexical_cast is not a member of boost'. Include it directly.
|
||||
---
|
||||
SoapyUHDDevice.cpp | 1 +
|
||||
UHDSoapyDevice.cpp | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/SoapyUHDDevice.cpp b/SoapyUHDDevice.cpp
|
||||
index 41140a8..673f06c 100644
|
||||
--- a/SoapyUHDDevice.cpp
|
||||
+++ b/SoapyUHDDevice.cpp
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <uhd/version.hpp>
|
||||
#include <cctype>
|
||||
#include <iostream>
|
||||
+#include <boost/lexical_cast.hpp>
|
||||
|
||||
/***********************************************************************
|
||||
* Stream wrapper
|
||||
diff --git a/UHDSoapyDevice.cpp b/UHDSoapyDevice.cpp
|
||||
index 88641c5..8ed6574 100644
|
||||
--- a/UHDSoapyDevice.cpp
|
||||
+++ b/UHDSoapyDevice.cpp
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
+#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
@@ -11,21 +11,16 @@
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "soapyuhd";
|
||||
version = "0.4.1-unstable-2025-10-05";
|
||||
version = "0.4.1-unstable-2026-09-25";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pothosware";
|
||||
repo = "SoapyUHD";
|
||||
# version that supports cmake 4
|
||||
rev = "cf78b9ca3bddfc9263d2acb7e8afcb0036938163";
|
||||
hash = "sha256-/hJ78dUL477gX3c2kV8kUknIk01PUf+ie1Gl7Ujq1Ac=";
|
||||
# includes get_stream_info() overrides needed for UHD >= 4.11
|
||||
rev = "c695089c9d139f90465d2025d8dcb2ef26fa00f0";
|
||||
hash = "sha256-uGPCmjSHI8dx4//tacuHLNPwDImoacvcKHplYyNpLao=";
|
||||
};
|
||||
|
||||
# Newer versions of Boost do not pull in boost::lexical_cast transitively, so
|
||||
# it must be explicitly specified.
|
||||
# Vendored from https://github.com/pothosware/SoapyUHD/pull/76
|
||||
patches = [ ./boost-lexical-cast.patch ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
@@ -38,18 +33,12 @@ stdenv.mkDerivation {
|
||||
|
||||
cmakeFlags = [ "-DSoapySDR_DIR=${soapysdr}/share/cmake/SoapySDR/" ];
|
||||
|
||||
# SoapyUHD was originally pinned to C++14 as that was required by UHD at the
|
||||
# time, but UHD 4.10 upgrades to C++20, so we switch to that here as well.
|
||||
# https://github.com/pothosware/SoapyUHD/commit/1f7b6fa245f782e5d18453f5cbc6d9f27e6b26df
|
||||
postPatch = ''
|
||||
sed -i "s:DESTINATION .*uhd/modules:DESTINATION $out/lib/uhd/modules:" CMakeLists.txt
|
||||
|
||||
substituteInPlace CMakeLists.txt --replace-fail \
|
||||
"set(CMAKE_CXX_STANDARD 14)" "set(CMAKE_CXX_STANDARD 20)"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/pothosware/SoapyAirspy";
|
||||
homepage = "https://github.com/pothosware/SoapyUHD";
|
||||
description = "SoapySDR plugin for UHD devices";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ markuskowa ];
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
fetchpatch2,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
pkg-config,
|
||||
@@ -192,6 +193,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
# Add missing log_add_impl.hpp to the installed headers.
|
||||
# https://github.com/EttusResearch/uhd/pull/945
|
||||
patches = [
|
||||
(fetchpatch2 {
|
||||
url = "https://github.com/EttusResearch/uhd/commit/6bc1d4d011825b2dca6d60b1cfb327dc07c63414.patch?full_index=1";
|
||||
hash = "sha256-Rx1B3za4sFbX3d6Vj8bVaPvPunNwc4Ir0WiXjLDgoQk=";
|
||||
})
|
||||
];
|
||||
|
||||
# Build only the host software
|
||||
preConfigure = "cd host";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user