From f20ffa02e93df2f1279984849d4588abe0301926 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Sep 2021 11:10:59 +0000 Subject: [PATCH] Get oroshi working --- flake.nix | 4 +-- nix/oroshi.nix | 56 +++++++++++++++++++++++++++------------ oroshi/python/__init__.py | 1 + 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index 6735c90d..04b665d1 100644 --- a/flake.nix +++ b/flake.nix @@ -56,13 +56,13 @@ pythonComponents = [ "vlsisapd" "hurricane" "crlcore" "flute" "etesian" "anabatic" "katana" "bora" "katabatic" "kite" - "tutorial" "unicorn" + "tutorial" "unicorn" "oroshi" ]; components = pythonComponents ++ [ "lefdef" "bootstrap" "cumulus" "coloquinte" "equinox" "knik" "ispd" "karakaze" "nimbus" - "metis" "mauka" "oroshi" "solstice" "stratus1" + "metis" "mauka" "solstice" "stratus1" "documentation" "unittests" ]; diff --git a/nix/oroshi.nix b/nix/oroshi.nix index 9aba7b57..b3e3c39b 100644 --- a/nix/oroshi.nix +++ b/nix/oroshi.nix @@ -1,21 +1,43 @@ -{ version, meta }: +{ generic, ... }: -{ lib, stdenv, cmake, ninja, python2, qt4, coriolis-crlcore -, coriolis-bootstrap, coriolis-vlsisapd, coriolis-hurricane -, doxygen, boost }: +let pkg = + { qt4, coriolis-crlcore, doxygen, lib, python2Packages + , coriolis-vlsisapd, coriolis-hurricane }: + { + name = "oroshi"; + src = ../oroshi; -let boostWithPython = boost.override { enablePython = true; python = python2; }; in + buildInputs = [ + coriolis-vlsisapd qt4 python2Packages.pyqt4 + coriolis-crlcore coriolis-hurricane qt4 + python2Packages.numpy + ]; + nativeBuildInputs = [ doxygen ]; -stdenv.mkDerivation { - pname = "coriolis-oroshi"; + postInstall = '' + # for import check + mkdir -p /build/coriolistop/etc/coriolis2 + export CORIOLIS_TOP=/build/coriolistop + ''; + pythonImportsCheck = [ + "oroshi.wip_transistor" + "oroshi.wip_dp" + "oroshi.wip_csp" + "oroshi.stack" + "oroshi.resistorsnake" + "oroshi.resistor" + "oroshi.paramsmatrix" + "oroshi.nonunitcapacitor" + "oroshi.multicapacitor" + "oroshi.dtr" + "oroshi.capacitorvrtracks" + "oroshi.capacitorunit" + "oroshi.capacitorroutedsingle" + "oroshi.capacitorrouted" + "oroshi.capacitormatrix" + "oroshi" + ]; - src = ../oroshi; - - buildInputs = [ - python2 coriolis-bootstrap coriolis-vlsisapd - coriolis-crlcore coriolis-hurricane qt4 boostWithPython - ]; - nativeBuildInputs = [ cmake ninja doxygen ]; - - inherit version meta; -} + meta.license = lib.licenses.gpl2Plus; + }; +in generic pkg diff --git a/oroshi/python/__init__.py b/oroshi/python/__init__.py index 02d16c11..af7a1b63 100644 --- a/oroshi/python/__init__.py +++ b/oroshi/python/__init__.py @@ -3,6 +3,7 @@ from Hurricane import DbU from Hurricane import DataBase import oroshi.dtr +if not DataBase.getDB(): DataBase.create() rules = None