about summary refs log tree commit diff
path: root/pkgs/tools/misc/remind/default.nix
blob: 51448931dcfb3f616f377ab98d056fa9df9f9730 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, stdenv
, fetchurl
, tk
, tcllib
, tcl
, tkremind ? true
}:

tcl.mkTclDerivation rec {
  pname = "remind";
  version = "05.00.01";

  src = fetchurl {
    url = "https://dianne.skoll.ca/projects/remind/download/remind-${version}.tar.gz";
    hash = "sha256-tj36/lLn67/hkNMrRVGXRLqQ9Sx6oDKZHeajiSYn97c=";
  };

  propagatedBuildInputs = lib.optionals tkremind [ tcllib tk ];

  postPatch = lib.optionalString tkremind ''
    # NOTA BENE: The path to rem2pdf is replaced in tkremind for future use
    # as rem2pdf is currently not build since it requires the JSON::MaybeXS,
    # Pango and Cairo Perl modules.
    substituteInPlace scripts/tkremind \
      --replace-fail "exec wish" "exec ${lib.getBin tk}/bin/wish" \
      --replace-fail 'set Remind "remind"' "set Remind \"$out/bin/remind\"" \
      --replace-fail 'set Rem2PS "rem2ps"' "set Rem2PS \"$out/bin/rem2ps\"" \
      --replace-fail 'set Rem2PDF "rem2pdf"' "set Rem2PDF \"$out/bin/rem2pdf\""
  '';

  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (toString [
    # Disable clang link time optimization until the following issue is resolved:
    # https://github.com/NixOS/nixpkgs/issues/19098
    "-fno-lto"
    # On Darwin setenv and unsetenv are defined in stdlib.h from libSystem
    "-DHAVE_SETENV"
    "-DHAVE_UNSETENV"
  ]);

  meta = with lib; {
    homepage = "https://dianne.skoll.ca/projects/remind/";
    description = "Sophisticated calendar and alarm program for the console";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ raskin kovirobi ];
    mainProgram = "remind";
    platforms = platforms.unix;
  };
}