Commit 00a0c4c4 authored by Daniel Løvbrøtte Olsen's avatar Daniel Løvbrøtte Olsen Committed by Yt
Browse files

hydrus: 520 -> 544

Adds support for a bunch of media types
Small improvements to the package
parent 0f24b240
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
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' )
+16 −5
Original line number Diff line number Diff line
@@ -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