2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitLab, fetchFromGitHub, buildGoModule, ruby
|
|
|
|
, bundlerEnv, pkg-config
|
2020-11-30 08:33:03 +00:00
|
|
|
# libgit2 + dependencies
|
|
|
|
, libgit2, openssl, zlib, pcre, http-parser }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-12-06 16:07:01 +00:00
|
|
|
# git2go 32.0.5 does not support libgit2 1.2.0 or 1.3.0.
|
|
|
|
# It needs a specific commit in between those two releases.
|
|
|
|
libgit2_custom = libgit2.overrideAttrs (oldAttrs: rec {
|
|
|
|
version = "1.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libgit2";
|
|
|
|
repo = "libgit2";
|
|
|
|
rev = "109b4c887ffb63962c7017a66fc4a1f48becb48e";
|
|
|
|
sha256 = "sha256-w029FHpOv5K49wE1OJMOlkTe+2cv+ORYqEHxs59GDBI=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
rubyEnv = bundlerEnv rec {
|
|
|
|
name = "gitaly-env";
|
|
|
|
inherit ruby;
|
|
|
|
copyGemFiles = true;
|
|
|
|
gemdir = ./.;
|
|
|
|
gemset =
|
|
|
|
let x = import (gemdir + "/gemset.nix");
|
|
|
|
in x // {
|
|
|
|
# grpc expects the AR environment variable to contain `ar rpc`. See the
|
|
|
|
# discussion in nixpkgs #63056.
|
|
|
|
grpc = x.grpc // {
|
|
|
|
patches = [ ../fix-grpc-ar.patch ];
|
|
|
|
dontBuild = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
version = "14.6.2";
|
2021-09-18 10:52:07 +00:00
|
|
|
gitaly_package = "gitlab.com/gitlab-org/gitaly/v${lib.versions.major version}";
|
|
|
|
in
|
|
|
|
|
|
|
|
buildGoModule {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gitaly";
|
2021-09-18 10:52:07 +00:00
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "gitlab-org";
|
|
|
|
repo = "gitaly";
|
|
|
|
rev = "v${version}";
|
2022-01-19 23:45:15 +00:00
|
|
|
sha256 = "sha256-a9qFAtQP5QtI+E6V3LBYAMYQbvhgOcn75l+6pSQPZ+0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
vendorSha256 = "sha256-ZLd4E3+e25Hqmd6ZyF3X6BveMEg7OF0FX9IvNBWn3v0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit rubyEnv;
|
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
ldflags = "-X ${gitaly_package}/internal/version.version=${version} -X ${gitaly_package}/internal/version.moduleVersion=${version}";
|
|
|
|
|
2021-08-06 21:57:35 +00:00
|
|
|
tags = [ "static,system_libgit2" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = [ rubyEnv.wrappedRuby libgit2_custom openssl zlib pcre http-parser ];
|
2020-11-30 08:33:03 +00:00
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $ruby
|
2020-11-24 20:58:05 +00:00
|
|
|
cp -rv $src/ruby/{bin,lib,proto,git-hooks} $ruby
|
2021-09-18 10:52:07 +00:00
|
|
|
mv $out/bin/gitaly-git2go $out/bin/gitaly-git2go-${version}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
outputs = [ "out" "ruby" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://gitlab.com/gitlab-org/gitaly";
|
|
|
|
description = "A Git RPC service for handling all the git calls made by GitLab";
|
2021-12-19 01:06:50 +00:00
|
|
|
platforms = platforms.linux ++ [ "x86_64-darwin" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ roblabla globin fpletz talyz ];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|