Skip to content

Commit

Permalink
nanovna-qt: init at 20200403 (#253368)
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst authored Dec 20, 2024
2 parents 255bca1 + 93c1d0e commit 9de99ed
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 0 deletions.
36 changes: 36 additions & 0 deletions pkgs/by-name/na/nanovna-qt/fix-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/libxavna/xavna_mock_ui/xavna_mock_ui.H b/libxavna/xavna_mock_ui/xavna_mock_ui.H
index 333f9ed..819a019 100644
--- a/libxavna/xavna_mock_ui/xavna_mock_ui.H
+++ b/libxavna/xavna_mock_ui/xavna_mock_ui.H
@@ -2,6 +2,7 @@
#define XAVNA_MOCK_UI_H

#include <functional>
+#include <string>
using namespace std;
typedef function<void(string dut_name, double cableLen1, double cableLen2)> xavna_ui_changed_cb;

diff --git a/vna_qt/firmwareupdater.H b/vna_qt/firmwareupdater.H
index 7654211..8b61dfb 100644
--- a/vna_qt/firmwareupdater.H
+++ b/vna_qt/firmwareupdater.H
@@ -3,6 +3,7 @@
#include <string>
#include <functional>
#include <pthread.h>
+#include <cstdint>
using namespace std;

class FirmwareUpdater
diff --git a/vna_qt/polarview.C b/vna_qt/polarview.C
index 8bde6e3..5800463 100644
--- a/vna_qt/polarview.C
+++ b/vna_qt/polarview.C
@@ -3,6 +3,7 @@
#include <cmath>
#include <QPaintEvent>
#include <QPainter>
+#include <QPainterPath>
PolarView::PolarView(QWidget *parent) : QWidget(parent)
{

78 changes: 78 additions & 0 deletions pkgs/by-name/na/nanovna-qt/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
libtool,
fftw,
eigen,
qt5,
}:

stdenv.mkDerivation rec {
pname = "nanovna-qt";
# 20200507 dropped support for NanoVNA V2.2
version = "20200403";

src = fetchFromGitHub {
owner = "nanovna-v2";
repo = "NanoVNA-QT";
rev = version;
hash = "sha256-0nRpjLglCog9e4bSkaNSwjrwmLwut3Ykr3AaYZCaMEs=";
};

patches = [ ./fix-build.patch ];

nativeBuildInputs = [
autoreconfHook
libtool
qt5.wrapQtAppsHook
];

buildInputs = [
fftw
eigen
qt5.qtbase
qt5.qtcharts
];

autoreconfFlags = [ "--install" ];

postBuild = ''
pushd libxavna/xavna_mock_ui/
qmake
make
popd
pushd vna_qt/
qmake
make
popd
'';

installPhase = ''
runHook preInstall
install -Dm555 vna_qt/vna_qt -t $out/bin/
install -Dm555 libxavna/.libs/libxavna.so.0.0.0 -t $out/lib/
ln -s libxavna.so.0.0.0 $out/lib/libxavna.so.0
ln -s libxavna.so.0.0.0 $out/lib/libxavna.so
install -Dm555 libxavna/xavna_mock_ui/libxavna_mock_ui.so.1.0.0 -t $out/lib/
ln -s libxavna_mock_ui.so.1.0.0 $out/lib/libxavna_mock_ui.so.1.0
ln -s libxavna_mock_ui.so.1.0.0 $out/lib/libxavna_mock_ui.so.1
ln -s libxavna_mock_ui.so.1.0.0 $out/lib/libxavna_mock_ui.so
runHook postInstall
'';

preFixup = ''
qtWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$out/lib")
'';

meta = {
description = "PC GUI software for NanoVNA V2 series";
homepage = "https://nanorfe.com/nanovna-v2.html";
mainProgram = "vna_qt";
license = lib.licenses.gpl2Only;
changelog = "https://github.com/nanovna-v2/NanoVNA-QT/releases/tag/v${version}";
maintainers = with lib.maintainers; [ chuangzhu ];
platforms = lib.platforms.linux;
};
}

0 comments on commit 9de99ed

Please sign in to comment.