2023-12-09 18:49:39 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
2024-04-28 18:43:55 +00:00
|
|
|
, libressl
|
2023-12-09 18:49:39 +00:00
|
|
|
, libbsd
|
|
|
|
, libevent
|
|
|
|
, libuuid
|
|
|
|
, libossp_uuid
|
|
|
|
, libmd
|
|
|
|
, zlib
|
|
|
|
, ncurses
|
|
|
|
, bison
|
2023-03-20 10:50:48 +00:00
|
|
|
, autoPatchelfHook
|
2024-04-28 18:43:55 +00:00
|
|
|
, testers
|
2024-06-26 07:47:57 +00:00
|
|
|
, signify
|
|
|
|
, withSsh ? true, openssh
|
|
|
|
# Default editor to use when neither VISUAL nor EDITOR are defined
|
|
|
|
, defaultEditor ? null
|
2022-09-11 19:09:58 +00:00
|
|
|
}:
|
2021-10-02 10:24:23 +00:00
|
|
|
|
2023-12-09 18:49:39 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-10-02 10:24:23 +00:00
|
|
|
pname = "got";
|
2024-07-12 16:29:29 +00:00
|
|
|
version = "0.101";
|
2021-10-02 10:24:23 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-12-09 18:49:39 +00:00
|
|
|
url = "https://gameoftrees.org/releases/portable/got-portable-${finalAttrs.version}.tar.gz";
|
2024-07-12 16:29:29 +00:00
|
|
|
hash = "sha256-JQZBgscxoMv4Dki77s8tYo4r5BBG+ErsDYnY5/am3MA=";
|
2021-10-02 10:24:23 +00:00
|
|
|
};
|
|
|
|
|
2023-03-20 10:50:48 +00:00
|
|
|
nativeBuildInputs = [ pkg-config bison ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
|
2021-10-02 10:24:23 +00:00
|
|
|
|
2024-04-28 18:43:55 +00:00
|
|
|
buildInputs = [ libressl libbsd libevent libuuid libmd zlib ncurses ]
|
2023-12-09 18:49:39 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ libossp_uuid ];
|
2021-10-02 10:24:23 +00:00
|
|
|
|
2023-03-20 10:50:48 +00:00
|
|
|
preConfigure = lib.optionalString stdenv.isDarwin ''
|
2023-12-09 18:49:39 +00:00
|
|
|
# The configure script assumes dependencies on Darwin are installed via
|
2022-09-11 19:09:58 +00:00
|
|
|
# Homebrew or MacPorts and hardcodes assumptions about the paths of
|
|
|
|
# dependencies which fails the nixpkgs configurePhase.
|
2024-03-11 15:41:14 +00:00
|
|
|
substituteInPlace configure --replace-fail 'xdarwin' 'xhomebrew'
|
2022-09-11 19:09:58 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-26 07:47:57 +00:00
|
|
|
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 [
|
2023-03-20 10:50:48 +00:00
|
|
|
# error: conflicting types for 'strmode'
|
|
|
|
"-DHAVE_STRMODE=1"
|
|
|
|
# Undefined symbols for architecture arm64: "_bsd_getopt"
|
|
|
|
"-include getopt.h"
|
|
|
|
]);
|
|
|
|
|
2024-04-28 18:43:55 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
2021-10-02 10:24:23 +00:00
|
|
|
|
2024-03-11 15:41:14 +00:00
|
|
|
meta = {
|
|
|
|
changelog = "https://gameoftrees.org/releases/CHANGES";
|
2024-05-07 12:41:18 +00:00
|
|
|
description = "Version control system which prioritizes ease of use and simplicity over flexibility";
|
2021-10-02 10:24:23 +00:00
|
|
|
longDescription = ''
|
|
|
|
Game of Trees (Got) is a version control system which prioritizes
|
|
|
|
ease of use and simplicity over flexibility.
|
|
|
|
|
|
|
|
Got uses Git repositories to store versioned data. Git can be used
|
|
|
|
for any functionality which has not yet been implemented in
|
|
|
|
Got. It will always remain possible to work with both Got and Git
|
|
|
|
on the same repository.
|
|
|
|
'';
|
|
|
|
homepage = "https://gameoftrees.org";
|
2024-03-11 15:41:14 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = with lib.maintainers; [ abbe afh ];
|
|
|
|
mainProgram = "got";
|
|
|
|
platforms = with lib.platforms; darwin ++ linux;
|
2021-10-02 10:24:23 +00:00
|
|
|
};
|
2023-12-09 18:49:39 +00:00
|
|
|
})
|