18 , withSsh ? true, openssh
19 # Default editor to use when neither VISUAL nor EDITOR are defined
20 , defaultEditor ? null
24 stdenv' = if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64
25 then overrideSDK stdenv "11.0"
28 stdenv'.mkDerivation (finalAttrs: {
33 url = "https://gameoftrees.org/releases/portable/got-portable-${finalAttrs.version}.tar.gz";
34 hash = "sha256-sy14eSC8SXUhOVoGvrB9f0+StpN5WGMiS2BJ09ZpyMk=";
37 nativeBuildInputs = [ pkg-config bison ]
38 ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
40 buildInputs = [ libressl libbsd libevent libuuid libmd zlib ncurses ]
41 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libossp_uuid ];
43 preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
44 # The configure script assumes dependencies on Darwin are installed via
45 # Homebrew or MacPorts and hardcodes assumptions about the paths of
46 # dependencies which fails the nixpkgs configurePhase.
47 substituteInPlace configure --replace-fail 'xdarwin' 'xhomebrew'
50 env.NIX_CFLAGS_COMPILE = toString (
51 lib.optionals (defaultEditor != null) [
52 ''-DGOT_DEFAULT_EDITOR="${lib.getExe defaultEditor}"''
53 ] ++ lib.optionals withSsh [
54 ''-DGOT_DIAL_PATH_SSH="${lib.getExe openssh}"''
55 ''-DGOT_TAG_PATH_SSH_KEYGEN="${lib.getExe' openssh "ssh-keygen"}"''
56 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
57 ''-DGOT_TAG_PATH_SIGNIFY="${lib.getExe signify}"''
58 ] ++ lib.optionals stdenv.cc.isClang [
59 "-Wno-error=implicit-function-declaration"
60 "-Wno-error=int-conversion"
61 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
62 # error: conflicting types for 'strmode'
64 # Undefined symbols for architecture arm64: "_bsd_getopt"
68 passthru.tests.version = testers.testVersion {
69 package = finalAttrs.finalPackage;
73 changelog = "https://gameoftrees.org/releases/CHANGES";
74 description = "Version control system which prioritizes ease of use and simplicity over flexibility";
76 Game of Trees (Got) is a version control system which prioritizes
77 ease of use and simplicity over flexibility.
79 Got uses Git repositories to store versioned data. Git can be used
80 for any functionality which has not yet been implemented in
81 Got. It will always remain possible to work with both Got and Git
82 on the same repository.
84 homepage = "https://gameoftrees.org";
85 license = lib.licenses.isc;
86 maintainers = with lib.maintainers; [ abbe afh ];
88 platforms = with lib.platforms; darwin ++ linux;