From patchwork Sat Feb 25 08:25:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liliana Marie Prikler X-Patchwork-Id: 47299 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0631816BA4; Sat, 25 Feb 2023 09:58:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5F5A916AFC for ; Sat, 25 Feb 2023 09:58:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVrJc-0008Hx-TA; Sat, 25 Feb 2023 04:58:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVrJb-0008HK-Fz for guix-patches@gnu.org; Sat, 25 Feb 2023 04:58:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVrJb-0005T5-8B for guix-patches@gnu.org; Sat, 25 Feb 2023 04:58:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVrJb-0007ID-4L for guix-patches@gnu.org; Sat, 25 Feb 2023 04:58:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61783] [PATCH 5/6] gnu: Add boolector. References: <94a22cf50237fb101387b9a47c3beae6626631be.camel@gmail.com> In-Reply-To: <94a22cf50237fb101387b9a47c3beae6626631be.camel@gmail.com> Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Feb 2023 09:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61783 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61783@debbugs.gnu.org Received: via spool by 61783-submit@debbugs.gnu.org id=B61783.167731907627996 (code B ref 61783); Sat, 25 Feb 2023 09:58:03 +0000 Received: (at 61783) by debbugs.gnu.org; 25 Feb 2023 09:57:56 +0000 Received: from localhost ([127.0.0.1]:39120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVrJT-0007HN-Iu for submit@debbugs.gnu.org; Sat, 25 Feb 2023 04:57:56 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVrJP-0007GO-CS for 61783@debbugs.gnu.org; Sat, 25 Feb 2023 04:57:52 -0500 Received: by mail-ed1-f68.google.com with SMTP id ec43so6754787edb.8 for <61783@debbugs.gnu.org>; Sat, 25 Feb 2023 01:57:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:to:subject:date:from:from:to:cc:subject :date:message-id:reply-to; bh=26BG4AW9/4cV4HHdxlkP/OjNK3L2RxyynNW7BibALfI=; b=bb39DtTwaLopUzwgseNTFvyEmluTcvYyQWN1oz0z1adQfd9SBeulon+OEmdhxpcSAG JRXbhPm/kelPAA0bStx++Fma9fskSiYf1+f955cw7S6lvncihRWHbiaNTl8BcQ16HNR/ ycPc/iYgXsm6zZk+QZIMh3CNW2rrNNt2Svn0X5KbvmHGHRUgFT8YLn6gClJtyHmrb/hi vUn6P3/zJAJ1Wu1twb5eVyVOuJtpatik+MJ7onEePObz5idTRNneX9Br8ToMnI/SIyNS iDPY8C+goVCeRsw64/xDgKHl+39fE7mZDGYCt/FetFGoEamCR+ShZ3Ww4CqoGcmOzQE9 xzig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:to:subject:date:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=26BG4AW9/4cV4HHdxlkP/OjNK3L2RxyynNW7BibALfI=; b=1C8Ya2ExScd4t1ADeKM8aqvbgsGaBZUpdaTidpau0Ux71x6reUdtRLfSHWBLVpKgMU EHTWCz5gWO7WEXjrk3fdx0Ypuj69EC+00NYwN/hUb6TuNIhXG043UGWkxI8HoqmvhBog isaj9Ar63KEWcN4FxB0OuHZq0hcszzKP0pMC/Lg3M8F/cp8wViTXLDfjyUuSx/urjVXt jgcoY9fRChIFgI7F4OAxVK5KeKaoweZkqmMxejHj1nebENWegxu8rLuPfKqlIybF7mzy zBE7nToWMeEUAvowthbeBcyirJhY/fydA/SdNUvqVlFK9MbStcd6gnkwHf4XiUjTEhSF L2vA== X-Gm-Message-State: AO0yUKWalgSkFEWGRFxzB+DYvgUKRR2TtlgppjtF7xoePzPVwcB8TcS/ g/qRX6wwCEweFiYp5/gpMFlp93szW2uswg== X-Google-Smtp-Source: AK7set+73tpzhO4s7HO65YK2ObMYzesOVTjn9cFSKMjEddV3l472ANoVczQkplkD0qPQwikGp/uzNw== X-Received: by 2002:a17:906:792:b0:8b1:94cc:4a6b with SMTP id l18-20020a170906079200b008b194cc4a6bmr28877341ejc.37.1677319065818; Sat, 25 Feb 2023 01:57:45 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id u15-20020a50d50f000000b0049e1f167956sm670720edi.9.2023.02.25.01.57.45 for <61783@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 01:57:45 -0800 (PST) From: Liliana Marie Prikler Date: Sat, 25 Feb 2023 09:25:34 +0100 Message-ID: <748ea74f585fe89cacf9d9926c44d4d064de7283.camel@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/boolector-find-googletest: New file. * gnu/local.mk (dist_patch_DATA): Register it here. * gnu/packages/maths.scm (boolector): New variable. --- gnu/local.mk | 1 + gnu/packages/maths.scm | 54 +++++ .../patches/boolector-find-googletest.patch | 204 ++++++++++++++++++ 3 files changed, 259 insertions(+) create mode 100644 gnu/packages/patches/boolector-find-googletest.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0838f66618..e1c5acfbc6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -951,6 +951,7 @@ dist_patch_DATA = \ %D%/packages/patches/binutils-CVE-2021-45078.patch \ %D%/packages/patches/bloomberg-bde-cmake-module-path.patch \ %D%/packages/patches/bloomberg-bde-tools-fix-install-path.patch \ + %D%/packages/patches/boolector-find-googletest.patch \ %D%/packages/patches/bpftrace-disable-bfd-disasm.patch \ %D%/packages/patches/breezy-fix-gio.patch \ %D%/packages/patches/byobu-writable-status.patch \ diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 507b7056a4..28750e5f46 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -6081,6 +6081,60 @@ (define-public jacal (home-page "https://www.gnu.org/software/jacal/") (license license:gpl3+))) +(define-public boolector + (package + (name "boolector") + (version "3.2.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Boolector/boolector") + (commit version))) + (file-name (git-file-name name version)) + (patches (search-patches "boolector-find-googletest.patch")) + (sha256 + (base32 + "07rvp3iry7a7ixwl0q7nc47fwky1s1cyia7gqrjsg46syqlxbz2c")))) + (build-system cmake-build-system) + (arguments + (list #:configure-flags + #~(list "-DBUILD_SHARED_LIBS=on" + (string-append + "-DBtor2Tools_INCLUDE_DIR=" + (dirname (search-input-file %build-inputs + "include/btor2parser.h"))) + (string-append + "-DBtor2Tools_LIBRARIES=" + (search-input-file %build-inputs + "lib/libbtor2parser.so"))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-cmake + (lambda _ + (delete-file "cmake/FindCryptoMiniSat.cmake") + (substitute* (list "CMakeLists.txt" "src/CMakeLists.txt") + (("find_package\\(CryptoMiniSat\\)") + "find_package(cryptominisat5 CONFIG) +find_package(louvain_communities)") + (("CryptoMiniSat_FOUND") "cryptominisat5_FOUND") + (("CryptoMiniSat_INCLUDE_DIR") + "CRYPTOMINISAT5_INCLUDE_DIRS") + (("CryptoMiniSat_LIBRARIES") + "CRYPTOMINISAT5_LIBRARIES")))) + (add-after 'unpack 'fix-sources + (lambda _ + (substitute* (find-files "." "\\.c$") + (("\"btor2parser/btor2parser\\.h\"") ""))))))) + (inputs (list btor2tools + boost cryptominisat louvain-community sqlite)) + (native-inputs (list googletest pkg-config python-wrapper)) + (home-page "http://boolector.github.io/") + (synopsis "Bitvector-based theory solver") + (description "Boolector is a @abbrev{SMT, satisfiability modulo theories} +solver for the theories of fixed-size bit-vectors, arrays and uninterpreted +functions.") + (license license:lgpl3+))) + (define-public yices (package (name "yices") diff --git a/gnu/packages/patches/boolector-find-googletest.patch b/gnu/packages/patches/boolector-find-googletest.patch new file mode 100644 index 0000000000..baa7c6cd96 --- /dev/null +++ b/gnu/packages/patches/boolector-find-googletest.patch @@ -0,0 +1,204 @@ +From 91533caf29a2c5b10b4912fd352e7af82c787598 Mon Sep 17 00:00:00 2001 +From: Aina Niemetz +Date: Wed, 16 Jun 2021 16:17:27 -0700 +Subject: [PATCH] Configure google test as external project. + +--- + CMakeLists.txt | 7 ---- + cmake/FindGoogleTest.cmake | 60 +++++++++++++++++++++++++++++++++ + cmake/googletest-download.cmake | 28 --------------- + cmake/googletest.cmake | 41 ---------------------- + test/CMakeLists.txt | 5 ++- + 5 files changed, 64 insertions(+), 77 deletions(-) + create mode 100644 cmake/FindGoogleTest.cmake + delete mode 100644 cmake/googletest-download.cmake + delete mode 100644 cmake/googletest.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 38056ede6..d30475bcd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -440,13 +440,6 @@ configure_file( + #-----------------------------------------------------------------------------# + # Regression tests + +-# Get and configure google test +-include(cmake/googletest.cmake) +-fetch_googletest( +- ${PROJECT_SOURCE_DIR}/cmake +- ${PROJECT_BINARY_DIR}/googletest +- ) +- + enable_testing() + + #-----------------------------------------------------------------------------# +diff --git a/cmake/FindGoogleTest.cmake b/cmake/FindGoogleTest.cmake +new file mode 100644 +index 000000000..c6eecd179 +--- /dev/null ++++ b/cmake/FindGoogleTest.cmake +@@ -0,0 +1,60 @@ ++# Boolector: Satisfiablity Modulo Theories (SMT) solver. ++# ++# Copyright (C) 2007-2021 by the authors listed in the AUTHORS file. ++# ++# This file is part of Boolector. ++# See COPYING for more information on using this software. ++# ++ ++# Find GTest ++# ++# GTest_FOUND - Found GTest ++# GTest::GTest - GTest library ++ ++find_package(GTest 1.10.0) ++ ++if(NOT GTest_FOUND) ++ include(ExternalProject) ++ ++ set(GTest_VERSION "1.10.0") ++ ++ ExternalProject_Add( ++ GTest-EP ++ PREFIX "${CMAKE_BINARY_DIR}/deps" ++ URL https://github.com/google/googletest/archive/refs/tags/release-${GTest_VERSION}.tar.gz ++ URL_HASH SHA1=9c89be7df9c5e8cb0bc20b3c4b39bf7e82686770 ++ DOWNLOAD_NAME gtest.tar.gz ++ CMAKE_ARGS ++ -DCMAKE_INSTALL_PREFIX= ++ BUILD_COMMAND ${CMAKE_COMMAND} --build . ++ BUILD_BYPRODUCTS ++ /lib/libgtest.a ++ /lib/libgtest_main.a ++ LOG_DOWNLOAD ON ++ LOG_UPDATE ON ++ LOG_CONFIGURE ON ++ LOG_BUILD ON ++ LOG_INSTALL ON ++ LOG_OUTPUT_ON_FAILURE TRUE ++ ) ++ ++ set(GTest_INCLUDE_DIR "${CMAKE_BINARY_DIR}/deps/include/") ++ set(GTest_MAIN_LIBRARY "${CMAKE_BINARY_DIR}/deps/lib/libgtest_main.a") ++ set(GTest_LIBRARY "${CMAKE_BINARY_DIR}/deps/lib/libgtest.a") ++ file(MAKE_DIRECTORY "${GTest_INCLUDE_DIR}") ++ ++ add_library(GTest::gtest_main STATIC IMPORTED GLOBAL) ++ set_target_properties(GTest::gtest_main ++ PROPERTIES ++ IMPORTED_LOCATION "${GTest_MAIN_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${GTest_INCLUDE_DIR}" ++ INTERFACE_LINK_LIBRARIES "${GTest_LIBRARY}" ++ ) ++ set(GTest_FOUND TRUE) ++ add_dependencies(GTest::gtest_main GTest-EP) ++ message(STATUS "Building GTest ${GTest_VERSION}: ${GTest_MAIN_LIBRARY}") ++ ++ mark_as_advanced(GTest_FOUND) ++ mark_as_advanced(GTest_INCLUDE_DIR) ++ mark_as_advanced(GTest_LIBRARIES) ++endif() +diff --git a/cmake/googletest-download.cmake b/cmake/googletest-download.cmake +deleted file mode 100644 +index 8dca59539..000000000 +--- a/cmake/googletest-download.cmake ++++ /dev/null +@@ -1,28 +0,0 @@ +-# Boolector: Satisfiablity Modulo Theories (SMT) solver. +-# +-# Copyright (C) 2007-2021 by the authors listed in the AUTHORS file. +-# +-# This file is part of Boolector. +-# See COPYING for more information on using this software. +-# +- +-# code copied from https://crascit.com/2015/07/25/cmake-gtest/ +-cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +- +-project(googletest-download NONE) +- +-include(ExternalProject) +- +-ExternalProject_Add( +- googletest +- SOURCE_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-src" +- BINARY_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-build" +- GIT_REPOSITORY +- https://github.com/google/googletest.git +- GIT_TAG +- release-1.10.0 +- CONFIGURE_COMMAND "" +- BUILD_COMMAND "" +- INSTALL_COMMAND "" +- TEST_COMMAND "" +- ) +diff --git a/cmake/googletest.cmake b/cmake/googletest.cmake +deleted file mode 100644 +index af5a5bc36..000000000 +--- a/cmake/googletest.cmake ++++ /dev/null +@@ -1,41 +0,0 @@ +-# Boolector: Satisfiablity Modulo Theories (SMT) solver. +-# +-# Copyright (C) 2007-2021 by the authors listed in the AUTHORS file. +-# +-# This file is part of Boolector. +-# See COPYING for more information on using this software. +-# +- +-# the following code to fetch googletest +-# is inspired by and adapted after https://crascit.com/2015/07/25/cmake-gtest/ +-# download and unpack googletest at configure time +- +-macro(fetch_googletest _download_module_path _download_root) +- set(GOOGLETEST_DOWNLOAD_ROOT ${_download_root}) +- configure_file( +- ${_download_module_path}/googletest-download.cmake +- ${_download_root}/CMakeLists.txt +- @ONLY +- ) +- unset(GOOGLETEST_DOWNLOAD_ROOT) +- +- execute_process( +- COMMAND +- "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . +- WORKING_DIRECTORY +- ${_download_root} +- ) +- execute_process( +- COMMAND +- "${CMAKE_COMMAND}" --build . +- WORKING_DIRECTORY +- ${_download_root} +- ) +- +- # adds the targers: gtest, gtest_main, gmock, gmock_main +- add_subdirectory( +- ${_download_root}/googletest-src +- ${_download_root}/googletest-build +- EXCLUDE_FROM_ALL +- ) +-endmacro() +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 13f87d5e0..f2e14fd81 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -5,6 +5,9 @@ + # This file is part of Boolector. + # See COPYING for more information on using this software. + # ++ ++find_package(GoogleTest REQUIRED) ++ + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/tests) + + set(test_names +@@ -47,7 +50,7 @@ foreach(test ${test_names}) + add_executable (test${test} test_${test}.cpp) + target_include_directories(test${test} PRIVATE ${PROJECT_SOURCE_DIR}/test/new_test) + target_link_libraries(test${test} boolector m) +- target_link_libraries(test${test} gtest_main) ++ target_link_libraries(test${test} GTest::gtest_main) + set_target_properties(test${test} PROPERTIES OUTPUT_NAME test${test}) + add_test(${test} ${CMAKE_BINARY_DIR}/bin/tests/test${test}) + endforeach()