[bug#34000] gnu: Separate youtube-viewer-cli from youtube-viewer

Message ID 35d89c27bb458aff9b13339b765f2d3f@riseup.net
State Accepted
Headers show
Series [bug#34000] gnu: Separate youtube-viewer-cli from youtube-viewer | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

swedebugia Jan. 6, 2019, 9:43 p.m. UTC
On 2019-01-06 21:29, swedebugia@riseup.net wrote:
> 

This is updated to fix a parens error.

Patch

From f9003e6c285e7b1c64ead7c6d876ba95d00dd1c2 Mon Sep 17 00:00:00 2001
From: swedebugia <swedebugia@riseup.net>
Date: Sun, 6 Jan 2019 22:23:29 +0100
Subject: [PATCH 2/2] gnu: youtube-viewer: Rename to youtube-viewer-gtk

* gnu/packages/video.scm (youtube-viewer):
  [name] Rename it.
  [arguments] Add phase to rename the binary.
---
 gnu/packages/video.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index c6bd9063c..128152371 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1466,9 +1466,9 @@  audio, images) from the Web.  It can use either mpv or vlc for playback.")
     (home-page "https://you-get.org/")
     (license license:expat)))
 
-(define-public youtube-viewer
+(define-public youtube-viewer-gtk
   (package
-    (name "youtube-viewer")
+    (name "youtube-viewer-gtk")
     (version "3.5.0")
     (source (origin
               (method git-fetch)
@@ -1509,6 +1509,14 @@  audio, images) from the Web.  It can use either mpv or vlc for playback.")
                (for-each (cut wrap-program <>
                               `("PERL5LIB" ":" prefix (,lib-path ,site-dir)))
                          (find-files bin-dir))
+               #t)))
+                  (add-after 'wrap-program 'rename
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                   (bin-dir (string-append out "/bin/")))
+               (chdir bin-dir)
+               (rename-file "gtk-youtube-viewer"
+                            "youtube-viewer-gtk")
                #t))))))
     (synopsis
      "Lightweight application for searching and streaming videos from YouTube")
-- 
2.19.2