mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 10:31:36 +00:00
67 lines
1.8 KiB
Nix
67 lines
1.8 KiB
Nix
{ lib, fetchFromGitLab, fetchFromGitHub, buildGoModule, ruby
|
|
, bundlerEnv, pkg-config
|
|
# libgit2 + dependencies
|
|
, libgit2, openssl, zlib, pcre, http-parser }:
|
|
|
|
let
|
|
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;
|
|
};
|
|
};
|
|
};
|
|
version = "14.3.2";
|
|
gitaly_package = "gitlab.com/gitlab-org/gitaly/v${lib.versions.major version}";
|
|
in
|
|
|
|
buildGoModule {
|
|
pname = "gitaly";
|
|
inherit version;
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "gitlab-org";
|
|
repo = "gitaly";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-00Sgv1b3dwbN7ic//7NtrdiliunOnXRJ0GTQHYFjuqo=";
|
|
};
|
|
|
|
vendorSha256 = "sha256-9RhPQosen70E9t1iAoc2SeKs9pYMMpMqgXLekWfKNf8=";
|
|
|
|
passthru = {
|
|
inherit rubyEnv;
|
|
};
|
|
|
|
ldflags = "-X ${gitaly_package}/internal/version.version=${version} -X ${gitaly_package}/internal/version.moduleVersion=${version}";
|
|
|
|
tags = [ "static,system_libgit2" ];
|
|
nativeBuildInputs = [ pkg-config ];
|
|
buildInputs = [ rubyEnv.wrappedRuby libgit2 openssl zlib pcre http-parser ];
|
|
doCheck = false;
|
|
|
|
postInstall = ''
|
|
mkdir -p $ruby
|
|
cp -rv $src/ruby/{bin,lib,proto,git-hooks} $ruby
|
|
mv $out/bin/gitaly-git2go $out/bin/gitaly-git2go-${version}
|
|
'';
|
|
|
|
outputs = [ "out" "ruby" ];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://gitlab.com/gitlab-org/gitaly";
|
|
description = "A Git RPC service for handling all the git calls made by GitLab";
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ roblabla globin fpletz talyz ];
|
|
license = licenses.mit;
|
|
};
|
|
}
|