nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 115 lines 3.1 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 pkg-config, 6 libressl, 7 libbsd, 8 libevent, 9 libuuid, 10 libossp_uuid, 11 libmd, 12 zlib, 13 ncurses, 14 bison, 15 autoPatchelfHook, 16 testers, 17 signify, 18 apple-sdk_15, 19 nix-update-script, 20 withSsh ? true, 21 openssh, 22 # Default editor to use when neither VISUAL nor EDITOR are defined 23 defaultEditor ? null, 24}: 25 26stdenv.mkDerivation (finalAttrs: { 27 pname = "got"; 28 version = "0.116"; 29 30 src = fetchurl { 31 url = "https://gameoftrees.org/releases/portable/got-portable-${finalAttrs.version}.tar.gz"; 32 hash = "sha256-6KZK1zuCwbbfnfnaWj6Nqb5gUcNJc3mUCAaHjZWOTf8="; 33 }; 34 35 nativeBuildInputs = [ 36 pkg-config 37 bison 38 ] 39 ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; 40 41 buildInputs = [ 42 libressl 43 libbsd 44 libevent 45 libuuid 46 libmd 47 zlib 48 ncurses 49 ] 50 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 51 libossp_uuid 52 apple-sdk_15 53 ]; 54 55 preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' 56 # The configure script assumes dependencies on Darwin are installed via 57 # Homebrew or MacPorts and hardcodes assumptions about the paths of 58 # dependencies which fails the nixpkgs configurePhase. 59 substituteInPlace configure --replace-fail 'xdarwin' 'xhomebrew' 60 ''; 61 62 env.NIX_CFLAGS_COMPILE = toString ( 63 lib.optionals (defaultEditor != null) [ 64 ''-DGOT_DEFAULT_EDITOR="${lib.getExe defaultEditor}"'' 65 ] 66 ++ lib.optionals withSsh [ 67 ''-DGOT_DIAL_PATH_SSH="${lib.getExe openssh}"'' 68 ''-DGOT_TAG_PATH_SSH_KEYGEN="${lib.getExe' openssh "ssh-keygen"}"'' 69 ] 70 ++ lib.optionals stdenv.hostPlatform.isLinux [ 71 ''-DGOT_TAG_PATH_SIGNIFY="${lib.getExe signify}"'' 72 ] 73 ++ lib.optionals stdenv.cc.isClang [ 74 "-Wno-error=implicit-function-declaration" 75 "-Wno-error=int-conversion" 76 ] 77 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 78 # error: conflicting types for 'strmode' 79 "-DHAVE_STRMODE=1" 80 # Undefined symbols for architecture arm64: "_bsd_getopt" 81 "-include getopt.h" 82 ] 83 ); 84 85 passthru = { 86 updateScript = nix-update-script { 87 extraArgs = [ "--url=https://github.com/ThomasAdam/got-portable" ]; 88 }; 89 tests.version = testers.testVersion { 90 package = finalAttrs.finalPackage; 91 }; 92 }; 93 94 meta = { 95 changelog = "https://gameoftrees.org/releases/CHANGES"; 96 description = "Version control system which prioritizes ease of use and simplicity over flexibility"; 97 longDescription = '' 98 Game of Trees (Got) is a version control system which prioritizes 99 ease of use and simplicity over flexibility. 100 101 Got uses Git repositories to store versioned data. Git can be used 102 for any functionality which has not yet been implemented in 103 Got. It will always remain possible to work with both Got and Git 104 on the same repository. 105 ''; 106 homepage = "https://gameoftrees.org"; 107 license = lib.licenses.isc; 108 maintainers = with lib.maintainers; [ 109 abbe 110 afh 111 ]; 112 mainProgram = "got"; 113 platforms = with lib.platforms; darwin ++ linux; 114 }; 115})