summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-03-15 21:50:00 +0100
committerChristian Breunig <christian@breunig.cc>2025-03-15 21:50:00 +0100
commitd1381eb21c8923597ff5920a8aab16cdf53285b8 (patch)
treefb0129a4e2c5b7d23317cf8f9a4b74f182329f34
parent677d1e2bf8109b9fd4da60e20376f992b747e384 (diff)
downloadlibvyosconfig-T5400-fix-schroedingers-env.tar.gz
libvyosconfig-T5400-fix-schroedingers-env.zip
T5400: initialize OPAM environment where it's really neededT5400-fix-schroedingers-env
-rw-r--r--Makefile8
-rwxr-xr-xdebian/rules2
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)