Skip to content

Commit

Permalink
hydrus: 520 -> 544
Browse files Browse the repository at this point in the history
Adds support for a bunch of media types
Small improvements to the package
  • Loading branch information
dali99 authored and Yt committed Sep 26, 2023
1 parent 0f24b24 commit 00a0c4c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
18 changes: 18 additions & 0 deletions pkgs/applications/graphics/hydrus/0001-inform-nixpkgs.patch
Original file line number Diff line number Diff line change
@@ -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' )
21 changes: 16 additions & 5 deletions pkgs/applications/graphics/hydrus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -56,7 +64,6 @@ python3Packages.buildPythonPackage rec {
requests
send2trash
service-identity
six
twisted
];

Expand Down Expand Up @@ -92,6 +99,7 @@ python3Packages.buildPythonPackage rec {
-e TestHydrusSessions \
-e TestServer \
-e TestClientMetadataMigration \
-e TestClientFileStorage \
'';

outputs = [ "out" "doc" ];
Expand All @@ -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
Expand Down

0 comments on commit 00a0c4c

Please sign in to comment.