3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #210769 from sikmir/o-editor

o: 2.57.0 → 2.58.0
This commit is contained in:
Nick Cao 2023-01-18 13:42:18 +08:00 committed by GitHub
commit a2d165a9dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,25 +1,29 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper, pkg-config
, tcsh
, withGui ? stdenv.isLinux, vte # vte is broken on darwin
, withGui ? true, vte
}:
buildGoModule rec {
pname = "o";
version = "2.57.0";
version = "2.58.0";
src = fetchFromGitHub {
owner = "xyproto";
repo = "o";
rev = "v${version}";
hash = "sha256-UKFquf5h1e7gRAZgtcTdEpoNv+TOC8BYb2ED26X274s=";
hash = "sha256-oYWlciTQ/4mm/gTSQEkD/xPeLfDjIAMksjj1DVodZW4=";
};
postPatch = ''
substituteInPlace ko/main.cpp --replace '/bin/csh' '${tcsh}/bin/tcsh'
'';
vendorSha256 = null;
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace Makefile \
--replace "-Wl,--as-needed" ""
# Requires impure pbcopy and pbpaste
substituteInPlace v2/pbcopy_test.go \
--replace TestPBcopy SkipTestPBcopy
'';
nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ];
buildInputs = lib.optional withGui vte;
@ -31,7 +35,7 @@ buildGoModule rec {
installManPage o.1
'' + lib.optionalString withGui ''
make install-gui PREFIX=$out
wrapProgram $out/bin/ko --prefix PATH : $out/bin
wrapProgram $out/bin/og --prefix PATH : $out/bin
'';
meta = with lib; {