packages: update support for dsview

This commit is contained in:
Kate 2025-04-05 19:08:31 +02:00
parent 9af99b6de4
commit f2912871de
5 changed files with 94 additions and 1 deletions

View file

@ -10,7 +10,7 @@
packages = [
deprekages.ykush-udev-rules
deprekages.hantek-udev-rules
deprekages.dreamsource-udev-rules
deprekages.dsview
deprekages.humanfx
pkgs.numworks-udev-rules
pkgs.android-udev-rules

View file

@ -71,6 +71,9 @@ with pkgs;
bytecode-viewer
# Poking our phone.
# Hardware hacking
deprekages.dsview
# Backup
kitty

View file

@ -30,6 +30,7 @@ flake-utils.lib.eachDefaultSystem (
ffts = callPackage ./scopehal-apps/ffts.nix { };
libsigrok4DSL = callPackage ./scopehal-apps/libsigrok4DSL.nix { };
vulkan-sdk = callPackage ./scopehal-apps/vulkan-sdk.nix { };
dsview = pkgs.libsForQt5.callPackage ./dsview { };
scopehal-apps = callPackage ./scopehal-apps { deprekages = deprekages.${system}; };
scopehal-sigrok-bridge = callPackage ./scopehal-apps/sigrok-bridge.nix {
deprekages = deprekages.${system};

View file

@ -0,0 +1,62 @@
{
stdenv,
lib,
fetchFromGitHub,
pkg-config,
cmake,
wrapQtAppsHook,
libzip,
boost,
fftw,
libusb1,
qtbase,
qtsvg,
qtwayland,
python3,
desktopToDarwinBundle,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dsview";
version = "2024-11-05";
src = fetchFromGitHub {
owner = "DreamSourceLab";
repo = "DSView";
rev = "2e9e2c8e726df4ef5687d39b83d4f797cc44b574";
sha256 = "sha256-F7T3wEasIzfhQXVaU8MVo06h3RB1nhWxkp2sUb8Ct80=";
};
patches = [
# Fix absolute install paths
./install.patch
];
# /build/source/libsigrok4DSL/strutil.c:343:19: error: implicit declaration of function 'strcasecmp'; did you mean 'g_strcasecmp'? []
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=format-security";
nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
buildInputs = [
boost
fftw
qtbase
qtsvg
libusb1
libzip
python3
] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland;
meta = {
description = "GUI program for supporting various instruments from DreamSourceLab, including logic analyzer, oscilloscope, etc";
mainProgram = "DSView";
homepage = "https://www.dreamsourcelab.com/";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
};
})

View file

@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc82669f..d196c78f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -669,19 +669,10 @@ install(FILES DSView/icons/logo.svg DESTINATION share/icons/hicolor/scalable/app
install(FILES DSView/icons/logo.svg DESTINATION share/pixmaps RENAME dsview.svg)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
- install(FILES DSView/DSView.desktop DESTINATION /usr/share/applications RENAME dsview.desktop)
-
add_compile_definitions(_DEFAULT_SOURCE)
-
- if(IS_DIRECTORY /usr/lib/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /usr/lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
- elseif(IS_DIRECTORY /lib/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
- elseif(IS_DIRECTORY /etc/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /etc/udev/rules.d RENAME 60-dreamsourcelab.rules)
- endif()
-
-endif()
+ install(FILES DSView/DreamSourceLab.rules DESTINATION lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
+ endif()
+install(FILES DSView/DSView.desktop DESTINATION share/applications RENAME dsview.desktop)
install(FILES NEWS25 DESTINATION share/DSView RENAME NEWS25)
install(FILES NEWS31 DESTINATION share/DSView RENAME NEWS31)