btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / re / remind / package.nix
blobeb01ac3c885d160892abc5f2ef3a163d003887e2
2   lib,
3   stdenv,
4   fetchurl,
5   tk,
6   tclPackages,
7   tcl,
8   tkremind ? null,
9   withGui ?
10     if tkremind != null then
11       lib.warn "tkremind is deprecated and should be removed; use withGui instead." tkremind
12     else
13       true,
16 tcl.mkTclDerivation rec {
17   pname = "remind";
18   version = "05.00.07";
20   src = fetchurl {
21     url = "https://dianne.skoll.ca/projects/remind/download/remind-${version}.tar.gz";
22     hash = "sha256-id3yVyKHRSJWhm8r4Zmc/k61AZUt1wa3lArQktDbt9w=";
23   };
25   propagatedBuildInputs = lib.optionals withGui [
26     tclPackages.tcllib
27     tk
28   ];
30   postPatch = lib.optionalString withGui ''
31     # NOTA BENE: The path to rem2pdf is replaced in tkremind for future use
32     # as rem2pdf is currently not build since it requires the JSON::MaybeXS,
33     # Pango and Cairo Perl modules.
34     substituteInPlace scripts/tkremind.in \
35       --replace-fail "exec wish" "exec ${lib.getExe' tk "wish"}" \
36       --replace-fail 'set Remind "remind"' "set Remind \"$out/bin/remind\"" \
37       --replace-fail 'set Rem2PS "rem2ps"' "set Rem2PS \"$out/bin/rem2ps\"" \
38       --replace-fail 'set Rem2PDF "rem2pdf"' "set Rem2PDF \"$out/bin/rem2pdf\""
39   '';
41   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
42     # On Darwin setenv and unsetenv are defined in stdlib.h from libSystem
43     "-DHAVE_SETENV"
44     "-DHAVE_UNSETENV"
45   ]);
47   meta = with lib; {
48     homepage = "https://dianne.skoll.ca/projects/remind/";
49     description = "Sophisticated calendar and alarm program for the console";
50     license = licenses.gpl2Only;
51     maintainers = with maintainers; [
52       raskin
53       kovirobi
54     ];
55     mainProgram = "remind";
56     platforms = platforms.unix;
57   };