gnu: sequoia: Fix pkgconfig files.
authorHartmut Goebel <h.goebel@crazy-compilers.com>
Sun, 10 May 2020 22:00:47 +0000 (00:00 +0200)
committerHartmut Goebel <h.goebel@crazy-compilers.com>
Mon, 11 May 2020 10:05:38 +0000 (12:05 +0200)
The pkgconfig files defines the wrong prefix: It is the build directory, while
it should be the installation prefix. This is caused by Makefiles replacing
`PREFIX` by `$(shell pwd)`.

See <https://gitlab.com/sequoia-pgp/sequoia/-/issues/502> for details.

* gnu/packages/sequoia.scm (sequoia)[fix-pkgconfig-file-substitutes]: New
  phase.

gnu/packages/sequoia.scm

index 1c21c9c..91c1dcd 100644 (file)
                  (("\\ssetup.py\\s+install\\s")
                   " setup.py install --root=/ --single-version-externally-managed "))
                #t)))
+         (add-after 'unpack 'fix-pkgconfig-file-substitutes
+           ;; preempt Makefiles replacing PREFIX by pwd
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "ffi/sequoia.pc.in"
+                 (("PREFIX") out))
+               (substitute* "openpgp-ffi/sequoia-openpgp.pc.in"
+                 (("PREFIX") out))
+               #t)))
          (add-after 'unpack 'set-missing-env-vars
            (lambda* (#:key inputs #:allow-other-keys)
              ;; FIXME: why do we need to set this here?