Commit 2aa1c488 authored by dish's avatar dish
Browse files

matrix-appservice-slack: drop

The package still relies on classic Slack apps, which have been
deprecated, as well as mkYarnPackage in nixpkgs, which is deprecated.
I'd consider it abandoned at this point.
parent 14195556
Loading
Loading
Loading
Loading
+0 −79
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  cargo,
  rustPlatform,
  rustc,
  napi-rs-cli,
  nodejs,
  libiconv,
}:

stdenv.mkDerivation rec {
  pname = "matrix-sdk-crypto-nodejs";
  version = "0.1.0-beta.3";

  src = fetchFromGitHub {
    owner = "matrix-org";
    repo = "matrix-rust-sdk";
    tag = "${pname}-v${version}";
    hash = "sha256-0p+1cMn9PU+Jk2JW7G+sdzxhMaI3gEAk5w2nm05oBSU=";
  };

  patches = [
    # This is needed because two versions of indexed_db_futures are present (which will fail to vendor, see https://github.com/rust-lang/cargo/issues/10310).
    # (matrix-sdk-crypto-nodejs doesn't use this dependency, we only need to remove it to vendor the dependencies successfully.)
    ./remove-duplicate-dependency.patch
  ];

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit
      pname
      version
      src
      patches
      ;
    hash = "sha256-utpqRh5FIVgEX0dbYIS3GL/np6g6Itz8t27ov5CBrG8=";
  };

  nativeBuildInputs = [
    rustPlatform.cargoSetupHook
    cargo
    rustc
    napi-rs-cli
    nodejs
  ];

  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];

  buildPhase = ''
    runHook preBuild

    cd bindings/${pname}
    npm run release-build --offline

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    local -r outPath="$out/lib/node_modules/@matrix-org/${pname}"
    mkdir -p "$outPath"
    cp package.json index.js index.d.ts matrix-sdk-crypto.*.node "$outPath"

    runHook postInstall
  '';

  meta = {
    description = "No-network-IO implementation of a state machine that handles E2EE for Matrix clients";
    homepage = "https://github.com/matrix-org/matrix-rust-sdk/tree/${src.rev}/bindings/matrix-sdk-crypto-nodejs";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [
      winter
      dandellion
    ];
    inherit (nodejs.meta) platforms;
  };
}
+0 −55
Original line number Diff line number Diff line
diff --git a/Cargo.lock b/Cargo.lock
index 208ef4ff..b5045040 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2124,19 +2124,6 @@ dependencies = [
  "web-sys",
 ]
 
-[[package]]
-name = "indexed_db_futures"
-version = "0.2.3"
-source = "git+https://github.com/Hywan/rust-indexed-db?branch=feat-factory-nodejs#5dab67890cea0ab88b967031adc09179a537d77c"
-dependencies = [
- "cfg-if",
- "js-sys",
- "uuid 0.8.2",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
 [[package]]
 name = "indexmap"
 version = "1.9.1"
@@ -2726,8 +2713,7 @@ dependencies = [
  "derive_builder",
  "getrandom 0.2.7",
  "gloo-utils",
- "indexed_db_futures 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "indexed_db_futures 0.2.3 (git+https://github.com/Hywan/rust-indexed-db?branch=feat-factory-nodejs)",
+ "indexed_db_futures",
  "js-sys",
  "matrix-sdk-base",
  "matrix-sdk-common",
diff --git a/crates/matrix-sdk-indexeddb/Cargo.toml b/crates/matrix-sdk-indexeddb/Cargo.toml
index 5b0ef4f4..da73979b 100644
--- a/crates/matrix-sdk-indexeddb/Cargo.toml
+++ b/crates/matrix-sdk-indexeddb/Cargo.toml
@@ -16,7 +16,7 @@ rustdoc-args = ["--cfg", "docsrs"]
 [features]
 default = ["e2e-encryption"]
 e2e-encryption = ["matrix-sdk-base/e2e-encryption", "dep:matrix-sdk-crypto", "dashmap"]
-experimental-nodejs = ["indexed_db_futures_nodejs"]
+experimental-nodejs = []
 
 [dependencies]
 anyhow = "1.0.57"
@@ -26,7 +26,6 @@ dashmap = { version = "5.2.0", optional = true }
 derive_builder = "0.11.2"
 gloo-utils = { version = "0.1", features = ["serde"] }
 indexed_db_futures = "0.2.3"
-indexed_db_futures_nodejs = { version = "0.2.3", package = "indexed_db_futures", git = "https://github.com/Hywan/rust-indexed-db", branch = "feat-factory-nodejs", optional = true }
 js-sys = { version = "0.3.58" }
 matrix-sdk-base = { version = "0.6.0", path = "../matrix-sdk-base", features = ["js"] }
 matrix-sdk-crypto = { version = "0.6.0", path = "../matrix-sdk-crypto", features = ["js"], optional = true }
+0 −96
Original line number Diff line number Diff line
{
  "name": "matrix-appservice-slack",
  "version": "2.1.2",
  "description": "A Matrix <--> Slack bridge",
  "engines": {
    "node": ">=16 <=18"
  },
  "main": "app.js",
  "scripts": {
    "prepare": "yarn build",
    "start": "node ./lib/app.js",
    "build": "yarn build:app && yarn build:widget",
    "build:app": "tsc --build",
    "build:widget": "vite build --config widget/vite.config.ts",
    "test": "yarn test:unit && yarn test:integration",
    "test:unit": "mocha --require ts-node/register --recursive tests/unit/*.ts",
    "test:integration": "mocha --exit --reporter list --ui bdd --require ts-node/register --recursive tests/integration/*.ts",
    "test:postgres": "SLACKBRIDGE_TEST_ENABLEPG=yes mocha --reporter list --ui bdd --require ts-node/register --recursive tests/integration/PgDatastoreTest.ts",
    "lint": "eslint -c .eslintrc.js ./src && eslint -c ./widget/.eslintrc.js 'widget/src/**/*.{ts,tsx}'"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/matrix-org/matrix-appservice-slack.git"
  },
  "keywords": [
    "matrix-org",
    "slack"
  ],
  "author": "Matrix.org",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/matrix-org/matrix-appservice-slack/issues"
  },
  "homepage": "https://github.com/matrix-org/matrix-appservice-slack#readme",
  "dependencies": {
    "@alloc/quick-lru": "^5.2.0",
    "@slack/logger": "^3.0.0",
    "@slack/rtm-api": "^6.0.0",
    "@slack/web-api": "^6.7.2",
    "Slackdown": "git+https://Half-Shot@github.com/half-shot/slackdown.git",
    "ajv": "^8.12.0",
    "axios": "^0.27.2",
    "classnames": "^2.3.2",
    "escape-string-regexp": "^4.0.0",
    "https-proxy-agent": "^5.0.1",
    "matrix-appservice-bridge": "^8.1.2",
    "matrix-widget-api": "^1.1.1",
    "minimist": "^1.2.6",
    "nedb": "^1.8.0",
    "node-emoji": "^1.10.0",
    "nunjucks": "^3.2.4",
    "p-queue": "^6.0.0",
    "pg-promise": "^10.11.1",
    "randomstring": "^1.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "url-join": "^5.0.0",
    "uuid": "^8.3.2",
    "yargs": "17.5.1"
  },
  "devDependencies": {
    "@tailwindcss/forms": "^0.5.3",
    "@tsconfig/node16": "^1.0.3",
    "@types/chai": "^4.2.21",
    "@types/js-yaml": "^4.0.2",
    "@types/mocha": "^9.1.1",
    "@types/nedb": "^1.8.12",
    "@types/node": "^18.6.1",
    "@types/node-emoji": "^1.8.1",
    "@types/nunjucks": "^3.1.5",
    "@types/randomstring": "^1.1.7",
    "@types/react": "^18.0.27",
    "@types/react-dom": "^18.0.10",
    "@types/uuid": "^8.3.1",
    "@types/yargs": "17.0.10",
    "@typescript-eslint/eslint-plugin": "^5.0.0",
    "@typescript-eslint/parser": "^5.50.0",
    "@vitejs/plugin-react": "^3.1.0",
    "autoprefixer": "^10.4.13",
    "chai": "^4.3.4",
    "eslint": "^8.20.0",
    "eslint-plugin-jsdoc": "^39.3.3",
    "eslint-plugin-prefer-arrow": "^1.2.3",
    "eslint-plugin-react": "^7.32.2",
    "eslint-plugin-react-hooks": "^4.6.0",
    "js-yaml": "^4.1.0",
    "mocha": "^10.0.0",
    "postcss": "^8.4.21",
    "prom-client": "^14.0.1",
    "source-map-support": "^0.5.19",
    "tailwindcss": "^3.2.4",
    "ts-node": "^10.1.0",
    "typescript": "^4.4.3",
    "vite": "^4.1.1"
  }
}
+0 −65
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  fetchYarnDeps,
  makeWrapper,
  mkYarnPackage,
  nodejs_20,
  callPackage,
}:

let
  data = lib.importJSON ./pin.json;
  nodejs = nodejs_20;
  matrix-sdk-crypto-nodejs = callPackage ./matrix-sdk-crypto-nodejs-0_1_0-beta_3/package.nix { };
in
mkYarnPackage rec {
  inherit nodejs;

  pname = "matrix-appservice-slack";
  version = data.version;

  packageJSON = ./package.json;
  src = fetchFromGitHub {
    owner = "matrix-org";
    repo = "matrix-appservice-slack";
    rev = data.version;
    hash = data.srcHash;
  };

  offlineCache = fetchYarnDeps {
    yarnLock = src + "/yarn.lock";
    sha256 = data.yarnHash;
  };
  packageResolutions = {
    "@matrix-org/matrix-sdk-crypto-nodejs" =
      "${matrix-sdk-crypto-nodejs}/lib/node_modules/@matrix-org/matrix-sdk-crypto-nodejs";
  };

  nativeBuildInputs = [ makeWrapper ];

  buildPhase = ''
    runHook preBuild
    yarn run build
    runHook postBuild
  '';

  postInstall = ''
    makeWrapper '${nodejs}/bin/node' "$out/bin/matrix-appservice-slack" --add-flags \
        "$out/libexec/matrix-appservice-slack/deps/matrix-appservice-slack/lib/app.js"
  '';

  doDist = false;

  meta = with lib; {
    description = "Matrix <--> Slack bridge";
    mainProgram = "matrix-appservice-slack";
    maintainers = with maintainers; [
      beardhatcode
      chvp
    ];
    license = licenses.asl20;
    # Depends on nodejs_18 that has been removed.
    broken = true;
  };
}
+0 −5
Original line number Diff line number Diff line
{
  "version": "2.1.2",
  "srcHash": "sha256-e9k+5xvgHkVt/fKAr0XhYjbEzHYwdGRdqiPWWbT0T5M=",
  "yarnHash": "0266rrfx0fnrhn64ivy4iygf6nl5vc5i08j6h72k2zrh3rg203kz"
}
Loading