From 7c5679408f58bdfde5de013ac55263ff57ae81c9 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sun, 22 Aug 2021 10:54:22 +0000 Subject: [PATCH] Get vlsisapd and bootstrap building! --- flake.nix | 30 ++++++++++++++++++++++++------ nix/bootstrap.nix | 15 +++++++++++++++ nix/vlsisapd.nix | 20 ++++++++++++++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 nix/bootstrap.nix create mode 100644 nix/vlsisapd.nix diff --git a/flake.nix b/flake.nix index 7f56207f..6d1d38fc 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ # 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 }: @@ -29,14 +30,21 @@ src = ./.; postPatch = '' - patchShebangs . 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; runHook postConfigure"; + configurePhase = '' + runHook preConfigure + makeCmakeFindLibs + export LDFLAGS="$NIX_LDFLAGS" + runHook postConfigure + ''; hardeningDisable = [ "format" ]; @@ -63,22 +71,32 @@ 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/"; + license = licenses.gpl3; + platforms = platforms.all; + }; in rec { overlay = final: prev: { - coriolis = final.callPackage coriolis {}; + coriolis-vlsisapd = final.callPackage (import ./nix/vlsisapd.nix { inherit version meta; }) {}; + coriolis-bootstrap = final.callPackage (import ./nix/bootstrap.nix { inherit version meta; }) {}; }; packages = forAllSystems (system: - { - inherit (nixpkgsFor.${system}) coriolis; + with nixpkgsFor.${system}; { + vlsisapd = coriolis-vlsisapd; + bootstrap = coriolis-bootstrap; }); defaultPackage = forAllSystems (system: self.packages.${system}.coriolis); devShell = defaultPackage; - hydraJobs.coriolis = self.defaultPackage; + #hydraJobs.coriolis = self.defaultPackage; }; } diff --git a/nix/bootstrap.nix b/nix/bootstrap.nix new file mode 100644 index 00000000..7e410005 --- /dev/null +++ b/nix/bootstrap.nix @@ -0,0 +1,15 @@ +{ version, meta }: + +{ lib, stdenv, python2, cmake, boost, bison, flex +, libxml2, rapidjson, which, qt4, zlib, bzip2, ninja }: + +stdenv.mkDerivation { + pname = "coriolis-bootstrap"; + + src = ../bootstrap; + + buildInputs = [ python2 ]; + nativeBuildInputs = [ cmake ninja ]; + + inherit version meta; +} diff --git a/nix/vlsisapd.nix b/nix/vlsisapd.nix new file mode 100644 index 00000000..9746caa4 --- /dev/null +++ b/nix/vlsisapd.nix @@ -0,0 +1,20 @@ +{ version, meta }: + +{ lib, stdenv, python2, cmake, boost, bison, flex +, libxml2, rapidjson, which, qt4, zlib, bzip2, ninja +, coriolis-bootstrap }: + +let boostWithPython = boost.override { enablePython = true; python = python2; }; in + +stdenv.mkDerivation { + pname = "coriolis-vlsisapd"; + + src = ../vlsisapd; + + cmakeFlags = [ "-DCMAKE_MODULE_PATH=${coriolis-bootstrap}/share/cmake/Modules" ]; + + buildInputs = [ python2 boostWithPython coriolis-bootstrap libxml2 bison flex qt4 ]; + nativeBuildInputs = [ cmake ninja ]; + + inherit version meta; +}