mctc-lib: build with meson

This commit is contained in:
Nick Cao 2024-03-26 15:53:29 -04:00
parent cf7071bff3
commit 14e08254a2
No known key found for this signature in database
1 changed files with 8 additions and 12 deletions

View File

@ -2,9 +2,11 @@
, lib
, fetchFromGitHub
, gfortran
, meson
, ninja
, pkg-config
, python3
, json-fortran
, cmake
}:
stdenv.mkDerivation rec {
@ -18,24 +20,18 @@ stdenv.mkDerivation rec {
hash = "sha256-AXjg/ZsitdDf9fNoGVmVal1iZ4/sxjJb7A9W4yye/rg=";
};
nativeBuildInputs = [ gfortran pkg-config cmake ];
nativeBuildInputs = [ gfortran meson ninja pkg-config python3 ];
buildInputs = [ json-fortran ];
outputs = [ "out" "dev" ];
# Fix the Pkg-Config files for doubled store paths
postPatch = ''
substituteInPlace config/template.pc \
--replace "\''${prefix}/" ""
'';
cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
];
doCheck = true;
postPatch = ''
patchShebangs --build config/install-mod.py
'';
meta = with lib; {
description = "Modular computation tool chain library";
mainProgram = "mctc-convert";