remind: Simplify package with tcl.mkTclDerivation

This commit is contained in:
Andrew Brooks 2021-04-30 18:05:22 -05:00
parent 87c5626e41
commit 499adf6b0c

View file

@ -3,20 +3,18 @@
, fetchurl , fetchurl
, tk , tk
, tcllib , tcllib
, makeWrapper , tcl
, tkremind ? true , tkremind ? true
}: }:
let let
inherit (lib) optional optionalString; inherit (lib) optional optionals optionalString;
tclLibraries = lib.optionals tkremind [ tcllib tk ]; tclLibraries = optionals tkremind [ tcllib tk ];
tclLibPaths = lib.concatStringsSep " "
(map (p: "${p}/lib/${p.libPrefix}") tclLibraries);
tkremindPatch = optionalString tkremind '' tkremindPatch = optionalString tkremind ''
substituteInPlace scripts/tkremind --replace "exec wish" "exec ${tk}/bin/wish" substituteInPlace scripts/tkremind --replace "exec wish" "exec ${tk}/bin/wish"
''; '';
in in
stdenv.mkDerivation rec { tcl.mkTclDerivation rec {
pname = "remind"; pname = "remind";
version = "03.03.06"; version = "03.03.06";
@ -25,7 +23,6 @@ stdenv.mkDerivation rec {
sha256 = "sha256-lpoMAXDJxwODY0/aoo25GRBYWFhE4uf11pR5/ITZX1s="; sha256 = "sha256-lpoMAXDJxwODY0/aoo25GRBYWFhE4uf11pR5/ITZX1s=";
}; };
nativeBuildInputs = optional tkremind makeWrapper;
propagatedBuildInputs = tclLibraries; propagatedBuildInputs = tclLibraries;
postPatch = '' postPatch = ''
@ -37,10 +34,6 @@ stdenv.mkDerivation rec {
${tkremindPatch} ${tkremindPatch}
''; '';
postInstall = optionalString tkremind ''
wrapProgram $out/bin/tkremind --set TCLLIBPATH "${tclLibPaths}"
'';
meta = with lib; { meta = with lib; {
homepage = "https://dianne.skoll.ca/projects/remind/"; homepage = "https://dianne.skoll.ca/projects/remind/";
description = "Sophisticated calendar and alarm program for the console"; description = "Sophisticated calendar and alarm program for the console";