From 4dff6fd6c3d6ca812a554fab13d3abdbd2ec28ad Mon Sep 17 00:00:00 2001 From: Las Safin Date: Fri, 27 Aug 2021 14:26:33 +0000 Subject: [PATCH] etesian and anabatic --- anabatic/src/CMakeLists.txt | 1 + crlcore/cmake_modules/FindCORIOLIS.cmake | 2 + etesian/cmake_modules/FindETESIAN.cmake | 3 ++ flake.nix | 69 ++++-------------------- nix/anabatic.nix | 23 ++++++++ nix/coloquinte.nix | 2 - nix/crlcore.nix | 9 ---- nix/cumulus.nix | 10 ---- nix/etesian.nix | 22 ++++++++ nix/flute.nix | 10 ---- nix/hurricane.nix | 2 - nix/lefdef.nix | 2 - nix/vlsisapd.nix | 2 - 13 files changed, 62 insertions(+), 95 deletions(-) create mode 100644 nix/anabatic.nix create mode 100644 nix/etesian.nix diff --git a/anabatic/src/CMakeLists.txt b/anabatic/src/CMakeLists.txt index 7597035f..0752d5f1 100644 --- a/anabatic/src/CMakeLists.txt +++ b/anabatic/src/CMakeLists.txt @@ -6,6 +6,7 @@ endif ( CHECK_DETERMINISM ) include_directories( ${ANABATIC_SOURCE_DIR}/src ${CORIOLIS_INCLUDE_DIR} + ${ETESIAN_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR} ${FLUTE_INCLUDE_DIR} diff --git a/crlcore/cmake_modules/FindCORIOLIS.cmake b/crlcore/cmake_modules/FindCORIOLIS.cmake index d630ae0b..c4bf4637 100644 --- a/crlcore/cmake_modules/FindCORIOLIS.cmake +++ b/crlcore/cmake_modules/FindCORIOLIS.cmake @@ -63,3 +63,5 @@ IF(UNIX) HURRICANE_CHECK_LIBRARIES(CORIOLIS_PYTHON ${CORIOLIS_FIND_REQUIRED}) ENDIF(UNIX) + +SET(CORIOLIS_INCLUDE_DIR "${CRLCORE_INCLUDE_PATH}") diff --git a/etesian/cmake_modules/FindETESIAN.cmake b/etesian/cmake_modules/FindETESIAN.cmake index b0508d93..8c6a04df 100644 --- a/etesian/cmake_modules/FindETESIAN.cmake +++ b/etesian/cmake_modules/FindETESIAN.cmake @@ -5,6 +5,7 @@ # ETESIAN_INCLUDE_DIR - the path to where the Coriolis include files are. # ETESIAN_LIBRARIES - The path to where the Coriolis library files are. +find_package(COLOQUINTE REQUIRED) SET(ETESIAN_INCLUDE_PATH_DESCRIPTION "directory containing the Etesian include files. E.g /usr/local/include/coriolis or /asim/coriolis/include/coriolis") @@ -24,6 +25,8 @@ IF(UNIX) # Help the user find it if we cannot. DOC "The ${ETESIAN_INCLUDE_PATH_DESCRIPTION}" ) + SET(ETESIAN_INCLUDE_PATH "${ETESIAN_INCLUDE_PATH};${COLOQUINTE_INCLUDE_DIR}") + MESSAGE("djaa${ETESIAN_INCLUDE_PATH};${COLOQUINTE_INCLUDE_DIR}djau") FIND_LIBRARY(ETESIAN_LIBRARY_PATH NAMES etesian diff --git a/flake.nix b/flake.nix index f37da1d9..f81aba29 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,8 @@ let # Generate a user-friendly version numer. - version = builtins.substring 0 8 self.lastModifiedDate; + #version = builtins.substring 0 8 self.lastModifiedDate; + version = "unstable"; # System types to support. supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; @@ -19,60 +20,6 @@ # Nixpkgs instantiated for supported system types. nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; }); - /* - coriolis = - { lib, stdenv, python2, cmake_2_8, boost, bison, flex - , libxml2, rapidjson, which, qt4, zlib, bzip2 }: - let boostWithPython = boost.override { enablePython = true; python = python2; }; in - stdenv.mkDerivation { - name = "coriolis-${version}"; - - src = ./.; - - postPatch = '' - export HOME=/build - mkdir -p /build/coriolis-2.x/src - dir="$PWD" - mv "$PWD" -T /build/coriolis-2.x/src/coriolis - - patchShebangs . - fixCmakeFiles . - ''; - - configurePhase = '' - runHook preConfigure - makeCmakeFindLibs - export LDFLAGS="$NIX_LDFLAGS" - runHook postConfigure - ''; - - hardeningDisable = [ "format" ]; - - buildPhase = '' - runHook preBuild - ./bootstrap/ccb.py --project=coriolis --make="-j$NIX_BUILD_CORES install" - runHook postBuild - ''; - - installPhase = '' - mkdir $out - mv /build/coriolis-2.x/*.* -t $out - ''; - - checkPhase = "true"; - - buildInputs = [ python2 boostWithPython libxml2 rapidjson qt4 zlib bzip2 ]; - nativeBuildInputs = [ cmake_2_8 bison flex which ]; - - meta = with lib; { - description = "Coriolis is a free database, placement tool and routing tool for VLSI design."; - homepage = "http://coriolis.lip6.fr/"; - license = licenses.gpl3; - platforms = platforms.all; - }; - }; - */ - meta = with nixpkgs.lib; { description = "Coriolis is a free database, placement tool and routing tool for VLSI design."; homepage = "http://coriolis.lip6.fr/"; @@ -80,7 +27,13 @@ platforms = platforms.all; }; - components = [ "vlsisapd" "lefdef" "bootstrap" "hurricane" "crlcore" "cumulus" "flute" ]; + override = drv: drv.overrideAttrs (o: { + preConfigure = '' + cmakeFlagsArray+=(-DCMAKE_MODULE_PATH="$(sed -e 's|:|/share/cmake/Modules;|g' <<< "$CMAKE_PREFIX_PATH:")") + '' + (o.preConfigure or ""); + }); + + components = [ "vlsisapd" "lefdef" "bootstrap" "hurricane" "crlcore" "cumulus" "flute" "etesian" "anabatic" "coloquinte" ]; in @@ -88,9 +41,9 @@ overlay = final: prev: builtins.foldl' (acc: elem: acc // { - "coriolis-${elem}" = final.callPackage ( + "coriolis-${elem}" = override (final.callPackage ( import "${self}/nix/${elem}.nix" { inherit version meta; } - ) {}; + ) {}); }) {} components; packages = forAllSystems (system: builtins.foldl' (acc: elem: acc // { diff --git a/nix/anabatic.nix b/nix/anabatic.nix new file mode 100644 index 00000000..b0db117e --- /dev/null +++ b/nix/anabatic.nix @@ -0,0 +1,23 @@ +{ version, meta }: + +{ lib, stdenv, cmake, ninja, python2, boost +, coriolis-bootstrap, coriolis-vlsisapd, coriolis-hurricane +, coriolis-crlcore, coriolis-etesian, qt4 +, coriolis-flute }: + +let boostWithPython = boost.override { enablePython = true; python = python2; }; in + +stdenv.mkDerivation { + pname = "coriolis-anabatic"; + + src = ../anabatic; + + buildInputs = [ + python2 boostWithPython coriolis-bootstrap + coriolis-vlsisapd coriolis-hurricane coriolis-crlcore + coriolis-etesian qt4 coriolis-flute + ]; + nativeBuildInputs = [ cmake ninja ]; + + inherit version meta; +} diff --git a/nix/coloquinte.nix b/nix/coloquinte.nix index 21d9b1c0..f8b581d8 100644 --- a/nix/coloquinte.nix +++ b/nix/coloquinte.nix @@ -9,8 +9,6 @@ stdenv.mkDerivation { src = ../coloquinte; - cmakeFlags = [ "-DCMAKE_MODULE_PATH=${coriolis-bootstrap}/share/cmake/Modules" ]; - buildInputs = [ boostWithPython coriolis-bootstrap qt4 ]; nativeBuildInputs = [ cmake ninja ]; diff --git a/nix/crlcore.nix b/nix/crlcore.nix index ea34db99..f0f38fea 100644 --- a/nix/crlcore.nix +++ b/nix/crlcore.nix @@ -11,15 +11,6 @@ stdenv.mkDerivation { src = ../crlcore; - cmakeFlags = [ - ( - "-DCMAKE_MODULE_PATH=" - + "${coriolis-bootstrap}/share/cmake/Modules" - + ";${coriolis-vlsisapd}/share/cmake/Modules" - + ";${coriolis-hurricane}/share/cmake/Modules" - ) - ]; - buildInputs = [ python2 boostWithPython coriolis-bootstrap coriolis-lefdef coriolis-hurricane coriolis-vlsisapd libxml2 bison flex qt4 diff --git a/nix/cumulus.nix b/nix/cumulus.nix index a5284027..3d93902e 100644 --- a/nix/cumulus.nix +++ b/nix/cumulus.nix @@ -9,16 +9,6 @@ stdenv.mkDerivation { src = ../cumulus; - cmakeFlags = [ - ( - "-DCMAKE_MODULE_PATH=" - + "${coriolis-bootstrap}/share/cmake/Modules" - + ";${coriolis-vlsisapd}/share/cmake/Modules" - + ";${coriolis-hurricane}/share/cmake/Modules" - + ";${coriolis-crlcore}/share/cmake/Modules" - ) - ]; - buildInputs = [ python2 coriolis-bootstrap coriolis-vlsisapd coriolis-hurricane coriolis-crlcore ]; nativeBuildInputs = [ cmake ninja ]; diff --git a/nix/etesian.nix b/nix/etesian.nix new file mode 100644 index 00000000..f1abc703 --- /dev/null +++ b/nix/etesian.nix @@ -0,0 +1,22 @@ +{ version, meta }: + +{ lib, stdenv, cmake, ninja, python2, boost +, coriolis-bootstrap, coriolis-vlsisapd, coriolis-hurricane +, coriolis-crlcore, coriolis-coloquinte, qt4 }: + +let boostWithPython = boost.override { enablePython = true; python = python2; }; in + +stdenv.mkDerivation { + pname = "coriolis-etesian"; + + src = ../etesian; + + buildInputs = [ + qt4 python2 boostWithPython coriolis-bootstrap coriolis-vlsisapd + coriolis-hurricane coriolis-coloquinte coriolis-crlcore + ]; + propagatedBuildInputs = [ coriolis-coloquinte ]; + nativeBuildInputs = [ cmake ninja ]; + + inherit version meta; +} diff --git a/nix/flute.nix b/nix/flute.nix index 0d398ff0..780d0be3 100644 --- a/nix/flute.nix +++ b/nix/flute.nix @@ -11,16 +11,6 @@ stdenv.mkDerivation { src = ../flute; - cmakeFlags = [ - ( - "-DCMAKE_MODULE_PATH=" - + "${coriolis-bootstrap}/share/cmake/Modules" - + ";${coriolis-vlsisapd}/share/cmake/Modules" - + ";${coriolis-hurricane}/share/cmake/Modules" - + ";${coriolis-crlcore}/share/cmake/Modules" - ) - ]; - buildInputs = [ python2 boostWithPython coriolis-bootstrap coriolis-vlsisapd coriolis-hurricane coriolis-crlcore ]; nativeBuildInputs = [ cmake ninja ]; diff --git a/nix/hurricane.nix b/nix/hurricane.nix index 8bcf8c2a..99647c3b 100644 --- a/nix/hurricane.nix +++ b/nix/hurricane.nix @@ -11,8 +11,6 @@ stdenv.mkDerivation { src = ../hurricane; - cmakeFlags = [ "-DCMAKE_MODULE_PATH=${coriolis-bootstrap}/share/cmake/Modules;${coriolis-vlsisapd}/share/cmake/Modules" ]; - buildInputs = [ python2 boostWithPython coriolis-bootstrap libxml2 bison flex qt4 bzip2 coriolis-vlsisapd rapidjson ]; nativeBuildInputs = [ cmake ninja ]; diff --git a/nix/lefdef.nix b/nix/lefdef.nix index 177f70b3..1d703a66 100644 --- a/nix/lefdef.nix +++ b/nix/lefdef.nix @@ -12,8 +12,6 @@ stdenv.mkDerivation { hardeningDisable = [ "format" ]; - cmakeFlags = [ "-DCMAKE_MODULE_PATH=${coriolis-bootstrap}/share/cmake/Modules" ]; - buildInputs = [ python2 boostWithPython coriolis-bootstrap bison flex zlib ]; nativeBuildInputs = [ cmake ninja ]; diff --git a/nix/vlsisapd.nix b/nix/vlsisapd.nix index 2b19f57d..fa17ed9a 100644 --- a/nix/vlsisapd.nix +++ b/nix/vlsisapd.nix @@ -10,8 +10,6 @@ stdenv.mkDerivation { src = ../vlsisapd; - cmakeFlags = [ "-DCMAKE_MODULE_PATH=${coriolis-bootstrap}/share/cmake/Modules" ]; - buildInputs = [ python2 boostWithPython coriolis-bootstrap libxml2 bison flex qt4 ]; nativeBuildInputs = [ cmake ninja ];