Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got: add withSsh flag and defaultEditor parameter #322600

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion pkgs/by-name/go/got/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
, bison
, autoPatchelfHook
, testers
, signify
, withSsh ? true, openssh
# Default editor to use when neither VISUAL nor EDITOR are defined
, defaultEditor ? null
}:

stdenv.mkDerivation (finalAttrs: {
Expand All @@ -37,7 +41,18 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace configure --replace-fail 'xdarwin' 'xhomebrew'
'';

env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
env.NIX_CFLAGS_COMPILE = toString (
lib.optionals (defaultEditor != null) [
''-DGOT_DEFAULT_EDITOR="${lib.getExe defaultEditor}"''
] ++ lib.optionals withSsh [
''-DGOT_DIAL_PATH_SSH="${lib.getExe openssh}"''
''-DGOT_TAG_PATH_SSH_KEYGEN="${lib.getExe' openssh "ssh-keygen"}"''
] ++ lib.optionals stdenv.isLinux [
''-DGOT_TAG_PATH_SIGNIFY="${lib.getExe signify}"''
] ++ lib.optionals stdenv.cc.isClang [
"-Wno-error=implicit-function-declaration"
"-Wno-error=int-conversion"
] ++ lib.optionals stdenv.isDarwin [
eclairevoyant marked this conversation as resolved.
Show resolved Hide resolved
# error: conflicting types for 'strmode'
"-DHAVE_STRMODE=1"
# Undefined symbols for architecture arm64: "_bsd_getopt"
Expand Down