about summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorDaniel Olsen <daniel.olsen99@gmail.com>2023-03-28 17:16:50 +0200
committerYt <happysalada@tuta.io>2023-09-26 00:07:29 +0000
commit00a0c4c44152b05220675ff7bbfa2049b130c58f (patch)
treeb16ac97c91f989dd106badd7e009dc3787308788 /pkgs/applications/graphics
parent0f24b2409c947cf72e894b712f5ec20ff6a73694 (diff)
hydrus: 520 -> 544
Adds support for a bunch of media types
Small improvements to the package
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/hydrus/0001-inform-nixpkgs.patch18
-rw-r--r--pkgs/applications/graphics/hydrus/default.nix21
2 files changed, 34 insertions, 5 deletions
diff --git a/pkgs/applications/graphics/hydrus/0001-inform-nixpkgs.patch b/pkgs/applications/graphics/hydrus/0001-inform-nixpkgs.patch
new file mode 100644
index 0000000000000..e7200814eb059
--- /dev/null
+++ b/pkgs/applications/graphics/hydrus/0001-inform-nixpkgs.patch
@@ -0,0 +1,18 @@
+diff --git a/hydrus/core/HydrusConstants.py b/hydrus/core/HydrusConstants.py
+index 809338ef..9125928f 100644
+--- a/hydrus/core/HydrusConstants.py
++++ b/hydrus/core/HydrusConstants.py
+@@ -59,12 +59,7 @@ elif PLATFORM_HAIKU:
+ RUNNING_FROM_SOURCE = sys.argv[0].endswith( '.py' ) or sys.argv[0].endswith( '.pyw' )
+ RUNNING_FROM_MACOS_APP = os.path.exists( os.path.join( BASE_DIR, 'running_from_app' ) )
+ 
+-if RUNNING_FROM_SOURCE:
+-    NICE_RUNNING_AS_STRING = 'from source'
+-elif RUNNING_FROM_FROZEN_BUILD:
+-    NICE_RUNNING_AS_STRING = 'from frozen build'
+-elif RUNNING_FROM_MACOS_APP:
+-    NICE_RUNNING_AS_STRING = 'from App'
++NICE_RUNNING_AS_STRING = "from nixpkgs (source)"
+ 
+ BIN_DIR = os.path.join( BASE_DIR, 'bin' )
+ HELP_DIR = os.path.join( BASE_DIR, 'help' )
diff --git a/pkgs/applications/graphics/hydrus/default.nix b/pkgs/applications/graphics/hydrus/default.nix
index ed8f2bef9e352..968f60ba80965 100644
--- a/pkgs/applications/graphics/hydrus/default.nix
+++ b/pkgs/applications/graphics/hydrus/default.nix
@@ -12,16 +12,21 @@
 
 python3Packages.buildPythonPackage rec {
   pname = "hydrus";
-  version = "520";
+  version = "544";
   format = "other";
 
   src = fetchFromGitHub {
     owner = "hydrusnetwork";
     repo = "hydrus";
     rev = "refs/tags/v${version}";
-    hash = "sha256-y8KfPe3cBBq/iPCG7hNXrZDkOSNi+qSir6rO/65SHkI=";
+    hash = "sha256-e3VvkdJAQx5heKDJ1Ms6XpXrXWdzv48f8yu0DHfPy1A=";
   };
 
+  patches = [
+    # Nixpkgs specific, can be removed if upstream makes a more reasonable check
+    ./0001-inform-nixpkgs.patch
+  ];
+
   nativeBuildInputs = [
     wrapQtAppsHook
     python3Packages.mkdocs-material
@@ -37,13 +42,16 @@ python3Packages.buildPythonPackage rec {
     cbor2
     chardet
     cloudscraper
+    dateparser
     html5lib
     lxml
     lz4
     numpy
     opencv4
     pillow
+    pillow-heif
     psutil
+    psd-tools
     pympler
     pyopenssl
     pyqt6
@@ -56,7 +64,6 @@ python3Packages.buildPythonPackage rec {
     requests
     send2trash
     service-identity
-    six
     twisted
   ];
 
@@ -92,6 +99,7 @@ python3Packages.buildPythonPackage rec {
     -e TestHydrusSessions \
     -e TestServer \
     -e TestClientMetadataMigration \
+    -e TestClientFileStorage \
   '';
 
   outputs = [ "out" "doc" ];
@@ -100,13 +108,16 @@ python3Packages.buildPythonPackage rec {
     # Move the hydrus module and related directories
     mkdir -p $out/${python3Packages.python.sitePackages}
     mv {hydrus,static} $out/${python3Packages.python.sitePackages}
+    # Fix random files being marked with execute permissions
+    chmod -x $out/${python3Packages.python.sitePackages}/static/*.{png,svg,ico}
+    # Build docs
     mkdocs build -d help
     mv help $out/doc/
 
     # install the hydrus binaries
     mkdir -p $out/bin
-    install -m0755 server.py $out/bin/hydrus-server
-    install -m0755 client.py $out/bin/hydrus-client
+    install -m0755 hydrus_server.py $out/bin/hydrus-server
+    install -m0755 hydrus_client.py $out/bin/hydrus-client
   '' + lib.optionalString enableSwftools ''
     mkdir -p $out/${python3Packages.python.sitePackages}/bin
     # swfrender seems to have to be called sfwrender_linux