summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
authorAndrey Makarov <ph.makarov@gmail.com>2021-07-06 21:09:56 +0300
committerGitHub <noreply@github.com>2021-07-06 20:09:56 +0200
commitb88496ac67bea92c40cf1d0f3dc55b0fa91550a4 (patch)
tree964d5ac38d9d69952b91530e029a61e25ed79c98 /tools
parent252eea8cae33e486b179398e193aea9459954338 (diff)
downloadNim-b88496ac67bea92c40cf1d0f3dc55b0fa91550a4.tar.gz
fix compilation on Debian 7 (no git -C) (#18427)
* fix compilation on Debian 7 (no git -C)

* address review

* allow specify branch for testing unmerged csources

* temporarily change csources checkout parameters for testing

* Update tools/deps.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* fix failure

* Update config/build_config.txt

* set proper git branch/hash

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'tools')
-rw-r--r--tools/ci_generate.nim2
-rw-r--r--tools/deps.nim9
-rw-r--r--tools/niminst/makefile.nimf3
3 files changed, 10 insertions, 4 deletions
diff --git a/tools/ci_generate.nim b/tools/ci_generate.nim
index 52b84f0d8..ecf0023d3 100644
--- a/tools/ci_generate.nim
+++ b/tools/ci_generate.nim
@@ -61,7 +61,7 @@ SET nim_csources=bin\nim_csources_%nim_csourcesHash%.exe
 echo "building from csources: %nim_csources%"
 
 if not exist %nim_csourcesDir% (
-  git clone -q --depth 1 %nim_csourcesUrl% %nim_csourcesDir%
+  git clone -q --depth 1 -b %nim_csourcesBranch% %nim_csourcesUrl% %nim_csourcesDir%
 )
 
 if not exist %nim_csources% (
diff --git a/tools/deps.nim b/tools/deps.nim
index 8ed95b59a..95b2916a1 100644
--- a/tools/deps.nim
+++ b/tools/deps.nim
@@ -28,8 +28,13 @@ proc cloneDependency*(destDirBase: string, url: string, commit = commitHead,
     # from failing
     execRetry fmt"git clone -q {url} {destDir2}"
   if isGitRepo(destDir):
-    execRetry fmt"git -C {destDir2} fetch -q"
-    exec fmt"git -C {destDir2} checkout -q {commit}"
+    let oldDir = getCurrentDir()
+    setCurrentDir(destDir2)
+    try:
+      execRetry "git fetch -q"
+      exec fmt"git checkout -q {commit}"
+    finally:
+      setCurrentDir(oldDir)
   elif allowBundled:
     discard "this dependency was bundled with Nim, don't do anything"
   else:
diff --git a/tools/niminst/makefile.nimf b/tools/niminst/makefile.nimf
index aff0c5da0..8c40cf50f 100644
--- a/tools/niminst/makefile.nimf
+++ b/tools/niminst/makefile.nimf
@@ -25,7 +25,8 @@ endif
 
 ifeq ($(uos),linux)
   myos = linux
-  LDFLAGS += -ldl -lm
+  # add -lrt to avoid "undefined reference to `clock_gettime'" with glibc<2.17
+  LDFLAGS += -ldl -lm -lrt
 endif
 ifeq ($(uos),dragonfly)
   myos = freebsd