2020-03-02 21:21:35 +01:00
|
|
|
{ stdenv, fetchFromGitLab, fetchFromGitHub, buildGoPackage, ruby,
|
|
|
|
bundlerEnv, pkgconfig, libgit2 }:
|
2017-07-05 23:53:31 +02:00
|
|
|
|
2017-09-03 15:38:28 +02:00
|
|
|
let
|
2019-07-10 02:09:15 +02:00
|
|
|
rubyEnv = bundlerEnv rec {
|
2017-09-03 15:38:28 +02:00
|
|
|
name = "gitaly-env";
|
|
|
|
inherit ruby;
|
2020-03-03 20:13:49 +01:00
|
|
|
copyGemFiles = true;
|
2017-09-03 15:38:28 +02:00
|
|
|
gemdir = ./.;
|
2019-07-10 02:09:15 +02:00
|
|
|
gemset =
|
2019-07-16 03:29:57 +02:00
|
|
|
let x = import (gemdir + "/gemset.nix");
|
2019-07-10 02:09:15 +02: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 15:38:28 +02:00
|
|
|
};
|
2020-03-02 21:21:35 +01:00
|
|
|
libgit2_0_27 = libgit2.overrideAttrs (oldAttrs: rec {
|
|
|
|
version = "0.27.8";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libgit2";
|
|
|
|
repo = "libgit2";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0wzx8nkyy9m7mx6cks58chjd4289vjsw97mxm9w6f1ggqsfnmbr9";
|
|
|
|
};
|
|
|
|
});
|
2017-09-03 15:38:28 +02:00
|
|
|
in buildGoPackage rec {
|
2020-03-27 10:08:59 +01:00
|
|
|
version = "12.8.8";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gitaly";
|
2017-07-05 23:53:31 +02:00
|
|
|
|
2017-09-03 15:38:28 +02:00
|
|
|
src = fetchFromGitLab {
|
2017-07-05 23:53:31 +02:00
|
|
|
owner = "gitlab-org";
|
|
|
|
repo = "gitaly";
|
2020-01-13 21:49:18 +01:00
|
|
|
rev = "v${version}";
|
2020-03-27 10:08:59 +01:00
|
|
|
sha256 = "182jqglzbzq8jnlq6l634125jkvi67pfr1xck68n4k09gyzqllxv";
|
2017-07-05 23:53:31 +02:00
|
|
|
};
|
|
|
|
|
2019-12-23 00:09:58 +01:00
|
|
|
# Fix a check which assumes that hook files are writeable by their
|
|
|
|
# owner.
|
|
|
|
patches = [ ./fix-executable-check.patch ];
|
|
|
|
|
2017-09-03 15:38:28 +02:00
|
|
|
goPackagePath = "gitlab.com/gitlab-org/gitaly";
|
2017-07-05 23:53:31 +02:00
|
|
|
|
2017-09-03 15:38:28 +02:00
|
|
|
passthru = {
|
|
|
|
inherit rubyEnv;
|
|
|
|
};
|
2018-09-25 02:11:36 +02:00
|
|
|
|
2019-07-16 01:17:38 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2020-03-02 21:21:35 +01:00
|
|
|
buildInputs = [ rubyEnv.wrappedRuby libgit2_0_27 ];
|
2019-07-16 01:17:38 +02:00
|
|
|
goDeps = ./deps.nix;
|
|
|
|
preBuild = "rm -r go/src/gitlab.com/gitlab-org/labkit/vendor";
|
2018-06-06 13:04:35 +02:00
|
|
|
|
2017-09-03 15:38:28 +02:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $ruby
|
2019-10-01 15:38:22 +02:00
|
|
|
cp -rv $src/ruby/{bin,lib,proto,git-hooks,gitlab-shell} $ruby
|
2019-03-29 16:52:03 +01:00
|
|
|
|
|
|
|
# gitlab-shell will try to read its config relative to the source
|
|
|
|
# code by default which doesn't work in nixos because it's a
|
|
|
|
# read-only filesystem
|
2019-05-06 19:11:11 +02:00
|
|
|
substituteInPlace $ruby/gitlab-shell/lib/gitlab_config.rb --replace \
|
2019-03-29 16:52:03 +01:00
|
|
|
"File.join(ROOT_PATH, 'config.yml')" \
|
|
|
|
"'/run/gitlab/shell-config.yml'"
|
2017-07-05 23:53:31 +02:00
|
|
|
'';
|
|
|
|
|
2017-09-03 15:38:28 +02:00
|
|
|
outputs = [ "bin" "out" "ruby" ];
|
|
|
|
|
2017-07-05 23:53:31 +02:00
|
|
|
meta = with stdenv.lib; {
|
2019-10-06 06:59:27 +02:00
|
|
|
homepage = https://gitlab.com/gitlab-org/gitaly;
|
|
|
|
description = "A Git RPC service for handling all the git calls made by GitLab";
|
2019-10-09 15:45:12 +02:00
|
|
|
platforms = platforms.linux;
|
2020-03-02 21:27:05 +01:00
|
|
|
maintainers = with maintainers; [ roblabla globin fpletz talyz ];
|
2017-07-05 23:53:31 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|