Hi help-guix,

I am trying to refactor the package r-freetype-harfbuzz, which has as part of its inputs some inline package definitions:

    (native-inputs
     `(("r-testthat" ,r-testthat)
       ("static-freetype"
        ,(package
           (inherit (static-package freetype))
           (arguments
           ...)
       ("static-harfbuzz"
        ,(package
           (inherit harfbuzz)
           (arguments
             ...))

This package definition seems to build just fine. I wanted to extract these inline package definitions, so I wrote something like

(define r-freetype-harfbuzz/static-freetype
  (package
    (inherit (static-package freetype))))

and tried to build it. However, I get lots of errors, starting with "error: freetype: unbound variable". I guess the rest of these are just due to the module failing to compile (but I attached the full log just in case). This is a very confusing error, because lots of package definitions in this file already refer to freetype. I get the same errors if I change the package to just `(inherit freetype)` too, so the static-package part is not the issue. I can see in the module definition too that (gnu packages fontutils) is definitely included.

Hopefully someone can see where I'm going wrong,

Dan
error: freetype: unbound variable
hint: Did you forget `(use-modules (guix licenses))' or `#:use-module (guix
licenses)'?

error: googletest: unbound variable
hint: Did you forget a `use-modules' form?

error: bzip2: unbound variable
hint: Did you forget a `use-modules' form?

error: libusb: unbound variable
hint: Did you forget a `use-modules' form?

error: make-lld-wrapper: unbound variable
hint: Did you forget `(use-modules (gnu packages llvm))' or `#:use-module (gnu
packages llvm)'?

error: tcc: unbound variable
hint: Did you forget a `use-modules' form?

error: cross-gcc-toolchain: unbound variable
hint: Did you forget `(use-modules (gnu packages cross-base))' or `#:use-module
(gnu packages cross-base)'?

error: gnu-make: unbound variable
hint: Did you forget a `use-modules' form?

error: tar: unbound variable
hint: Did you forget a `use-modules' form?

error: gcc-toolchain: unbound variable
hint: Did you forget a `use-modules' form?

error: xdgpp: unbound variable
hint: Did you forget a `use-modules' form?

error: cross-binutils: unbound variable
hint: Did you forget `(use-modules (gnu packages cross-base))' or `#:use-module
(gnu packages cross-base)'?

Throw to key `unbound-variable' with args `("resolve-interface" "no binding `~A' in module ~A" (shared-mime-info (gnu packages freedesktop)) #f)'.
Backtrace:
In ice-9/boot-9.scm:
  1784:12 17 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In unknown file:
          16 (apply-smob/0 #<thunk 7fe7a0a782e0>)
In ice-9/boot-9.scm:
    733:2 15 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
    619:8 14 (_ #(#(#<directory (guile-user) 7fe7a0a7cc80>)))
In guix/ui.scm:
   2402:7 13 (run-guix . _)
  2365:10 12 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1784:12 11 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/scripts/package.scm:
   190:18 10 (_)
In gnu/packages.scm:
   244:33  9 (fold-packages #<procedure 7fe79d4fde80 at guix/scripts/package.scm:190:32 (package result)> () _ #:select? #<undefined>)
In guix/discovery.scm:
    142:2  8 (all-modules _ #:warn _)
In srfi/srfi-1.scm:
   576:18  7 (fold #<procedure 7fe79d4fdd80 at guix/discovery.scm:142:8 (spec result)> _ (("/home/daniel/home-seed/projects/guix" . "gnu/packages")))
In guix/discovery.scm:
   148:19  6 (_ _ ())
    115:5  5 (scheme-modules _ _ #:warn _)
In srfi/srfi-1.scm:
   807:23  4 (filter-map #<procedure 7fe79d4fdbe0 at guix/discovery.scm:115:16 (file)> _ . _)
In guix/discovery.scm:
   123:24  3 (_ . _)
In guix/ui.scm:
    365:2  2 (report-unbound-variable-error _ #:frame _)
In ice-9/boot-9.scm:
  1705:22  1 (raise-exception _ #:continuable? _)
In guix/ui.scm:
   921:18  0 (_ _)

guix/ui.scm:921:18: Throw to key `match-error' with args `("match" "no matching pattern" (unbound-variable "resolve-interface" "no binding `~A' in module ~A" (shared-mime-info (gnu packages freedesktop)) #f))'.

Reply via email to