st: small cosmetic rewrite

This commit is contained in:
AndersonTorres 2021-09-04 18:43:33 -03:00
parent 81254b1a1f
commit d26f8c444f

@ -2,34 +2,33 @@
, stdenv , stdenv
, fetchurl , fetchurl
, pkg-config , pkg-config
, writeText
, libX11
, ncurses
, fontconfig , fontconfig
, freetype , freetype
, libX11
, libXft , libXft
, ncurses
, writeText
, conf ? null , conf ? null
, patches ? [ ] , patches ? [ ]
, extraLibs ? [ ] , extraLibs ? [ ]
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "st"; pname = "st";
version = "0.8.4"; version = "0.8.4";
src = fetchurl { src = fetchurl {
url = "https://dl.suckless.org/st/${pname}-${version}.tar.gz"; url = "https://dl.suckless.org/st/${pname}-${version}.tar.gz";
sha256 = "19j66fhckihbg30ypngvqc9bcva47mp379ch5vinasjdxgn3qbfl"; hash = "sha256-1C087OtNamXjLpClM249RG22EsP72evBeAvGyaAzRqY=";
}; };
inherit patches; inherit patches;
configFile = optionalString (conf != null) (writeText "config.def.h" conf); configFile = lib.optionalString (conf != null)
(writeText "config.def.h" conf);
postPatch = optionalString (conf != null) "cp ${configFile} config.def.h" postPatch = lib.optionalString (conf != null) "cp ${configFile} config.def.h"
+ optionalString stdenv.isDarwin '' + lib.optionalString stdenv.isDarwin ''
substituteInPlace config.mk --replace "-lrt" "" substituteInPlace config.mk --replace "-lrt" ""
''; '';
@ -52,11 +51,13 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
TERMINFO=$out/share/terminfo make install PREFIX=$out TERMINFO=$out/share/terminfo make install PREFIX=$out
runHook postInstall runHook postInstall
''; '';
meta = { meta = with lib; {
homepage = "https://st.suckless.org/"; homepage = "https://st.suckless.org/";
description = "Simple Terminal for X from Suckless.org Community"; description = "Simple Terminal for X from Suckless.org Community";
license = licenses.mit; license = licenses.mit;