-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdefault.nix
More file actions
46 lines (39 loc) · 1.01 KB
/
default.nix
File metadata and controls
46 lines (39 loc) · 1.01 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
{
python3,
buildPythonPackage,
lib,
pytest,
nix-gitignore,
clang,
swig4,
}:
let
yosys = builtins.fetchTarball {
url = "https://github.com/yosyshq/yosys/archive/73cb4977b2e493b840b23419919a63be7c83e6df.tar.gz";
sha256 = "sha256:0rhhx08dia0rd51rp3922vnqzi2fjarz1mrzp27s79k9y5k0mhzk";
};
in
buildPythonPackage rec {
name = "libparse";
version_file = builtins.readFile ./libparse/__version__.py;
version_list = builtins.match ''.+''\n__version__ = "([^"]+)"''\n.+''$'' version_file;
version = builtins.head version_list;
prePatch = ''
rm -rf ./yosys
cp -r ${yosys} ./yosys
'';
src = (nix-gitignore.gitignoreSourcePure ./.gitignore ./.);
checkPhase = ''
python3 ./test/test.py
'';
nativeBuildInputs = [
clang
swig4
];
meta = with lib; {
description = "Python wrapper around Yosys's libparse";
license = with licenses; [asl20];
homepage = "https://github.com/efabless/libpaprse-python";
platforms = platforms.linux ++ platforms.darwin;
};
}