-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upstream switched to using TypeScript in v4.4.0, which broke the patch. This fixes that issue by migrating to building The Lounge from source, instead of having to patch the minified JavaScript. (cherry picked from commit 6347aba)
- Loading branch information
Showing
7 changed files
with
86 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, yarn, fixup_yarn_lock, nodejs, npmHooks, nixosTests }: | ||
|
||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "thelounge"; | ||
version = "4.4.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "thelounge"; | ||
repo = "thelounge"; | ||
rev = "v${finalAttrs.version}"; | ||
hash = "sha256-2MHq71lKkFe1uHEENgUiYsO99bPyLmEZZIdcdgsZfSM="; | ||
}; | ||
|
||
# Allow setting package path for the NixOS module. | ||
patches = [ ./packages-path.patch ]; | ||
|
||
# Use the NixOS module's state directory by default. | ||
postPatch = '' | ||
echo /var/lib/thelounge > .thelounge_home | ||
''; | ||
|
||
offlineCache = fetchYarnDeps { | ||
yarnLock = "${finalAttrs.src}/yarn.lock"; | ||
hash = "sha256-OKLsNGl94EDyLgP2X2tiwihgRQFXGvf5XgXwgX+JEpk="; | ||
}; | ||
|
||
nativeBuildInputs = [ nodejs yarn fixup_yarn_lock npmHooks.npmInstallHook ]; | ||
|
||
configurePhase = '' | ||
runHook preConfigure | ||
export HOME="$PWD" | ||
fixup_yarn_lock yarn.lock | ||
yarn config --offline set yarn-offline-mirror ${finalAttrs.offlineCache} | ||
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive | ||
patchShebangs node_modules | ||
runHook postConfigure | ||
''; | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
NODE_ENV=production yarn build | ||
runHook postBuild | ||
''; | ||
|
||
# `npm prune` doesn't work and/or hangs for whatever reason. | ||
preInstall = '' | ||
rm -rf node_modules | ||
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive --production | ||
''; | ||
|
||
dontNpmPrune = true; | ||
|
||
# Takes way, way, way too long. | ||
dontStrip = true; | ||
|
||
passthru.tests = nixosTests.thelounge; | ||
|
||
meta = with lib; { | ||
description = "Modern, responsive, cross-platform, self-hosted web IRC client"; | ||
homepage = "https://thelounge.chat"; | ||
changelog = "https://github.com/thelounge/thelounge/releases/tag/v${finalAttrs.version}"; | ||
maintainers = with maintainers; [ winter raitobezarius ]; | ||
license = licenses.mit; | ||
inherit (nodejs.meta) platforms; | ||
}; | ||
}) |
13 changes: 13 additions & 0 deletions
13
pkgs/applications/networking/irc/thelounge/packages-path.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/server/config.ts b/server/config.ts | ||
index 543a8135..9744f00d 100644 | ||
--- a/server/config.ts | ||
+++ b/server/config.ts | ||
@@ -145,7 +145,7 @@ class Config { | ||
} | ||
|
||
getPackagesPath() { | ||
- return path.join(this.#homePath, "packages"); | ||
+ return process.env.THELOUNGE_PACKAGES || path.join(this.#homePath, "packages"); | ||
} | ||
|
||
getPackageModulePath(packageName: string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
pkgs/development/node-packages/thelounge-packages-path.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters