From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0Fm7JEbv+GJiHAEAbAwnHQ (envelope-from ) for ; Sun, 14 Aug 2022 14:49:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YKHAJEbv+GIJngAAauVa8A (envelope-from ) for ; Sun, 14 Aug 2022 14:49:10 +0200 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 20A3B36A21 for ; Sun, 14 Aug 2022 14:49:10 +0200 (CEST) Received: from localhost ([::1]:55302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oND3F-00033m-CA for larch@yhetil.org; Sun, 14 Aug 2022 08:49:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oND2C-0002XX-Uq for guix-patches@gnu.org; Sun, 14 Aug 2022 08:48:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oND2C-0005qN-LC for guix-patches@gnu.org; Sun, 14 Aug 2022 08:48:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oND2C-0003Ha-H1 for guix-patches@gnu.org; Sun, 14 Aug 2022 08:48:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56803] [PATCH v2 6/6] gnu: Add hydrus-network. Resent-From: Tomasz Jeneralczyk Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Aug 2022 12:48:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56803 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56803@debbugs.gnu.org Cc: Tomasz Jeneralczyk Received: via spool by 56803-submit@debbugs.gnu.org id=B56803.166048126512460 (code B ref 56803); Sun, 14 Aug 2022 12:48:04 +0000 Received: (at 56803) by debbugs.gnu.org; 14 Aug 2022 12:47:45 +0000 Received: from localhost ([127.0.0.1]:36153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oND1s-0003Eo-7V for submit@debbugs.gnu.org; Sun, 14 Aug 2022 08:47:45 -0400 Received: from outgoing1.lunanode.net ([172.81.176.235]:56529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oND1b-0003Dp-Kn for 56803@debbugs.gnu.org; Sun, 14 Aug 2022 08:47:42 -0400 Received: from mail1.lunanode.net (mail1.lunanode.net [170.75.162.243]) by outgoing1.lunanode.net (Postfix) with ESMTPS id 686E340011 for <56803@debbugs.gnu.org>; Sun, 14 Aug 2022 12:47:27 +0000 (UTC) From: Tomasz Jeneralczyk Date: Sun, 14 Aug 2022 14:46:23 +0200 Message-Id: <2a7e6f4b11784ab9dc680e1fe3255f6e15333e32.1660481045.git.tj@schwi.pl> X-Mailer: git-send-email 2.37.1 In-Reply-To: <458d155cb6f630e0e8aea1793a4c97b3d76520e6.1660481045.git.tj@schwi.pl> References: <458d155cb6f630e0e8aea1793a4c97b3d76520e6.1660481045.git.tj@schwi.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660481350; 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; bh=7SJtJmKBnBYpAv0hq6F2FfbnpNQF6xSHIzGiTW05R4o=; b=kuBte3zJfb9w06+wh8VlWNwBgUisgcflM45Rnxq+blXZ55atZ9oXkWgs9cnogK+avG4ulo uV7U7mlOPLs+Y4jv99cAEDWFjC4LdAWl8Oiru9VyYnb3+sKnw3b4K0pBO08PqUsptsvg0+ CfHxfMpz5OtwoowEA/7sI8u14sJDGUktNVHG6UmqSRV90p7dSD3Ek/nHS6GNNlBy+patHH /bykZ3ylYF52OtoIKcp52GmyCa2RsuXsq0sUJ/50yX8NmfPZHVbIKJSGwf3rrfHuZD3Jjg V5eCYJK8VmPi+QavL9mw1PkeRotSNJyYXecy2vl/H75zdtf13QE52xkF2eCQzQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660481350; a=rsa-sha256; cv=none; b=s2izzaL7XjSCNb/ftW/iqzcGU9idCwmyalDXKBKFM5DJzFnQbgy9ut4/YcvWYSXUVJuqoG HI+7vaRlUZxitTQDxpmrtCdTs5p2OVXtLU1AjssfWS50JqHpJ2Ol7L5YX2ivGtGlfF7Zmt i1T1DjG5nQD4dGeQ7OybwUzUzmUXw+oXCtRKOcSn+O5IQYmMO5Omp1B6R/FbATNAquPMbY gvtjGRnjUUFnEDqnkduhEJ/qCW7PSIDcSLlK1miQAmc9rqJp5rJwX0Gy/4+H+MbhGj9jHO LdJvvBtbJh9cV+dByfcl5rgGlmQ7fpCi7QUv7gISAho7ZSQhiiBHHM5SBMzqQw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.66 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 20A3B36A21 X-Spam-Score: -1.66 X-Migadu-Scanner: scn0.migadu.com X-TUID: CsGoomF9ilb6 Hydrus-network has a weekly release cycle and is meant to be used from its own directory so I artificially spread it out to comply with guix's expectations. I was not able to build the program's help files. Fixing it would probably mean packaging a whole new build system for guix - more info in source comments. Also adds copyright and new used modules. * gnu/packages/image-viewers.scm (hydrus-network): Add variable. --- gnu/packages/image-viewers.scm | 133 +++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm index 88dbba866b..7878fe1048 100644 --- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -24,6 +24,7 @@ ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2021 dissent ;;; Copyright © 2022 Michael Rohleder +;;; Copyright © 2022 Tomasz Jeneralczyk ;;; ;;; This file is part of GNU Guix. ;;; @@ -54,6 +55,7 @@ (define-module (gnu packages image-viewers) #:use-module (guix build-system qt) #:use-module (gnu packages autotools) #:use-module (gnu packages algebra) + #:use-module (gnu packages animation) #:use-module (gnu packages backup) #:use-module (gnu packages base) #:use-module (gnu packages bash) @@ -84,14 +86,20 @@ (define-module (gnu packages image-viewers) #:use-module (gnu packages photo) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-check) + #:use-module (gnu packages python-compression) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) #:use-module (gnu packages suckless) #:use-module (gnu packages terminals) + #:use-module (gnu packages upnp) #:use-module (gnu packages version-control) #:use-module (gnu packages video) #:use-module (gnu packages web) #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (gnu packages)) @@ -973,3 +981,128 @@ (define-public xzgv (description "xzgv is a fast image viewer that provides extensive keyboard support.") (license license:gpl2+))) + +(define-public hydrus-network + (package + (name "hydrus-network") + (version "495") ; upstream has a weekly release cycle. + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/hydrusnetwork/hydrus") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "03zhrcmjzbk37sl9nwjahfmr8aflss84c4xhg5ci5b8jvbbqmr1j")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(let ((static-dir "/share/hydrus/static")) + (modify-phases %standard-phases + ;; Hydrus is a python program but does not uses setup.py or any + ;; other build system to build itself - it's delivered ready to + ;; run from the source. + (replace 'check + (lambda _ + (setenv "DISPLAY" ":0") + (setenv "XDG_CACHE_HOME" (getcwd)) + (setenv "HOME" (getcwd)) + (invoke "xvfb-run" "python" "test.py"))) + ;; I was not able to build the program's help files. Updating + ;; python-pymdown-extensions to its latest version might be the + ;; solution, but this would require also packaging its new build + ;; system that is not present in guix yet. I decided to cut short there. + (delete 'build) + (add-before 'install 'patch-variables + (lambda* (#:key outputs inputs #:allow-other-keys) + (let ((ffmpeg (search-input-file inputs "/bin/ffmpeg")) + (swfrender (search-input-file inputs "/bin/swfrender")) + (upnpc (search-input-file inputs "/bin/upnpc")) + (out (assoc-ref outputs "out"))) + (with-directory-excursion "hydrus" + ;; Without this the program would incorrectly assume + ;; that it uses user's ffmpeg binary when it isn't. + (substitute* "client/ClientController.py" + (("if (HydrusVideoHandling\\.FFMPEG_PATH).*" _ var) + (string-append "if " var " == \"" ffmpeg "\":\n"))) + (with-directory-excursion "core" + (substitute* "HydrusConstants.py" + (("STATIC_DIR = .*") + (string-append "STATIC_DIR = \"" out static-dir "\"\n"))) + (substitute* "HydrusFlashHandling.py" + (("SWFRENDER_PATH = .*\n") + (string-append "SWFRENDER_PATH = \"" swfrender "\"\n"))) + (substitute* "HydrusVideoHandling.py" + (("FFMPEG_PATH = .*\n") + (string-append "FFMPEG_PATH = \"" ffmpeg "\"\n"))) + (substitute* "networking/HydrusNATPunch.py" + (("UPNPC_PATH = .*\n") + (string-append "UPNPC_PATH = \"" upnpc "\"\n")))))))) + ;; Since everything lives in hydrus's root directory, it needs to + ;; be spread out to comply with guix's expectations. + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (client (string-append out "/bin/hydrus")) + (server (string-append out "/bin/hydrus-server"))) + (copy-recursively "static" + (string-append out static-dir)) + (copy-recursively "hydrus" + (string-append out + "/lib/python" + (python-version + #$(this-package-input "python")) + "/site-packages/hydrus")) + (mkdir (string-append out "/bin")) + (copy-file "client.py" client) + (chmod client #o0555) + (copy-file "server.py" server) + (chmod server #o0555)))))))) + ;; All native-inputs are only needed for the the check phase + (native-inputs + (list + xvfb-run + python-nose + python-mock + python-httmock)) + ;; All python packages were taken from static/build_files/linux/requirements.txt + (propagated-inputs + (list + python-beautifulsoup4 + python-cbor2 + python-chardet + python-cloudscraper + python-html5lib + python-lxml + python-lz4 + python-numpy + opencv ; its python bindings are a drop-in replacement for opencv-python-headless + python-pillow + python-psutil + python-pylzma + python-pyopenssl + ;; since hydrus' version 494 it supports python-pyside-6 but it's not yet + ;; in guix. pyside-2 is still supported as a fallback. + python-pyside-2 + python-pysocks + python-mpv + python-pyyaml + python-qtpy + python-requests + python-send2trash + python-service-identity + python-six + python-twisted)) + (inputs (list swftools ffmpeg miniupnpc python)) + (synopsis "Organize your media with tags like a dektop booru") + (description + "The hydrus network client is an application written for +internet-fluent media nerds who have large image/swf/webm collections. +It browses with tags instead of folders, a little like a booru on your desktop. +Advanced users can share tags and files anonymously through custom servers that +any user may run. Everything is free and privacy is the first concern.") + (home-page "https://hydrusnetwork.github.io/hydrus/") + (license license:wtfpl2))) -- 2.37.1