diff --git a/pkgs/by-name/ha/hardinfo2/default-no-theme.patch b/pkgs/by-name/ha/hardinfo2/default-no-theme.patch new file mode 100644 index 000000000000..14ec8807e853 --- /dev/null +++ b/pkgs/by-name/ha/hardinfo2/default-no-theme.patch @@ -0,0 +1,13 @@ +diff --git a/shell/shell.c b/shell/shell.c +index 76523e9a..dbfe2d16 100644 +--- a/shell/shell.c ++++ b/shell/shell.c +@@ -620,7 +620,7 @@ static void create_window(void) + gchar *conf_path = g_build_filename(g_get_user_config_dir(), "hardinfo2","settings.ini", NULL); + g_key_file_load_from_file(key_file, conf_path, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, NULL); + params.theme = g_key_file_get_integer(key_file, "Theme", "ThemeNumber", NULL); +- if(params.theme==0) params.theme=1; ++ if(params.theme==0) params.theme=-1; //default to no theme + if(params.theme<-1) params.theme=-1; + if(params.theme>6) params.theme=-1; + diff --git a/pkgs/by-name/ha/hardinfo2/package.nix b/pkgs/by-name/ha/hardinfo2/package.nix index 44385da328b3..63c8658cdc9f 100644 --- a/pkgs/by-name/ha/hardinfo2/package.nix +++ b/pkgs/by-name/ha/hardinfo2/package.nix @@ -4,14 +4,18 @@ fetchFromGitHub, cmake, + glslang, pkg-config, libsForQt5, + makeWrapper, wrapGAppsHook4, + cups, gtk3, json-glib, lerc, libdatrie, + libdecor, libepoxy, libnghttp2, libpsl, @@ -21,46 +25,69 @@ libsysprof-capture, libthai, libxkbcommon, + libXdmcp, + libXtst, pcre2, sqlite, util-linux, - libXdmcp, - libXtst, - mesa-demos, - makeWrapper, + vulkan-headers, + wayland, + + # runtime dmidecode, + gawk, + iperf, + mesa-demos, + sysbench, + udisks, + vulkan-tools, + xdg-utils, + xrandr, + + nix-update-script, + + printingSupport ? true, }: -stdenv.mkDerivation (finalAtrs: { +stdenv.mkDerivation (finalAttrs: { pname = "hardinfo2"; - version = "2.2.10"; + version = "2.2.13"; src = fetchFromGitHub { owner = "hardinfo2"; repo = "hardinfo2"; - tag = "release-${finalAtrs.version}"; - hash = "sha256-Ea1uhzAQEn8oDvWslGzrqoI2yzVDGxwTqbthfKEkYyQ="; + tag = "release-${finalAttrs.version}"; + hash = "sha256-HRP8xjiwhlNHjW4D8y74Pshpn7bksmN5j4jhfF6KOYo="; }; + patches = [ + ./remove-update.patch + ./default-no-theme.patch + ]; + + # fix absolute path for xdg-open + postPatch = '' + substituteInPlace deps/sysobj_early/gui/uri_handler.c \ + --replace-fail /usr/bin/xdg-open "${lib.getExe' xdg-utils "xdg-open"}" + ''; + nativeBuildInputs = [ cmake pkg-config + + glslang + wrapGAppsHook4 libsForQt5.wrapQtAppsHook makeWrapper ]; - preFixup = '' - makeWrapperArgs+=("''${qtWrapperArgs[@]}") - ''; - - dontWrapQtApps = true; - buildInputs = [ gtk3 json-glib lerc libdatrie + libdecor libepoxy libnghttp2 libpsl @@ -75,6 +102,8 @@ stdenv.mkDerivation (finalAtrs: { util-linux libXdmcp libXtst + vulkan-headers + wayland ]; hardeningDisable = [ "fortify" ]; @@ -84,20 +113,56 @@ stdenv.mkDerivation (finalAtrs: { (lib.cmakeFeature "CMAKE_INSTALL_SERVICEDIR" "${placeholder "out"}/lib") ]; - postFixup = '' - wrapProgram $out/bin/hardinfo2 \ - --prefix PATH : "${dmidecode}/bin:${mesa-demos}/bin" + dontWrapQtApps = true; + preFixup = '' + makeWrapperArgs+=("''${qtWrapperArgs[@]}") ''; + runtimeDeps = [ + # system stats + dmidecode + mesa-demos # glxinfo + vkgears for benchmark + + # display info + vulkan-tools # vulkaninfo + xrandr + + # additional tooling for benchmarks + # https://github.com/hardinfo2/hardinfo2/blob/release-2.2.13/shell/shell.c#L641-L652 + gawk + iperf + sysbench + udisks + ]; + + runtimeLibs = lib.optionals printingSupport [ cups ]; + + postFixup = '' + wrapProgram $out/bin/hardinfo2 \ + --prefix PATH : ${lib.makeBinPath finalAttrs.runtimeDeps} \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath finalAttrs.runtimeLibs} + + substituteInPlace $out/lib/systemd/system/hardinfo2.service \ + --replace-fail "ExecStart=/usr/bin/hwinfo2_fetch_sysdata" "ExecStart=$out/hwinfo2_fetch_sysdata" + ''; + + # account for tags having a release- prefix + passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=release-(.*)" ]; }; + meta = { - homepage = "http://www.hardinfo2.org"; description = "System information and benchmarks for Linux systems"; + homepage = "http://www.hardinfo2.org/"; + downloadPage = "https://github.com/hardinfo2/hardinfo2/"; + changelog = "https://github.com/hardinfo2/hardinfo2/releases/tag/release-${finalAttrs.version}"; license = with lib.licenses; [ gpl2Plus gpl3Plus lgpl2Plus ]; - maintainers = with lib.maintainers; [ sigmanificient ]; + maintainers = with lib.maintainers; [ + sigmanificient + jk + ]; platforms = lib.platforms.linux; mainProgram = "hardinfo2"; }; diff --git a/pkgs/by-name/ha/hardinfo2/remove-update.patch b/pkgs/by-name/ha/hardinfo2/remove-update.patch new file mode 100644 index 000000000000..960e79b3fedf --- /dev/null +++ b/pkgs/by-name/ha/hardinfo2/remove-update.patch @@ -0,0 +1,58 @@ +diff --git a/includes/uidefs.h b/includes/uidefs.h +index 552fd3cb..4998f677 100644 +--- a/includes/uidefs.h ++++ b/includes/uidefs.h +@@ -36,7 +36,6 @@ char *uidefs_str = + " " + " " + " " +- " " + " " + " " + " " +@@ -48,8 +47,6 @@ char *uidefs_str = + /* " "*/ + " " + " " +- " " +- " " + " " + ""; + +diff --git a/shell/menu.c b/shell/menu.c +index 5ffd4410..04398b1d 100644 +--- a/shell/menu.c ++++ b/shell/menu.c +@@ -52,11 +52,6 @@ static GtkActionEntry entries[] = { + N_("Send benchmark results and receive updated data from the network"), + G_CALLBACK(cb_sync_manager)}, + +- {"UpdateAction", HI_STOCK_UPDATES, +- N_("Update Available"), "", +- N_("Update Available"), +- G_CALLBACK(cb_update)}, +- + //does not work correctly and value low + /*{"CopyAction", HI_STOCK_CLIPBOARD, + N_("_Copy to Clipboard"), "C", +@@ -78,11 +73,6 @@ static GtkActionEntry entries[] = { + NULL, + G_CALLBACK(cb_open_help_page)}, + +- {"UpdatesPageAction", NULL, +- N_("_Update HardInfo2"), "", +- NULL, +- G_CALLBACK(cb_open_updates_page)}, +- + {"ReportBugAction", NULL, + N_("_Report bug"), NULL, + NULL, +@@ -237,8 +227,6 @@ void menu_init(Shell * shell) + gtk_image_menu_item_set_image(t,icon_cache_get_image_at_size("home.svg",size,size)); + t=GTK_IMAGE_MENU_ITEM(gtk_ui_manager_get_widget(shell->ui_manager, "/MainMenu/HelpMenu/HelpPage")); + gtk_image_menu_item_set_image(t,icon_cache_get_image_at_size("help.svg",size,size)); +- t=GTK_IMAGE_MENU_ITEM(gtk_ui_manager_get_widget(shell->ui_manager, "/MainMenu/HelpMenu/UpdatesPage")); +- gtk_image_menu_item_set_image(t,icon_cache_get_image_at_size("updates.svg",size,size)); + t=GTK_IMAGE_MENU_ITEM(gtk_ui_manager_get_widget(shell->ui_manager, "/MainMenu/HelpMenu/ReportBug")); + gtk_image_menu_item_set_image(t,icon_cache_get_image_at_size("report-bug.svg",size,size)); + t=GTK_IMAGE_MENU_ITEM(gtk_ui_manager_get_widget(shell->ui_manager, "/MainMenu/HelpMenu/About"));