GNU bug report logs - #33792
[PATCH] gnu: Add flatpak.

Previous Next

Package: guix-patches;

Reported by: Rutger Helling <rhelling <at> mykolab.com>

Date: Tue, 18 Dec 2018 15:24:01 UTC

Severity: normal

Tags: patch

Done: Rutger Helling <rhelling <at> mykolab.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33792 in the body.
You can then email your comments to 33792 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#33792; Package guix-patches. (Tue, 18 Dec 2018 15:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rutger Helling <rhelling <at> mykolab.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 18 Dec 2018 15:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Rutger Helling <rhelling <at> mykolab.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add flatpak.
Date: Tue, 18 Dec 2018 16:12:49 +0100
[Message part 1 (text/plain, inline)]
Hey Guix,

this patch adds Flatpak.
[0001-gnu-Add-flatpak.patch (text/x-patch, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33792; Package guix-patches. (Tue, 18 Dec 2018 18:03:01 GMT) Full text and rfc822 format available.

Message #8 received at 33792 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Rutger Helling <rhelling <at> mykolab.com>
Cc: 33792 <at> debbugs.gnu.org
Subject: Re: [bug#33792] [PATCH] gnu: Add flatpak.
Date: Tue, 18 Dec 2018 19:01:53 +0100
[Message part 1 (text/plain, inline)]
Hi Rutger,

On Tue, 18 Dec 2018 16:12:49 +0100
Rutger Helling <rhelling <at> mykolab.com> wrote:

> this patch adds Flatpak.

Try

             (string-append "--with-xml-catalog="
                            (assoc-ref %build-inputs "docbook-xml")
                            "/xml/dtd/docbook/catalog.xml"))

and

         (add-before 'configure 'fix-docbook
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "configure"
               ;; The configure check is overzealous about making sure that
               ;; things are in place -- it uses the xmlcatalog tool to make
               ;; sure that docbook-xsl is available, but this tool can only
               ;; look in one catalog file, unlike the $XML_CATALOG_FILES
               ;; variable that Guix defines.  Fool the test by using the
               ;; docbook-xsl catalog explicitly and get on with life.
               (("\"\\$XML_CATALOG_FILE\" \
\"http://docbook.sourceforge.net/release/xsl/")
                (string-append (car (find-files (assoc-ref inputs "docbook-xsl")
                                                "^catalog.xml$"))
                               " \"http://docbook.sourceforge.net/release/xsl/")))
             #t))

Also, try patching the tests like this:

         (add-after 'unpack 'patch-/var/tmp
           (lambda _
             (substitute* '("tests/libtest.sh"
                            "tests/test-run.sh"
                            "tests/testlibrary.c"
                            "buildutil/tap-test"
                            ; ./common/flatpak-dir.c
                            ; ./common/flatpak-run.c
                            )
               (("/var/tmp") "/tmp"))
             (substitute* "tests/libtest.sh"
              (("/usr/bin/") "")
              (("/bin/") ""))
             #t))

Also, in an earlier iteration I needed the following, but if it works without, then fine!

         (add-before 'check 'set-environment-up
           (lambda _
             ;(mkdir-p "/tmp/b")
             (setenv "HOME" "/tmp")
             ;; Note: needs xattr support.
             (setenv "TMPDIR" "/tmp")
             ;;; TODO /dev/fuse
             (mkdir-p "/tmp/ldconfig.d")
             (call-with-output-file "/tmp/ldconfig.d/ldconfig"
               (lambda (port)
                 (display "#!/bin/sh\nexit 0\n" port)))
             (chmod "/tmp/ldconfig.d/ldconfig" #o755)
             (setenv "PATH" (string-append "/tmp/ldconfig.d:" (getenv "PATH")))
             #t)))))

Additional inputs may be needed.  I had those:

    (inputs
     `(("appstream-glib" ,appstream-glib)
       ("attr" ,attr)
       ("fuse" ,fuse)
       ("glib" ,glib)
       ("gpgme" ,gpgme)
       ("json-glib" ,json-glib)
       ("libarchive" ,libarchive)
       ("libcap" ,libcap)
       ("libseccomp" ,libseccomp)
       ("libsoup" ,libsoup)
       ("libxml2" ,libxml2)
       ("libxau" ,libxau)
       ("nettle" ,nettle)
       ("libostree" ,libostree)
       ("polkit" ,polkit)))
    (native-inputs
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
       ("dbus" ,dbus) ; for the tests
       ("docbook-xml" ,docbook-xml-4.1.2)
       ("docbook-xsl" ,docbook-xsl)
       ("fuse" ,fuse) ; for the tests
       ("gettext-minimal" ,gettext-minimal)
       ;("git" ,git)
       ("glib" ,glib "bin")
       ("gnupg" ,gnupg)
       ("gobject-introspection" ,gobject-introspection)
       ("gtk-doc" ,gtk-doc)
       ("libtool" ,libtool)
       ("pkg-config" ,pkg-config)
       ("which" ,which)
       ("libglnx" ,(origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/GNOME/libglnx.git")
                   (commit "6f1ee5db1400b13a9a0fa0b2274ae34e8710c1aa")))
             (sha256
              (base32
               "137329m4lm3ssmxyyr1cin0xmlpsz4kfk26ydq6i4zf7qz81n64s"))))
       ("bubblewrap" ,(origin
        (method url-fetch)
        (uri (string-append "https://github.com/projectatomic/bubblewrap/archive/"
                            "v0.2.0.tar.gz"))

        (sha256
          (base32
            "17796rqhp5wn3q2lspgqbyk7nk1ixns9m2kgw82j2h2yfyi15mjh"))))
       ("xmltproc" ,libxslt)))
    (home-page "https://www.flatpak.org/")
    (synopsis "Flatpak")
    (description "Flatpak")
    (license license:lgpl2.1+)))

And I fiddled with libglnx:

           (lambda* (#:key inputs #:allow-other-keys)
             (use-modules (system repl debug))
             (set! terminal-width (lambda () 1000000))
             (delete-file-recursively "libglnx")
             (copy-recursively (assoc-ref inputs "libglnx") "libglnx")
             (delete-file-recursively "bsdiff")
             ;(symlink "bsdiff-4.3-endsley" "bsdiff")
             (copy-recursively (assoc-ref inputs "bsdiff") "bsdiff")
             (setenv "NOCONFIGURE" "1")
             (invoke "sh" "autogen.sh"))))))

If it works without, your version may be fine as is.  I just wanted to
share the parts I already had to try.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33792; Package guix-patches. (Tue, 18 Dec 2018 19:46:02 GMT) Full text and rfc822 format available.

Message #11 received at 33792 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 33792 <at> debbugs.gnu.org, Rutger Helling <rhelling <at> mykolab.com>
Subject: Re: [bug#33792] [PATCH] gnu: Add flatpak.
Date: Tue, 18 Dec 2018 20:45:35 +0100
Le Tue, 18 Dec 2018 19:01:53 +0100,
Danny Milosavljevic <dannym <at> scratchpost.org> a écrit :

> Hi Rutger,
> 
> On Tue, 18 Dec 2018 16:12:49 +0100
> Rutger Helling <rhelling <at> mykolab.com> wrote:
> 
> > this patch adds Flatpak.  
> 
> Try
> 
>              (string-append "--with-xml-catalog="
>                             (assoc-ref %build-inputs "docbook-xml")
>                             "/xml/dtd/docbook/catalog.xml"))
> 
> and
> 
>          (add-before 'configure 'fix-docbook
>            (lambda* (#:key inputs #:allow-other-keys)
>              (substitute* "configure"
>                ;; The configure check is overzealous about making
> sure that ;; things are in place -- it uses the xmlcatalog tool to
> make ;; sure that docbook-xsl is available, but this tool can only
>                ;; look in one catalog file, unlike the
> $XML_CATALOG_FILES ;; variable that Guix defines.  Fool the test by
> using the ;; docbook-xsl catalog explicitly and get on with life.
>                (("\"\\$XML_CATALOG_FILE\" \
> \"http://docbook.sourceforge.net/release/xsl/")
>                 (string-append (car (find-files (assoc-ref inputs
> "docbook-xsl") "^catalog.xml$"))
>                                "
> \"http://docbook.sourceforge.net/release/xsl/"))) #t))
> 
> Also, try patching the tests like this:
> 
>          (add-after 'unpack 'patch-/var/tmp
>            (lambda _
>              (substitute* '("tests/libtest.sh"
>                             "tests/test-run.sh"
>                             "tests/testlibrary.c"
>                             "buildutil/tap-test"
>                             ; ./common/flatpak-dir.c
>                             ; ./common/flatpak-run.c
>                             )
>                (("/var/tmp") "/tmp"))
>              (substitute* "tests/libtest.sh"
>               (("/usr/bin/") "")
>               (("/bin/") ""))
>              #t))
> 
> Also, in an earlier iteration I needed the following, but if it works
> without, then fine!
> 
>          (add-before 'check 'set-environment-up
>            (lambda _
>              ;(mkdir-p "/tmp/b")
>              (setenv "HOME" "/tmp")
>              ;; Note: needs xattr support.
>              (setenv "TMPDIR" "/tmp")
>              ;;; TODO /dev/fuse
>              (mkdir-p "/tmp/ldconfig.d")
>              (call-with-output-file "/tmp/ldconfig.d/ldconfig"
>                (lambda (port)
>                  (display "#!/bin/sh\nexit 0\n" port)))
>              (chmod "/tmp/ldconfig.d/ldconfig" #o755)
>              (setenv "PATH" (string-append "/tmp/ldconfig.d:" (getenv
> "PATH"))) #t)))))
> 
> Additional inputs may be needed.  I had those:
> 
>     (inputs
>      `(("appstream-glib" ,appstream-glib)
>        ("attr" ,attr)
>        ("fuse" ,fuse)
>        ("glib" ,glib)
>        ("gpgme" ,gpgme)
>        ("json-glib" ,json-glib)
>        ("libarchive" ,libarchive)
>        ("libcap" ,libcap)
>        ("libseccomp" ,libseccomp)
>        ("libsoup" ,libsoup)
>        ("libxml2" ,libxml2)
>        ("libxau" ,libxau)
>        ("nettle" ,nettle)
>        ("libostree" ,libostree)
>        ("polkit" ,polkit)))
>     (native-inputs
>      `(("autoconf" ,autoconf)
>        ("automake" ,automake)
>        ("dbus" ,dbus) ; for the tests
>        ("docbook-xml" ,docbook-xml-4.1.2)
>        ("docbook-xsl" ,docbook-xsl)
>        ("fuse" ,fuse) ; for the tests
>        ("gettext-minimal" ,gettext-minimal)
>        ;("git" ,git)
>        ("glib" ,glib "bin")
>        ("gnupg" ,gnupg)
>        ("gobject-introspection" ,gobject-introspection)
>        ("gtk-doc" ,gtk-doc)
>        ("libtool" ,libtool)
>        ("pkg-config" ,pkg-config)
>        ("which" ,which)
>        ("libglnx" ,(origin
>              (method git-fetch)
>              (uri (git-reference
>                    (url "https://github.com/GNOME/libglnx.git")
>                    (commit
> "6f1ee5db1400b13a9a0fa0b2274ae34e8710c1aa"))) (sha256
>               (base32
>                "137329m4lm3ssmxyyr1cin0xmlpsz4kfk26ydq6i4zf7qz81n64s"))))
>        ("bubblewrap" ,(origin
>         (method url-fetch)
>         (uri (string-append
> "https://github.com/projectatomic/bubblewrap/archive/"
> "v0.2.0.tar.gz"))
> 
>         (sha256
>           (base32
>             "17796rqhp5wn3q2lspgqbyk7nk1ixns9m2kgw82j2h2yfyi15mjh"))))

Just so you know, we already have a bubblewrap package. Maybe you can
use it instead of bundling the sources?

>        ("xmltproc" ,libxslt)))
>     (home-page "https://www.flatpak.org/")
>     (synopsis "Flatpak")
>     (description "Flatpak")
>     (license license:lgpl2.1+)))
> 
> And I fiddled with libglnx:
> 
>            (lambda* (#:key inputs #:allow-other-keys)
>              (use-modules (system repl debug))
>              (set! terminal-width (lambda () 1000000))
>              (delete-file-recursively "libglnx")
>              (copy-recursively (assoc-ref inputs "libglnx") "libglnx")
>              (delete-file-recursively "bsdiff")
>              ;(symlink "bsdiff-4.3-endsley" "bsdiff")
>              (copy-recursively (assoc-ref inputs "bsdiff") "bsdiff")
>              (setenv "NOCONFIGURE" "1")
>              (invoke "sh" "autogen.sh"))))))
> 
> If it works without, your version may be fine as is.  I just wanted to
> share the parts I already had to try.





Information forwarded to guix-patches <at> gnu.org:
bug#33792; Package guix-patches. (Wed, 19 Dec 2018 08:47:01 GMT) Full text and rfc822 format available.

Message #14 received at 33792 <at> debbugs.gnu.org (full text, mbox):

From: Rutger Helling <rhelling <at> mykolab.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>, 33792 <at> debbugs.gnu.org
Subject: Re: [bug#33792] [PATCH] gnu: Add flatpak.
Date: Wed, 19 Dec 2018 09:46:28 +0100
[Message part 1 (text/plain, inline)]
@Julien
The patch already uses the system bubblewrap, see the
--with-system-bubblewrap argument.

@Danny
Thanks for sharing your work! Unfortunately it fixed neither the
documentation nor the tests for me. I think the source might have
changed too much. The "--with-xml-catalog" argument no longer exists
and the tests still error on trying to copy something.

I don't think the rest is necessary. I got both GIMP and Firefox 
nightly working. Make sure you use the --user parameter though, or
you'll need root.

For the record, this is how I got Firefox running:
$ flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo 
$ flatpak install --user --from https://firefox-flatpak.mojefedora.cz/org.mozilla.FirefoxNightly.flatpakref
$ flatpak run org.mozilla.FirefoxNightly/x86_64/master

OK to push?

On Tue, 18 Dec 2018 20:45:35 +0100
Julien Lepiller <julien <at> lepiller.eu> wrote:

> Le Tue, 18 Dec 2018 19:01:53 +0100,
> Danny Milosavljevic <dannym <at> scratchpost.org> a écrit :
> 
> > Hi Rutger,
> > 
> > On Tue, 18 Dec 2018 16:12:49 +0100
> > Rutger Helling <rhelling <at> mykolab.com> wrote:
> >   
> > > this patch adds Flatpak.    
> > 
> > Try
> > 
> >              (string-append "--with-xml-catalog="
> >                             (assoc-ref %build-inputs "docbook-xml")
> >                             "/xml/dtd/docbook/catalog.xml"))
> > 
> > and
> > 
> >          (add-before 'configure 'fix-docbook
> >            (lambda* (#:key inputs #:allow-other-keys)
> >              (substitute* "configure"
> >                ;; The configure check is overzealous about making
> > sure that ;; things are in place -- it uses the xmlcatalog tool to
> > make ;; sure that docbook-xsl is available, but this tool can only
> >                ;; look in one catalog file, unlike the
> > $XML_CATALOG_FILES ;; variable that Guix defines.  Fool the test by
> > using the ;; docbook-xsl catalog explicitly and get on with life.
> >                (("\"\\$XML_CATALOG_FILE\" \
> > \"http://docbook.sourceforge.net/release/xsl/")
> >                 (string-append (car (find-files (assoc-ref inputs
> > "docbook-xsl") "^catalog.xml$"))
> >                                "
> > \"http://docbook.sourceforge.net/release/xsl/"))) #t))
> > 
> > Also, try patching the tests like this:
> > 
> >          (add-after 'unpack 'patch-/var/tmp
> >            (lambda _
> >              (substitute* '("tests/libtest.sh"
> >                             "tests/test-run.sh"
> >                             "tests/testlibrary.c"
> >                             "buildutil/tap-test"
> >                             ; ./common/flatpak-dir.c
> >                             ; ./common/flatpak-run.c
> >                             )
> >                (("/var/tmp") "/tmp"))
> >              (substitute* "tests/libtest.sh"
> >               (("/usr/bin/") "")
> >               (("/bin/") ""))
> >              #t))
> > 
> > Also, in an earlier iteration I needed the following, but if it
> > works without, then fine!
> > 
> >          (add-before 'check 'set-environment-up
> >            (lambda _
> >              ;(mkdir-p "/tmp/b")
> >              (setenv "HOME" "/tmp")
> >              ;; Note: needs xattr support.
> >              (setenv "TMPDIR" "/tmp")
> >              ;;; TODO /dev/fuse
> >              (mkdir-p "/tmp/ldconfig.d")
> >              (call-with-output-file "/tmp/ldconfig.d/ldconfig"
> >                (lambda (port)
> >                  (display "#!/bin/sh\nexit 0\n" port)))
> >              (chmod "/tmp/ldconfig.d/ldconfig" #o755)
> >              (setenv "PATH" (string-append
> > "/tmp/ldconfig.d:" (getenv "PATH"))) #t)))))
> > 
> > Additional inputs may be needed.  I had those:
> > 
> >     (inputs
> >      `(("appstream-glib" ,appstream-glib)
> >        ("attr" ,attr)
> >        ("fuse" ,fuse)
> >        ("glib" ,glib)
> >        ("gpgme" ,gpgme)
> >        ("json-glib" ,json-glib)
> >        ("libarchive" ,libarchive)
> >        ("libcap" ,libcap)
> >        ("libseccomp" ,libseccomp)
> >        ("libsoup" ,libsoup)
> >        ("libxml2" ,libxml2)
> >        ("libxau" ,libxau)
> >        ("nettle" ,nettle)
> >        ("libostree" ,libostree)
> >        ("polkit" ,polkit)))
> >     (native-inputs
> >      `(("autoconf" ,autoconf)
> >        ("automake" ,automake)
> >        ("dbus" ,dbus) ; for the tests
> >        ("docbook-xml" ,docbook-xml-4.1.2)
> >        ("docbook-xsl" ,docbook-xsl)
> >        ("fuse" ,fuse) ; for the tests
> >        ("gettext-minimal" ,gettext-minimal)
> >        ;("git" ,git)
> >        ("glib" ,glib "bin")
> >        ("gnupg" ,gnupg)
> >        ("gobject-introspection" ,gobject-introspection)
> >        ("gtk-doc" ,gtk-doc)
> >        ("libtool" ,libtool)
> >        ("pkg-config" ,pkg-config)
> >        ("which" ,which)
> >        ("libglnx" ,(origin
> >              (method git-fetch)
> >              (uri (git-reference
> >                    (url "https://github.com/GNOME/libglnx.git")
> >                    (commit
> > "6f1ee5db1400b13a9a0fa0b2274ae34e8710c1aa"))) (sha256
> >               (base32
> >                "137329m4lm3ssmxyyr1cin0xmlpsz4kfk26ydq6i4zf7qz81n64s"))))
> >        ("bubblewrap" ,(origin
> >         (method url-fetch)
> >         (uri (string-append
> > "https://github.com/projectatomic/bubblewrap/archive/"
> > "v0.2.0.tar.gz"))
> > 
> >         (sha256
> >           (base32
> >             "17796rqhp5wn3q2lspgqbyk7nk1ixns9m2kgw82j2h2yfyi15mjh"))))  
> 
> Just so you know, we already have a bubblewrap package. Maybe you can
> use it instead of bundling the sources?
> 
> >        ("xmltproc" ,libxslt)))
> >     (home-page "https://www.flatpak.org/")
> >     (synopsis "Flatpak")
> >     (description "Flatpak")
> >     (license license:lgpl2.1+)))
> > 
> > And I fiddled with libglnx:
> > 
> >            (lambda* (#:key inputs #:allow-other-keys)
> >              (use-modules (system repl debug))
> >              (set! terminal-width (lambda () 1000000))
> >              (delete-file-recursively "libglnx")
> >              (copy-recursively (assoc-ref inputs "libglnx")
> > "libglnx") (delete-file-recursively "bsdiff")
> >              ;(symlink "bsdiff-4.3-endsley" "bsdiff")
> >              (copy-recursively (assoc-ref inputs "bsdiff") "bsdiff")
> >              (setenv "NOCONFIGURE" "1")
> >              (invoke "sh" "autogen.sh"))))))
> > 
> > If it works without, your version may be fine as is.  I just wanted
> > to share the parts I already had to try.  
> 

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33792; Package guix-patches. (Wed, 19 Dec 2018 23:39:02 GMT) Full text and rfc822 format available.

Message #17 received at 33792 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Rutger Helling <rhelling <at> mykolab.com>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 33792 <at> debbugs.gnu.org
Subject: Re: [bug#33792] [PATCH] gnu: Add flatpak.
Date: Thu, 20 Dec 2018 00:38:51 +0100
[Message part 1 (text/plain, inline)]
>OK to push?

Yeah, fine by me!
[Message part 2 (application/pgp-signature, inline)]

Reply sent to Rutger Helling <rhelling <at> mykolab.com>:
You have taken responsibility. (Thu, 20 Dec 2018 07:38:01 GMT) Full text and rfc822 format available.

Notification sent to Rutger Helling <rhelling <at> mykolab.com>:
bug acknowledged by developer. (Thu, 20 Dec 2018 07:38:02 GMT) Full text and rfc822 format available.

Message #22 received at 33792-done <at> debbugs.gnu.org (full text, mbox):

From: Rutger Helling <rhelling <at> mykolab.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 33792-done <at> debbugs.gnu.org
Subject: Re: [bug#33792] [PATCH] gnu: Add flatpak.
Date: Thu, 20 Dec 2018 08:37:34 +0100
[Message part 1 (text/plain, inline)]
Corrected the license to lgpl2.1+ instead of lgpl2.1 and pushed as
36e1ab842d5e0c221d15385bc7c535ee81b03ff8, thanks!

On Thu, 20 Dec 2018 00:38:51 +0100
Danny Milosavljevic <dannym <at> scratchpost.org> wrote:

> >OK to push?  
> 
> Yeah, fine by me!

[Message part 2 (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 17 Jan 2019 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 211 days ago.

Previous Next


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