Hi all,

I am trying to package pymediainfo, but the build fails in the test phase with

"OSError: libmediainfo.so.0: cannot open shared object file: No such file or directory"

When I skip the test phase, the build succeeds, but using pymediainfo in a python script gives the same error. Injecting the library path into the __init__.py does not help.

(define-public python-pymediainfo
  (package
    (name "python-pymediainfo")
    (version "4.1")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pymediainfo" version))
        (sha256
          (base32
            "0mhpxs7vlqx8w75z93dy7nnvx89kwfdjkla03l19an15rlyqyspd"))))
    (build-system python-build-system)
    (native-inputs
      `(("python-setuptools-scm" ,python-setuptools-scm)
         ("python-pytest" ,python-pytest)
         ("python-pytest-runner" ,python-pytest-runner)))
    (inputs
      `(("libmediainfo" ,libmediainfo)))
    (propagated-inputs
      `(("python-setuptools" ,python-setuptools)))
;    (arguments
     ;; FIXME: OSError: libmediainfo.so.0: cannot open shared object file: No such file or directory
;     '(#:tests? #f))
    (arguments
     `(#:phases (modify-phases %standard-phases
         (add-after 'unpack 'patch-libmediainfo
           (lambda _
             (substitute* "pymediainfo/__init__.py"
               (("libmediainfo.so.0") (string-append (assoc-ref %build-inputs "libmediainfo") "/lib/libmedia.so.0"))))))))
    (home-page
      "https://github.com/sbraz/pymediainfo")
    (synopsis
      "Python wrapper for the mediainfo library")
    (description
      "Python wrapper for the mediainfo library to access the most relevant technical and tag data for video and audio files.")
    (license license:expat)))


Best regards,

Sebastian