From 75d790e09d0bce7ba82cd2d692b18a00c49025ba Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Fri, 7 Oct 2011 12:44:37 +0200 Subject: [PATCH] Switch to using libsolv instead of satsolver --- CMakeLists.txt | 17 ++++++++++------- cmake/modules/FindSatsolver.cmake | 40 --------------------------------------- libzypp.spec.cmake | 11 +++++------ zypp/CMakeLists.txt | 4 ++-- 4 files changed, 17 insertions(+), 55 deletions(-) delete mode 100644 cmake/modules/FindSatsolver.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c975716..8e42ebd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,8 @@ MACRO(ADD_TESTS) ENDMACRO(ADD_TESTS) #################################################################### +# prefer packages using the same install prefix as we do +SET(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX} usr/localX /usr/local /usr) FIND_PACKAGE(Rpm REQUIRED) IF ( NOT RPM_FOUND) @@ -120,14 +122,15 @@ ELSE ( NOT ZLIB_FOUND) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) ENDIF( NOT ZLIB_FOUND) -FIND_PACKAGE(Satsolver REQUIRED) -IF ( NOT SATSOLVER_FOUND ) - MESSAGE( FATAL_ERROR " libsatsolver not found" ) -ELSE ( NOT SATSOLVER_FOUND ) - INCLUDE_DIRECTORIES( ${SATSOLVER_INCLUDE_DIR} ) -ENDIF( NOT SATSOLVER_FOUND ) +#SET(LibSolv_USE_STATIC_LIBS ON) +FIND_PACKAGE(LibSolv REQUIRED ext) +IF ( NOT LibSolv_FOUND ) + MESSAGE( FATAL_ERROR " libsolv not found" ) +ELSE() + INCLUDE_DIRECTORIES( ${LibSolv_INCLUDE_DIRS} ) +ENDIF() -# satsolver uses expat and has open references to it: +# libsolv uses expat and has open references to it: FIND_PACKAGE(EXPAT REQUIRED) FIND_PACKAGE(OpenSSL REQUIRED) diff --git a/cmake/modules/FindSatsolver.cmake b/cmake/modules/FindSatsolver.cmake deleted file mode 100644 index 1c462bf..0000000 --- a/cmake/modules/FindSatsolver.cmake +++ /dev/null @@ -1,40 +0,0 @@ - -if(SATSOLVER_INCLUDE_DIR AND SATSOLVER_LIBRARY AND SATSOLVER_EXT_LIBRARY) - # Already in cache, be silent - set(SATSOLVER_FIND_QUIETLY TRUE) -endif(SATSOLVER_INCLUDE_DIR AND SATSOLVER_LIBRARY AND SATSOLVER_EXT_LIBRARY) - -set(SATSOLVER_LIBRARY) -set(SATSOLVER_EXT_LIBRARY) -set(SATSOLVER_INCLUDE_DIR) - -FIND_PATH(SATSOLVER_INCLUDE_DIR satsolver/solvable.h - ${CMAKE_INSTALL_PREFIX}/include - /usr/local/include - /usr/include -) - -FIND_LIBRARY(SATSOLVER_LIBRARY NAMES satsolver - PATHS - ${CMAKE_INSTALL_PREFIX}/lib - /usr/local/lib - /usr/lib -) - -FIND_LIBRARY(SATSOLVER_EXT_LIBRARY NAMES satsolverext - PATHS - ${CMAKE_INSTALL_PREFIX}/lib - /usr/local/lib - /usr/lib -) - -if(SATSOLVER_INCLUDE_DIR AND SATSOLVER_LIBRARY) - MESSAGE( STATUS "satsolver found: includes in ${SATSOLVER_INCLUDE_DIR}, library in ${SATSOLVER_LIBRARY} ${SATSOLVER_EXT_LIBRARY} ") - set(SATSOLVER_FOUND TRUE) -else(SATSOLVER_INCLUDE_DIR AND SATSOLVER_LIBRARY) - MESSAGE( STATUS "** satsolver not found") - MESSAGE( STATUS "** install package libsatsolver-devel") - MESSAGE( STATUS "** (http://svn.opensuse.org/svn/zypp/trunk/sat-solver)") -endif(SATSOLVER_INCLUDE_DIR AND SATSOLVER_LIBRARY) - -MARK_AS_ADVANCED(SATSOLVER_INCLUDE_DIR SATSOLVER_LIBRARY) diff --git a/libzypp.spec.cmake b/libzypp.spec.cmake index 557a6d5..d4b2ad6 100644 --- a/libzypp.spec.cmake +++ b/libzypp.spec.cmake @@ -50,11 +50,11 @@ BuildRequires: graphviz BuildRequires: libxml2-devel BuildRequires: libproxy-devel -BuildRequires: libsatsolver-devel >= 0.14.17 +BuildRequires: libsolv-devel %if 0%{?suse_version} >= 1100 -%requires_eq satsolver-tools +%requires_eq libsolv-tools %else -Requires: satsolver-tools +Requires: libsolv-tools %endif # required for testsuite, webrick @@ -95,7 +95,6 @@ Requires: gpg2 Requires: gnupg2 %endif -%define min_aria_version 1.1.2 # --------------------------------------------------------------- %if 0%{?suse_version} >= 1110 # (almost) common codebase, but on SLES11-SP1 (according to Rudi @@ -169,9 +168,9 @@ Requires: curl-devel Requires: libcurl-devel >= %{min_curl_version} %endif %if 0%{?suse_version} >= 1100 -%requires_ge libsatsolver-devel +%requires_ge libsolv-devel %else -Requires: libsatsolver-devel +Requires: libsolv-devel %endif Summary: Package, Patch, Pattern, and Product Management - developers files Group: System/Packages diff --git a/zypp/CMakeLists.txt b/zypp/CMakeLists.txt index 8361c25..db4d53f 100644 --- a/zypp/CMakeLists.txt +++ b/zypp/CMakeLists.txt @@ -890,7 +890,7 @@ ENDMACRO( SET_LOGGROUP ) SET_LOGGROUP( "zypp" ${zypp_lib_SRCS} ) # override some defaults -SET_LOGGROUP( "satsolver" ${zypp_sat_SRCS} ) +SET_LOGGROUP( "libsolv" ${zypp_sat_SRCS} ) #SET_LOGGROUP( "group" ${zypp_target_rpm_SRCS} ) #SET_LOGGROUP( "group" ${zypp_parser_yum2_SRCS} ) #SET_LOGGROUP( "group" ${zypp_capability_SRCS} ) @@ -927,7 +927,7 @@ TARGET_LINK_LIBRARIES(zypp ${GETTEXT_LIBRARIES} ) TARGET_LINK_LIBRARIES(zypp ${CURL_LIBRARY} ) TARGET_LINK_LIBRARIES(zypp ${LIBXML_LIBRARY} ) TARGET_LINK_LIBRARIES(zypp ${ZLIB_LIBRARY} ) -TARGET_LINK_LIBRARIES(zypp ${SATSOLVER_LIBRARY} ${SATSOLVER_EXT_LIBRARY} ${EXPAT_LIBRARY}) +TARGET_LINK_LIBRARIES(zypp ${LibSolv_LIBRARIES} ${EXPAT_LIBRARY}) TARGET_LINK_LIBRARIES(zypp ${OPENSSL_LIBRARIES} ) TARGET_LINK_LIBRARIES(zypp ${CRYPTO_LIBRARIES} ) TARGET_LINK_LIBRARIES(zypp ${SIGNALS_LIBRARY} ) -- 2.7.4