unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre Neidhardt <mail@ambrevar.xyz>
To: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
Cc: 37850@debbugs.gnu.org, petermikkelsen10@gmail.com
Subject: bug#37850: Glib documentation is missing
Date: Fri, 15 Nov 2019 12:17:30 +0100	[thread overview]
Message-ID: <87tv752xth.fsf@ambrevar.xyz> (raw)
In-Reply-To: <20191112183458.fmlullhdc65bp2am@pelzflorian.localdomain>

[-- Attachment #1: Type: text/plain, Size: 7923 bytes --]

You are right, something is wrong with substitute-keyword-arguments.

If I copy-paste the arguments from glib, then add the stuff to build the
doc, everything is fine.

Peter, Ricardo, Marius, any clue what's going on?

Here follows a working definition for glib-with-documentation.
Obviously the copy-pasting of arguments is less than ideal.

--8<---------------cut here---------------start------------->8---
(define-public glib-with-documentation
  (package
    (inherit glib)
    (properties '((hidden? . #f)))
    (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference
    (native-inputs
     `(("gtk-doc" ,gtk-doc)             ; for the doc
       ("docbook-xml" ,docbook-xml)
       ,@(package-native-inputs glib)))
    (arguments
     `( ;; TODO: Uncomment on the next rebuild cycle.
       ;; #:disallowed-references (,tzdata-for-tests)

       #:configure-flags (list "-Dgtk_doc=true")
       #:phases
       (modify-phases %standard-phases
         (add-before 'build 'pre-build
           (lambda* (#:key inputs outputs #:allow-other-keys)
             ;; For tests/gdatetime.c.
             (setenv "TZDIR"
                     (string-append (assoc-ref inputs "tzdata")
                                    "/share/zoneinfo"))

             ;; Some tests want write access there.
             (setenv "HOME" (getcwd))
             (setenv "XDG_CACHE_HOME" (getcwd))
             #t))
         (add-after 'unpack 'disable-failing-tests
           (lambda _
             (let ((disable
                    (lambda (test-file test-paths)
                      (define pattern+procs
                        (map (lambda (test-path)
                               (cons
                                ;; XXX: only works for single line statements.
                                (format #f "g_test_add_func.*\"~a\".*" test-path)
                                (const "")))
                             test-paths))
                      (substitute test-file pattern+procs)))
                   (failing-tests
                    '(("glib/tests/thread.c"
                       ( ;; prlimit(2) returns ENOSYS on Linux 2.6.32-5-xen-amd64
                        ;; as found on hydra.gnu.org, and strace(1) doesn't
                        ;; recognize it.
                        "/thread/thread4"))

                      ;; This tries to find programs in FHS directories.
                      ("glib/tests/utils.c"
                       ("/utils/find-program"))

                      ;; This fails because "glib/tests/echo-script" cannot be
                      ;; found.
                      ("glib/tests/spawn-singlethread.c"
                       ("/gthread/spawn-script"))

                      ("glib/tests/timer.c"
                       ( ;; fails if compiler optimizations are enabled, which they
                        ;; are by default.
                        "/timer/stop"))

                      ("gio/tests/gapplication.c"
                       ( ;; XXX: proven to be unreliable.  See:
                        ;;  <https://bugs.debian.org/756273>
                        ;;  <http://bugs.gnu.org/18445>
                        "/gapplication/quit"

                        ;; XXX: fails randomly for unknown reason. See:
                        ;;  <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00215.html>
                        "/gapplication/local-actions"))

                      ("gio/tests/contenttype.c"
                       ( ;; XXX: requires shared-mime-info.
                        "/contenttype/guess"
                        "/contenttype/guess_svg_from_data"
                        "/contenttype/subtype"
                        "/contenttype/list"
                        "/contenttype/icon"
                        "/contenttype/symbolic-icon"
                        "/contenttype/tree"))

                      ("gio/tests/appinfo.c"
                       ( ;; XXX: requires update-desktop-database.
                        "/appinfo/associations"))

                      ("gio/tests/desktop-app-info.c"
                       ( ;; XXX: requires update-desktop-database.
                        "/desktop-app-info/delete"
                        "/desktop-app-info/default"
                        "/desktop-app-info/fallback"
                        "/desktop-app-info/lastused"
                        "/desktop-app-info/search"))

                      ("gio/tests/gdbus-peer.c"
                       ( ;; Requires /etc/machine-id.
                        "/gdbus/codegen-peer-to-peer"))

                      ("gio/tests/gdbus-unix-addresses.c"
                       ( ;; Requires /etc/machine-id.
                        "/gdbus/x11-autolaunch"))

                      ("gio/tests/gsocketclient-slow.c"
                       ( ;; These tests tries to resolve "localhost", and fails.
                        "/socket-client/happy-eyeballs/slow"
                        "/socket-client/happy-eyeballs/cancellation/delayed")))))
               (for-each (lambda (x) (apply disable x)) failing-tests)
               #t)))
         (replace 'check
           (lambda _
             (setenv "MESON_TESTTHREADS"
                     (number->string (parallel-job-count)))
             ;; Do not run tests marked as "flaky".
             (invoke "meson" "test" "--no-suite" "flaky")))
         ;; TODO: meson does not permit the bindir to be outside of prefix.
         ;; See https://github.com/mesonbuild/meson/issues/2561
         ;; We can remove this once meson is patched.
         (add-after 'install 'move-executables
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
                   (bin (assoc-ref outputs "bin")))
               (mkdir-p bin)
               (rename-file (string-append out "/bin")
                            (string-append bin "/bin"))
               ;; Do not refer to "bindir", which points to "${prefix}/bin".
               ;; We don't patch "bindir" to point to "$bin/bin", because that
               ;; would create a reference cycle between the "out" and "bin"
               ;; outputs.
               (substitute* (list (string-append out "/lib/pkgconfig/gio-2.0.pc")
                                  (string-append out "/lib/pkgconfig/glib-2.0.pc"))
                 (("bindir=\\$\\{prefix\\}/bin") "")
                 (("=\\$\\{bindir\\}/") "="))
               #t)))
         (add-after 'unpack 'make-local-docbook-xml
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((replace-http (lambda (file)
                                   (substitute* file
                                     ;; Warning: gio.xml uses docbook 4.2.
                                     (("http://www.oasis-open.org/docbook/xml/4../docbookx.dtd")
                                      (string-append (assoc-ref inputs "docbook-xml")
                                                     "/xml/dtd/docbook/docbookx.dtd")))) ))
               (replace-http "gio/gdbus-2.0/codegen/codegen_docbook.py")
               (for-each replace-http (find-files "." "\\.xml$"))
               #t)))
         (add-after 'install 'move-doc
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
                   (doc (assoc-ref outputs "doc"))
                   (html (string-append "/share/gtk-doc")))
               (copy-recursively (string-append out html)
                                 (string-append doc html))
               (delete-file-recursively (string-append out html))
               #t))))))))
--8<---------------cut here---------------end--------------->8---

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2019-11-15 11:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 10:45 bug#37850: Glib documentation is missing Pierre Neidhardt
2019-10-23 18:22 ` Marius Bakke
2019-10-23 18:38   ` Pierre Neidhardt
2019-10-25 21:23     ` Ludovic Courtès
2019-10-26  9:04       ` Pierre Neidhardt
2019-10-29 10:36         ` Pierre Neidhardt
2019-11-03 16:39           ` Pierre Neidhardt
2019-11-03 19:04             ` Marius Bakke
2019-11-04  9:46               ` Pierre Neidhardt
2019-11-09 23:20                 ` Marius Bakke
2019-11-11  9:29                   ` Pierre Neidhardt
2019-11-12 12:32                     ` pelzflorian (Florian Pelz)
2019-11-12 13:22                       ` pelzflorian (Florian Pelz)
2019-11-12 16:00                         ` Pierre Neidhardt
2019-11-12 18:34                           ` pelzflorian (Florian Pelz)
2019-11-15 11:17                             ` Pierre Neidhardt [this message]
2019-11-15 12:14                               ` pelzflorian (Florian Pelz)
2019-11-15 14:10                               ` Marius Bakke
2019-11-15 15:06                                 ` Pierre Neidhardt
2019-11-21 19:50                                   ` Marius Bakke
2019-11-27 12:37                                     ` Pierre Neidhardt
2019-11-09  2:03 ` Alexandros Theodotou
2019-11-09  2:10   ` Alexandros Theodotou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tv752xth.fsf@ambrevar.xyz \
    --to=mail@ambrevar.xyz \
    --cc=37850@debbugs.gnu.org \
    --cc=pelzflorian@pelzflorian.de \
    --cc=petermikkelsen10@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).