[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/04: gnu: youtube-dl: Avoid using pre-generated code.
From: |
guix-commits |
Subject: |
01/04: gnu: youtube-dl: Avoid using pre-generated code. |
Date: |
Tue, 15 Dec 2020 13:16:19 -0500 (EST) |
mhw pushed a commit to branch master
in repository guix.
commit 740c0f37f9c9ddd37edbd6925761c94f792b9db9
Author: Mark H Weaver <mhw@netris.org>
AuthorDate: Wed Nov 11 00:15:02 2020 -0500
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'.
---
gnu/packages/video.scm | 29 ++++++++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index d47241d..7a04df4 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
;;; 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, 2016, 2017, 2018, 2019, 2020 Efraim Flashner
<efraim@flashner.co.il>
;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
@@ -65,7 +65,7 @@
(define-module (gnu packages video)
#:use-module (ice-9 match)
- #:use-module (srfi srfi-1)
+ #:use-module ((srfi srfi-1) #:hide (zip))
#:use-module (srfi srfi-26)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix utils)
@@ -2203,7 +2203,18 @@ To load this plugin, specify the following option when
starting mpv:
"youtube-dl-" version ".tar.gz"))
(sha256
(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)
(arguments
;; 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)
(format #f "~a or '~a'" match (which "ffmpeg"))))
#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
(lambda* (#:key outputs #:allow-other-keys)
(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"
(string-append zsh "/_youtube-dl"))
#t))))))
+ (native-inputs
+ `(("zip" ,zip)))
(inputs
`(("ffmpeg" ,ffmpeg)))
(synopsis "Download videos from YouTube.com and other sites")