From 2a8936a081666a032f35717cb273b41d84f43ed1 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Fri, 23 Jul 2021 18:44:56 +0200 Subject: [PATCH 1/6] hydrus: Add dandellion to maintainers --- pkgs/applications/graphics/hydrus/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/hydrus/default.nix b/pkgs/applications/graphics/hydrus/default.nix index a3b043adbe5..710c2620f1b 100644 --- a/pkgs/applications/graphics/hydrus/default.nix +++ b/pkgs/applications/graphics/hydrus/default.nix @@ -108,6 +108,6 @@ pythonPackages.buildPythonPackage rec { description = "Danbooru-like image tagging and searching system for the desktop"; license = licenses.wtfpl; homepage = "https://hydrusnetwork.github.io/hydrus/"; - maintainers = [ maintainers.evanjs ]; + maintainers = with maintainers; [ dandellion evanjs ]; }; } From cfe66d16b798d58bb2b857fc50ea68999306d710 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Fri, 23 Jul 2021 18:47:11 +0200 Subject: [PATCH 2/6] hydrus: 441 -> 447 --- pkgs/applications/graphics/hydrus/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/hydrus/default.nix b/pkgs/applications/graphics/hydrus/default.nix index 710c2620f1b..37edc37337a 100644 --- a/pkgs/applications/graphics/hydrus/default.nix +++ b/pkgs/applications/graphics/hydrus/default.nix @@ -10,14 +10,14 @@ pythonPackages.buildPythonPackage rec { pname = "hydrus"; - version = "441"; + version = "447"; format = "other"; src = fetchFromGitHub { owner = "hydrusnetwork"; repo = "hydrus"; rev = "v${version}"; - sha256 = "13h4qcz0iqba4mwyvgmdqh99jy22x7kw20f3g43b5aq3qyk9ca2h"; + sha256 = "0a9nrsbw3w1229bm90xayixvkpvr6g338w64x4v75sqxvpbx84lz"; }; nativeBuildInputs = [ From 4683bca7df8bfec9bf1292ada5bae062532f57c5 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 24 Jul 2021 01:45:30 +0200 Subject: [PATCH 3/6] pythonPackages.pylzma: init at 0.5.0 --- .../python-modules/pylzma/default.nix | 23 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/development/python-modules/pylzma/default.nix diff --git a/pkgs/development/python-modules/pylzma/default.nix b/pkgs/development/python-modules/pylzma/default.nix new file mode 100644 index 00000000000..78bc24d35d4 --- /dev/null +++ b/pkgs/development/python-modules/pylzma/default.nix @@ -0,0 +1,23 @@ +{ lib, buildPythonPackage, fetchPypi }: + +buildPythonPackage rec { + pname = "pylzma"; + version = "0.5.0"; + + # This vendors an old LZMA SDK + # After some discussion, it seemed most reasonable to keep it that way + # xz, and uefi-firmware-parser also does this + src = fetchPypi { + inherit pname version; + sha256 = "074anvhyjgsv2iby2ql1ixfvjgmhnvcwjbdz8gk70xzkzcm1fx5q"; + }; + + pythonImportsCheck = [ "pylzma" ]; + + meta = with lib; { + homepage = "https://www.joachim-bauch.de/projects/pylzma/"; + description = "Platform independent python bindings for the LZMA compression library"; + license = licenses.lgpl21Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5cab2a4f0c7..d18cdc0e967 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6211,6 +6211,8 @@ in { pylxd = callPackage ../development/python-modules/pylxd { }; + pylzma = callPackage ../development/python-modules/pylzma { }; + pymacaroons = callPackage ../development/python-modules/pymacaroons { }; pymaging = callPackage ../development/python-modules/pymaging { }; From 97be046b0e014aafca7edf7e3352d7730a66f7a9 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 24 Jul 2021 02:09:38 +0200 Subject: [PATCH 4/6] hydrus: Add pylzma as dependency --- pkgs/applications/graphics/hydrus/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/graphics/hydrus/default.nix b/pkgs/applications/graphics/hydrus/default.nix index 37edc37337a..ea67f8d5231 100644 --- a/pkgs/applications/graphics/hydrus/default.nix +++ b/pkgs/applications/graphics/hydrus/default.nix @@ -34,6 +34,7 @@ pythonPackages.buildPythonPackage rec { psutil pyopenssl pyyaml + pylzma requests send2trash service-identity From c8516c8ce5bf2992bb1deef514af8292d77528e7 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 24 Jul 2021 03:40:25 +0200 Subject: [PATCH 5/6] hydrus: correct dependencies, simply external programs --- pkgs/applications/graphics/hydrus/default.nix | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/pkgs/applications/graphics/hydrus/default.nix b/pkgs/applications/graphics/hydrus/default.nix index ea67f8d5231..292c3cf2156 100644 --- a/pkgs/applications/graphics/hydrus/default.nix +++ b/pkgs/applications/graphics/hydrus/default.nix @@ -1,14 +1,14 @@ { lib , fetchFromGitHub -, xz , wrapQtAppsHook , miniupnpc_2 +, ffmpeg , enableSwftools ? false , swftools -, pythonPackages +, python3Packages }: -pythonPackages.buildPythonPackage rec { +python3Packages.buildPythonPackage rec { pname = "hydrus"; version = "447"; format = "other"; @@ -24,31 +24,33 @@ pythonPackages.buildPythonPackage rec { wrapQtAppsHook ]; - propagatedBuildInputs = with pythonPackages; [ + propagatedBuildInputs = with python3Packages; [ beautifulsoup4 + chardet + cloudscraper html5lib lxml + lz4 + nose numpy opencv4 pillow psutil - pyopenssl - pyyaml pylzma + pyopenssl + pyside2 + pysocks + pythonPackages.mpv + pyyaml + qtpy requests send2trash service-identity + six twisted - lz4 - xz - pysocks - matplotlib - qtpy - pyside2 - mpv ]; - checkInputs = with pythonPackages; [ nose httmock ]; + checkInputs = with python3Packages; [ nose mock httmock ]; # most tests are failing, presumably because we are not using test.py checkPhase = '' @@ -78,31 +80,28 @@ pythonPackages.buildPythonPackage rec { outputs = [ "out" "doc" ]; - postPatch = '' - sed 's;os\.path\.join(\sHC\.BIN_DIR,.*;"${miniupnpc_2}/bin/upnpc";' \ - -i ./hydrus/core/networking/HydrusNATPunch.py - '' + lib.optionalString enableSwftools '' - 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} + mkdir -p $out/${python3Packages.python.sitePackages} + mv {hydrus,static} $out/${python3Packages.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 + '' + 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 ''; dontWrapQtApps = true; preFixup = '' makeWrapperArgs+=("''${qtWrapperArgs[@]}") + makeWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ ffmpeg miniupnpc_2 ]}) ''; meta = with lib; { From eb07e28d0f220021465e1a70253cc70672cca53c Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 24 Jul 2021 14:45:20 +0200 Subject: [PATCH 6/6] swftools: unmark as broken --- pkgs/tools/video/swftools/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/video/swftools/default.nix b/pkgs/tools/video/swftools/default.nix index 6867869a0a9..c48d684d3fc 100644 --- a/pkgs/tools/video/swftools/default.nix +++ b/pkgs/tools/video/swftools/default.nix @@ -19,7 +19,6 @@ stdenv.mkDerivation rec { license = licenses.gpl2Only; maintainers = [ maintainers.koral ]; platforms = lib.platforms.unix; - broken = true; knownVulnerabilities = [ "CVE-2017-10976" "CVE-2017-11096"