GNU bug report logs - #62424
[PATCH] gnu: Add lazarus.

Previous Next

Package: guix-patches;

Reported by: dannym <at> scratchpost.org

Date: Fri, 24 Mar 2023 19:49:02 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "(" <paren <at> disroot.org>
To: <dannym <at> scratchpost.org>, <62424 <at> debbugs.gnu.org>
Subject: [bug#62424] [PATCH] gnu: Add lazarus.
Date: Wed, 29 Mar 2023 20:26:00 +0100
[Message part 1 (text/plain, inline)]
Heya,

Adding on to what Maxim said:

On Thu Mar 23, 2023 at 10:16 AM GMT,  wrote:
> +    (arguments
> +     `(#:tests? #f ; No tests exist
> +       #:phases
> +       (modify-phases %standard-phases
> +        (delete 'configure)
> +        (replace 'build
> +          (lambda* (#:key inputs outputs #:allow-other-keys)
> +            ;; RUNPATH -k-rpath=
> +            ;; -Xr<x> rlink-path
> +            (let* ((libdirs
> +                    (map (lambda (x)
> +                           (assoc-ref inputs x))
> +                         '("glib" "gdk-pixbuf" "gtk+" "libx11"
> +                           "libx11" "pango" "cairo" "atk")))
> +                   (libs (append
> +                          (map (lambda (name)
> +                                 (string-append "-Fl" name "/lib"))
> +                               libdirs)
> +                          (map (lambda (name)
> +                                 (string-append "-k-rpath=" name "/lib"))
> +                               libdirs))))
> +              (setenv "LAZARUS_LIBPATHS"
> +                      (string-append ;"-XD "
> +                                     (string-join libs " ")))
> +              (setenv "MAKEFLAGS"
> +                      (string-append "LHELP_OPT="
> +                                     (string-join libs "\\ "))))
> +            (setenv "INSTALL_PREFIX" (assoc-ref outputs "out"))
> +            (invoke "make" "bigide"))))))

Please make sure you use the new-ish LIST/GEXP style for ARGUMENTS; also, much
of your modified BUILD phase could be replaced by modifying #:MAKE-FLAGS, and
LIBS could be generated in a much simpler way with FOLD from (SRFI SRFI-1):

---
> +    (arguments
> +     (list #:tests? #f ;no tests
> +           #:make-flags
> +           #~(begin
> +               (use-modules (srfi srfi-1))
> +               (let* ((lib-dirs
> +                       (list #$@(map this-package-input
> +                                     '("glib" "gdk-pixbuf" "gtk+"
> +                                       "libx11" "pango" "cairo" "atk"))))
> +                      (lib-flags
> +                       (fold (lambda (pkg flags)
> +                               (cons* (string-append "-Fl" pkg "/lib")
> +                                      (string-append "-k-rpath=" pkg "/lib")
> +                                      flags))
> +                             lib-dirs)))
> +                 (list (string-append "LAZARUS_LIBPATHS="
> +                                      (string-join lib-flags))
> +                       (string-append "LHELP_OPT="
> +                                      (string-join lib-flags "\\ "))
> +                       (string-append "INSTALL_PREFIX=" #$output))))
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (delete 'configure)
> +               (replace 'build
> +                 (lambda _
> +                   (invoke "make" "bigide"))))))
---

Note that I have not tested that this modification actually works, but I'd be
surprised if it didn't.

    -- (
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 2 years and 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.