Add a nix flake
This commit is contained in:
parent
2a20129a48
commit
0f0f929022
3 changed files with 158 additions and 0 deletions
56
default.nix
Normal file
56
default.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, pkg-config
|
||||
, fontconfig
|
||||
, freetype
|
||||
, libX11
|
||||
, libXft
|
||||
, harfbuzz
|
||||
, gd
|
||||
, glib
|
||||
, ncurses
|
||||
, writeText
|
||||
, conf ? null
|
||||
, patches ? []
|
||||
, extraLibs ? []
|
||||
, nixosTests
|
||||
, imlib2
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "st";
|
||||
version = "0.8.5";
|
||||
|
||||
src = ./.;
|
||||
inherit patches;
|
||||
|
||||
configFile =
|
||||
lib.optionalString (conf != null) (writeText "config.def.h" conf);
|
||||
|
||||
postPatch = lib.optionalString (conf != null) "cp ${configFile} config.def.h"
|
||||
+ lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace config.mk --replace "-lrt" ""
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
makeFlags = [ "PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config" ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config ncurses fontconfig freetype ];
|
||||
buildInputs = [ libX11 libXft harfbuzz gd glib imlib2 ] ++ extraLibs;
|
||||
|
||||
preInstall = ''
|
||||
export TERMINFO=$out/share/terminfo
|
||||
'';
|
||||
|
||||
installFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
passthru.tests.test = nixosTests.terminal-emulators.st;
|
||||
|
||||
meta = with lib; {
|
||||
description = "st terminal";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ sioodmy ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue