2023-04-16 22:27:32 +02:00
|
|
|
{ buildNpmPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, esbuild
|
2023-05-08 08:49:28 +02:00
|
|
|
, buildWebExtension ? false
|
2023-04-16 22:27:32 +02:00
|
|
|
}:
|
2023-08-20 22:20:05 +02:00
|
|
|
let
|
2024-03-23 06:49:57 +01:00
|
|
|
version = "1.7.3";
|
|
|
|
gitHash = "caa14ec";
|
2023-08-20 22:20:05 +02:00
|
|
|
in
|
2023-04-16 22:27:32 +02:00
|
|
|
buildNpmPackage rec {
|
2023-05-08 08:49:28 +02:00
|
|
|
pname = "vencord";
|
2023-08-20 22:20:05 +02:00
|
|
|
inherit version;
|
2023-04-16 22:27:32 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Vendicated";
|
|
|
|
repo = "Vencord";
|
|
|
|
rev = "v${version}";
|
2024-03-23 06:49:57 +01:00
|
|
|
hash = "sha256-BsM7Gt1NEsZu/rxK58+Tix1xIJr6RvgbdjxVnro2soA=";
|
2023-04-16 22:27:32 +02:00
|
|
|
};
|
|
|
|
|
2023-10-22 10:04:13 +02:00
|
|
|
ESBUILD_BINARY_PATH = lib.getExe (esbuild.overrideAttrs (final: _: {
|
|
|
|
version = "0.15.18";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "evanw";
|
|
|
|
repo = "esbuild";
|
|
|
|
rev = "v${final.version}";
|
|
|
|
hash = "sha256-b9R1ML+pgRg9j2yrkQmBulPuLHYLUQvW+WTyR/Cq6zE=";
|
|
|
|
};
|
|
|
|
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
|
|
|
|
}));
|
2023-04-16 22:27:32 +02:00
|
|
|
|
|
|
|
# Supresses an error about esbuild's version.
|
|
|
|
npmRebuildFlags = [ "|| true" ];
|
|
|
|
|
2023-09-27 20:42:17 +02:00
|
|
|
makeCacheWritable = true;
|
2024-03-23 06:49:57 +01:00
|
|
|
npmDepsHash = "sha256-XRVxF0dW0HIsLtijvxM/feW6rI/c4LsnA6Tmrp51arE=";
|
2023-04-16 22:27:32 +02:00
|
|
|
npmFlags = [ "--legacy-peer-deps" ];
|
2023-05-08 08:49:28 +02:00
|
|
|
npmBuildScript = if buildWebExtension then "buildWeb" else "build";
|
2023-08-20 22:20:05 +02:00
|
|
|
npmBuildFlags = [ "--" "--standalone" "--disable-updater" ];
|
2023-04-16 22:27:32 +02:00
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
cp ${./package-lock.json} ./package-lock.json
|
2023-09-27 20:42:17 +02:00
|
|
|
chmod +w ./package-lock.json
|
2023-04-16 22:27:32 +02:00
|
|
|
'';
|
|
|
|
|
2023-08-20 22:20:05 +02:00
|
|
|
VENCORD_HASH = gitHash;
|
|
|
|
VENCORD_REMOTE = "${src.owner}/${src.repo}";
|
|
|
|
|
2023-06-24 13:49:56 +02:00
|
|
|
installPhase =
|
|
|
|
if buildWebExtension then ''
|
|
|
|
cp -r dist/chromium-unpacked/ $out
|
|
|
|
'' else ''
|
|
|
|
cp -r dist/ $out
|
|
|
|
'';
|
2023-04-16 22:27:32 +02:00
|
|
|
|
2023-10-22 17:53:50 +02:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2023-04-16 22:27:32 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Vencord web extension";
|
|
|
|
homepage = "https://github.com/Vendicated/Vencord";
|
|
|
|
license = licenses.gpl3Only;
|
2023-10-03 18:24:38 +02:00
|
|
|
maintainers = with maintainers; [ FlafyDev fwam NotAShelf Scrumplex ];
|
2023-04-16 22:27:32 +02:00
|
|
|
};
|
|
|
|
}
|