coriolis/flake.nix

81 lines
2.8 KiB
Nix
Raw Normal View History

2021-08-16 12:06:47 -05:00
{
description = "Coriolis is a free database, placement tool and routing tool for VLSI design.";
# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-21.05";
outputs = { self, nixpkgs }:
let
# Generate a user-friendly version numer.
2021-08-27 15:18:09 -05:00
version = builtins.substring 0 8 self.lastModifiedDate;
2021-08-16 12:06:47 -05:00
# System types to support.
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; });
2021-08-22 05:54:22 -05:00
meta = with nixpkgs.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;
};
2021-08-16 12:06:47 -05:00
2021-08-27 09:26:33 -05:00
override = drv: drv.overrideAttrs (o: {
preConfigure = ''
cmakeFlagsArray+=(-DCMAKE_MODULE_PATH="$(sed -e 's|:|/share/cmake/Modules;|g' <<< "$CMAKE_PREFIX_PATH:")")
'' + (o.preConfigure or "");
2021-08-27 15:08:48 -05:00
cmakeFlags = [ "-DBUILD_DOC=ON" ] ++ (o.cmakeFlags or []);
2021-08-27 09:26:33 -05:00
});
2021-08-29 12:36:58 -05:00
generic = import ./nix/generic.nix { inherit version meta; };
# not generic: solstice lefdef equinox knik coloquinte bootstrap
2021-08-27 09:36:23 -05:00
components = [
"vlsisapd" "lefdef" "bootstrap" "hurricane" "crlcore"
"cumulus" "flute" "etesian" "anabatic" "coloquinte"
2021-08-27 10:27:53 -05:00
"katana" "bora" "equinox" "knik" "katabatic" "ispd"
2021-08-27 11:44:57 -05:00
"karakaze" "kite" "nimbus" "metis" "mauka" "oroshi"
2021-08-27 14:56:12 -05:00
"solstice" "stratus1" "tutorial" "unicorn" "documentation"
2021-08-27 15:00:36 -05:00
"unittests"
2021-08-27 09:36:23 -05:00
];
2021-08-23 03:44:07 -05:00
2021-08-29 12:36:58 -05:00
commonArgs = { inherit version meta generic; };
2021-08-16 12:06:47 -05:00
in
rec {
2021-08-23 03:44:07 -05:00
overlay = final: prev:
builtins.foldl'
(acc: elem: acc // {
2021-08-27 09:26:33 -05:00
"coriolis-${elem}" = override (final.callPackage (
2021-08-29 12:36:58 -05:00
let f = import (./nix + "/${elem}.nix"); in
f (builtins.intersectAttrs (builtins.functionArgs f) commonArgs)
2021-08-27 09:26:33 -05:00
) {});
2021-08-23 03:44:07 -05:00
}) {} components;
packages = forAllSystems (system: builtins.foldl' (acc: elem: acc // {
${elem} = nixpkgsFor.${system}.${"coriolis-${elem}"};
}) {} components);
2021-08-16 12:06:47 -05:00
2021-08-27 15:18:09 -05:00
defaultPackage = forAllSystems (system: self.packages.${system}.unicorn);
devShell = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
env = pkgs.python2.buildEnv.override {
2021-08-29 13:25:21 -05:00
extraLibs = builtins.map (x: pkgs.${"coriolis-${x}"}) [ "vlsisapd" "hurricane" "crlcore" ];
};
in env.env
);
2021-08-16 12:06:47 -05:00
2021-08-22 05:54:22 -05:00
#hydraJobs.coriolis = self.defaultPackage;
2021-08-16 12:06:47 -05:00
};
}