2019-07-16 00:17:38 +01:00
|
|
|
{ stdenv, fetchFromGitLab, buildGoPackage, ruby, bundlerEnv, pkgconfig, libgit2 }:
|
2017-07-05 22:53:31 +01:00
|
|
|
|
2017-09-03 14:38:28 +01:00
|
|
|
let
|
2019-07-10 01:09:15 +01:00
|
|
|
rubyEnv = bundlerEnv rec {
|
2017-09-03 14:38:28 +01:00
|
|
|
name = "gitaly-env";
|
|
|
|
inherit ruby;
|
|
|
|
gemdir = ./.;
|
2019-07-10 01:09:15 +01:00
|
|
|
gemset =
|
2019-07-16 02:29:57 +01:00
|
|
|
let x = import (gemdir + "/gemset.nix");
|
2019-07-10 01:09:15 +01: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 14:38:28 +01:00
|
|
|
};
|
|
|
|
in buildGoPackage rec {
|
2019-08-14 13:52:16 +01:00
|
|
|
version = "1.53.2";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gitaly";
|
2017-07-05 22:53:31 +01:00
|
|
|
|
2017-09-03 14:38:28 +01:00
|
|
|
src = fetchFromGitLab {
|
2017-07-05 22:53:31 +01:00
|
|
|
owner = "gitlab-org";
|
|
|
|
repo = "gitaly";
|
|
|
|
rev = "v${version}";
|
2019-08-14 13:52:16 +01:00
|
|
|
sha256 = "0x4dhqaxx6n5jlcvf69rglxiz11037ghgcnskks6qnlcbkd85j3d";
|
2017-07-05 22:53:31 +01:00
|
|
|
};
|
|
|
|
|
2017-09-03 14:38:28 +01:00
|
|
|
goPackagePath = "gitlab.com/gitlab-org/gitaly";
|
2017-07-05 22:53:31 +01:00
|
|
|
|
2017-09-03 14:38:28 +01:00
|
|
|
passthru = {
|
|
|
|
inherit rubyEnv;
|
|
|
|
};
|
2018-09-25 01:11:36 +01:00
|
|
|
|
2019-07-16 00:17:38 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ rubyEnv.wrappedRuby libgit2 ];
|
|
|
|
goDeps = ./deps.nix;
|
|
|
|
preBuild = "rm -r go/src/gitlab.com/gitlab-org/labkit/vendor";
|
2018-06-06 12:04:35 +01:00
|
|
|
|
2017-09-03 14:38:28 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $ruby
|
2019-05-06 18:11:11 +01:00
|
|
|
cp -rv $src/ruby/{bin,lib,git-hooks,gitlab-shell} $ruby
|
2019-03-29 15:52:03 +00: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 18:11:11 +01:00
|
|
|
substituteInPlace $ruby/gitlab-shell/lib/gitlab_config.rb --replace \
|
2019-03-29 15:52:03 +00:00
|
|
|
"File.join(ROOT_PATH, 'config.yml')" \
|
|
|
|
"'/run/gitlab/shell-config.yml'"
|
2017-07-05 22:53:31 +01:00
|
|
|
'';
|
|
|
|
|
2017-09-03 14:38:28 +01:00
|
|
|
outputs = [ "bin" "out" "ruby" ];
|
|
|
|
|
2017-07-05 22:53:31 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://www.gitlab.com/;
|
|
|
|
platforms = platforms.unix;
|
2019-07-16 00:17:38 +01:00
|
|
|
maintainers = with maintainers; [ roblabla globin fpletz ];
|
2017-07-05 22:53:31 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|