From e991b1bb26b8dafe32e525db69d492eb5947433e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 22 Nov 2022 16:16:45 +0100 Subject: Add shvspy --- devShells/qt.nix | 1 - nixos/modules/develop.nix | 3 +++ pkgs/default.nix | 12 ++++++++++++ pkgs/shvspy/default.nix | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 pkgs/shvspy/default.nix diff --git a/devShells/qt.nix b/devShells/qt.nix index 8bcce47..caf9b99 100644 --- a/devShells/qt.nix +++ b/devShells/qt.nix @@ -8,7 +8,6 @@ in pkgs.mkShell { packages = (with pkgs; with libsForQt5; [ qtbase qtserialport - qtserialport qtwebsockets doctest diff --git a/nixos/modules/develop.nix b/nixos/modules/develop.nix index 62e6bd3..f827292 100644 --- a/nixos/modules/develop.nix +++ b/nixos/modules/develop.nix @@ -102,6 +102,9 @@ in { # Documentation man-pages man-pages-posix linux-manual + + # SHV + shvspy ]; programs.wireshark.enable = true; diff --git a/pkgs/default.nix b/pkgs/default.nix index 4bcf504..80d75ad 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -34,6 +34,18 @@ let ]; }; + # Elektroline packages + shvspy = callPackage ./shvspy { }; + qcoro = nixpkgs.libsForQt5.qcoro.overrideAttrs (oldAttrs: { + version = "0.6.1"; + src = nixpkgs.fetchFromGitHub { + owner = "danvratil"; + repo = "qcoro"; + rev = "261663560f59a162c0c82158a6cde41089668871"; + sha256 = "OAYJpoW3b0boSYBfuzLrFvlYSmP3SON8O6HsDQoi+I8="; + }; + }); + } // (nixpkgs.lib.optionalAttrs (nixpkgs.stdenv.hostPlatform != nixpkgs.stdenv.buildPlatform) { # Nixpkgs fixup glib = nixpkgs.glib.overrideAttrs (super: { diff --git a/pkgs/shvspy/default.nix b/pkgs/shvspy/default.nix new file mode 100644 index 0000000..495a2ec --- /dev/null +++ b/pkgs/shvspy/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchFromGitHub +, cmake, doctest, libsForQt5, qcoro +, makeDesktopItem, copyDesktopItems +}: +with libsForQt5; + +stdenv.mkDerivation rec { + name = "shvspy"; + + src = fetchFromGitHub { + owner = "silicon-heaven"; + repo = "shvspy"; + rev = "a922e963bf7884164fe2b124a7a4366f7fc802a3"; + sha256 = "ExA+sFlkxFKXk69DKoGzKm80ypiNFwN281MwZkMgaVY="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + cmake doctest wrapQtAppsHook copyDesktopItems + ]; + buildInputs = [ + qtbase qtserialport qtwebsockets doctest qcoro + ]; + + desktopItems = [ + (makeDesktopItem { + name = "shvspy"; + exec = "shvspy"; + desktopName = "SHVSpy"; + categories = [ "Network" "RemoteAccess" ]; + }) + ]; + + meta = with lib; { + description = "Console version of Stardict program"; + homepage = "https://dushistov.github.io/sdcv/"; + license = licenses.gpl2; + }; +} -- cgit v1.2.3