nixpkgs/pkgs/applications/version-management/gitlab/gitaly/default.nix
Ben Gamari 363b352af3 gitlab: 11.10.8 -> 12.0.3
This is a major version bump but things were generally straightforward
save two wrinkles:

 * it is necessary to ignore collisions in the gitlab bundler
   environment as both `omniauth_oauth2_generic` and
   `apollo_upload_server` provide a `console` executable.

 * grpc had to be patched since its build system expects the `AR`
   environment variable to contain not just the path to `ar` but
   also the `rpc` flags (see the discussion in nixpkgs #63056).
2019-07-14 23:03:39 +02:00

61 lines
1.5 KiB
Nix

{ stdenv, fetchFromGitLab, buildGoPackage, ruby, bundlerEnv }:
let
rubyEnv = bundlerEnv rec {
name = "gitaly-env";
inherit ruby;
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;
};
};
};
in buildGoPackage rec {
version = "1.47.0";
name = "gitaly-${version}";
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "gitaly";
rev = "v${version}";
sha256 = "1b8gshvwiypwl0f4963l37y7sjrn851marr77fhczx128axrniiw";
};
goPackagePath = "gitlab.com/gitlab-org/gitaly";
passthru = {
inherit rubyEnv;
};
subPackages = [ "." ];
buildInputs = [ rubyEnv.wrappedRuby ];
postInstall = ''
mkdir -p $ruby
cp -rv $src/ruby/{bin,lib,git-hooks,gitlab-shell} $ruby
# 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
substituteInPlace $ruby/gitlab-shell/lib/gitlab_config.rb --replace \
"File.join(ROOT_PATH, 'config.yml')" \
"'/run/gitlab/shell-config.yml'"
'';
outputs = [ "bin" "out" "ruby" ];
meta = with stdenv.lib; {
homepage = http://www.gitlab.com/;
platforms = platforms.unix;
maintainers = with maintainers; [ roblabla ];
license = licenses.mit;
};
}