From 62ea910ef36306905ef562f646745aade3f7c2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Tue, 2 Mar 2021 17:26:38 +0100 Subject: [PATCH] pothos: init at 0.7.1 --- pkgs/applications/radio/pothos/default.nix | 74 +++++++++++++++ pkgs/applications/radio/pothos/spuce.patch | 101 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 177 insertions(+) create mode 100644 pkgs/applications/radio/pothos/default.nix create mode 100644 pkgs/applications/radio/pothos/spuce.patch diff --git a/pkgs/applications/radio/pothos/default.nix b/pkgs/applications/radio/pothos/default.nix new file mode 100644 index 00000000000..64f5093c4b9 --- /dev/null +++ b/pkgs/applications/radio/pothos/default.nix @@ -0,0 +1,74 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, pkg-config +, doxygen +, wrapQtAppsHook +, pcre +, poco +, qtbase +, qtsvg +, libsForQt5 +, nlohmann_json +, soapysdr-with-plugins +, portaudio +, alsaLib +, muparserx +, python3 +}: + +mkDerivation rec { + pname = "pothos"; + version = "0.7.1"; + + src = fetchFromGitHub { + owner = "pothosware"; + repo = "PothosCore"; + rev = "pothos-${version}"; + sha256 = "038c3ipvf4sgj0zhm3vcj07ymsva4ds6v89y43f5d3p4n8zc2rsg"; + fetchSubmodules = true; + }; + + patches = [ + # spuce's CMakeLists.txt uses QT5_USE_Modules, which does not seem to work on Nix + ./spuce.patch + ]; + + nativeBuildInputs = [ cmake pkg-config doxygen wrapQtAppsHook ]; + + buildInputs = [ + pcre poco qtbase qtsvg libsForQt5.qwt nlohmann_json + soapysdr-with-plugins portaudio alsaLib muparserx python3 + ]; + + postInstall = '' + install -Dm644 $out/share/Pothos/Desktop/pothos-flow.desktop $out/share/applications/pothos-flow.desktop + install -Dm644 $out/share/Pothos/Desktop/pothos-flow-16.png $out/share/icons/hicolor/16x16/apps/pothos-flow.png + install -Dm644 $out/share/Pothos/Desktop/pothos-flow-22.png $out/share/icons/hicolor/22x22/apps/pothos-flow.png + install -Dm644 $out/share/Pothos/Desktop/pothos-flow-32.png $out/share/icons/hicolor/32x32/apps/pothos-flow.png + install -Dm644 $out/share/Pothos/Desktop/pothos-flow-48.png $out/share/icons/hicolor/48x48/apps/pothos-flow.png + install -Dm644 $out/share/Pothos/Desktop/pothos-flow-64.png $out/share/icons/hicolor/64x64/apps/pothos-flow.png + install -Dm644 $out/share/Pothos/Desktop/pothos-flow-128.png $out/share/icons/hicolor/128x128/apps/pothos-flow.png + install -Dm644 $out/share/Pothos/Desktop/pothos-flow.xml $out/share/mime/application/pothos-flow.xml + rm -r $out/share/Pothos/Desktop + ''; + + dontWrapQtApps = true; + preFixup = '' + # PothosUtil does not need to be wrapped + wrapQtApp $out/bin/PothosFlow + wrapQtApp $out/bin/spuce_fir_plot + wrapQtApp $out/bin/spuce_iir_plot + wrapQtApp $out/bin/spuce_other_plot + wrapQtApp $out/bin/spuce_window_plot + ''; + + meta = with lib; { + description = "The Pothos data-flow framework"; + homepage = "https://github.com/pothosware/PothosCore/wiki"; + license = licenses.boost; + platforms = platforms.linux; + maintainers = with maintainers; [ eduardosm ]; + }; +} diff --git a/pkgs/applications/radio/pothos/spuce.patch b/pkgs/applications/radio/pothos/spuce.patch new file mode 100644 index 00000000000..ed0377540a8 --- /dev/null +++ b/pkgs/applications/radio/pothos/spuce.patch @@ -0,0 +1,101 @@ +diff --git a/spuce/qt_fir/CMakeLists.txt b/spuce/qt_fir/CMakeLists.txt +index fa2e580..e32113c 100644 +--- a/spuce/qt_fir/CMakeLists.txt ++++ b/spuce/qt_fir/CMakeLists.txt +@@ -6,7 +6,7 @@ Message("Project spuce fir_plot") + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) + +-FIND_PACKAGE(Qt5 REQUIRED Gui Core Widgets) ++FIND_PACKAGE(Qt5 REQUIRED Gui Core Widgets PrintSupport) + + set(SOURCES + make_filter.cpp +@@ -27,11 +27,7 @@ set_property(TARGET spuce_fir PROPERTY POSITION_INDEPENDENT_CODE TRUE) + set_property(TARGET spuce_fir_plot PROPERTY POSITION_INDEPENDENT_CODE TRUE) + set_property(TARGET spuce_fir_plot PROPERTY CXX_STANDARD 11) + +-TARGET_LINK_LIBRARIES(spuce_fir_plot spuce_fir ${QT_LIBRARIES} spuce) +-QT5_USE_Modules(spuce_fir_plot Gui) +-QT5_USE_Modules(spuce_fir_plot Core) +-QT5_USE_Modules(spuce_fir_plot Widgets) +-QT5_USE_Modules(spuce_fir_plot PrintSupport) ++TARGET_LINK_LIBRARIES(spuce_fir_plot spuce_fir ${QT_LIBRARIES} spuce Qt::Gui Qt::Core Qt::Widgets Qt::PrintSupport) + + INSTALL(TARGETS spuce_fir_plot DESTINATION bin) + +diff --git a/spuce/qt_iir/CMakeLists.txt b/spuce/qt_iir/CMakeLists.txt +index 4717226..debb5f9 100644 +--- a/spuce/qt_iir/CMakeLists.txt ++++ b/spuce/qt_iir/CMakeLists.txt +@@ -6,7 +6,7 @@ Message("Project spuce iir_plot") + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) + +-FIND_PACKAGE(Qt5 REQUIRED Gui Core Widgets) ++FIND_PACKAGE(Qt5 REQUIRED Gui Core Widgets PrintSupport) + + set(SOURCES + make_filter.cpp +@@ -27,10 +27,6 @@ set_property(TARGET spuce_iir PROPERTY POSITION_INDEPENDENT_CODE TRUE) + set_property(TARGET spuce_iir_plot PROPERTY CXX_STANDARD 11) + set_property(TARGET spuce_iir_plot PROPERTY POSITION_INDEPENDENT_CODE TRUE) + +-TARGET_LINK_LIBRARIES(spuce_iir_plot spuce_iir ${QT_LIBRARIES} spuce) +-QT5_USE_Modules(spuce_iir_plot Gui) +-QT5_USE_Modules(spuce_iir_plot Core) +-QT5_USE_Modules(spuce_iir_plot Widgets) +-QT5_USE_Modules(spuce_iir_plot PrintSupport) ++TARGET_LINK_LIBRARIES(spuce_iir_plot spuce_iir ${QT_LIBRARIES} spuce Qt::Gui Qt::Core Qt::Widgets Qt::PrintSupport) + + INSTALL(TARGETS spuce_iir_plot DESTINATION bin) +diff --git a/spuce/qt_other/CMakeLists.txt b/spuce/qt_other/CMakeLists.txt +index 29c270d..e1ed778 100644 +--- a/spuce/qt_other/CMakeLists.txt ++++ b/spuce/qt_other/CMakeLists.txt +@@ -6,7 +6,7 @@ Message("Project spuce window_plot") + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) + +-FIND_PACKAGE(Qt5 REQUIRED Gui Core Widgets) ++FIND_PACKAGE(Qt5 REQUIRED Gui Core Widgets PrintSupport) + + set(SOURCES make_filter.cpp) + ADD_LIBRARY(spuce_other STATIC ${SOURCES}) +@@ -23,10 +23,6 @@ ADD_EXECUTABLE(spuce_other_plot ${other_plot_SOURCES} ${other_plot_HEADERS_MOC}) + set_property(TARGET spuce_other_plot PROPERTY CXX_STANDARD 11) + set_property(TARGET spuce_other_plot PROPERTY POSITION_INDEPENDENT_CODE TRUE) + +-TARGET_LINK_LIBRARIES(spuce_other_plot spuce_other ${QT_LIBRARIES} spuce) +-QT5_USE_Modules(spuce_other_plot Gui) +-QT5_USE_Modules(spuce_other_plot Core) +-QT5_USE_Modules(spuce_other_plot Widgets) +-QT5_USE_Modules(spuce_other_plot PrintSupport) ++TARGET_LINK_LIBRARIES(spuce_other_plot spuce_other ${QT_LIBRARIES} spuce Qt::Gui Qt::Core Qt::Widgets Qt::PrintSupport) + + INSTALL(TARGETS spuce_other_plot DESTINATION bin) +diff --git a/spuce/qt_window/CMakeLists.txt b/spuce/qt_window/CMakeLists.txt +index e95c85b..4a77ab8 100644 +--- a/spuce/qt_window/CMakeLists.txt ++++ b/spuce/qt_window/CMakeLists.txt +@@ -6,7 +6,7 @@ Message("Project spuce window_plot") + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) + +-FIND_PACKAGE(Qt5 REQUIRED Gui Core Widgets) ++FIND_PACKAGE(Qt5 REQUIRED Gui Core Widgets PrintSupport) + + set(SOURCES make_filter.cpp) + +@@ -25,10 +25,6 @@ set_property(TARGET spuce_window_plot PROPERTY CXX_STANDARD 11) + set_property(TARGET spuce_win PROPERTY POSITION_INDEPENDENT_CODE TRUE) + set_property(TARGET spuce_window_plot PROPERTY POSITION_INDEPENDENT_CODE TRUE) + +-TARGET_LINK_LIBRARIES(spuce_window_plot spuce_win ${QT_LIBRARIES} spuce) +-QT5_USE_Modules(spuce_window_plot Gui) +-QT5_USE_Modules(spuce_window_plot Core) +-QT5_USE_Modules(spuce_window_plot Widgets) +-QT5_USE_Modules(spuce_window_plot PrintSupport) ++TARGET_LINK_LIBRARIES(spuce_window_plot spuce_win ${QT_LIBRARIES} spuce Qt::Gui Qt::Core Qt::Widgets Qt::PrintSupport) + + INSTALL(TARGETS spuce_window_plot DESTINATION bin) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0c1849edcb4..97272222cbc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24589,6 +24589,8 @@ in ponymix = callPackage ../applications/audio/ponymix { }; + pothos = libsForQt5.callPackage ../applications/radio/pothos { }; + potrace = callPackage ../applications/graphics/potrace {}; posterazor = callPackage ../applications/misc/posterazor { };