From 3b59165f196b32f130150db7a7167dc2fadae315 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 25 Apr 2020 15:53:52 +0530 Subject: [PATCH] gnu: maradns: Fix cross compilation. * gnu/packages/dns.scm (maradns)[native-inputs]: Add gcc when cross compiling. [arguments]: Build make_32bit_tables for the host. --- gnu/packages/dns.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm index 80ed1f0b49..8cb6a2f3fa 100644 --- a/gnu/packages/dns.scm +++ b/gnu/packages/dns.scm @@ -43,6 +43,7 @@ #:use-module (gnu packages crypto) #:use-module (gnu packages datastructures) #:use-module (gnu packages flex) + #:use-module (gnu packages gcc) #:use-module (gnu packages glib) #:use-module (gnu packages groff) #:use-module (gnu packages groff) @@ -979,7 +980,15 @@ known public suffixes.") #:phases (modify-phases %standard-phases (replace 'configure - (lambda _ + (lambda* (#:key native-inputs #:allow-other-keys) + ;; make_32bit_tables generates a header file that is used during + ;; compilation. Hence, during cross compilation, it should be + ;; built for the host system. + (when ,(%current-target-system) + (substitute* "rng/Makefile" + (("\\$\\(CC\\) -o make_32bit_tables") + (string-append (assoc-ref native-inputs "gcc") + "/bin/gcc -o make_32bit_tables")))) (invoke "./configure"))) (add-before 'install 'create-install-directories (lambda* (#:key outputs #:allow-other-keys) @@ -991,6 +1000,10 @@ known public suffixes.") "/share/man/man5" "/share/man/man8")) #t)))))) + (native-inputs + `(,@(if (%current-target-system) + `(("gcc" ,gcc)) + '()))) (home-page "https://maradns.samiam.org") (synopsis "Small lightweight DNS server") (description "MaraDNS is a small and lightweight DNS server. MaraDNS -- 2.26.1