Unverified Commit f01c48f9 authored by Guillaume Girol's avatar Guillaume Girol Committed by GitHub
Browse files

bitwuzla: 0.7.0 -> 0.8.0 (#421506)

parents 4fca1a32 cec96cc3
Loading
Loading
Loading
Loading
+42 −28
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  fetchFromGitHub,
  copyPkgconfigItems,
  makePkgconfigItem,
  picosat,
}:

stdenv.mkDerivation rec {
  pname = "aiger";
  version = "1.9.9";
  version = "1.9.20";

  src = fetchurl {
    url = "https://fmv.jku.at/aiger/${pname}-${version}.tar.gz";
    sha256 = "1ish0dw0nf9gyghxsdhpy1jjiy5wp54c993swp85xp7m6vdx6l0y";
  src = fetchFromGitHub {
    owner = "arminbiere";
    repo = "aiger";
    tag = "rel-${version}";
    hash = "sha256-ggkxITuD8phq3VF6tGc/JWQGBhTfPxBdnRobKswYVa4=";
  };

  patches = [
    # Fix implicit declaration of `isatty`, which is an error with newer versions of clang.
    ./fix-missing-header.patch
  enableParallelBuilding = true;

  nativeBuildInputs = [ copyPkgconfigItems ];

  pkgconfigItems = [
    (makePkgconfigItem {
      name = "aiger";
      inherit version;
      cflags = [ "-I\${includedir}" ];
      libs = [
        "-L\${libdir}"
        "-laiger"
      ];
      variables = {
        includedir = "@includedir@";
        libdir = "@libdir@";
      };
      inherit (meta) description;
    })
  ];

  enableParallelBuilding = true;
  env = {
    # copyPkgconfigItems will substitute these in the pkg-config file
    includedir = "${placeholder "dev"}/include";
    libdir = "${placeholder "lib"}/lib";
  };

  configurePhase = ''
    # Set up picosat, so we can build 'aigbmc'
@@ -30,27 +54,17 @@ stdenv.mkDerivation rec {
    ./configure.sh
  '';

  installPhase = ''
    mkdir -p $out/bin $dev/include $lib/lib

    # Do the installation manually, as the Makefile has odd
    # cyrillic characters, and this is easier than adding
    # a whole .patch file.
    BINS=( \
      aigand aigdd aigflip aigfuzz aiginfo aigjoin   \
      aigmiter aigmove aignm aigor aigreset aigsim   \
      aigsplit aigstrip aigtoaig aigtoblif aigtocnf  \
      aigtodot aigtosmv aigunconstraint aigunroll    \
      andtoaig bliftoaig smvtoaig soltostim wrapstim \
      aigbmc aigdep
    )
  postBuild = ''
    $AR rcs libaiger.a aiger.o
  '';

    for x in ''${BINS[*]}; do
      install -m 755 -s $x $out/bin/$x
    done
  installFlags = [ "PREFIX=${placeholder "out"}" ];
  postInstall = ''
    # test that installing picosat in configurePhase suceeded
    test -f $out/bin/aigbmc

    cp -v aiger.o $lib/lib
    cp -v aiger.h $dev/include
    install -m 444 -Dt $lib/lib libaiger.a
    install -m 444 -Dt $dev/include aiger.h
  '';

  outputs = [
+5 −2
Original line number Diff line number Diff line
@@ -16,17 +16,18 @@
  zlib,
  pkg-config,
  cmake,
  aiger,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "bitwuzla";
  version = "0.7.0";
  version = "0.8.1";

  src = fetchFromGitHub {
    owner = "bitwuzla";
    repo = "bitwuzla";
    rev = finalAttrs.version;
    hash = "sha256-S8CtK8WEehUdOoqOmu5KnoqHFpCGrYWjZKv1st4M7bo=";
    hash = "sha256-4Gf06aZ3iBEu0bNZAGgWCXVgKA0ew37Zf6XArnlVAXw=";
  };

  strictDeps = true;
@@ -47,6 +48,7 @@ stdenv.mkDerivation (finalAttrs: {
    gmp
    zlib
    kissat
    aiger
  ];

  mesonFlags = [
@@ -55,6 +57,7 @@ stdenv.mkDerivation (finalAttrs: {
    "-Ddefault_library=shared"
    "-Dcryptominisat=true"
    "-Dkissat=true"
    "-Daiger=true"

    (lib.strings.mesonEnable "testing" finalAttrs.finalPackage.doCheck)
  ];
+4 −4
Original line number Diff line number Diff line
@@ -24,10 +24,10 @@ stdenv.mkDerivation {
    # doesn't handle real build products very well (it works on a build-time
    # dir, not installed copy)... This is so we can build 'blimc'
    substituteInPlace ./makefile \
      --replace 'targets: liblgl.a' 'targets: liblgl.a blimc'      \
      --replace '$(AIGER)/aiger.o'  '${aiger.lib}/lib/aiger.o'     \
      --replace '$(AIGER)/aiger.h'  '${aiger.dev}/include/aiger.h' \
      --replace '-I$(AIGER)'        '-I${aiger.dev}/include'
      --replace-fail 'targets: liblgl.a' 'targets: liblgl.a blimc'      \
      --replace-fail '$(AIGER)/aiger.o'  '${aiger.lib}/lib/libaiger.a'     \
      --replace-fail '$(AIGER)/aiger.h'  '${aiger.dev}/include/aiger.h' \
      --replace-fail '-I$(AIGER)'        '-I${aiger.dev}/include'
  '';

  installPhase = ''