From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czvf8-0000V0-Gn for guix-patches@gnu.org; Sun, 16 Apr 2017 21:41:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czvf5-0000rG-Bm for guix-patches@gnu.org; Sun, 16 Apr 2017 21:41:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:52950) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1czvf5-0000qp-6c for guix-patches@gnu.org; Sun, 16 Apr 2017 21:41:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1czvf4-0006Yy-FH for guix-patches@gnu.org; Sun, 16 Apr 2017 21:41:02 -0400 Subject: bug#26538: [PATCH 1/1] gnu: Add youtube-dl-gui. Resent-Message-ID: From: Chris Marusich Date: Sun, 16 Apr 2017 18:39:28 -0700 Message-Id: <20170417013928.28142-1-cmmarusich@gmail.com> In-Reply-To: <20170417013043.27302-1-cmmarusich@gmail.com> References: <20170417013043.27302-1-cmmarusich@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26538@debbugs.gnu.org Cc: Chris Marusich * gnu/packages/video.scm (youtube-dl-gui): New variable. --- gnu/packages/video.scm | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index b64664176..a80d187be 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2016 Eric Bavier ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2017 Feng Shu +;;; Copyright © 2017 Chris Marusich ;;; ;;; This file is part of GNU Guix. ;;; @@ -95,6 +96,7 @@ #:use-module (gnu packages version-control) #:use-module (gnu packages web) #:use-module (gnu packages webkit) + #:use-module (gnu packages wxwidgets) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xiph) #:use-module (gnu packages xml) @@ -1024,6 +1026,92 @@ YouTube.com and a few more sites.") (home-page "https://yt-dl.org") (license license:public-domain))) +(define-public youtube-dl-gui + (package + (name "youtube-dl-gui") + (version "0.3.8") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/MrS0m30n3/youtube-dl-gui/archive/" + version + ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 (base32 "1kaq3nrr7l52s9lvrqqywsk8yd6f2lciwj1hd40h8hs4463yrrqc")))) + (build-system python-build-system) + (arguments + ;; In Guix, wxpython has not yet been packaged for Python 3. + `(#:python ,python-2 + ;; This package has no tests. + #:tests? #f + #:phases (modify-phases %standard-phases + (add-before 'build 'patch-source + (lambda* (#:key inputs #:allow-other-keys) + ;; The youtube-dl-gui program lets you + ;; configure options. Some of them are + ;; problematic, so we change their defaults. + (substitute* "youtube_dl_gui/optionsmanager.py" + ;; When this is true, the builder process will + ;; try (and fail) to write logs to the builder + ;; user's home directory. + (("'enable_log': True") "'enable_log': False") + ;; This determines which youtube-dl program + ;; youtube-dl-gui will run. If we don't set + ;; this, then youtube-dl-gui might download + ;; an arbitrary copy from the Internet into + ;; the user's home directory and run it, so + ;; let's make sure youtube-dl-gui uses the + ;; youtube-dl from the inputs by default. + (("'youtubedl_path': self.config_path") + (string-append "'youtubedl_path': '" + (assoc-ref inputs "youtube-dl") + "/bin'")) + ;; When this is True, when youtube-dl-gui is + ;; finished downloading a file, it will try + ;; (and possibly fail) to open the directory + ;; containing the downloaded file. This can + ;; fail because it assumes that xdg-open is + ;; in PATH. Unfortunately, simply adding + ;; xdg-utils to the propagated inputs is not + ;; enough to make this work, so for now we + ;; set the default to False. + (("'open_dl_dir': True") "'open_dl_dir': False")) + ;; The youtube-dl program from the inputs is + ;; actually a wrapper script written in bash, + ;; so attempting to invoke it as a python + ;; script will fail. + (substitute* "youtube_dl_gui/downloaders.py" + (("cmd = \\['python', self\\.youtubedl_path\\]") + "cmd = [self.youtubedl_path]")) + ;; Use relative paths for installing data + ;; files so youtube-dl-gui installs the files + ;; relative to its prefix in the store, rather + ;; than relative to /. Also, instead of + ;; installing data files into + ;; $prefix/usr/share, install them into + ;; $prefix/share for consistency (see: + ;; (standards) Directory Variables). + (substitute* "setup.py" + (("= '/usr/share") "= 'share")) + ;; Update get_locale_file() so it finds the + ;; installed localization files. + (substitute* "youtube_dl_gui/utils.py" + (("os\\.path\\.join\\('/usr', 'share'") + (string-append "os.path.join('" + (assoc-ref %outputs "out") + "', 'share'")))))))) + (inputs + `(("python2-wxpython" ,python2-wxpython) + ("youtube-dl" ,youtube-dl))) + (home-page "https://github.com/MrS0m30n3/youtube-dl-gui") + (synopsis + "GUI (Graphical User Interface) for @command{youtube-dl}") + (description + "Youtube-dlG is a GUI (Graphical User Interface) for +@command{youtube-dl}. You can use it to download videos from YouTube and any +other sites that youtube-dl supports.") + (license license:unlicense))) + (define-public you-get (package (name "you-get") -- 2.12.0