gitaly: Fix gitaly-git2go binary name (#136569)

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)
This commit is contained in:
Kim Lindberger 2021-09-03 13:23:00 +02:00 committed by Yureka
parent b5d1601f7a
commit 9117f2a7d9
No known key found for this signature in database
GPG Key ID: B95AE06334AFF6BA

View File

@ -10,9 +10,13 @@ let
copyGemFiles = true; copyGemFiles = true;
gemdir = ./.; gemdir = ./.;
}; };
in buildGoModule rec {
version = "14.2.1"; version = "14.2.1";
gitaly_package = "gitlab.com/gitlab-org/gitaly/v${lib.versions.major version}";
in
buildGoModule {
pname = "gitaly"; pname = "gitaly";
inherit version;
src = fetchFromGitLab { src = fetchFromGitLab {
owner = "gitlab-org"; owner = "gitlab-org";
@ -27,6 +31,10 @@ in buildGoModule rec {
inherit rubyEnv; inherit rubyEnv;
}; };
buildFlagsArray = [
"-ldflags= -X ${gitaly_package}/internal/version.version=${version} -X ${gitaly_package}/internal/version.moduleVersion=${version}"
];
buildFlags = [ "-tags=static,system_libgit2" ]; buildFlags = [ "-tags=static,system_libgit2" ];
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ rubyEnv.wrappedRuby libgit2 openssl zlib pcre http-parser ]; buildInputs = [ rubyEnv.wrappedRuby libgit2 openssl zlib pcre http-parser ];
@ -35,6 +43,7 @@ in buildGoModule rec {
postInstall = '' postInstall = ''
mkdir -p $ruby mkdir -p $ruby
cp -rv $src/ruby/{bin,lib,proto,git-hooks} $ruby cp -rv $src/ruby/{bin,lib,proto,git-hooks} $ruby
mv $out/bin/gitaly-git2go $out/bin/gitaly-git2go-${version}
''; '';
outputs = [ "out" "ruby" ]; outputs = [ "out" "ruby" ];