From 9acdfbfd7280f7ae45411e2f3c005269dc053e78 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 28 Mar 2018 16:01:57 +0200 Subject: [PATCH] =?UTF-8?q?gsmartcontrol:=200.8.7=20=E2=86=92=201.1.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://github.com/NixOS/nixpkgs/issues/37444 --- pkgs/tools/misc/gsmartcontrol/default.nix | 26 ++++++--- pkgs/tools/misc/gsmartcontrol/fix-paths.patch | 58 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +- 3 files changed, 77 insertions(+), 11 deletions(-) create mode 100644 pkgs/tools/misc/gsmartcontrol/fix-paths.patch diff --git a/pkgs/tools/misc/gsmartcontrol/default.nix b/pkgs/tools/misc/gsmartcontrol/default.nix index d4322f051d0a..f7cdf5ca608b 100644 --- a/pkgs/tools/misc/gsmartcontrol/default.nix +++ b/pkgs/tools/misc/gsmartcontrol/default.nix @@ -1,18 +1,28 @@ -{ fetchurl, stdenv, smartmontools, gtkmm2, libglademm, pkgconfig, pcre }: +{ fetchurl, stdenv, smartmontools, autoreconfHook, gettext, gtkmm3, pkgconfig, wrapGAppsHook, pcre-cpp, gnome3 }: stdenv.mkDerivation rec { - version="0.8.7"; + version="1.1.3"; name = "gsmartcontrol-${version}"; src = fetchurl { - url = "http://artificialtime.com/gsmartcontrol/gsmartcontrol-${version}.tar.bz2"; - sha256 = "1ipykzqpfvlr84j38hr7q2cag4imrn1gql10slp8bfrs4h1si3vh"; + url = "mirror://sourceforge/gsmartcontrol/gsmartcontrol-${version}.tar.bz2"; + sha256 = "1a8j7dkml9zvgpk83xcdajfz7g6mmpmm5k86dl5sjc24zb7n4kxn"; }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ smartmontools gtkmm2 libglademm pcre ]; + patches = [ + ./fix-paths.patch + ]; - #installTargets = "install datainstall"; + nativeBuildInputs = [ autoreconfHook gettext pkgconfig wrapGAppsHook ]; + buildInputs = [ gtkmm3 pcre-cpp gnome3.adwaita-icon-theme ]; + + enableParallelBuilding = true; + + preFixup = '' + gappsWrapperArgs+=( + --prefix PATH : "${stdenv.lib.makeBinPath [ smartmontools ]}" + ) + ''; meta = { description = "Hard disk drive health inspection tool"; @@ -25,7 +35,7 @@ stdenv.mkDerivation rec { It allows you to inspect the drive's SMART data to determine its health, as well as run various tests on it. ''; - homepage = http://gsmartcontrol.sourceforge.net/; + homepage = https://gsmartcontrol.sourceforge.io/; license = stdenv.lib.licenses.gpl2Plus; maintainers = with stdenv.lib.maintainers; [qknight]; platforms = with stdenv.lib.platforms; linux; diff --git a/pkgs/tools/misc/gsmartcontrol/fix-paths.patch b/pkgs/tools/misc/gsmartcontrol/fix-paths.patch new file mode 100644 index 000000000000..905b63bee0c4 --- /dev/null +++ b/pkgs/tools/misc/gsmartcontrol/fix-paths.patch @@ -0,0 +1,58 @@ +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -475,6 +475,7 @@ + + + AC_CONFIG_FILES([ data/gsmartcontrol.desktop data/gsmartcontrol.appdata.xml \ ++ data/org.gsmartcontrol.policy \ + data/nsis/distribution.txt data/nsis/gsmartcontrol.nsi \ + debian.dist/changelog \ + src/gsc_winres.rc src/gsmartcontrol.exe.manifest \ +diff --git a/data/gsmartcontrol-root.in b/data/gsmartcontrol-root.in +--- a/data/gsmartcontrol-root.in ++++ b/data/gsmartcontrol-root.in +@@ -8,7 +8,7 @@ + # Run gsmartcontrol with root, asking for root password first. + # export GSMARTCONTROL_SU to override a su command (e.g. "kdesu -c"). + +-EXEC_BIN="@prefix@/sbin/gsmartcontrol"; ++EXEC_BIN="@prefix@/bin/gsmartcontrol"; + prog_name="gsmartcontrol" + + +@@ -118,7 +118,7 @@ + # Add @prefix@/sbin as well (freebsd seems to require it). + # Note that beesu won't show a GUI login box if /usr/sbin is before /usr/bin, + # so add it first as well. +-EXTRA_PATHS="/usr/bin:/usr/sbin:/usr/local/sbin:@prefix@/sbin"; ++EXTRA_PATHS="/usr/bin:/usr/sbin:/usr/local/sbin:@prefix@/bin"; + export PATH="$EXTRA_PATHS:$PATH" + + +diff --git a/data/org.gsmartcontrol.policy b/data/org.gsmartcontrol.policy.in +rename from data/org.gsmartcontrol.policy +rename to data/org.gsmartcontrol.policy.in +--- a/data/org.gsmartcontrol.policy ++++ b/data/org.gsmartcontrol.policy.in +@@ -12,7 +12,7 @@ + auth_admin + auth_admin + +- /usr/sbin/gsmartcontrol ++ @prefix@/bin/gsmartcontrol + true + + +diff --git a/src/Makefile.am b/src/Makefile.am +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -24,7 +24,7 @@ + # endif + + +-sbin_PROGRAMS = gsmartcontrol ++bin_PROGRAMS = gsmartcontrol + + gsmartcontrol_LDADD = $(top_builddir)/src/applib/libapplib.a \ + $(top_builddir)/src/libdebug/libdebug.a \ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ef4e1aafd775..33a9b2bf23b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2694,9 +2694,7 @@ with pkgs; sbsigntool = callPackage ../tools/security/sbsigntool { }; - gsmartcontrol = callPackage ../tools/misc/gsmartcontrol { - inherit (gnome2) libglademm; - }; + gsmartcontrol = callPackage ../tools/misc/gsmartcontrol { }; gssdp = callPackage ../development/libraries/gssdp { inherit (gnome2) libsoup;