summary refs log tree commit diff
path: root/gnu/packages/video.scm
diff options
context:
space:
mode:
authorAlex Vong <alexvong1995@gmail.com>2015-12-14 20:20:55 +0800
committerLudovic Courtès <ludo@gnu.org>2015-12-15 13:45:20 +0100
commit2ad9515c50fbb44bfd829682078acfcf6d0d2d19 (patch)
treed743295143f6dd6eb6f4952342b76de68c0859b9 /gnu/packages/video.scm
parente0508b6bf7a378e774b42e212befc77d5fb3eb5e (diff)
downloadguix-2ad9515c50fbb44bfd829682078acfcf6d0d2d19.tar.gz
gnu: youtube-dl: Install man pages and completion files.
* gnu/packages/video.scm (youtube-dl) [arguments]: Add
fix-the-data-directories phase.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/video.scm')
-rw-r--r--gnu/packages/video.scm22
1 files changed, 22 insertions, 0 deletions
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 76374e2ac6..4f6ef6d7e5 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015 Alex Vong <alexvong1995@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -822,6 +823,27 @@ projects while introducing many more.")
     (build-system python-build-system)
     (native-inputs `(("python-setuptools" ,python-setuptools)))
     (home-page "http://youtube-dl.org")
+    (arguments
+     ;; The problem here is that the directory for the man page and completion
+     ;; files is relative, and for some reason, setup.py uses the
+     ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
+     ;; So, we need pass the prefix directly.  In addition, make sure the Bash
+     ;; completion file is called 'youtube-dl' rather than
+     ;; 'youtube-dl.bash-completion'.
+     `(#:phases (modify-phases %standard-phases
+                  (add-before 'install 'fix-the-data-directories
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((prefix (assoc-ref outputs "out")))
+                        (mkdir "bash-completion")
+                        (rename-file "youtube-dl.bash-completion"
+                                     "bash-completion/youtube-dl")
+                        (substitute* "setup.py"
+                          (("youtube-dl\\.bash-completion")
+                           "bash-completion/youtube-dl")
+                          (("'etc/")
+                           (string-append "'" prefix "/etc/"))
+                          (("'share/")
+                           (string-append "'" prefix "/share/")))))))))
     (synopsis "Download videos from YouTube.com and other sites")
     (description
      "Youtube-dl is a small command-line program to download videos from