Unverified Commit 9de99ed5 authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

nanovna-qt: init at 20200403 (#253368)

parents 255bca1a 93c1d0e0
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
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 −0
Original line number Diff line number Diff line
{
  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;
  };
}