blob: d7cd65e9a53c5ae3da6165d569ddc9f3b7bec483 [file] [log] [blame]
Skyler Greyec5ffff2023-03-26 10:44:35 +00001{ fetchFromGitHub
2, nodejs
3, stdenv
4, callPackage
5, gnused
6}:
7let
8 nodeDependencies = (callPackage ./etherpad { }).nodeDependencies;
9in
10stdenv.mkDerivation rec {
11 pname = "etherpad";
12 version = "1.8.18";
13
14 src = fetchFromGitHub {
15 owner = "ether";
16 repo = "etherpad-lite";
17 rev = version;
18 sha256 = "sha256-FziTdHmZ7DgWlSd7AhRdZioQNEPmiGZFHjc8pwnpKIo=";
19 };
20
21 buildInputs = [
22 nodejs
23 ];
24
25 buildPhase = ''
26 ln -s ${nodeDependencies}/lib/node_modules ./src/node_modules
27 export PATH="${nodeDependencies}/bin:$PATH"
28 '';
29
30 installPhase = ''
31 mkdir $out
32 cp ./* $out -r
33
34 mv $out/bin/fastRun.sh $out/bin/etherpad
35 sed -i "s#^cd .*#cd $out/#g" $out/bin/etherpad
36 chmod +x $out/bin/etherpad
37 '';
38}