2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitLab, fetchFromGitHub, buildGoModule, ruby
|
|
|
|
, bundlerEnv, pkg-config
|
2020-11-30 08:33:03 +00:00
|
|
|
# libgit2 + dependencies
|
2022-12-02 08:20:57 +00:00
|
|
|
, libgit2, openssl, zlib, pcre, http-parser }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
rubyEnv = bundlerEnv rec {
|
|
|
|
name = "gitaly-env";
|
|
|
|
inherit ruby;
|
|
|
|
copyGemFiles = true;
|
|
|
|
gemdir = ./.;
|
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
version = "15.6.1";
|
2022-06-26 10:26:21 +00:00
|
|
|
package_version = "v${lib.versions.major version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
gitaly_package = "gitlab.com/gitlab-org/gitaly/${package_version}";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
commonOpts = {
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "gitlab-org";
|
|
|
|
repo = "gitaly";
|
|
|
|
rev = "v${version}";
|
2022-12-02 08:20:57 +00:00
|
|
|
sha256 = "sha256-mzX+6kMXqdrxqMaUwN2tG5kJgKSRv0/tNN8ibHqBbzU=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
vendorSha256 = "sha256-SEPfso27PHHpvnQwdeMQYECw/CZIa/NdpMBSTRJEwIo=";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
ldflags = [ "-X ${gitaly_package}/internal/version.version=${version}" "-X ${gitaly_package}/internal/version.moduleVersion=${version}" ];
|
|
|
|
|
|
|
|
tags = [ "static,system_libgit2" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2022-12-02 08:20:57 +00:00
|
|
|
buildInputs = [ rubyEnv.wrappedRuby libgit2 openssl zlib pcre http-parser ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
auxBins = buildGoModule ({
|
|
|
|
pname = "gitaly-aux";
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
subPackages = [ "cmd/gitaly-hooks" "cmd/gitaly-ssh" "cmd/gitaly-git2go" "cmd/gitaly-lfs-smudge" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
} // commonOpts);
|
|
|
|
in
|
|
|
|
buildGoModule ({
|
|
|
|
pname = "gitaly";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit rubyEnv;
|
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
subPackages = [ "cmd/gitaly" "cmd/gitaly-backup" ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
preConfigure = ''
|
|
|
|
mkdir -p _build/bin
|
|
|
|
cp -r ${auxBins}/bin/* _build/bin
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $ruby
|
2022-12-02 08:20:57 +00:00
|
|
|
cp -rv $src/ruby/{bin,lib} $ruby
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
outputs = [ "out" "ruby" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://gitlab.com/gitlab-org/gitaly";
|
|
|
|
description = "A Git RPC service for handling all the git calls made by GitLab";
|
2021-12-19 01:06:50 +00:00
|
|
|
platforms = platforms.linux ++ [ "x86_64-darwin" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ roblabla globin talyz yayayayaka ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
2022-08-12 12:06:08 +00:00
|
|
|
} // commonOpts)
|