unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#39292] [PATCH 10/10] gnu: Add rapid-photo-downloader
       [not found] <87sgjtgtju.fsf@cbaines.net>
@ 2020-02-23 10:40 ` Sebastian Schott
  2020-02-23 16:55   ` Christopher Baines
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Schott @ 2020-02-23 10:40 UTC (permalink / raw)
  To: 39292@debbugs.gnu.org; +Cc: Christopher Baines

Hi Chris,

you are right, some libraries I added in native-inputs of rapid-photo-downloader cause trouble, e.g., I got "ValueError: Namespace Notify not available", when I try to start the program. This is a bit confusing, because before committing, I successfully tested this, but maybe I manually installed these libraries and therefore had no "clean" testing environment.

Now, I experimented a bit with native-inputs, inputs and propagated-inputs and managed to start the program, when I install it with the code at the end of this mail (./pre-inst-env guix install rapid-photo-downloader). When I just build the program and cd into the store folder to run it, I still got the "notify error" (./pre-inst-env guix build rapid-photo-downloader --> cd /gnu/store/.../bin --> ./rapid-photo-downloader). This makes sense, because without installing the program, also the propagated-inputs are not installed.

What is the recommended way to test a program without interfering with the current user profile, but still considering propagated-inputs?

You mentioned inputs are used for libraries required at runtime. Now I wonder, why I need to put libnotify, libgudev, usdisks and gexiv2 into the propagated-inputs to avoid errors like "ValueError: Namespace Notify not available"?


Best,

Sebastian


(define-public rapid-photo-downloader
  (package
    (name "rapid-photo-downloader")
    (version "0.9.18")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://launchpad.net/rapid/pyqt/"
                                  version "/+download/" name "-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "15p7sssg6vmqbm5xnc4j5dr89d7gl7y5qyq44a240yl5aqkjnybw"))))
    (build-system python-build-system)
    (native-inputs
     `(("file" ,file)
       ("intltool" ,intltool)
       ))
    (inputs
     `(("gdk-pixbuf" ,gdk-pixbuf)
;       ("gexiv2" ,gexiv2)
       ("gobject-introspection" ,gobject-introspection) ;
       ("gst-libav" ,gst-libav)
       ("gst-plugins-base" ,gst-plugins-base)
       ("gst-plugins-good" ,gst-plugins-good)
       ("gstreamer" ,gstreamer)
;       ("libgudev" ,libgudev)
;       ("libnotify" ,libnotify)
       ("libmediainfo" ,libmediainfo)
;       ("usdisks" ,udisks)
       ))
    (propagated-inputs
     `(("python-pyqt" ,python-pyqt)
       ("python-pygobject" ,python-pygobject)
       ("python-gphoto2" ,python-gphoto2)
       ("python-pyzmq" ,python-pyzmq)
       ("python-tornado" ,python-tornado)
       ("python-psutil" ,python-psutil)
       ("python-pyxdg" ,python-pyxdg)
       ("python-arrow" ,python-arrow)
       ("python-dateutil" ,python-dateutil)
       ("python-easygui" ,python-easygui)
       ("python-colour" ,python-colour)
       ("python-pymediainfo" ,python-pymediainfo)
       ("python-sortedcontainers" ,python-sortedcontainers)
       ("python-rawkit" ,python-rawkit)
       ("python-requests" ,python-requests)
       ("python-colorlog" ,python-colorlog)
       ("python-pyprind" ,python-pyprind)
       ("python-tenacity" ,python-tenacity)
       ("perl-image-exiftool" ,perl-image-exiftool)
       ("libnotify" ,libnotify)
       ("libgudev" ,libgudev)	
       ("usdisks" ,udisks)
       ("gexiv2" ,gexiv2)
       ))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-libmediainfo
           (lambda _
             (substitute* "raphodo/metadatavideo.py"
               (("pymedia_library_file = 'libmediainfo.so.0'")
                (string-append "pymedia_library_file = '"
                               (assoc-ref %build-inputs "libmediainfo")
                               "/lib/libmediainfo.so.0'")))
             #t))
         )))
    (home-page "https://www.damonlynch.net/rapid/")
    (synopsis "Import photos and videos from cameras, phones and memory cards")
    (description "Import photos and videos from cameras, phones and memory
cards and generate meaningful file and folder names.")
    (license license:gpl2+)))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#39292] [PATCH 10/10] gnu: Add rapid-photo-downloader
  2020-02-23 10:40 ` [bug#39292] [PATCH 10/10] gnu: Add rapid-photo-downloader Sebastian Schott
@ 2020-02-23 16:55   ` Christopher Baines
  2020-03-07 15:09     ` Sebastian Schott
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Baines @ 2020-02-23 16:55 UTC (permalink / raw)
  To: Sebastian Schott; +Cc: 39292@debbugs.gnu.org

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


Sebastian Schott <s.schott@mailbox.org> writes:

> Hi Chris,
>
> you are right, some libraries I added in native-inputs of
> rapid-photo-downloader cause trouble, e.g., I got "ValueError:
> Namespace Notify not available", when I try to start the program. This
> is a bit confusing, because before committing, I successfully tested
> this, but maybe I manually installed these libraries and therefore had
> no "clean" testing environment.
>
> Now, I experimented a bit with native-inputs, inputs and
> propagated-inputs and managed to start the program, when I install it
> with the code at the end of this mail (./pre-inst-env guix install
> rapid-photo-downloader). When I just build the program and cd into the
> store folder to run it, I still got the "notify error" (./pre-inst-env
> guix build rapid-photo-downloader --> cd /gnu/store/.../bin -->
> ./rapid-photo-downloader). This makes sense, because without
> installing the program, also the propagated-inputs are not installed.
>
> What is the recommended way to test a program without interfering with
> the current user profile, but still considering propagated-inputs?

Probably using guix environment --ad-hoc, although to set up the right
search paths, you'll need to also include some other packages in the
environment.

Propagated inputs with search paths are great for things like plugins,
and programming language libraries, but for improved reliability and
compatibility, they should be avoided for applications like Rapid Photo
Downloader.

> You mentioned inputs are used for libraries required at runtime. Now I
> wonder, why I need to put libnotify, libgudev, usdisks and gexiv2 into
> the propagated-inputs to avoid errors like "ValueError: Namespace
> Notify not available"?

Probably because of a search path like GI_TYPELIB_PATH. I've taken an
earlier version of your patch, and tweaked it [1] so that I can start
the application directly from the store (running [2]).

1: https://git.cbaines.net/guix/commit/?h=series-2725-tweaked&id=85613884ac9c4122460923aaf1e28ef13aab49df
2: /gnu/store/6ssz223fy59cpz3582jd3xqva49m9w8n-rapid-photo-downloader-0.9.18/bin/rapid-photo-downloader

If you take a look at that file [2], you'll see it's a bash script,
which sets a number of environment variables. This comes from the
wrap-program call in the patch [1].

Now using wrap-program is not an ideal technique, but what I think this
approach does provide is that it reduces the chance of other things in
your profile breaking rapid-photo-downloader, and it also means that you
can install another application that also uses a common dependency, but
has a different version of it, or a patched version, without running in
to difficulties combining both packages in to one profile.

Does that make sense?

Thanks,

Chris

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#39292] [PATCH 10/10] gnu: Add rapid-photo-downloader
  2020-02-23 16:55   ` Christopher Baines
@ 2020-03-07 15:09     ` Sebastian Schott
  2020-03-15 16:59       ` bug#39292: " Christopher Baines
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Schott @ 2020-03-07 15:09 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 39292@debbugs.gnu.org

Hi Chris,

thank you for the "guix environment --ad-hoc" hint and for implementing the wrapping technique. I revised all commits regarding to your suggestions and will upload the new patches soon.


Best,

Sebastian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#39292: [PATCH 10/10] gnu: Add rapid-photo-downloader
  2020-03-07 15:09     ` Sebastian Schott
@ 2020-03-15 16:59       ` Christopher Baines
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Baines @ 2020-03-15 16:59 UTC (permalink / raw)
  To: Sebastian Schott; +Cc: 39292-done

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


Sebastian Schott <s.schott@mailbox.org> writes:

> Hi Chris,
>
> thank you for the "guix environment --ad-hoc" hint and for
> implementing the wrapping technique. I revised all commits regarding
> to your suggestions and will upload the new patches soon.

Thanks Sebastian, I've finally got around to looking at the updated
patches, and they're pretty much perfect. I've pushed them to the master
branch as 39af91db7943700b723c96ce1fc100f110aa88d1.

Thanks for your work and persistence!

Chris

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-15 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87sgjtgtju.fsf@cbaines.net>
2020-02-23 10:40 ` [bug#39292] [PATCH 10/10] gnu: Add rapid-photo-downloader Sebastian Schott
2020-02-23 16:55   ` Christopher Baines
2020-03-07 15:09     ` Sebastian Schott
2020-03-15 16:59       ` bug#39292: " Christopher Baines

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).