2022-08-01 08:36:08 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper, pkg-config
|
2023-01-14 18:17:07 +00:00
|
|
|
, withGui ? true, vte
|
2022-08-01 08:36:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "o";
|
2023-01-14 18:17:07 +00:00
|
|
|
version = "2.58.0";
|
2022-08-01 08:36:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xyproto";
|
|
|
|
repo = "o";
|
|
|
|
rev = "v${version}";
|
2023-01-14 18:17:07 +00:00
|
|
|
hash = "sha256-oYWlciTQ/4mm/gTSQEkD/xPeLfDjIAMksjj1DVodZW4=";
|
2022-08-01 08:36:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
2023-01-14 18:17:07 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "-Wl,--as-needed" ""
|
|
|
|
|
|
|
|
# Requires impure pbcopy and pbpaste
|
|
|
|
substituteInPlace v2/pbcopy_test.go \
|
|
|
|
--replace TestPBcopy SkipTestPBcopy
|
|
|
|
'';
|
|
|
|
|
2022-08-01 08:36:08 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = lib.optional withGui vte;
|
|
|
|
|
|
|
|
preBuild = "cd v2";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cd ..
|
|
|
|
installManPage o.1
|
|
|
|
'' + lib.optionalString withGui ''
|
|
|
|
make install-gui PREFIX=$out
|
2023-01-14 18:17:07 +00:00
|
|
|
wrapProgram $out/bin/og --prefix PATH : $out/bin
|
2022-08-01 08:36:08 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Config-free text editor and IDE limited to VT100";
|
|
|
|
homepage = "https://github.com/xyproto/o";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
};
|
|
|
|
}
|