2021-01-25 00:26:54 -08:00
|
|
|
{ lib, fetchFromGitLab, fetchFromGitHub, buildGoModule, ruby
|
2021-01-18 22:50:56 -08:00
|
|
|
, bundlerEnv, pkg-config
|
2020-11-24 12:56:11 -08:00
|
|
|
# libgit2 + dependencies
|
|
|
|
, libgit2, openssl, zlib, pcre, http-parser }:
|
2017-07-05 14:53:31 -07:00
|
|
|
|
2017-09-03 06:38:28 -07:00
|
|
|
let
|
2020-12-26 13:06:22 -08:00
|
|
|
# libgit2 was updated to 1.1.0 in nixpkgs, but gitlab doesn't support that yet.
|
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/106909
|
|
|
|
libgit = libgit2.overrideAttrs (attrs: rec {
|
|
|
|
version = "1.0.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libgit2";
|
|
|
|
repo = "libgit2";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "06cwrw93ycpfb5kisnsa5nsy95pm11dbh0vvdjg1jn25h9q5d3vc";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2019-07-09 17:09:15 -07:00
|
|
|
rubyEnv = bundlerEnv rec {
|
2017-09-03 06:38:28 -07:00
|
|
|
name = "gitaly-env";
|
|
|
|
inherit ruby;
|
2020-03-03 11:13:49 -08:00
|
|
|
copyGemFiles = true;
|
2017-09-03 06:38:28 -07:00
|
|
|
gemdir = ./.;
|
2019-07-09 17:09:15 -07:00
|
|
|
gemset =
|
2019-07-15 18:29:57 -07:00
|
|
|
let x = import (gemdir + "/gemset.nix");
|
2019-07-09 17:09:15 -07:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
2017-09-03 06:38:28 -07:00
|
|
|
};
|
2020-11-26 04:41:18 -08:00
|
|
|
in buildGoModule rec {
|
2021-03-20 07:04:54 -07:00
|
|
|
version = "13.9.4";
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "gitaly";
|
2017-07-05 14:53:31 -07:00
|
|
|
|
2017-09-03 06:38:28 -07:00
|
|
|
src = fetchFromGitLab {
|
2017-07-05 14:53:31 -07:00
|
|
|
owner = "gitlab-org";
|
|
|
|
repo = "gitaly";
|
2020-01-13 12:49:18 -08:00
|
|
|
rev = "v${version}";
|
2021-03-18 16:56:29 -07:00
|
|
|
sha256 = "sha256-6ocP4SMafvLI2jfvcB8jk1AemAI/TiBQ1iaVxK7I54A=";
|
2017-07-05 14:53:31 -07:00
|
|
|
};
|
|
|
|
|
2021-03-20 07:04:54 -07:00
|
|
|
vendorSha256 = "10ssx0dvbzg70vr2sgnhzijnjxfw6533wdjxwakj62rpfayklp51";
|
2017-07-05 14:53:31 -07:00
|
|
|
|
2017-09-03 06:38:28 -07:00
|
|
|
passthru = {
|
|
|
|
inherit rubyEnv;
|
|
|
|
};
|
2018-09-24 17:11:36 -07:00
|
|
|
|
2020-11-24 12:56:11 -08:00
|
|
|
buildFlags = [ "-tags=static,system_libgit2" ];
|
2021-01-18 22:50:56 -08:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-12-26 13:06:22 -08:00
|
|
|
buildInputs = [ rubyEnv.wrappedRuby libgit openssl zlib pcre http-parser ];
|
2020-11-26 04:41:18 -08:00
|
|
|
doCheck = false;
|
2018-06-06 04:04:35 -07:00
|
|
|
|
2017-09-03 06:38:28 -07:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $ruby
|
2020-11-20 12:02:55 -08:00
|
|
|
cp -rv $src/ruby/{bin,lib,proto,git-hooks} $ruby
|
2017-07-05 14:53:31 -07:00
|
|
|
'';
|
|
|
|
|
2020-04-27 18:50:57 -07:00
|
|
|
outputs = [ "out" "ruby" ];
|
2017-09-03 06:38:28 -07:00
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://gitlab.com/gitlab-org/gitaly";
|
2019-10-05 21:59:27 -07:00
|
|
|
description = "A Git RPC service for handling all the git calls made by GitLab";
|
2019-10-09 06:45:12 -07:00
|
|
|
platforms = platforms.linux;
|
2020-03-02 12:27:05 -08:00
|
|
|
maintainers = with maintainers; [ roblabla globin fpletz talyz ];
|
2017-07-05 14:53:31 -07:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|