This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pkg-hopglass-fe.nix
51 lines (51 loc) · 1.58 KB
/
pkg-hopglass-fe.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ stdenv, lib, pkgs, python, nodejs_latest, fetchFromGitHub, fetchpatch, fetchzip, fetchurl, conf }:
let
nodejs = nodejs_latest;
yarn2nix = import (fetchFromGitHub {
rev = "3f2dbb08724bf8841609f932bfe1d61a78277232";
owner = "moretea";
repo = "yarn2nix";
sha256 = "142av7dwviapsnahgj8r6779gs2zr17achzhr8b97s0hsl08dcl2";
}) { inherit pkgs nodejs; };
in
yarn2nix.mkYarnPackage {
name = "hopglass-frontend";
src = fetchFromGitHub {
rev = "a2c943115937b13a7ee11630572ebbe3fa28d80a";
owner = "hopglass";
repo = "hopglass";
sha256 = "0448kbibnf21p2w0rvbfnxd5f45nvi8lsv3rxyma4876cc4imwbv";
};
conf = conf;
patches = [
(fetchpatch {
url = "https://github.com/freifunkhamburg/hopglass/commit/de3fc035ad2c1f3ff6b83a51b3678d9f7037d507.patch";
sha256 = "0wr2a7na3jb4z40blgm0nl54bhl2ablx34hxqmgsvncair5c66a9";
})
];
installPhase = ''
echo ---------------------------------------------------------------------------- installPhase
set -x
ls -l
cp -R $src/. .
chmod -R u+w .
# Time to patch again, due to the overwriting of the files.
patchPhase
node_modules/.bin/grunt --force
mkdir -p $out
set +x
'';
distPhase = ''
cp -Rv build/* $out/
cat "$conf" > $out/config.json
'';
allowedReferences = [ "out" ];
yarnPreBuild = ''
mkdir -p $HOME/.node-gyp/${nodejs.version}
echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
'';
# work around some purity problems in nix
#yarnLock = ./yarn.lock;
#packageJSON = ./package.json;
}