Skip to content

Commit

Permalink
FIXME: gitaly-git: try using install-bundled-git target
Browse files Browse the repository at this point in the history
  • Loading branch information
srhb committed Oct 24, 2024
1 parent e049989 commit 0bf3280
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ buildGoModule ({
preConfigure = ''
mkdir -p _build/bin
cp -r ${auxBins}/bin/* _build/bin
for f in ${git}/bin/git-*; do
# gitaly embeds these git binaries in its own binary
# https://gitlab.com/gitlab-org/gitaly/-/blob/10fd91391a7c30ca54ec81eea881740cfdee8b0a/Makefile#L122
find ${git}/bin
for f in ${git}/bin/{git,git-remote-http,git-http-backend}; do
cp "$f" "_build/bin/gitaly-$(basename $f)";
done
'';
Expand Down
14 changes: 8 additions & 6 deletions pkgs/applications/version-management/gitlab/gitaly/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,25 @@ stdenv.mkDerivation rec {
hash = "sha256-R4K5b4d1DQw+pwoOCAK4EJtVPXQDPossTUmVv0LJtUs=";
};

majmin = lib.versions.majorMinor version;

# we actually use the gitaly build system
unpackPhase = ''
cp -r ${gitaly.src} source
chmod -R +w source
mkdir -p source/_build/deps
cp -r ${src} source/_build/deps/git-distribution
chmod -R +w source/_build/deps/git-distribution
cp -r ${src} source/_build/deps/git-v${majmin}
chmod -R +w source/_build/deps/git-v${majmin}
# FIXME? maybe just patch the makefile?
echo -n 'v${version} DEVELOPER=1 DEVOPTS=no-error USE_LIBPCRE=YesPlease NO_PERL=YesPlease NO_EXPAT=YesPlease NO_TCLTK=YesPlease NO_GETTEXT=YesPlease NO_PYTHON=YesPlease' > source/_build/deps/git-distribution.version
echo -n 'v${version}' > source/_build/deps/git-distribution/version
echo -n 'v${version} DEVELOPER=1 DEVOPTS=no-error USE_LIBPCRE=YesPlease NO_PERL=YesPlease NO_EXPAT=YesPlease NO_TCLTK=YesPlease NO_GETTEXT=YesPlease NO_PYTHON=YesPlease' > source/_build/deps/git-v${majmin}.version
echo -n 'v${version}' > source/_build/deps/git-v${majmin}/version
'';
sourceRoot = "source";

buildFlags = [ "git" ];
buildFlags = [ "install-bundled-git" ];

buildInputs = [
curl
Expand All @@ -44,7 +46,7 @@ stdenv.mkDerivation rec {
];

# The build phase already installs it all
GIT_PREFIX = placeholder "out";
PREFIX = placeholder "out";
dontInstall = true;

meta = {
Expand Down

0 comments on commit 0bf3280

Please sign in to comment.