me
/
guix
Archived
1
0
Fork 0

gnu: youtube-dl: Avoid using pre-generated code.

* gnu/packages/video.scm (youtube-dl)[source]: Add 'snippet' to delete
pre-generated files.
[arguments]: Add 'build-generated-files' phase.
[native-inputs]: New field, to add 'zip'.
master
Mark H Weaver 2020-11-11 00:15:02 -05:00
parent aeb11754e0
commit 740c0f37f9
No known key found for this signature in database
GPG Key ID: 7CEF29847562C516
1 changed files with 26 additions and 3 deletions

View File

@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014, 2015, 2016 David Thompson <davet@gnu.org> ;;; Copyright © 2014, 2015, 2016 David Thompson <davet@gnu.org>
;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014, 2015, 2016, 2018, 2020 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca> ;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
@ -65,7 +65,7 @@
(define-module (gnu packages video) (define-module (gnu packages video)
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (srfi srfi-1) #:use-module ((srfi srfi-1) #:hide (zip))
#:use-module (srfi srfi-26) #:use-module (srfi srfi-26)
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix utils) #:use-module (guix utils)
@ -2203,7 +2203,18 @@ To load this plugin, specify the following option when starting mpv:
"youtube-dl-" version ".tar.gz")) "youtube-dl-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"0iv4l78ylzx8q6myv4v7xq6r5y0hacz6l30bqk1szncfikvfc3cf")))) "0iv4l78ylzx8q6myv4v7xq6r5y0hacz6l30bqk1szncfikvfc3cf"))
(snippet
'(begin
;; Delete the pre-generated files, except for the man page
;; which requires 'pandoc' to build.
(for-each delete-file '("youtube-dl"
;;pandoc is needed to generate
;;"youtube-dl.1"
"youtube-dl.bash-completion"
"youtube-dl.fish"
"youtube-dl.zsh"))
#t))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
;; The problem here is that the directory for the man page and completion ;; The problem here is that the directory for the man page and completion
@ -2224,6 +2235,16 @@ To load this plugin, specify the following option when starting mpv:
(("\\.get\\('ffmpeg_location'\\)" match) (("\\.get\\('ffmpeg_location'\\)" match)
(format #f "~a or '~a'" match (which "ffmpeg")))) (format #f "~a or '~a'" match (which "ffmpeg"))))
#t)) #t))
(add-before 'build 'build-generated-files
(lambda _
;; Avoid the make targets that require pandoc.
(invoke "make"
"PYTHON=python"
"youtube-dl"
;;"youtube-dl.1" ; needs pandoc
"youtube-dl.bash-completion"
"youtube-dl.zsh"
"youtube-dl.fish")))
(add-before 'install 'fix-the-data-directories (add-before 'install 'fix-the-data-directories
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((prefix (assoc-ref outputs "out"))) (let ((prefix (assoc-ref outputs "out")))
@ -2247,6 +2268,8 @@ To load this plugin, specify the following option when starting mpv:
(copy-file "youtube-dl.zsh" (copy-file "youtube-dl.zsh"
(string-append zsh "/_youtube-dl")) (string-append zsh "/_youtube-dl"))
#t)))))) #t))))))
(native-inputs
`(("zip" ,zip)))
(inputs (inputs
`(("ffmpeg" ,ffmpeg))) `(("ffmpeg" ,ffmpeg)))
(synopsis "Download videos from YouTube.com and other sites") (synopsis "Download videos from YouTube.com and other sites")