From d1381eb21c8923597ff5920a8aab16cdf53285b8 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 15 Mar 2025 21:50:00 +0100 Subject: T5400: initialize OPAM environment where it's really needed --- Makefile | 8 ++++---- debian/rules | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5c798c3..0ba31e2 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,10 @@ GENERATED=$(BUILDDIR)/generated/vyosconfig.h \ $(BUILDDIR)/generated/vyosconfig.c \ $(BUILDDIR)/generated/vyosconfig_bindings.ml -OSTYPE:=$(shell ocamlfind ocamlc -config | awk '/^os_type:/ {print $$2}') -SYSTEM:=$(shell ocamlfind ocamlc -config | awk '/^system:/ {print $$2}') -EXTDLL:=$(shell ocamlfind ocamlc -config | awk '/^ext_dll:/ {print $$2}') -CC:= $(shell ocamlfind ocamlc -config | awk '/^bytecomp_c_compiler/ {for(i=2;i<=NF;i++) printf "%s " ,$$i}') +OSTYPE:=$(shell eval $$(opam env --root=/opt/opam --set-root); ocamlfind ocamlc -config | awk '/^os_type:/ {print $$2}') +SYSTEM:=$(shell eval $$(opam env --root=/opt/opam --set-root); ocamlfind ocamlc -config | awk '/^system:/ {print $$2}') +EXTDLL:=$(shell eval $$(opam env --root=/opt/opam --set-root); ocamlfind ocamlc -config | awk '/^ext_dll:/ {print $$2}') +CC:= $(shell eval $$(opam env --root=/opt/opam --set-root); ocamlfind ocamlc -config | awk '/^bytecomp_c_compiler/ {for(i=2;i<=NF;i++) printf "%s " ,$$i}') ifeq ($(OSTYPE),$(filter $(OSTYPE),Win32 Cygwin)) EXTEXE=.exe diff --git a/debian/rules b/debian/rules index 8d4a32b..99a5ee2 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,7 @@ VYCONF_DEF := etc/vyos dh $@ --with quilt override_dh_auto_build: - ./build.sh $(DIR) + eval $$(opam env --root=/opt/opam --set-root) && ./build.sh $(DIR) override_dh_auto_install: mkdir -p $(DIR)/$(VYCONF_CONF) -- cgit v1.2.3