nixpkgs/pkgs/applications/networking/instant-messengers/element/seshat/default.nix
2021-08-04 00:08:53 +02:00

45 lines
1.2 KiB
Nix

{ rustPlatform, fetchFromGitHub, callPackage, sqlcipher, nodejs-14_x, python3, yarn, fixup_yarn_lock }:
rustPlatform.buildRustPackage rec {
pname = "seshat-node";
version = "2.3.0";
src = fetchFromGitHub {
owner = "matrix-org";
repo = "seshat";
rev = version;
sha256 = "0zigrz59mhih9asmbbh38z2fg0sii2342q6q0500qil2a0rssai7";
};
sourceRoot = "source/seshat-node/native";
nativeBuildInputs = [ nodejs-14_x python3 yarn ];
buildInputs = [ sqlcipher ];
npm_config_nodedir = nodejs-14_x;
yarnOfflineCache = (callPackage ./yarn.nix {}).offline_cache;
buildPhase = ''
cd ..
chmod u+w . ./yarn.lock
export HOME=/tmp
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
${fixup_yarn_lock}/bin/fixup_yarn_lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
node_modules/.bin/neon build --release
'';
doCheck = false;
installPhase = ''
shopt -s extglob
rm -rf native/!(index.node)
rm -rf node_modules
cp -r . $out
'';
cargoSha256 = "0habjf85mzqxwf8k15msm4cavd7ldq4zpxddkwd4inl2lkvlffqj";
}