This repository has been archived by the owner on Mar 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdefault.nix
62 lines (54 loc) · 1.78 KB
/
default.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
52
53
54
55
56
57
58
59
60
61
62
{ stdenv, makeWrapper, symlinkJoin, lib, glibcLocales, coreutils, bash, parallel, bc, jq, gnused,
datamash, gnugrep, curl,
ethsign, foundry, setzer,
ssb-server, oracle-suite, oracleVersion ? "0.0.0-dev" }:
stdenv.mkDerivation rec {
name = "omnia-${version}";
version = lib.fileContents ./version;
src = ./.;
buildInputs =
[ coreutils bash parallel bc jq gnused datamash gnugrep ssb-server ethsign foundry setzer oracle-suite curl ];
nativeBuildInputs = [ makeWrapper ];
passthru.runtimeDeps = buildInputs;
buildPhase = ''
find ./bin -type f | while read -r x; do patchShebangs "$x"; done
find ./exec -type f | while read -r x; do patchShebangs "$x"; done
'';
doCheck = true;
checkPhase = ''
find ./test -path "*/test/*.sh" -executable | while read -r x; do
patchShebangs "$x"
PATH="./exec:$PATH" $x
done
'';
installPhase = let
path = lib.makeBinPath passthru.runtimeDeps;
locales = lib.optionalString (glibcLocales != null) ''--set LOCALE_ARCHIVE "${glibcLocales}"/lib/locale/locale-archive'';
in ''
mkdir -p $out
cp -r ./version $out/version
cp -r ./lib $out/lib
cp -r ./config $out/config
cp -r ./bin $out/bin
chmod +x $out/bin/*
find $out/bin -type f | while read -r x; do
wrapProgram "$x" \
--prefix PATH : "$out/exec:${path}" \
--set ORACLE_VERSION "${oracleVersion}" \
${locales}
done
cp -r ./exec $out/exec
chmod +x $out/exec/*
find $out/exec -type f | while read -r x; do
wrapProgram "$x" \
--prefix PATH : "$out/exec:${path}" \
${locales}
done
'';
meta = {
description = "Omnia is a Feed and Relay Oracle client";
homepage = "https://github.com/chronicleprotocol/omnia";
license = lib.licenses.gpl3;
inherit version;
};
}