From 5d615ce319e7ae78c93c3988b9b0b6622ffb5cde Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 9 Sep 2024 12:37:24 +1000 Subject: [PATCH] chore: nph needs specific nim version --- Makefile | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c7444a7c3c..6504c2d5b0 100644 --- a/Makefile +++ b/Makefile @@ -270,11 +270,29 @@ networkmonitor: | build deps librln ############ ## Format ## ############ -.PHONY: build-nph clean-nph install-nph print-nph-path +.PHONY: set-nim-202 build-nph clean-nph install-nph print-nph-path + +set-nim-202: +ifeq ($(NIM_202), "") +ifneq ($(shell nim --version|grep "2\.0\.2" -c), "1") +ifeq ($(detected_OS),Linux) + wget https://nim-lang.org/download/nim-2.0.2-linux_x64.tar.xz -O nim-2.0.2-linux_x64.tar.xz + echo "3f1aaf4e19b2c341afad7b0f29644d6a40aebb71c7c02420489595751b1796ee66b4a3ba7783c504ef5d732b45e9f0d5443576580c3652e820ce3aebee768f93 nim-2.0.2-linux_x64.tar.xz" > nim-2.0.2-linux_x64.tar.xz.sha512 + sha512sum -c nim-2.0.2-linux_x64.tar.xz.sha512 + tar xavf nim-2.0.2-linux_x64.tar.xz +NIM_202 := "./nim-2.0.2/bin/nim" +else + echo "Please compile nph manually or improve this job" + exit 1 +endif +else +NIM_202 := $(shell which nim) +endif +endif -build-nph: +build-nph: set-nim-202 ifeq ("$(wildcard $(NPH))","") - $(ENV_SCRIPT) nim c vendor/nph/src/nph.nim + $(NIM_202) c vendor/nph/src/nph.nim endif GIT_PRE_COMMIT_HOOK := .git/hooks/pre-commit