From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +lIEAE7zZmH9YQEAgWs5BA (envelope-from ) for ; Wed, 13 Oct 2021 16:55:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wLGiNk3zZmHWNgAAB5/wlQ (envelope-from ) for ; Wed, 13 Oct 2021 14:55:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D73B9EF44 for ; Wed, 13 Oct 2021 16:55:04 +0200 (CEST) Received: from localhost ([::1]:55222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mafep-0004Vr-Ux for larch@yhetil.org; Wed, 13 Oct 2021 10:55:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mafdq-0003FR-Ar for guix-patches@gnu.org; Wed, 13 Oct 2021 10:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mafdq-0005Pg-1V for guix-patches@gnu.org; Wed, 13 Oct 2021 10:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mafdp-0003iD-Vf for guix-patches@gnu.org; Wed, 13 Oct 2021 10:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51179] [PATCH v2] Re: bug#51179: [PATCH] gnu: Add yt-dlp. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Oct 2021 14:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51179 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Robin Templeton Cc: 51179@debbugs.gnu.org Received: via spool by 51179-submit@debbugs.gnu.org id=B51179.163413683614255 (code B ref 51179); Wed, 13 Oct 2021 14:54:01 +0000 Received: (at 51179) by debbugs.gnu.org; 13 Oct 2021 14:53:56 +0000 Received: from localhost ([127.0.0.1]:33004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mafde-0003hm-SN for submit@debbugs.gnu.org; Wed, 13 Oct 2021 10:53:56 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mafda-0003hV-UA for 51179@debbugs.gnu.org; Wed, 13 Oct 2021 10:53:49 -0400 Received: by mail-wr1-f68.google.com with SMTP id r7so9316162wrc.10 for <51179@debbugs.gnu.org>; Wed, 13 Oct 2021 07:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=+hktt7fX1gnC2PfZxph/0KFD/H+tuhdKiWirRlugcE8=; b=T2gqAOJpKFv4aumsywZ7tdNkqvB2TU2llgoQR6icqi/WtTVbzbKsFiW5Xj5onkwtet o314+tMhDt+6+AJTiECfSRrrPzBqGT212t7biD6aKoYUUD69tXVzeA43C1ixndfQead3 QnrfHmKaVWIwL3XaLALDkik3UBVmbHCfufFNI78cr+bztxSvGC2dfLO7mgVymApUtOqH 8tVSKnDPHNc+58CctmQvjtv8DXPMp+I2SdtL0FlVz+qt0Sxm2o1HGweFXVZDPfNNvXeR khRKWyfHGjvN4DTkrvqNEqkTRDE+QJGKhgZVv2vyYwiwV86SfxM7ujh7SqzKjBwcEBxx q0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=+hktt7fX1gnC2PfZxph/0KFD/H+tuhdKiWirRlugcE8=; b=USemS7pY5a9I9xKEBri8vychlTk6SD/racaQZ1vPUyejLNq4a7QABcjwX4Qo9XzzOu r9M61rZ+tqbHpX7zFymVjUu8cCMKIxFn2Oi1+BmvQ7VGKAjr96YlZYWu52PjIib+qZ9j 7RxSXDiT6rtn0gi//jeSWDuM7lxOU3MyKeEXt3ogrhHup2sbnc+lk4hLnfaKYSf4lN0s u0m/hsJ+N5xvCC1Nzw4EiL7fACBzp6PcwJ2QRkal2Cj4WbxcZqTFex5BjNj1Gd8RrlDS 80tzjQmj5t4qh1UiuZi3oUT2bAV1K5N9Zw3Pw/JVA1xorHQBtXLEwwGhnnGw0mKNzwjK bf9g== X-Gm-Message-State: AOAM531GJZiljh2tLP92SenYUekzXZ0ifIxfUhmWPFU3w69k29yNhTAF VU+0MsmEcrgfW4BQyYKXA0I= X-Google-Smtp-Source: ABdhPJx6HewIRwkNuAVIJD3SA0Xh3Nh0gwBRFmN6tb6oqaf0rQFt3PHvspZCmdTdbQJPTvS2sLWfyA== X-Received: by 2002:adf:9b8a:: with SMTP id d10mr38655931wrc.151.1634136820680; Wed, 13 Oct 2021 07:53:40 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id h1sm5479487wmb.7.2021.10.13.07.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 07:53:40 -0700 (PDT) Message-ID: <99268fb747b2278cc0e279c5efc83f5bbbfaccf1.camel@gmail.com> From: Liliana Marie Prikler Date: Wed, 13 Oct 2021 16:53:38 +0200 In-Reply-To: <87ee8pm6sn.fsf_-_@terpri.org> References: <87pms9mf7a.fsf@terpri.org> <87ee8pm6sn.fsf_-_@terpri.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634136905; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+hktt7fX1gnC2PfZxph/0KFD/H+tuhdKiWirRlugcE8=; b=bEcUr2kw3ZS4CNNo5TIIvzIk/2BbvzUKSpoLBLDibFn7xMmVcfQSusLFGkrOabCErl+kP+ YW68moo5tBGDvTXGvlvZU/1vAOvGsiZ9Khd1+7cGaQbj3zvKVk6DSAbi1MD2uZ+LsvdC2B g/rEDHlyRCGJDmHj1dyy3lnhl1cRMlaLp2WSFe3pp4jlKmtWpx9Q1+f5RNngHW/XqV53PE xacL2jgtEMXj8k+DfhqwGlV/X9j6/SqA+Tcwm8fA+KMJL84jpR9pmmftBqmyncx4PDUUVO WoSnQSBh9e0cEuxEgFE6Mdbz4UG4KrEK242dilXQgnprlWAZAW+r6o2kxoL2Aw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634136905; a=rsa-sha256; cv=none; b=puTz6RrPBkt6UULvK4Z1gCtaala6vwFMpVPQ9/vNCALyshgvNn6QSGJ3uxTbpUVmpVRozd JP9AFtw0KufZGBXorlNrbesOhWUHBURWS2UNlyyNdjGgQKe+mv2A+rpmn0Xxz1G4l9EF2Z qkLZfcyx6KJajJ2xX7FKMLfZocC68J8fIvwBtqbfMiM/n7lPO5k9CNLLlkkpwo+D6d3Gxv kb2rnDQTnWPxJMcfIoxcct/922HlvN4wlhiL31yUdFXYvSiW/CqjA1EDEq0TCiMVP52aSW Z4UTLFl+E2gklyhAYtv4Id1CGL3C6lfELfo1en1sVx9/JNlp7GMfw7Ah4NPFzA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=T2gqAOJp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=T2gqAOJp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: D73B9EF44 X-Spam-Score: -1.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: c1QndKfDM3KK Hi Robin, when pasting other stuff into a patch, one usually ought to do so after the "---" line before the summary and the first diff. Am Mittwoch, den 13.10.2021, 08:46 -0400 schrieb Robin Templeton: > Liliana Marie Prikler writes: > > [...] > > > + (snippet > > > + '(begin > > > + ;; Delete the pre-generated files, except for > > > the man page > > > + ;; which requires 'pandoc' to build. > [...] > > Is this the same as for youtube-dl? If not, we might want to give > > pandoc as native-input. That will increase build times, but it > > ought not to increase closure size. > > This is analogous to youtube-dl's pandoc avoidance; IMHO youtube-dl > ought to use pandoc as a native input, but I wanted to keep the > packaging as close to youtube-dl's as possible. Hence why I asked whether youtube-dl does the same. Making that change would probably be out of scope for now. > [...] > > > + (add-before 'build 'build-generated-files > > > + (lambda _ > > > + ;; Avoid the make targets that require > > > pandoc. > > > + (invoke "make" > > > + "PYTHON=python" > > > + "yt-dlp" > > > + ;;"youtube-dl.1" ; needs pandoc > > > + "completions"))) > > > + (add-before 'install 'fix-the-data-directories > > > + (lambda* (#:key outputs #:allow-other-keys) > > > + (let ((prefix (assoc-ref outputs "out"))) > > > + (substitute* "setup.py" > > > + (("'etc/") > > > + (string-append "'" prefix "/etc/")) > > > + (("'share/") > > > + (string-append "'" prefix > > > "/share/"))) > > > + #t)))))) > > Horizontal space is at a premium and you can save some. > > I'm not sure where exactly this should use fewer columns, but I > squeezed the make invocation onto a single line. You fixed it by accident, given that you're now required to use substitute-keyword-arguments*, putting #:phases on an extra line as it ought to be. > v2 also adds three inputs needed for the program to run correctly > (updated based on efraim's yt-dlp package, ;; in > that package, the extra libraries are propagated inputs, but adding > them as regular inputs appears to be sufficient). Can we somehow verify that this is indeed the case? Normally we would wrap PYTHONPATH in such a case. > [...] > > Otherwise LGTM, but haven't tested. > > Thanks for the quick review! Patch v2 below. (I tested it on a few > YouTube videos and it worked as expected, at least for simple "yt-dlp > $URL"-type usage.) > > --8<---------------cut here---------------start------------->8--- > > * gnu/packages/video.scm (yt-dlp): New variable. > > Suggested-by: bdju > --- > gnu/packages/video.scm | 61 > ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 61 insertions(+) > > diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm > index fcac369f60..94f5e85e77 100644 > --- a/gnu/packages/video.scm > +++ b/gnu/packages/video.scm > @@ -142,6 +142,7 @@ > #:use-module (gnu packages man) > #:use-module (gnu packages markup) > #:use-module (gnu packages maths) > + #:use-module (gnu packages music) > #:use-module (gnu packages mp3) > #:use-module (gnu packages ncurses) > #:use-module (gnu packages networking) > @@ -2360,6 +2361,66 @@ YouTube.com and many more sites.") > (home-page "https://yt-dl.org") > (license license:public-domain))) > > +(define-public yt-dlp > + (package/inherit youtube-dl > + (name "yt-dlp") > + (version "2021.10.10") > + (source (origin > + (method url-fetch) > + (uri (string-append "https://github.com/yt-dlp/yt-dlp/ > " > + "releases/download/" > + version "/yt-dlp.tar.gz")) > + (sha256 > + (base32 > + "1ywld4qhvsik970gbac1h3kvxb74r7150m5axq9r5nffdw5sz3v > d")) > + (snippet > + '(begin > + ;; Delete the pre-generated files, except for the > man page > + ;; which requires 'pandoc' to build. > + (for-each delete-file '("yt-dlp" > + ;;pandoc is needed to > generate > + ;;"yt-dlp.1" > + "completions/bash/yt-dlp" > + "completions/fish/yt- > dlp.fish" > + "completions/zsh/_yt- > dlp")) > + #t)))) > + (arguments > + (substitute-keyword-arguments (package-arguments youtube-dl) > + ((#:phases phases) > + `(modify-phases ,phases > + ;; See the comment for the corresponding phase in > youtube-dl. > + (replace 'default-to-the-ffmpeg-input > + (lambda _ > + (substitute* "yt_dlp/postprocessor/ffmpeg.py" > + (("\\.get\\('ffmpeg_location'\\)" match) > + (format #f "~a or '~a'" match (which "ffmpeg")))) > + #t)) > + (replace 'build-generated-files > + (lambda _ > + ;; Avoid the yt-dlp.1 target, which requires pandoc. > + (invoke "make" "PYTHON=python" "yt-dlp" > "completions"))) > + (replace 'fix-the-data-directories > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((prefix (assoc-ref outputs "out"))) > + (substitute* "setup.py" > + (("'etc/") > + (string-append "'" prefix "/etc/")) > + (("'share/") > + (string-append "'" prefix "/share/")))) > + #t)) > + (delete 'install-completion))))) Why do we not install completions? > + (inputs > + `(("python-mutagen" ,python-mutagen) > + ("python-pycryptodomex" ,python-pycryptodomex) > + ("python-websockets" ,python-websockets) > + ,@(package-inputs youtube-dl))) > + (description > + "yt-dlp is a small command-line program to download videos from > +YouTube.com and many more sites. It is a fork of youtube-dl with a > +focus on adding new features while keeping up-to-date with the > +original project.") > + (home-page "https://github.com/yt-dlp/yt-dlp"))) > + > (define-public youtube-dl-gui > (package > (name "youtube-dl-gui") Regards, Liliana