2021-01-17 00:15:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkgconfig, writeText, libX11, ncurses
|
2020-04-24 23:36:52 +00:00
|
|
|
, libXft, conf ? null, patches ? [], extraLibs ? []}:
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "st";
|
|
|
|
version = "0.8.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-07-18 16:06:22 +00:00
|
|
|
url = "https://dl.suckless.org/st/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "19j66fhckihbg30ypngvqc9bcva47mp379ch5vinasjdxgn3qbfl";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit patches;
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
configFile = optionalString (conf!=null) (writeText "config.def.h" conf);
|
2020-10-11 12:50:04 +00:00
|
|
|
|
|
|
|
postPatch = optionalString (conf!=null) "cp ${configFile} config.def.h"
|
|
|
|
+ optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace config.mk --replace "-lrt" ""
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ncurses ];
|
|
|
|
buildInputs = [ libX11 libXft ] ++ extraLibs;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
TERMINFO=$out/share/terminfo make install PREFIX=$out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://st.suckless.org/";
|
|
|
|
description = "Simple Terminal for X from Suckless.org Community";
|
|
|
|
license = licenses.mit;
|
2020-10-11 12:50:04 +00:00
|
|
|
maintainers = with maintainers; [ andsild ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|