2022-10-30 15:09:59 +00:00
|
|
|
{ pkgs, nodePackages, makeWrapper, nixosTests, nodejs, stdenv, lib, fetchFromGitHub, fetchurl, autoPatchelfHook, matrix-sdk-crypto-nodejs }:
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
ourNodePackages = import ./node-composition.nix {
|
|
|
|
inherit pkgs nodejs;
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
version = (lib.importJSON ./package.json).version;
|
|
|
|
srcInfo = lib.importJSON ./src.json;
|
2021-04-05 15:23:46 +00:00
|
|
|
in
|
2021-12-06 16:07:01 +00:00
|
|
|
ourNodePackages.package.override {
|
2021-05-29 03:34:57 +00:00
|
|
|
pname = "matrix-appservice-irc";
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matrix-org";
|
|
|
|
repo = "matrix-appservice-irc";
|
|
|
|
rev = version;
|
|
|
|
inherit (srcInfo) sha256;
|
|
|
|
};
|
2021-05-29 03:34:57 +00:00
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook makeWrapper nodePackages.node-gyp-build ];
|
|
|
|
|
|
|
|
dontAutoPatchelf = true;
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
postRebuild = ''
|
|
|
|
npm run build
|
|
|
|
'';
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
postInstall = ''
|
|
|
|
makeWrapper '${nodejs}/bin/node' "$out/bin/matrix-appservice-irc" \
|
|
|
|
--add-flags "$out/lib/node_modules/matrix-appservice-irc/app.js"
|
2022-10-30 15:09:59 +00:00
|
|
|
|
|
|
|
cp -rv ${matrix-sdk-crypto-nodejs}/lib/node_modules/@matrix-org/matrix-sdk-crypto-nodejs $out/lib/node_modules/matrix-appservice-irc/node_modules/@matrix-org/
|
2021-04-05 15:23:46 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.matrix-appservice-irc = nixosTests.matrix-appservice-irc;
|
2021-08-22 07:53:02 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Node.js IRC bridge for Matrix";
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-04-05 15:23:46 +00:00
|
|
|
homepage = "https://github.com/matrix-org/matrix-appservice-irc";
|
|
|
|
license = licenses.asl20;
|
2022-09-14 18:05:37 +00:00
|
|
|
platforms = platforms.linux;
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
}
|