fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 bison,
7 boost,
8 capnproto,
9 doxygen,
10 flex,
11 pkg-config,
12 python3,
13 tbb_2021,
14 buildPackages,
15 nix-update-script,
16}:
17stdenv.mkDerivation (finalAttrs: {
18 pname = "naja";
19 version = "0.2.1";
20
21 src = fetchFromGitHub {
22 owner = "najaeda";
23 repo = "naja";
24 tag = "v${finalAttrs.version}";
25 hash = "sha256-eKeb6V9u4huesQV4sq9GxIcxO2SVvMrUDeQaObCCags=";
26 fetchSubmodules = true;
27 };
28
29 outputs = [
30 "out"
31 "lib"
32 "dev"
33 ];
34
35 # disable building tests for cross build
36 postPatch =
37 lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
38 substituteInPlace CMakeLists.txt \
39 --replace-fail 'enable_testing()' "" \
40 --replace-fail 'add_subdirectory(test)' ""
41 substituteInPlace thirdparty/yosys-liberty/CMakeLists.txt \
42 --replace-fail 'add_subdirectory(test)' ""
43 ''
44 + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
45 patchShebangs --build test/test_utils/diff_files.py
46 '';
47
48 strictDeps = true;
49
50 nativeBuildInputs = [
51 bison
52 cmake
53 doxygen
54 flex
55 pkg-config
56 ]
57 ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
58 python3 # test scripts
59 ];
60
61 buildInputs = [
62 boost
63 capnproto # cmake modules
64 flex # include dir
65 tbb_2021
66 python3
67 ];
68
69 cmakeFlags = [
70 # provide correct executables for cross
71 (lib.cmakeFeature "Python3_EXECUTABLE" (lib.getExe python3.pythonOnBuildForHost))
72 # TODO: remove these once capnp cross is fixed properly
73 (lib.cmakeFeature "CAPNP_EXECUTABLE" (lib.getExe' buildPackages.capnproto "capnp"))
74 (lib.cmakeFeature "CAPNPC_CXX_EXECUTABLE" (lib.getExe' buildPackages.capnproto "capnpc-c++"))
75 ];
76
77 postInstall = ''
78 moveToOutput lib/libnaja_bne.so $lib
79 '';
80
81 doCheck = true;
82
83 passthru.updateScript = nix-update-script { };
84
85 meta = {
86 description = "Structural Netlist API (and more) for EDA post synthesis flow development";
87 homepage = "https://github.com/najaeda/naja";
88 license = lib.licenses.asl20;
89 teams = [ lib.teams.ngi ];
90 mainProgram = "naja_edit";
91 platforms = lib.platforms.all;
92 };
93})