From d35993a5ff6c4fc601b6f20bd6b1fe5da4e05d24 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 5 Mar 2025 08:30:40 +0100 Subject: [PATCH] tahoe-lafs: unstable-2021-07-09 -> 1.20.0 Diff: https://github.com/tahoe-lafs/tahoe-lafs/compare/8e28a9d0e02fde2388aca549da2b5c452ac4337f...tahoe-lafs-1.20.0 --- pkgs/by-name/ta/tahoe-lafs/package.nix | 143 ++++++++++--------------- 1 file changed, 57 insertions(+), 86 deletions(-) diff --git a/pkgs/by-name/ta/tahoe-lafs/package.nix b/pkgs/by-name/ta/tahoe-lafs/package.nix index d478dd5e4670..207c585f297a 100644 --- a/pkgs/by-name/ta/tahoe-lafs/package.nix +++ b/pkgs/by-name/ta/tahoe-lafs/package.nix @@ -1,52 +1,21 @@ { lib, - nettools, - python311, - texinfo, + python3Packages, fetchFromGitHub, + texinfo, + versionCheckHook, }: -# FAILURES: The "running build_ext" phase fails to compile Twisted -# plugins, because it tries to write them into Twisted's (immutable) -# store path. The problem appears to be non-fatal, but there's probably -# some loss of functionality because of it. - -let - # Tahoe-LAFS unstable-2021-07-09 is incompatible with Python 3.12, and - # uses eliot in a way incompatible after version 1.14.0. - # These versions should be unpinned, when updating Tahoe-LAFS to a more recent version. - python = python311.override { - self = python; - packageOverrides = self: super: { - eliot = super.eliot.overridePythonAttrs (oldAttrs: rec { - version = "1.14.0"; - - src = fetchFromGitHub { - owner = "itamarst"; - repo = "eliot"; - rev = "refs/tags/${version}"; - hash = "sha256-1QE/s8P2g7DGIcuT+/AikAaWMTafNWn4BRZqpBn5ghk="; - }; - - disabledTests = [ - "test_default" - "test_large_numpy_array" - "test_numpy" - ]; - }); - }; - }; - python3Packages = python.pkgs; -in python3Packages.buildPythonApplication rec { pname = "tahoe-lafs"; - version = "unstable-2021-07-09"; + version = "1.20.0"; + pyproject = true; src = fetchFromGitHub { owner = "tahoe-lafs"; repo = "tahoe-lafs"; - rev = "8e28a9d0e02fde2388aca549da2b5c452ac4337f"; - sha256 = "sha256-MuD/ZY+die7RCsuVdcePSD0DdwatXRi7CxW2iFt22L0="; + tag = "tahoe-lafs-${version}"; + hash = "sha256-9qaL4GmdjClviKTnwAxaTywvJChQ5cVVgWs1IkFxhIY="; }; outputs = [ @@ -55,86 +24,65 @@ python3Packages.buildPythonApplication rec { "info" ]; - postPatch = '' - sed -i "src/allmydata/util/iputil.py" \ - -es"|_linux_path = '/sbin/ifconfig'|_linux_path = '${nettools}/bin/ifconfig'|g" - - # Chroots don't have /etc/hosts and /etc/resolv.conf, so work around - # that. - for i in $(find src/allmydata/test -type f) - do - sed -i "$i" -e"s/localhost/127.0.0.1/g" - done - - sed -i 's/"zope.interface.*"/"zope.interface"/' src/allmydata/_auto_deps.py - sed -i 's/"pycrypto.*"/"pycrypto"/' src/allmydata/_auto_deps.py - - # incompatible with latest autobahn - rm src/allmydata/test/web/test_logs.py - ''; - # Remove broken and expensive tests. preConfigure = '' ( cd src/allmydata/test # Buggy? - rm cli/test_create.py test_client.py + rm cli/test_create.py # These require Tor and I2P. rm test_connections.py test_iputil.py test_hung_server.py test_i2p_provider.py test_tor_provider.py - - # Fails due to the above tests missing - rm test_python3.py - - # Expensive - rm test_system.py ) ''; + build-system = with python3Packages; [ + hatch-vcs + hatchling + ]; + nativeBuildInputs = with python3Packages; [ + # docs + recommonmark sphinx + sphinx-rtd-theme texinfo ]; - # The `backup' command requires `sqlite3'. - propagatedBuildInputs = + dependencies = with python3Packages; [ - appdirs - beautifulsoup4 - characteristic + attrs + autobahn + cbor2 + click + collections-extended + cryptography distro eliot - fixtures + filelock foolscap future - html5lib + klein magic-wormhole netifaces - pyasn1 - pycrypto + psutil + pycddl + pyopenssl + pyrsistent pyutil pyyaml - recommonmark - service-identity - simplejson - sphinx-rtd-theme - testtools + six treq twisted + werkzeug zfec zope-interface ] ++ twisted.optional-dependencies.tls ++ twisted.optional-dependencies.conch; - nativeCheckInputs = with python3Packages; [ - mock - hypothesis - twisted - ]; - # Install the documentation. postInstall = '' ( @@ -150,11 +98,34 @@ python3Packages.buildPythonApplication rec { ) ''; + nativeCheckInputs = + with python3Packages; + [ + beautifulsoup4 + fixtures + html5lib + hypothesis + mock + prometheus-client + testtools + twisted + ] + ++ [ + versionCheckHook + ]; + versionCheckProgram = "${placeholder "out"}/bin/tahoe"; + versionCheckProgramArg = "--version"; + checkPhase = '' + runHook preCheck + + runHook versionCheckHook trial --rterrors allmydata + + runHook postCheck ''; - meta = with lib; { + meta = { description = "Tahoe-LAFS, a decentralized, fault-tolerant, distributed storage system"; mainProgram = "tahoe"; longDescription = '' @@ -165,10 +136,10 @@ python3Packages.buildPythonApplication rec { ''; homepage = "https://tahoe-lafs.org/"; license = [ - licenses.gpl2Plus # or + lib.licenses.gpl2Plus # or "TGPPLv1+" ]; maintainers = with lib.maintainers; [ MostAwesomeDude ]; - platforms = platforms.linux; + platforms = lib.platforms.linux; }; }