ovni/nix/shell-glibc-2.26.nix

51 lines
1.1 KiB
Nix
Raw Normal View History

2022-01-11 17:37:22 +01:00
{
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";
2022-01-11 18:13:33 +01:00
cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
buildFlags = [ "VERBOSE=1" ];
checkFlags = [ "CTEST_OUTPUT_ON_FAILURE=1" ];
2022-01-11 17:37:22 +01:00
dontStrip = true;
2022-01-11 17:56:08 +01:00
doCheck = true;
checkTarget = "test";
2022-01-11 17:37:22 +01:00
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
2022-01-11 18:13:33 +01:00
make test CTEST_OUTPUT_ON_FAILURE=1
2022-01-11 17:37:22 +01:00
make install
exit 0
'';
};
}