tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
etherpad-lite: init at 2.3.0
same as #353814, but newer version
Isa
9 months ago
9ef6ff72
b08e86e1
+166
3 changed files
expand all
collapse all
unified
split
pkgs
by-name
et
etherpad-lite
dont-fail-on-plugins-json.patch
outdir.patch
package.nix
+19
pkgs/by-name/et/etherpad-lite/dont-fail-on-plugins-json.patch
···
1
1
+
diff --git a/src/static/js/pluginfw/installer.ts b/src/static/js/pluginfw/installer.ts
2
2
+
index c605378e1..27e3e487b 100644
3
3
+
--- a/src/static/js/pluginfw/installer.ts
4
4
+
+++ b/src/static/js/pluginfw/installer.ts
5
5
+
@@ -83,7 +83,13 @@ export const checkForMigration = async () => {
6
6
+
try {
7
7
+
await fs.access(installedPluginsPath, fs.constants.F_OK);
8
8
+
} catch (err) {
9
9
+
- await migratePluginsFromNodeModules();
10
10
+
+ logger.info(`${installedPluginsPath} not found, creating using current node modules`);
11
11
+
+ try {
12
12
+
+ await migratePluginsFromNodeModules();
13
13
+
+ } catch (err2) {
14
14
+
+ logger.warn(`unable to create ${installedPluginsPath}, skipping plugin migrations`);
15
15
+
+ return;
16
16
+
+ }
17
17
+
}
18
18
+
19
19
+
/*
+51
pkgs/by-name/et/etherpad-lite/outdir.patch
···
1
1
+
From e881a383b38d4d80ee28c17a14b5de58889245de Mon Sep 17 00:00:00 2001
2
2
+
From: Alexandre Iooss <erdnaxe@crans.org>
3
3
+
Date: Tue, 5 Nov 2024 16:30:33 +0100
4
4
+
Subject: [PATCH] Use temporary directory for esbuild
5
5
+
6
6
+
---
7
7
+
src/node/hooks/express/specialpages.ts | 11 +++++------
8
8
+
9
9
+
diff --git a/src/node/hooks/express/specialpages.ts b/src/node/hooks/express/specialpages.ts
10
10
+
index 2e26eaa0cee..31d5138e67c 100644
11
11
+
--- a/src/node/hooks/express/specialpages.ts
12
12
+
+++ b/src/node/hooks/express/specialpages.ts
13
13
+
@@ -3,6 +3,7 @@
14
14
+
import path from 'node:path';
15
15
+
const eejs = require('../../eejs')
16
16
+
import fs from 'node:fs';
17
17
+
+import os from 'node:os';
18
18
+
const fsp = fs.promises;
19
19
+
const toolbar = require('../../utils/toolbar');
20
20
+
const hooks = require('../../../static/js/pluginfw/hooks');
21
21
+
@@ -89,7 +90,7 @@ const convertTypescript = (content: string) => {
22
22
+
const outputRaw = buildSync({
23
23
+
stdin: {
24
24
+
contents: content,
25
25
+
- resolveDir: path.join(settings.root, 'var','js'),
26
26
+
+ resolveDir: settings.root,
27
27
+
loader: 'js'
28
28
+
},
29
29
+
alias:{
30
30
+
@@ -222,7 +223,7 @@ const convertTypescriptWatched = (content: string, cb: (output:string, hash: str
31
31
+
build({
32
32
+
stdin: {
33
33
+
contents: content,
34
34
+
- resolveDir: path.join(settings.root, 'var','js'),
35
35
+
+ resolveDir: settings.root,
36
36
+
loader: 'js'
37
37
+
},
38
38
+
alias:{
39
39
+
@@ -276,10 +277,8 @@ exports.expressCreateServer = async (hookName: string, args: ArgsExpressType, cb
40
40
+
settings,
41
41
+
})
42
42
+
43
43
+
-
44
44
+
-
45
45
+
- const outdir = path.join(settings.root, 'var','js')
46
46
+
- // Create the outdir if it doesn't exist
47
47
+
+ // Create a temporary directory to store runtime-built JS files
48
48
+
+ const outdir = path.join(os.tmpdir(), 'js');
49
49
+
if (!fs.existsSync(outdir)) {
50
50
+
fs.mkdirSync(outdir);
51
51
+
}
+96
pkgs/by-name/et/etherpad-lite/package.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
stdenv,
4
4
+
fetchFromGitHub,
5
5
+
nix-update-script,
6
6
+
pnpm_9,
7
7
+
makeWrapper,
8
8
+
nodejs,
9
9
+
}:
10
10
+
11
11
+
let
12
12
+
pnpm = pnpm_9;
13
13
+
in
14
14
+
stdenv.mkDerivation (finalAttrs: {
15
15
+
pname = "etherpad-lite";
16
16
+
version = "2.3.0";
17
17
+
18
18
+
src = fetchFromGitHub {
19
19
+
owner = "ether";
20
20
+
repo = "etherpad-lite";
21
21
+
tag = "v${finalAttrs.version}";
22
22
+
hash = "sha256-OomZ1oziEGgLJfYyfkHZOPRHfrrWc4XLAsZA4cn0btA=";
23
23
+
};
24
24
+
25
25
+
patches = [
26
26
+
./outdir.patch
27
27
+
# etherpad expects to read and write $out/lib/var/installed_plugins.json
28
28
+
# FIXME: this patch disables plugin support
29
29
+
./dont-fail-on-plugins-json.patch
30
30
+
];
31
31
+
32
32
+
pnpmDeps = pnpm.fetchDeps {
33
33
+
inherit (finalAttrs) pname version src;
34
34
+
hash = "sha256-nhiPopGLCeCHiqEQ3solwuLwkDnHTH3otbxIJmbuQAA=";
35
35
+
};
36
36
+
37
37
+
nativeBuildInputs = [
38
38
+
pnpm.configHook
39
39
+
makeWrapper
40
40
+
];
41
41
+
42
42
+
buildInputs = [
43
43
+
nodejs
44
44
+
];
45
45
+
46
46
+
buildPhase = ''
47
47
+
runHook preBuild
48
48
+
NODE_ENV="production" pnpm run build:etherpad
49
49
+
runHook postBuild
50
50
+
'';
51
51
+
52
52
+
preInstall = ''
53
53
+
# remove unnecessary files
54
54
+
rm node_modules/.modules.yaml
55
55
+
pnpm prune --prod --ignore-scripts
56
56
+
find -type f \( -name "*.d.ts" -o -name "*.map" \) -exec rm -rf {} +
57
57
+
58
58
+
# remove non-deterministic files
59
59
+
rm node_modules/.modules.yaml
60
60
+
'';
61
61
+
62
62
+
# Upstream scripts uses `pnpm run prod` which is equivalent to
63
63
+
# `cross-env NODE_ENV=production node --require tsx/cjs node/server.ts`
64
64
+
installPhase = ''
65
65
+
runHook preInstall
66
66
+
mkdir -p $out/{lib/etherpad-lite,bin}
67
67
+
cp -r node_modules ui src doc admin $out/lib/etherpad-lite
68
68
+
makeWrapper ${lib.getExe nodejs} $out/bin/etherpad-lite \
69
69
+
--inherit-argv0 \
70
70
+
--add-flags "--require tsx/cjs $out/lib/etherpad-lite/node_modules/ep_etherpad-lite/node/server.ts" \
71
71
+
--suffix PATH : "${lib.makeBinPath [ pnpm ]}" \
72
72
+
--set NODE_PATH "$out/lib/node_modules:$out/lib/etherpad-lite/node_modules/ep_etherpad-lite/node_modules" \
73
73
+
--set-default NODE_ENV production
74
74
+
find $out/lib -xtype l -delete
75
75
+
runHook postInstall
76
76
+
'';
77
77
+
78
78
+
passthru.updateScript = nix-update-script { };
79
79
+
80
80
+
meta = {
81
81
+
description = "Modern really-real-time collaborative document editor";
82
82
+
longDescription = ''
83
83
+
Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users.
84
84
+
It provides full data export capabilities, and runs on your server, under your control.
85
85
+
'';
86
86
+
homepage = "https://etherpad.org/";
87
87
+
changelog = "https://github.com/ether/etherpad-lite/blob/${finalAttrs.src.rev}/CHANGELOG.md";
88
88
+
maintainers = with lib.maintainers; [
89
89
+
erdnaxe
90
90
+
f2k1de
91
91
+
];
92
92
+
license = lib.licenses.asl20;
93
93
+
mainProgram = "etherpad-lite";
94
94
+
platforms = lib.platforms.unix;
95
95
+
};
96
96
+
})