e7f8fe4f67
changed the binary name to always end with its module version. This
makes sure gitaly's internal version references are set to the package
version and renames the binary, postfixing it with the package
version.
(cherry picked from commit d14e9188d1cd88f1b530bf860638c2de27486a6d)
59 lines
1.5 KiB
Nix
59 lines
1.5 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 = ./.;
|
|
};
|
|
version = "14.2.1";
|
|
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-B3NtdS1UcT+nYIdoXs+tW2gnXZ0ew+NiIcCNi5z5fOc=";
|
|
};
|
|
|
|
vendorSha256 = "sha256-WhkNK+V7yXK+le1u8StAKajZIBzVKqV/WIau27oZBXE=";
|
|
|
|
passthru = {
|
|
inherit rubyEnv;
|
|
};
|
|
|
|
buildFlagsArray = [
|
|
"-ldflags= -X ${gitaly_package}/internal/version.version=${version} -X ${gitaly_package}/internal/version.moduleVersion=${version}"
|
|
];
|
|
|
|
buildFlags = [ "-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;
|
|
};
|
|
}
|