From 10be73149349daca80941c27a0145000acb89871 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Fri, 17 Sep 2021 14:45:52 -0400
Subject: [PATCH] Allow the Nix package to be built against Tahoe 1.16.0rc1

---
 default.nix             | 9 +++++++--
 nix/repo-1_16_0_rc1.nix | 7 +++++++
 nix/tahoe-lafs-1_16.nix | 6 ++++++
 3 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 nix/repo-1_16_0_rc1.nix
 create mode 100644 nix/tahoe-lafs-1_16.nix

diff --git a/default.nix b/default.nix
index 9910ed3..6d24dab 100644
--- a/default.nix
+++ b/default.nix
@@ -3,12 +3,17 @@
 , collectCoverage ? false
 , testSuite ? null
 , trialArgs ? null
-, tahoe-lafs ? null
+, tahoe-lafs ? "1.14.0"
 }:
 let
+  tahoe-packages = {
+    "1.14.0"    = pkgs.python2Packages.tahoe-lafs-1_14;
+    "1.16.0rc1" = pkgs.python2Packages.callPackage ./nix/tahoe-lafs-1_16.nix { };
+  };
+  tahoe-lafs' = builtins.getAttr tahoe-lafs tahoe-packages;
+
   pkgs' = pkgs.extend (import ./overlays.nix);
   callPackage = pkgs'.python27Packages.callPackage;
-  tahoe-lafs' = if tahoe-lafs == null then pkgs.python2Packages.tahoe-lafs-1_14 else tahoe-lafs;
 in
 callPackage ./zkapauthorizer.nix {
   challenge-bypass-ristretto = callPackage ./python-challenge-bypass-ristretto.nix { };
diff --git a/nix/repo-1_16_0_rc1.nix b/nix/repo-1_16_0_rc1.nix
new file mode 100644
index 0000000..4dce852
--- /dev/null
+++ b/nix/repo-1_16_0_rc1.nix
@@ -0,0 +1,7 @@
+{ fetchFromGitHub }:
+fetchFromGitHub {
+  owner = "fenn-cs";
+  repo = "tahoe-lafs";
+  rev = "f6a96ae3976ee21ad0376f7b6a22fc3d12110dce";
+  sha256 = "sha256:127z83c388mvxkz1qdjqdnlj5xgshyn5w5v40vda6mpyy7k9bpb4";
+}
diff --git a/nix/tahoe-lafs-1_16.nix b/nix/tahoe-lafs-1_16.nix
new file mode 100644
index 0000000..0aed9bd
--- /dev/null
+++ b/nix/tahoe-lafs-1_16.nix
@@ -0,0 +1,6 @@
+{ callPackage }:
+let
+  repo = callPackage ./repo-1_16_0_rc1.nix { };
+  tahoe-lafs = callPackage "${repo}/nix" { };
+in
+  tahoe-lafs
-- 
GitLab