diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2024-04-05 18:01:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 18:01:27 +0000 |
commit | 882e0f27d3d291117158060b0c5841112b525f1c (patch) | |
tree | 62cac597a09e87cb82cdb337b9b7a90d325153db /pkgs/applications/science | |
parent | 04b22a2203735961b874c3adf2cc64af236698e0 (diff) | |
parent | 7a51c8c82c65d605274b70612e7f701c4549c825 (diff) |
Merge staging-next into staging
Diffstat (limited to 'pkgs/applications/science')
4 files changed, 101 insertions, 41 deletions
diff --git a/pkgs/applications/science/logic/bitwuzla/default.nix b/pkgs/applications/science/logic/bitwuzla/default.nix index bacf8620e5fdc..1fa78849db6e8 100644 --- a/pkgs/applications/science/logic/bitwuzla/default.nix +++ b/pkgs/applications/science/logic/bitwuzla/default.nix @@ -1,70 +1,72 @@ { stdenv , fetchFromGitHub +, fetchpatch , lib , python3 -, cmake -, lingeling +, meson +, ninja +, git , btor2tools , symfpu , gtest , gmp , cadical -, minisat -, picosat , cryptominisat , zlib , pkg-config - # "*** internal error in 'lglib.c': watcher stack overflow" on aarch64-linux -, withLingeling ? !stdenv.hostPlatform.isAarch64 }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "bitwuzla"; - version = "unstable-2022-10-03"; + version = "0.4.0"; src = fetchFromGitHub { owner = "bitwuzla"; repo = "bitwuzla"; - rev = "3bc0f9f1aca04afabe1aff53dd0937924618b2ad"; - hash = "sha256-UXZERl7Nedwex/oUrcf6/GkDSgOQ537WDYm117RfvWo="; + rev = finalAttrs.version; + hash = "sha256-ZEdV4ml1LwrYwscgOcL2gLx/ijPYqRktXMQH/Njh8OI="; }; - nativeBuildInputs = [ cmake pkg-config ]; + patches = [ + # fix parser on aarch64 + # remove on next release + (fetchpatch { + url = "https://github.com/bitwuzla/bitwuzla/commit/4d914aa5ec34076c37749f0cf6dce976ea510386.patch"; + hash = "sha256-gp+HEamOySjPXCC39tt5DIMdQqEew26a+M15sNdCmTM="; + }) + ]; + + strictDeps = true; + + nativeBuildInputs = [ meson pkg-config git ninja ]; buildInputs = [ cadical cryptominisat - picosat - minisat btor2tools symfpu gmp zlib - ] ++ lib.optional withLingeling lingeling; + ]; + + mesonFlags = [ + # note: the default value for default_library fails to link dynamic dependencies + # but setting it to shared works even in pkgsStatic + "-Ddefault_library=shared" - cmakeFlags = [ - "-DBUILD_SHARED_LIBS=ON" - "-DPicoSAT_INCLUDE_DIR=${lib.getDev picosat}/include/picosat" - "-DBtor2Tools_INCLUDE_DIR=${lib.getDev btor2tools}/include/btor2parser" - "-DBtor2Tools_LIBRARIES=${lib.getLib btor2tools}/lib/libbtor2parser${stdenv.hostPlatform.extensions.sharedLibrary}" - ] ++ lib.optional doCheck "-DTESTING=YES"; + (lib.strings.mesonEnable "testing" finalAttrs.doCheck) + ]; - nativeCheckInputs = [ python3 gtest ]; - # two tests fail on darwin and 3 on aarch64-linux - doCheck = stdenv.hostPlatform.isLinux && (!stdenv.hostPlatform.isAarch64); - preCheck = let - var = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; - in - '' - export ${var}=$(readlink -f lib) - patchShebangs .. - ''; + nativeCheckInputs = [ python3 ]; + checkInputs = [ gtest ]; + # two tests fail on darwin + doCheck = stdenv.hostPlatform.isLinux; - meta = with lib; { + meta = { description = "A SMT solver for fixed-size bit-vectors, floating-point arithmetic, arrays, and uninterpreted functions"; mainProgram = "bitwuzla"; homepage = "https://bitwuzla.github.io"; - license = licenses.mit; - platforms = platforms.unix; - maintainers = with maintainers; [ symphorien ]; + license = lib.licenses.mit; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ symphorien ]; }; -} +}) diff --git a/pkgs/applications/science/logic/cadical/default.nix b/pkgs/applications/science/logic/cadical/default.nix index 873b3836b73e0..12b01dea1a3dd 100644 --- a/pkgs/applications/science/logic/cadical/default.nix +++ b/pkgs/applications/science/logic/cadical/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub }: +{ lib, stdenv, fetchFromGitHub, copyPkgconfigItems, makePkgconfigItem }: stdenv.mkDerivation rec { pname = "cadical"; @@ -14,6 +14,35 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "lib" ]; doCheck = true; + nativeBuildInputs = [ copyPkgconfigItems ]; + + pkgconfigItems = [ + (makePkgconfigItem { + name = "cadical"; + inherit version; + cflags = [ "-I\${includedir}" ]; + libs = [ "-L\${libdir}" "-lcadical" ]; + variables = { + includedir = "@includedir@"; + libdir = "@libdir@"; + }; + inherit (meta) description; + }) + ]; + + env = { + # copyPkgconfigItems will substitute these in the pkg-config file + includedir = "${placeholder "dev"}/include"; + libdir = "${placeholder "lib"}/lib"; + }; + + enableParallelBuilding = true; + + # fix static build + postPatch = '' + substituteInPlace makefile.in --replace-fail "ar rc" '$(AR) rc' + ''; + # the configure script is not generated by autotools and does not accept the # arguments that the default configurePhase passes like --prefix and --libdir configurePhase = '' diff --git a/pkgs/applications/science/logic/cryptominisat/default.nix b/pkgs/applications/science/logic/cryptominisat/default.nix index 4be57a1946356..4040cdb797290 100644 --- a/pkgs/applications/science/logic/cryptominisat/default.nix +++ b/pkgs/applications/science/logic/cryptominisat/default.nix @@ -17,8 +17,14 @@ stdenv.mkDerivation rec { hash = "sha256-8oH9moMjQEWnQXKmKcqmXuXcYkEyvr4hwC1bC4l26mo="; }; - buildInputs = [ python3 boost ]; - nativeBuildInputs = [ cmake ]; + strictDeps = true; + buildInputs = [ boost ]; + nativeBuildInputs = [ python3 cmake ]; + + # musl does not have sys/unistd.h + postPatch = '' + substituteInPlace src/picosat/picosat.c --replace-fail '<sys/unistd.h>' '<unistd.h>' + ''; meta = with lib; { description = "An advanced SAT Solver"; diff --git a/pkgs/applications/science/logic/symfpu/default.nix b/pkgs/applications/science/logic/symfpu/default.nix index af61b7c617c78..2c83793114a15 100644 --- a/pkgs/applications/science/logic/symfpu/default.nix +++ b/pkgs/applications/science/logic/symfpu/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub }: +{ lib, stdenv, fetchFromGitHub, copyPkgconfigItems, makePkgconfigItem }: stdenv.mkDerivation rec { pname = "symfpu"; @@ -11,9 +11,32 @@ stdenv.mkDerivation rec { sha256 = "1jf5lkn67q136ppfacw3lsry369v7mdr1rhidzjpbz18jfy9zl9q"; }; + nativeBuildInputs = [ copyPkgconfigItems ]; + + pkgconfigItems = [ + (makePkgconfigItem { + name = "symfpu"; + inherit version; + cflags = [ "-I\${includedir}" ]; + variables = { + includedir = "@includedir@"; + }; + inherit (meta) description; + }) + ]; + + env = { + # copyPkgconfigItems will substitute this in the pkg-config file + includedir = "${placeholder "out"}/include"; + }; + installPhase = '' - mkdir -p $out/symfpu - cp -r * $out/symfpu/ + runHook preInstall + + mkdir -p $out/include/symfpu + cp -r * $out/include/symfpu/ + + runHook postInstall ''; meta = with lib; { |