File tree Expand file tree Collapse file tree 5 files changed +133
-17
lines changed
Expand file tree Collapse file tree 5 files changed +133
-17
lines changed Original file line number Diff line number Diff line change 1+ {
2+ python3 ,
3+ buildPythonPackage ,
4+ lib ,
5+ pytest ,
6+ nix-gitignore ,
7+ clang ,
8+ swig4 ,
9+ } :
10+
11+ let
12+ yosys = builtins . fetchTarball {
13+ url = "https://github.com/yosyshq/yosys/archive/73cb4977b2e493b840b23419919a63be7c83e6df.tar.gz" ;
14+ sha256 = "sha256:0rhhx08dia0rd51rp3922vnqzi2fjarz1mrzp27s79k9y5k0mhzk" ;
15+ } ;
16+ in
17+ buildPythonPackage rec {
18+ name = "libparse" ;
19+
20+ version_file = builtins . readFile ./libparse/__version__.py ;
21+ version_list = builtins . match ''.+''\n __version__ = "([^"]+)"''\n .+'' $'' version_file ;
22+ version = builtins . head version_list ;
23+
24+ prePatch = ''
25+ cp -r ${ yosys } ./yosys
26+ '' ;
27+
28+ src = ( nix-gitignore . gitignoreSourcePure ./.gitignore ./. ) ;
29+
30+ checkPhase = ''
31+ python3 ./test/test.py
32+ '' ;
33+
34+ nativeBuildInputs = [
35+ clang
36+ swig4
37+ ] ;
38+
39+ meta = with lib ; {
40+ description = "Python wrapper around Yosys's libparse" ;
41+ license = with licenses ; [ asl20 ] ;
42+ homepage = "https://github.com/efabless/libpaprse-python" ;
43+ platforms = platforms . linux ++ platforms . darwin ;
44+ } ;
45+ }
Original file line number Diff line number Diff line change 1+ # Copyright 2024 Efabless Corporation
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ {
15+ inputs = {
16+ nixpkgs . url = github:nixos/nixpkgs/nixos-23.11 ;
17+ } ;
18+
19+ outputs = {
20+ self ,
21+ nixpkgs ,
22+ ...
23+ } : {
24+ # Helper functions
25+ forAllSystems = function :
26+ nixpkgs . lib . genAttrs [
27+ "x86_64-linux"
28+ "aarch64-linux"
29+ "x86_64-darwin"
30+ "aarch64-darwin"
31+ ] (
32+ system :
33+ function ( import nixpkgs {
34+ inherit system ;
35+ } )
36+ ) ;
37+
38+ # Outputs
39+ packages = self . forAllSystems ( pkgs : let
40+ callPackage = pkgs . lib . callPackageWith ( pkgs // self . packages . ${ pkgs . system } ) ;
41+ callPythonPackage = pkgs . lib . callPackageWith ( pkgs // pkgs . python3 . pkgs // self . packages . ${ pkgs . system } ) ;
42+ in
43+ rec {
44+ libparse = callPythonPackage ./default.nix { } ;
45+ default = libparse ;
46+ }
47+ ) ;
48+ } ;
49+ }
Original file line number Diff line number Diff line change 1+ # Copyright 2024 Efabless Corporation
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
114__version__ = "0.3.1"
215
316if __name__ == "__main__" :
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments