From 842d60043b20c3c0d4624b2be3fe2dd7f0e9ee4a Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 11 Jan 2022 17:37:22 +0100 Subject: [PATCH] Add a nix shell with glibc 2.26 --- nix/shell-glibc-2.26.nix | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 nix/shell-glibc-2.26.nix diff --git a/nix/shell-glibc-2.26.nix b/nix/shell-glibc-2.26.nix new file mode 100644 index 0000000..22f16c5 --- /dev/null +++ b/nix/shell-glibc-2.26.nix @@ -0,0 +1,45 @@ +{ + pkgs ? import ( + builtins.fetchTarball { + # Use nixpkgs 18.03 with old glibc and cmake + url = "https://github.com/NixOS/nixpkgs/archive/3e1be2206b4c1eb3299fb633b8ce9f5ac1c32898.tar.gz"; + } + ) {} + +# By default use debug +, enableDebug ? true +}: + +with pkgs; + +{ + ovni = stdenv.mkDerivation rec { + name = "ovni"; + + buildInputs = [ cmake openmpi ]; + + cmakeBuildType = if (enableDebug) then "Debug" else "Release"; + dontStrip = true; + + src = ../.; + }; + + shell = pkgs.mkShell { + nativeBuildInputs = [ cmake openmpi ]; + NIX_ENFORCE_PURITY = 0; + shellHook = '' + set -e + curdir=$(pwd) + rm -rf build install + mkdir build install + cd build + cmake -DCMAKE_BUILD_TYPE=Debug \ + -DENABLE_DEBUG_LOG=ON \ + -DCMAKE_INSTALL_PREFIX="$curdir/install" .. + make VERBOSE=1 + make test + make install + exit 0 + ''; + }; +}