-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflake.nix
More file actions
63 lines (61 loc) · 1.77 KB
/
Copy pathflake.nix
File metadata and controls
63 lines (61 loc) · 1.77 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
{
description = "Graphical utilities for constraint graphs in hpp-manipulation";
inputs.gepetto.url = "github:gepetto/nix";
outputs =
inputs:
inputs.gepetto.lib.mkFlakoboros inputs (
{ lib, ... }:
{
overrideAttrs.hpp-plot =
{
drv-final,
drv-prev,
pkgs-final,
...
}:
{
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./bin
./cmake_modules
./CMakeLists.txt
./doc
./include
./package.xml
./plugins
./src
];
};
cmakeFlags = [
(lib.cmakeBool "USE_JS" false) # build from nix not cmake
];
postPatch = ''
# prepare npm offline cache
mkdir -p node_modules
cd src/web_app
cp package.json package-lock.json ../..
ln -s ../../node_modules
cd -
'';
nativeBuildInputs = drv-prev.nativeBuildInputs ++ [
pkgs-final.npmHooks.npmConfigHook
pkgs-final.nodejs
];
npmDeps = pkgs-final.fetchNpmDeps {
name = "${drv-final.pname}-${drv-final.version}-npm-deps";
src = drv-final.src + "/src/web_app/";
hash = "sha256-B8s+hhTn7CG3q8bx490SM8fKFAEGOmHX7u8JN/7qI94=";
};
preBuild = ''
cd ../src/web_app
npm --offline run build
cd -
'';
postInstall = ''
cp -r ../src/web_app/dist $out/share/hpp-plot/webapp
'';
};
}
);
}