2023-04-16 22:27:32 +02:00
|
|
|
{ buildNpmPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, substituteAll
|
|
|
|
, esbuild
|
|
|
|
, buildGoModule
|
2023-05-08 08:49:28 +02:00
|
|
|
, buildWebExtension ? false
|
2023-04-16 22:27:32 +02:00
|
|
|
}:
|
|
|
|
buildNpmPackage rec {
|
2023-05-08 08:49:28 +02:00
|
|
|
pname = "vencord";
|
2023-06-18 19:39:56 +02:00
|
|
|
version = "1.2.8";
|
2023-04-16 22:27:32 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Vendicated";
|
|
|
|
repo = "Vencord";
|
|
|
|
rev = "v${version}";
|
2023-06-18 19:39:56 +02:00
|
|
|
sha256 = "sha256-l3h4LrpMQ944i4QivKeL3dhZxZCr5uG29pQMY1XNbqc=";
|
2023-04-16 22:27:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
ESBUILD_BINARY_PATH = lib.getExe (esbuild.override {
|
|
|
|
buildGoModule = args: buildGoModule (args // rec {
|
|
|
|
version = "0.15.18";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "evanw";
|
|
|
|
repo = "esbuild";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-b9R1ML+pgRg9j2yrkQmBulPuLHYLUQvW+WTyR/Cq6zE=";
|
|
|
|
};
|
|
|
|
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
# Supresses an error about esbuild's version.
|
|
|
|
npmRebuildFlags = [ "|| true" ];
|
|
|
|
|
2023-06-18 19:39:56 +02:00
|
|
|
npmDepsHash = "sha256-m+hczXog03Gz81CP/blkRJPaTrEhmLQFvVtOfWKYQL4=";
|
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-06-24 13:49:56 +02:00
|
|
|
npmBuildFlags = [ "--" "--standalone" ];
|
2023-04-16 22:27:32 +02:00
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
cp ${./package-lock.json} ./package-lock.json
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./replace-git.patch;
|
|
|
|
inherit version;
|
|
|
|
})
|
2023-06-24 14:18:46 +02:00
|
|
|
./disable-updater-ui.patch
|
2023-04-16 22:27:32 +02:00
|
|
|
];
|
|
|
|
|
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
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Vencord web extension";
|
|
|
|
homepage = "https://github.com/Vendicated/Vencord";
|
|
|
|
license = licenses.gpl3Only;
|
2023-05-08 08:43:49 +02:00
|
|
|
maintainers = with maintainers; [ FlafyDev NotAShelf Scrumplex ];
|
2023-04-16 22:27:32 +02:00
|
|
|
};
|
|
|
|
}
|