Commit 7c08304f authored by TuKankamon's avatar TuKankamon
Browse files

earlyoom: 1.8.2 -> 1.9.0

parent 0edccd45
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
--- a/kill.c
+++ b/kill.c
@@ -55,7 +55,7 @@ static void notify(const char* summary, const char* body)
@@ -175,7 +175,7 @@ static void notify_dbus(const char* body)
         body2,
         NULL
     };
-    const char* dbus_send_path = "/usr/bin/dbus-send";
+    const char* dbus_send_path = "dbus-send";
     notify_spawn_subprocess(dbus_send_path, argv, NULL, 0);
 }
     // Complete command line looks like this:
     // dbus-send --system / net.nuetzlich.SystemNotifications.Notify 'string:summary text' 'string:and body text'
-    execl("/usr/bin/dbus-send", "dbus-send", "--system", "/", "net.nuetzlich.SystemNotifications.Notify",
+    execlp("dbus-send", "dbus-send", "--system", "/", "net.nuetzlich.SystemNotifications.Notify",
         summary2, body2, NULL);
     warn("notify: exec failed: %s\n", strerror(errno));
     exit(1);
+5 −16
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
  pandoc,
  stdenv,
  nixosTests,
  fetchpatch,
  # The man page requires pandoc to build and resides in a separate "man"
  # output which is pulled in on-demand. There is no need to disabled it unless
  # pandoc is hard to build on your platform.
@@ -13,36 +12,26 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "earlyoom";
  version = "1.8.2";
  version = "1.9.0";

  src = fetchFromGitHub {
    owner = "rfjakob";
    repo = "earlyoom";
    rev = "v${finalAttrs.version}";
    hash = "sha256-HZ7llMNdx2u1a6loIFjXt5QNkYpJp8GqLKxDf9exuzE=";
    hash = "sha256-eNWg96+uQn/s+iBCm8TH26pXVVzBdqbeQxVP2t4W7YA=";
  };

  outputs = [ "out" ] ++ lib.optionals withManpage [ "man" ];

  patches = [
    ./0000-fix-dbus-path.patch
    # Respect `MANDIR`.
    (fetchpatch {
      url = "https://github.com/rfjakob/earlyoom/commit/c5a1799a5ff4b3fd3132d50a510e8c126933cf4a.patch";
      hash = "sha256-64AkpTMmjiqZ6Byq6687zNIqrQ/IGRGgzzjyyAfcg14=";
    })
    # Correctly handle `PREFIX` as a default rather than always-concatenate.
    (fetchpatch {
      url = "https://github.com/rfjakob/earlyoom/commit/f7d6f1cc925962fbdcf57b1c2aeeabbf11e2d542.patch";
      hash = "sha256-DJDeQzcEGJMoMGIi1D/ogMaKG1VQvPZN9jXtUDGjyjk=";
    })
  ];
  patches = [ ./0000-fix-dbus-path.patch ];

  nativeBuildInputs = lib.optionals withManpage [ pandoc ];

  makeFlags = [
    "VERSION=${finalAttrs.version}"
    "PREFIX=${placeholder "out"}"
    "SYSCONFDIR=${placeholder "out"}/etc"
    "SYSTEMDUNITDIR=${placeholder "out"}/etc/systemd/system"
  ]
  ++ lib.optional withManpage "MANDIR=${placeholder "man"}/share/man";