@@ -1,16 +1,23 @@
1−{ lib, fetchurl, python3Packages }:
1+{ lib, fetchFromGitHub, python3Packages }:
22
3−python3Packages.buildPythonPackage rec {
3+python3Packages.buildPythonApplication rec {
44 pname = "heisenbridge";
55 version = "1.6.0";
66
7− # Use the release tarball because it has the version set correctly using the
8− # version.txt file.
9− src = fetchurl {
10− url = "https://github.com/hifi/heisenbridge/releases/download/v${version}/heisenbridge-${version}.tar.gz";
11− sha256 = "sha256-NhHMReY48lg1FhJlCRjRiSpy+9bDLtIV+j+zX8GZcL4=";
7+ src = fetchFromGitHub {
8+ owner = "hifi";
9+ repo = pname;
10+ rev = "v${version}";
11+ sha256 = "sha256-Q7xqKjAUBHh87VAgsgDOCPDINDh0yUdr3UoUlLqJr5k=";
1212 };
1313
14+ postPatch = ''
15+ echo "${version}" > heisenbridge/version.txt
16+
17+ substituteInPlace setup.cfg \
18+ --replace "mautrix >=0.10.5, <0.11" "mautrix >=0.10.5, <0.12"
19+ '';
20+
1421 propagatedBuildInputs = with python3Packages; [
1522 aiohttp
1623 irc
@@ -19,6 +26,10 @@ python3Packages.buildPythonPackage rec {
1926 pyyaml
2027 ];
2128
29+ checkInputs = with python3Packages; [
30+ pytestCheckHook
31+ ];
32+
2233 meta = with lib; {
2334 description = "A bouncer-style Matrix-IRC bridge.";
2435 homepage = "https://github.com/hifi/heisenbridge";