From 5b04230e30fd594ebab43c50e84f989503dc3535 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sat, 12 Dec 2015 11:20:44 +0800 Subject: [PATCH] gnu: youtube-dl: Add native-search-paths. * gnu/packages/video.scm (youtube-dl): Add native-search-paths. [native-search-paths]: Add fish_complete_path and MANPATH. --- gnu/packages/video.scm | 73 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 18 deletions(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 76374e2..e30c1ce 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -24,6 +24,7 @@ (define-module (gnu packages video) #:use-module (ice-9 match) + #:use-module (srfi srfi-26) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix utils) #:use-module (guix packages) @@ -808,25 +809,61 @@ projects while introducing many more.") (home-page "http://www.webmproject.org/"))) (define-public youtube-dl - (package - (name "youtube-dl") - (version "2015.12.09") - (source (origin - (method url-fetch) - (uri (string-append "http://youtube-dl.org/downloads/" - version "/youtube-dl-" - version ".tar.gz")) - (sha256 - (base32 - "11rzb30ik4all43r7bnsnm35mvs37y7xj3g9r7ig9jr7qlbhllwk")))) - (build-system python-build-system) - (native-inputs `(("python-setuptools" ,python-setuptools))) - (home-page "http://youtube-dl.org") - (synopsis "Download videos from YouTube.com and other sites") - (description - "Youtube-dl is a small command-line program to download videos from + (let* ((python-version "3.4") + (yt-dl-year "2015") + (yt-dl-month "12") + (yt-dl-day "09") + (make-version-string (lambda (string-list) + (string-join string-list "."))) + (make-zero-trimmed-version-string (lambda (string-list) + (make-version-string + (map (cut string-trim <> #\0) + string-list)))) + (with-base-dir (lambda (relative-path) + (string-append "lib/python" + python-version + "/site-packages/youtube_dl-" + (make-zero-trimmed-version-string + (list yt-dl-year + yt-dl-month + yt-dl-day)) + "-py" + python-version + ".egg/" + relative-path)))) + (package + (name "youtube-dl") + (version + (make-version-string (list yt-dl-year + yt-dl-month + yt-dl-day))) + (source (origin + (method url-fetch) + (uri (string-append "http://youtube-dl.org/downloads/" + version "/youtube-dl-" + version ".tar.gz")) + (sha256 + (base32 + "11rzb30ik4all43r7bnsnm35mvs37y7xj3g9r7ig9jr7qlbhllwk")))) + (build-system python-build-system) + (native-inputs `(("python-setuptools" ,python-setuptools))) + (native-search-paths + (list (search-path-specification + (variable "fish_complete_path") + (files `(,(with-base-dir "etc/fish/completions")))) + ;; TODO: fix bash completion + ;;(search-path-specification + ;; (variable "BASH_COMPLETION") ;we need to fix it + ;; (files `(,(with-base-dir "etc/bash_completion.d")))) + (search-path-specification + (variable "MANPATH") + (files `(,(with-base-dir "share/man")))))) + (home-page "http://youtube-dl.org") + (synopsis "Download videos from YouTube.com and other sites") + (description + "Youtube-dl is a small command-line program to download videos from YouTube.com and a few more sites.") - (license license:public-domain))) + (license license:public-domain)))) (define-public libbluray (package -- 2.6.3