From 00a0c4c44152b05220675ff7bbfa2049b130c58f Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Tue, 28 Mar 2023 17:16:50 +0200 Subject: [PATCH] hydrus: 520 -> 544 Adds support for a bunch of media types Small improvements to the package --- .../graphics/hydrus/0001-inform-nixpkgs.patch | 18 ++++++++++++++++ pkgs/applications/graphics/hydrus/default.nix | 21 ++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 pkgs/applications/graphics/hydrus/0001-inform-nixpkgs.patch 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 000000000000..e7200814eb05 --- /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 ed8f2bef9e35..968f60ba8096 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