Commit ee52555c authored by 06kellyjac's avatar 06kellyjac Committed by Bjørn Forsman
Browse files

hardinfo2: 2.2.10 -> 2.2.13

* Provide newly required wayland dependencies
* Move to finalAttrs pattern
* Remove update menu item
* Default to no-theme
* Fix access to xdg-open
* Provide runtime tooling for various benchmarks
* Make cups available for printer support
* Fix path on service file
* Added passthru.updateScript accounting for release- to get auto-updates
* Added meta.downloadPage
* Added meta.changelog
* Add myself as a maintainer
parent c3036a81
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
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;
 
+82 −17
Original line number Diff line number Diff line
@@ -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")
  ];

  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 : "${dmidecode}/bin:${mesa-demos}/bin"
      --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";
  };
+58 −0
Original line number Diff line number Diff line
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 =
     "	<menu name=\"HelpMenu\" action=\"HelpMenuAction\">"
     "		<menuitem name=\"WebPage\" action=\"HomePageAction\" always-show-image=\"true\"/>"
     "		<menuitem name=\"HelpPage\" action=\"HelpPageAction\" always-show-image=\"true\"/>"
-    "		<menuitem name=\"UpdatesPage\" action=\"UpdatesPageAction\" always-show-image=\"true\"/>"
     "		<menuitem name=\"ReportBug\" action=\"ReportBugAction\" always-show-image=\"true\"/>"
     "		<menuitem name=\"About\" action=\"AboutAction\" always-show-image=\"true\"/>"
     "	</menu>"
@@ -48,8 +47,6 @@ char *uidefs_str =
   /*    "			<toolitem name=\"Copy\" action=\"CopyAction\"/>"*/
     "			<separator/>"
     "                   <toolitem name=\"SyncManager\" action=\"SyncManagerAction\" always-show-image=\"true\"/>"
-    "			<separator/>"
-    "                   <toolitem name=\"Update\" action=\"UpdateAction\" always-show-image=\"true\"/>"
     "	</toolbar>"
     "</ui>";
 
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"), "<control>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"));