1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/graphics/hydrus/default.nix

114 lines
2.5 KiB
Nix
Raw Normal View History

{ lib
2020-10-18 19:48:54 +01:00
, fetchFromGitHub
2021-03-14 18:12:53 +00:00
, xz
2020-10-18 19:48:54 +01:00
, wrapQtAppsHook
, miniupnpc_2
2021-06-01 17:42:04 +01:00
, enableSwftools ? false
2020-10-18 19:48:54 +01:00
, swftools
, pythonPackages
}:
2021-03-05 06:35:58 +00:00
pythonPackages.buildPythonPackage rec {
2020-10-18 19:48:54 +01:00
pname = "hydrus";
2021-06-01 17:42:04 +01:00
version = "441";
2020-10-18 19:48:54 +01:00
format = "other";
src = fetchFromGitHub {
owner = "hydrusnetwork";
repo = "hydrus";
2021-03-05 06:35:58 +00:00
rev = "v${version}";
2021-06-01 17:42:04 +01:00
sha256 = "13h4qcz0iqba4mwyvgmdqh99jy22x7kw20f3g43b5aq3qyk9ca2h";
2020-10-18 19:48:54 +01:00
};
nativeBuildInputs = [
wrapQtAppsHook
];
propagatedBuildInputs = with pythonPackages; [
beautifulsoup4
html5lib
lxml
numpy
opencv4
pillow
psutil
pyopenssl
pyyaml
requests
send2trash
service-identity
twisted
lz4
2021-03-14 18:12:53 +00:00
xz
2020-10-18 19:48:54 +01:00
pysocks
matplotlib
qtpy
pyside2
2021-03-05 06:35:58 +00:00
mpv
2020-10-18 19:48:54 +01:00
];
checkInputs = with pythonPackages; [ nose httmock ];
# most tests are failing, presumably because we are not using test.py
checkPhase = ''
nosetests $src/hydrus/test \
-e TestClientAPI \
-e TestClientConstants \
-e TestClientDaemons \
-e TestClientData \
-e TestClientDB \
-e TestClientDBDuplicates \
-e TestClientDBTags \
-e TestClientImageHandling \
-e TestClientImportOptions \
-e TestClientListBoxes \
-e TestClientMigration \
-e TestClientNetworking \
-e TestClientTags \
-e TestClientThreading \
-e TestDialogs \
-e TestFunctions \
-e TestHydrusNATPunch \
-e TestHydrusSerialisable \
-e TestHydrusServer \
-e TestHydrusSessions \
-e TestServer \
'';
2021-04-12 16:36:15 +01:00
outputs = [ "out" "doc" ];
2020-10-18 19:48:54 +01:00
postPatch = ''
sed 's;os\.path\.join(\sHC\.BIN_DIR,.*;"${miniupnpc_2}/bin/upnpc";' \
2021-04-12 16:36:15 +01:00
-i ./hydrus/core/networking/HydrusNATPunch.py
2021-06-01 17:42:04 +01:00
'' + lib.optionalString enableSwftools ''
2020-10-18 19:48:54 +01:00
sed 's;os\.path\.join(\sHC\.BIN_DIR,.*;"${swftools}/bin/swfrender";' \
-i ./hydrus/core/HydrusFlashHandling.py
'';
#doCheck = true;
installPhase = ''
# Move the hydrus module and related directories
mkdir -p $out/${pythonPackages.python.sitePackages}
mv {hydrus,static} $out/${pythonPackages.python.sitePackages}
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
'';
dontWrapQtApps = true;
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
meta = with lib; {
2020-10-18 19:48:54 +01:00
description = "Danbooru-like image tagging and searching system for the desktop";
license = licenses.wtfpl;
homepage = "https://hydrusnetwork.github.io/hydrus/";
maintainers = [ maintainers.evanjs ];
};
}