gitlab: 12.3.5 -> 12.4.0
- gitlab-shell no longer requires ruby for anything else than the install script, so the bundlerEnv stuff could be dropped - gitlab-shell and gitlab-workhorse now report their versions correctly
This commit is contained in:
@@ -1,65 +1,25 @@
|
||||
{ stdenv, ruby, bundler, fetchFromGitLab, buildGoPackage, bundlerEnv }:
|
||||
{ stdenv, fetchFromGitLab, buildGoPackage, ruby }:
|
||||
|
||||
let
|
||||
version = "10.0.0";
|
||||
buildGoPackage rec {
|
||||
pname = "gitlab-shell-go";
|
||||
version = "10.2.0";
|
||||
src = fetchFromGitLab {
|
||||
owner = "gitlab-org";
|
||||
repo = "gitlab-shell";
|
||||
rev = "v${version}";
|
||||
sha256 = "0n1llkb0jrqxm10l9wqmqxjycydqphgz0chbbf395d8pywyz826x";
|
||||
sha256 = "1mpzsdqd8mlsh8wccz4s8415w080z55lnifn7l7vd5rflpnyfhcj";
|
||||
};
|
||||
rubyEnv = bundlerEnv {
|
||||
name = "gitlab-shell-env";
|
||||
inherit ruby;
|
||||
gemdir = ./.;
|
||||
};
|
||||
goPackage = buildGoPackage {
|
||||
pname = "gitlab-shell-go";
|
||||
inherit src version;
|
||||
|
||||
patches = [ ./remove-hardcoded-locations-go.patch ];
|
||||
buildInputs = [ ruby ];
|
||||
|
||||
goPackagePath = "gitlab.com/gitlab-org/gitlab-shell";
|
||||
goDeps = ./deps.nix;
|
||||
patches = [ ./remove-hardcoded-locations.patch ];
|
||||
|
||||
# gitlab-shell depends on an older version of gitaly which
|
||||
# contains old, vendored versions of some packages; gitlab-shell
|
||||
# also explicitly depends on newer versions of these libraries,
|
||||
# but buildGoPackage exposes the vendored versions instead,
|
||||
# leading to compilation errors. Since the vendored libraries
|
||||
# aren't used here anyway, we'll just remove them.
|
||||
postConfigure = ''
|
||||
rm -r "$NIX_BUILD_TOP/go/src/gitlab.com/gitlab-org/gitaly/vendor/"
|
||||
'';
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "gitlab-shell";
|
||||
inherit src version;
|
||||
goPackagePath = "gitlab.com/gitlab-org/gitlab-shell";
|
||||
goDeps = ./deps.nix;
|
||||
|
||||
patches = [ ./remove-hardcoded-locations-ruby.patch ];
|
||||
|
||||
# gitlab-shell will try to read its config relative to the source
|
||||
# code by default which doesn't work in nixos because it's a
|
||||
# read-only filesystem
|
||||
postPatch = ''
|
||||
substituteInPlace lib/gitlab_config.rb --replace \
|
||||
"File.join(ROOT_PATH, 'config.yml')" \
|
||||
"'/run/gitlab/shell-config.yml'"
|
||||
'';
|
||||
|
||||
buildInputs = [ rubyEnv.wrappedRuby ];
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/
|
||||
cp -R . $out/
|
||||
cp ${goPackage.bin}/bin/* $out/bin/
|
||||
|
||||
runHook postInstall
|
||||
postInstall = ''
|
||||
cp -r "$NIX_BUILD_TOP/go/src/$goPackagePath"/bin/* $bin/bin
|
||||
cp -r "$NIX_BUILD_TOP/go/src/$goPackagePath"/{support,VERSION} $bin/
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
||||
Reference in New Issue
Block a user