Subject: [PATCH] gnu: youtube-viewer: Add '$out/lib/perl5/site_perl/' to search path.

From: Alex Vong <[email-masked]>
Date: Fri, 02 Mar 2018 21:59:07 +0800

Hello,

This patch should fix <https://bugs.gnu.org/30641>.

From 2ad112584b40754fadb8269b7d5880500abe0050 Mon Sep 17 00:00:00 2001
From: Alex Vong <[email-masked]>
Date: Fri, 2 Mar 2018 21:22:59 +0800
Subject: [PATCH] gnu: youtube-viewer: Add '$out/lib/perl5/site_perl/' to
 search path.

Fixes <https://bugs.gnu.org/30671>.
Reported by Ricardo Wurmus <[email-masked]>.

* gnu/packages/video.scm (youtube-viewer)[arguments]: In 'wrap-program'
phase, add '$out/lib/perl5/site_perl/' to search path.
---
 gnu/packages/video.scm | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 8190b0ffc..74dd290a3 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1344,16 +1344,18 @@ audio, images) from the Web.  It can use either mpv or vlc for playback.")
                   (guix build utils)
                   (srfi srfi-26))
        #:module-build-flags '("--gtk")
-       #:phases (modify-phases %standard-phases
-                  (add-after 'install 'wrap-program
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let ((bin-dir (string-append (assoc-ref outputs "out")
-                                                    "/bin/"))
-                            (perl-path (getenv "PERL5LIB")))
-                        (for-each (cut wrap-program <>
-                                       `("PERL5LIB" ":" prefix (,perl-path)))
-                                  (find-files bin-dir))
-                        #t))))))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-program
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-dir (string-append out "/bin/"))
+                    (site-dir (string-append out "/lib/perl5/site_perl/"))
+                    (lib-path (getenv "PERL5LIB")))
+               (for-each (cut wrap-program <>
+                              `("PERL5LIB" ":" prefix (,lib-path ,site-dir)))
+                         (find-files bin-dir))
+               #t))))))
     (synopsis
      "Lightweight application for searching and streaming videos from YouTube")
     (description
-- 
2.16.2

Cheers,
Alex