52 lines
946 B
Nix
52 lines
946 B
Nix
|
{ pkgs ? import <nixpkgs> { }
|
||
|
, fetchFromGitea ? pkgs.fetchFromGitea
|
||
|
, stdenv ? pkgs.stdenv
|
||
|
, pkg-config ? pkgs.pkg-config
|
||
|
, fontconfig ? pkgs.fontconfig
|
||
|
, freetype ? pkgs.freetype
|
||
|
, libX11 ? pkgs.xorg.libX11
|
||
|
, libXft ? pkgs.xorg.libXft
|
||
|
, ncurses ? pkgs.ncurses
|
||
|
, extraLibs ? [ ]
|
||
|
}:
|
||
|
pkgs.stdenv.mkDerivation {
|
||
|
pname = "st";
|
||
|
name = "st";
|
||
|
|
||
|
src = fetchFromGitea {
|
||
|
domain = "git.bitlab21.com";
|
||
|
owner = "sam";
|
||
|
repo = "st";
|
||
|
rev = "1cde288ca34ad05984a0251a7879005128be085c";
|
||
|
sha256 = "sha256-4W9w/Efk+YCSP1VuUFr+jPXIyrlpktwxRPUOZHTAtx8=";
|
||
|
};
|
||
|
|
||
|
makeFlags = [
|
||
|
"PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
|
||
|
];
|
||
|
|
||
|
nativeBuildInputs = [
|
||
|
pkg-config
|
||
|
ncurses
|
||
|
fontconfig
|
||
|
freetype
|
||
|
];
|
||
|
|
||
|
buildInputs = [
|
||
|
libX11
|
||
|
libXft
|
||
|
] ++ extraLibs;
|
||
|
|
||
|
installFlags = [ "PREFIX=$(out)" ];
|
||
|
|
||
|
buildPhase = ''
|
||
|
make
|
||
|
'';
|
||
|
|
||
|
installPhase = ''
|
||
|
mkdir -p $out/usr/local/bin
|
||
|
mv st $out/usr/local/bin
|
||
|
'';
|
||
|
|
||
|
}
|