2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2020-10-18 19:48:54 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, miniupnpc_2
|
2021-07-24 02:40:25 +01:00
|
|
|
, ffmpeg
|
2021-06-01 17:42:04 +01:00
|
|
|
, enableSwftools ? false
|
2020-10-18 19:48:54 +01:00
|
|
|
, swftools
|
2021-07-24 02:40:25 +01:00
|
|
|
, python3Packages
|
2020-10-18 19:48:54 +01:00
|
|
|
}:
|
|
|
|
|
2021-07-24 02:40:25 +01:00
|
|
|
python3Packages.buildPythonPackage rec {
|
2020-10-18 19:48:54 +01:00
|
|
|
pname = "hydrus";
|
2022-08-11 15:24:05 +01:00
|
|
|
version = "495";
|
2020-10-18 19:48:54 +01:00
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hydrusnetwork";
|
|
|
|
repo = "hydrus";
|
2022-04-16 05:54:01 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-08-11 15:24:05 +01:00
|
|
|
sha256 = "sha256-MuSK19oSrRJZebATRpDW1CmUq4NKcpuoPmOuLyvL8A8=";
|
2020-10-18 19:48:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapQtAppsHook
|
2022-03-02 23:32:30 +00:00
|
|
|
python3Packages.mkdocs-material
|
2020-10-18 19:48:54 +01:00
|
|
|
];
|
|
|
|
|
2021-07-24 02:40:25 +01:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2020-10-18 19:48:54 +01:00
|
|
|
beautifulsoup4
|
2022-03-24 13:58:27 +00:00
|
|
|
cbor2
|
2021-07-24 02:40:25 +01:00
|
|
|
chardet
|
|
|
|
cloudscraper
|
2020-10-18 19:48:54 +01:00
|
|
|
html5lib
|
|
|
|
lxml
|
2021-07-24 02:40:25 +01:00
|
|
|
lz4
|
|
|
|
nose
|
2020-10-18 19:48:54 +01:00
|
|
|
numpy
|
|
|
|
opencv4
|
|
|
|
pillow
|
|
|
|
psutil
|
2021-07-24 02:40:25 +01:00
|
|
|
pylzma
|
2020-10-18 19:48:54 +01:00
|
|
|
pyopenssl
|
2021-07-24 02:40:25 +01:00
|
|
|
pyside2
|
|
|
|
pysocks
|
2022-06-22 22:37:09 +01:00
|
|
|
python3Packages.mpv
|
2020-10-18 19:48:54 +01:00
|
|
|
pyyaml
|
2021-07-24 02:40:25 +01:00
|
|
|
qtpy
|
2020-10-18 19:48:54 +01:00
|
|
|
requests
|
|
|
|
send2trash
|
|
|
|
service-identity
|
2021-07-24 02:40:25 +01:00
|
|
|
six
|
2020-10-18 19:48:54 +01:00
|
|
|
twisted
|
|
|
|
];
|
|
|
|
|
2021-07-24 02:40:25 +01:00
|
|
|
checkInputs = with python3Packages; [ nose mock httmock ];
|
2020-10-18 19:48:54 +01:00
|
|
|
|
|
|
|
# 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 \
|
2021-10-01 22:19:51 +01:00
|
|
|
-e TestHydrusNetwork \
|
2020-10-18 19:48:54 +01:00
|
|
|
-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
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# Move the hydrus module and related directories
|
2021-07-24 02:40:25 +01:00
|
|
|
mkdir -p $out/${python3Packages.python.sitePackages}
|
|
|
|
mv {hydrus,static} $out/${python3Packages.python.sitePackages}
|
2022-03-02 23:32:30 +00:00
|
|
|
mkdocs build -d help
|
2020-10-18 19:48:54 +01:00
|
|
|
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
|
2021-07-24 02:40:25 +01:00
|
|
|
'' + lib.optionalString enableSwftools ''
|
|
|
|
mkdir -p $out/${python3Packages.python.sitePackages}/bin
|
|
|
|
# swfrender seems to have to be called sfwrender_linux
|
|
|
|
# not sure if it can be loaded through PATH, but this is simpler
|
|
|
|
# $out/python3Packages.python.sitePackages/bin is correct NOT .../hydrus/bin
|
|
|
|
ln -s ${swftools}/bin/swfrender $out/${python3Packages.python.sitePackages}/bin/swfrender_linux
|
2020-10-18 19:48:54 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
2021-07-24 02:40:25 +01:00
|
|
|
makeWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ ffmpeg miniupnpc_2 ]})
|
2020-10-18 19:48:54 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
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/";
|
2021-07-23 17:44:56 +01:00
|
|
|
maintainers = with maintainers; [ dandellion evanjs ];
|
2020-10-18 19:48:54 +01:00
|
|
|
};
|
|
|
|
}
|