2021-08-05 21:33:18 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchpatch
|
2021-08-05 21:33:18 +00:00
|
|
|
, lib
|
|
|
|
, python3
|
2024-04-21 15:54:59 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, git
|
2021-08-05 21:33:18 +00:00
|
|
|
, btor2tools
|
2022-10-21 18:38:19 +00:00
|
|
|
, symfpu
|
2021-08-05 21:33:18 +00:00
|
|
|
, gtest
|
|
|
|
, gmp
|
|
|
|
, cadical
|
|
|
|
, cryptominisat
|
|
|
|
, zlib
|
|
|
|
, pkg-config
|
|
|
|
}:
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "bitwuzla";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.4.0";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bitwuzla";
|
|
|
|
repo = "bitwuzla";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-ZEdV4ml1LwrYwscgOcL2gLx/ijPYqRktXMQH/Njh8OI=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
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 ];
|
2021-08-05 21:33:18 +00:00
|
|
|
buildInputs = [
|
|
|
|
cadical
|
|
|
|
cryptominisat
|
|
|
|
btor2tools
|
2022-10-21 18:38:19 +00:00
|
|
|
symfpu
|
2021-08-05 21:33:18 +00:00
|
|
|
gmp
|
|
|
|
zlib
|
2024-04-21 15:54:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
(lib.strings.mesonEnable "testing" finalAttrs.doCheck)
|
|
|
|
];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeCheckInputs = [ python3 ];
|
|
|
|
checkInputs = [ gtest ];
|
|
|
|
# two tests fail on darwin
|
|
|
|
doCheck = stdenv.hostPlatform.isLinux;
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
meta = {
|
2021-08-05 21:33:18 +00:00
|
|
|
description = "A SMT solver for fixed-size bit-vectors, floating-point arithmetic, arrays, and uninterpreted functions";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "bitwuzla";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://bitwuzla.github.io";
|
2024-04-21 15:54:59 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ symphorien ];
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|