diff --git a/software/gitlab/software.cfg b/software/gitlab/software.cfg
index 9236593fd570483d44dcf0bb736b136b70315594..4f9123a0a4bb1e93ed3742a354c12590e17d9e15 100644
--- a/software/gitlab/software.cfg
+++ b/software/gitlab/software.cfg
@@ -12,6 +12,7 @@ extends =
     ../../component/nodejs/buildout.cfg
     ../../component/openssl/buildout.cfg
     ../../component/nginx/buildout.cfg
+    ../../component/libgit2/buildout.cfg
 
 #   for instance
     ../../component/bash/buildout.cfg
@@ -111,9 +112,9 @@ git-executable = ${git:location}/bin/git
 [gitlab-repository]
 <= git-repository
 #repository = https://gitlab.com/gitlab-org/gitlab-ce.git
-repository = https://lab.nexedi.com/nexedi/gitlab-ce.git
-# 8.5.X + NXD patches:
-revision = v8.5.3-15-g827d39147af496bcd4696c845e9094a07b5a09d3
+repository = https://lab.nexedi.com/kazuhiko/gitlab-ce.git
+# 8.5.8 + NXD patches:
+revision = v8.5.8-15-gb21dfec5f20e2c16878ae8f4e6baba8753502ec3
 location = ${buildout:parts-directory}/gitlab
 
 [gitlab-shell-repository]
@@ -144,6 +145,7 @@ bundle  = ${bundler-4gitlab:bundle}
 
 configure-command = cd ${:path} &&
     ${:bundle} config --local build.charlock_holmes --with-icu-dir=${icu:location}  &&
+    ${:bundle} config --local build.rugged --use-system-libraries=true --with-git2-include=${libgit2:location}/include --with-git2-lib=${libgit2:location}/lib
     ${:bundle} config --local build.pg  --with-pg-config=${postgresql92:location}/bin/pg_config
 
 make-binary =