Commit 670af1fb authored by Yureka's avatar Yureka Committed by Robert Helgesson
Browse files

hd-idle: package rewrite

Someone ported the original hd-idle to Golang and is maintaining it.
This replaces the hd-idle package with the actively maintained Golang
port. I assume nobody will need unmaintained original version since
the Golang port can do everything the original version can do.
parent bf873fbb
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:

stdenv.mkDerivation rec {
buildGoModule rec {
  pname = "hd-idle";
  version = "1.05";
  version = "1.16";

  src = fetchurl {
    url = "mirror://sourceforge/project/hd-idle/hd-idle-${version}.tgz";
    sha256 = "031sm996s0rhy3z91b9xvyimsj2yd2fhsww2al2hxda5s5wzxzjf";
  src = fetchFromGitHub {
    owner = "adelolmo";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-LZcMwF/BhHiWWXMcrzbk8GyvwXdA3B2olmbOBxQwV5g=";
  };

  prePatch = ''
    substituteInPlace Makefile \
      --replace "-g root -o root" ""
  '';
  vendorSha256 = null;

  nativeBuildInputs = [ installShellFiles ];

  installFlags = [ "TARGET_DIR=$(out)" ];
  postInstall = ''
    installManPage debian/hd-idle.8
  '';

  meta = with lib; {
    description = "Spins down external disks after a period of idle time";
    homepage = "http://hd-idle.sourceforge.net/";
    license = licenses.gpl2Plus;
    homepage = "https://github.com/adelolmo/hd-idle";
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    maintainers = [ maintainers.rycee ];
  };