pax_global_header00006660000000000000000000000064151736735720014532gustar00rootroot0000000000000052 comment=589bdeae445f6e7a503bf2b3e1cd554ff216c2c9 libzypp-17.38.7/000077500000000000000000000000001517367357200134125ustar00rootroot00000000000000libzypp-17.38.7/.clang-format000066400000000000000000000063211517367357200157670ustar00rootroot00000000000000--- Language: Cpp AccessModifierOffset: -2 AlignAfterOpenBracket: DontAlign AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Right AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: Yes BinPackArguments: true BinPackParameters: true BraceWrapping: AfterClass: true AfterControlStatement: true AfterEnum: true AfterFunction: true AfterNamespace: true AfterObjCDeclaration: true AfterStruct: true AfterUnion: true AfterExternBlock: false BeforeCatch: true BeforeElse: true IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom BreakBeforeInheritanceComma: false BreakInheritanceList: BeforeColon BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BreakConstructorInitializers: BeforeComma BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 80 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 2 ContinuationIndentWidth: 2 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IncludeBlocks: Preserve IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 - Regex: '^(<|"(gtest|isl|json)/)' Priority: 3 - Regex: '.*' Priority: 1 IncludeIsMainRegex: '(Test)?$' IndentCaseLabels: true IndentPPDirectives: None IndentWidth: 2 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepLineBreaksForNonEmptyLines: false KeepEmptyLinesAtTheStartOfBlocks: true MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: All ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: true ObjCSpaceBeforeProtocolList: false PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 1000000 PointerAlignment: Right ReflowComments: false SortIncludes: false SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: true SpacesInSquareBrackets: true Standard: Cpp11 TabWidth: 4 UseTab: Never ... libzypp-17.38.7/.clang-tidy000066400000000000000000000012431517367357200154460ustar00rootroot00000000000000Checks: - bugprone-use-after-move - bugprone-move-forwarding-reference - modernize-use-override - performance-move-const-arg - cppcoreguidelines-prefer-member-initializer - cppcoreguidelines-special-member-functions - performance-inefficient-vector-operation - performance-for-range-copy - bugprone-copy-constructor-init # - bugprone-dangling-handle - bugprone-dynamic-static-initializers - bugprone-unsafe-functions - -clang-diagnostic-unused-command-line-argument - -clang-diagnostic-ignored-optimization-argument WarningsAsErrors: 'bugprone-use-after-move' CheckOptions: performance-move-const-arg.CheckTriviallyCopyableMove: false libzypp-17.38.7/.gitattributes000066400000000000000000000000501517367357200163000ustar00rootroot00000000000000*.po merge=binary *.pot merge=binary libzypp-17.38.7/.github/000077500000000000000000000000001517367357200147525ustar00rootroot00000000000000libzypp-17.38.7/.github/workflows/000077500000000000000000000000001517367357200170075ustar00rootroot00000000000000libzypp-17.38.7/.github/workflows/build-and-publish-doc.yml000066400000000000000000000052471517367357200236100ustar00rootroot00000000000000name: Build and deploy documentation # Controls when the workflow will run on: #Enable this trigger to test changes to this workflow via build requests #pull_request: # Runs the trigger when a git TAG is created: push: tags: - '*' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" cancel-in-progress: false # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest # run on tumbleweed container: image: registry.opensuse.org/opensuse/tumbleweed:latest volumes: - my_docker_volume:/volume_mount # Steps required to build the docs steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Checkout repository uses: actions/checkout@v6 - name: Install dependencies run: bash -c 'zypper in -y "FastCGI-devel" "cmake >= 3.17" "dejagnu" "doxygen" "gcc-c++ >= 7" "gettext-devel" "ghostscript" "glib2-devel" "graphviz" "libboost_headers-devel" "libboost_program_options-devel" "libboost_test-devel" "libboost_thread-devel" "libbz2-devel" "libcurl-devel >= 7.19.4" "libgpgme-devel" "libproxy-devel" "libsigc++2-devel" "libsolv-devel-static >= 0.7.34" "libsolv-tools-base >= 0.7.29" "libxml2-devel" "libzck-devel" "libzstd-devel" "nginx" "pkg-config" "pkgconfig(libudev)" "pkgconfig(openssl)" "readline-devel >= 5.1" "rpm" "rpm-devel > 4.4" "rubygem(asciidoctor)" "squid" "texlive-dvips" "texlive-latex" "texlive-newunicodechar" "texlive-xcolor" "vsftpd" "xz-devel" "yaml-cpp-devel" "graphviz-gd"' # Build the docs - name: Run the build run: | mkdir build cd build cmake .. make doc - name: Upload artifact uses: actions/upload-pages-artifact@v5 with: path: ./build/zypp/doc/autodoc/html # Deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v5 libzypp-17.38.7/.gitignore000066400000000000000000000002131517367357200153760ustar00rootroot00000000000000build *.orig *.rej *.swp *.kate-swp #* .#* *# .*project .externalToolBuilders .settings *flymake.h.gch CMakeLists.txt.user* .vscode .cache libzypp-17.38.7/.obs/000077500000000000000000000000001517367357200142535ustar00rootroot00000000000000libzypp-17.38.7/.obs/workflows.yml000066400000000000000000000006571517367357200170430ustar00rootroot00000000000000ci_workflow: steps: - branch_package: source_project: zypp:ci:libzypp source_package: libzypp target_project: home:zypp-team filters: event: pull_request #master_workflow: # steps: # - branch_package: # source_project: zypp:ci:libzypp # source_package: libzypp # target_project: home:zypp-team # filters: # event: push # branches: # only: # - master libzypp-17.38.7/.travis.yml000066400000000000000000000024341517367357200155260ustar00rootroot00000000000000sudo: required dist: trusty group: stable language: c++ os: linux services: - docker before_install: - cat /proc/cpuinfo - docker pull opensuse:tumbleweed - docker run -i -d --name test opensuse:tumbleweed bash - docker exec test zypper ref - docker exec test zypper in -y --recommends cmake openssl-devel boost-devel dejagnu doxygen gcc-c++ gettext-devel graphviz libxml2-devel libproxy-devel pkg-config libsolv-devel libsolv-tools ruby rpm-devel libcurl-devel libboost_program_options*-devel libboost_test*-devel libudev-devel xorg-x11-fonts-core xorg-x11-fonts texlive-lm-fonts libgpgme-devel gpgme libboost_thread1_* - docker exec test zypper in -y "rubygem(asciidoctor)" script: - docker cp ../libzypp/ test:/root - docker exec test mkdir /root/build - docker exec test bash -c "cd /root/build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=1 ../libzypp" - docker exec test bash -c "cd /root/build && make -j4 VERBOSE=1" - docker exec test bash -c "cd /root/build && make -j4 -C doc/autodoc" - docker exec test bash -c "cd /root/build && make -j4 -C po translations" - docker exec test bash -c "cd /root/build && make -j4 -C tests" - docker exec test bash -c "cd /root/build/tests && LD_LIBRARY_PATH=\$PWD/../zypp:\$LD_LIBRARY_PATH ctest -VV ." on: repo: openSUSE/libzypp tags: true libzypp-17.38.7/CMakeLists.txt000066400000000000000000000420121517367357200161510ustar00rootroot00000000000000# This project builds legacy and the next generation libzypp. # Goal of having the same source tree for two generations of the library # is that we can share code that does not need to be rewritten without having # to rely on building another shared library and also be able to recompile the # shared code with different compiler flags... e.g. coroutine support on/off cmake_minimum_required(VERSION 3.17) project(zypp-libs) INCLUDE(CMakePushCheckState) include(CheckSymbolExists) # use Boost's config file if(POLICY CMP0167) cmake_policy(SET CMP0167 NEW) endif() # allow name libraries by name mixed with full # paths if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) OPTION (ENABLE_BUILD_DOCS "Build documentation by default?" OFF) OPTION (ENABLE_BUILD_TRANS "Build translation files by default?" OFF) OPTION (ENABLE_BUILD_TESTS "Build and run test suite by default?" OFF) OPTION (ENABLE_ZSTD_COMPRESSION "Build with zstd compression support?" OFF) OPTION (ENABLE_VISIBILITY_HIDDEN "Build with hidden visibility by default?" ON) OPTION (ENABLE_ZCHUNK_COMPRESSION "Build with zchunk compression support?" OFF) # Helps with bug https://bugzilla.gnome.org/show_bug.cgi?id=784550 , Segfault during signal emission when slots are cleared OPTION (ENABLE_SIGC_BLOCK_WORKAROUND "Enable a workaround for older sigcpp libraries?" OFF ) OPTION (DISABLE_MEDIABACKEND_TESTS "Disable Tests depending on Nginx and libfcgi?" OFF) OPTION (DISABLE_LIBPROXY "Build without libproxy support even if package is installed?" OFF) OPTION (DISABLE_AUTODOCS "Do not require doxygen being installed (required to build autodocs)?" OFF) # This option will reroute all tool binaries to the libzypp build dir instead of taking those installed in the default directories. OPTION (ENABLE_DEVEL_BUILD "Developer build, use zypp tools directly from build dir rather than the default locations" OFF) OPTION (ENABLE_CLANG_TIDY "Enables static checks with clang-tidy" OFF) OPTION (ENABLE_CPPCHECK "Enables static checks with cppcheck" OFF) OPTION (ENABLE_UBSAN_CHECKS "Enables the undefined behavior sanitizer runtime checks in debug builds." OFF) OPTION (BUILD_LIBZYPP "Build of the classic libzypp library" ON) OPTION (BUILD_LIBZYPPNG "Build of the next gen libzypp library" ON) OPTION (KEEP_LEGACY_ZYPPCONF "Install the vendor zypp.conf in /etc too (ONLY LEGACY SYSTEMS WANT THIS)" OFF) #-------------------------------------------------------------------------------- SET (have_system x) IF (DEBIAN) MESSAGE (STATUS "Building for Debian") ADD_DEFINITIONS (-DDEBIAN) SET (ENABLE_BUILD_DOCS ON) SET (ENABLE_BUILD_TRANS ON) SET (ENABLE_BUILD_TESTS ON) SET (have_system ${have_system}x) ENDIF (DEBIAN) IF (SUSE) MESSAGE (STATUS "Building for SUSE (${LIBZYPP_CODESTREAM})") ADD_DEFINITIONS (-DSUSE) SET(LibSolv_USE_STATIC_LIBS ON) SET (ENABLE_BUILD_DOCS ON) SET (ENABLE_BUILD_TRANS ON) SET (ENABLE_BUILD_TESTS ON) SET (have_system ${have_system}x) ENDIF (SUSE) IF (${have_system} STREQUAL x) MESSAGE (STATUS "Building for no specific system type.") ENDIF (${have_system} STREQUAL x) IF (${have_system} STRGREATER xx) MESSAGE (FATAL_ERROR "Can only build for one system type.") ENDIF (${have_system} STRGREATER xx) IF ( NOSCHNICKSCHNACK ) MESSAGE (STATUS "Building with NOSCHNICKSCHNACK") # In case you want make to build just the sources SET (ENABLE_BUILD_DOCS OFF) SET (ENABLE_BUILD_TRANS OFF) SET (ENABLE_BUILD_TESTS OFF) ENDIF() #-------------------------------------------------------------------------------- # We're going to move our default configuration successively into /usr/etc/. # The final configuration data will then be merged according to the rules # defined by the UAPI.6 Configuration Files Specification from: # system-wide configuration (/etc /zypp/zypp.conf[.d/*.conf]) # vendor configuration (/usr/etc/zypp/zypp.conf[.d/*.conf]) IF( NOT DEFINED ZYPPCONFDIR ) SET ( ZYPPCONFDIR "/usr/etc" ) ENDIF() #-------------------------------------------------------------------------------- # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked SET( CMAKE_MODULE_PATH ${zypp-libs_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} ) INCLUDE(ZyppCommon) # Macro to set the log group for a list of files MACRO( SET_LOGGROUP _group _files ) SET_SOURCE_FILES_PROPERTIES( ${_files} COMPILE_FLAGS -DZYPP_BASE_LOGGER_LOGGROUP=\\"${_group}\\" ) FOREACH (_currentFile ${ARGN}) #MESSAGE( STATUS "setting loggroup to \"${_group}\" for ${_currentFile}" ) SET_SOURCE_FILES_PROPERTIES( ${_currentFile} COMPILE_FLAGS -DZYPP_BASE_LOGGER_LOGGROUP=\\"${_group}\\" ) ENDFOREACH (_currentFile ${ARGN}) ENDMACRO( SET_LOGGROUP ) # general flags used for all targets add_library( zypp_initial_compiler_flags INTERFACE ) SET( CMAKE_THREAD_PREFER_PTHREAD TRUE ) FIND_PACKAGE( Threads REQUIRED ) IF ( NOT CMAKE_USE_PTHREADS_INIT ) MESSAGE( FATAL_ERROR "No pthreads found" ) ENDIF ( NOT CMAKE_USE_PTHREADS_INIT ) include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY) CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY) IF(${CXX_FORMAT_SECURITY}) target_compile_options( zypp_initial_compiler_flags INTERFACE "-Werror=format-security") target_link_options( zypp_initial_compiler_flags INTERFACE "-Werror=format-security") ENDIF(${CXX_FORMAT_SECURITY}) target_compile_options( zypp_initial_compiler_flags INTERFACE "-pthread" "-fno-strict-aliasing" "-g" "-Wall" "-Wp,-D_GLIBCXX_ASSERTIONS" ) target_link_options( zypp_initial_compiler_flags INTERFACE "-pthread" "-fno-strict-aliasing" "-g" "-Wall" "-Wp,-D_GLIBCXX_ASSERTIONS" ) target_compile_options( zypp_initial_compiler_flags INTERFACE "-fvisibility-inlines-hidden" "-Woverloaded-virtual" "-Wnon-virtual-dtor" "-ftemplate-backtrace-limit=0" ) target_link_options( zypp_initial_compiler_flags INTERFACE "-fvisibility-inlines-hidden" "-Woverloaded-virtual" "-Wnon-virtual-dtor" "-ftemplate-backtrace-limit=0" ) #cli args ignored by clang, it still prints a noisy warning though if ( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") target_compile_options( zypp_initial_compiler_flags INTERFACE "-Wl,-as-needed" ) target_link_options( zypp_initial_compiler_flags INTERFACE "-Wl,-as-needed" ) if( ENABLE_UBSAN_CHECKS ) target_compile_options( zypp_initial_compiler_flags INTERFACE "$<$:-fsanitize=undefined>" ) target_link_options( zypp_initial_compiler_flags INTERFACE "$<$:-fsanitize=undefined>" ) endif() endif() INCLUDE(CheckFunctionExists) CHECK_FUNCTION_EXISTS(pipe2 PIPE2_FOUND) IF(${PIPE2_FOUND}) target_compile_definitions( zypp_initial_compiler_flags INTERFACE HAVE_PIPE2 ) ENDIF(${PIPE2_FOUND}) #tell libsolv to rename its variables to be C++20 compatible target_compile_definitions(zypp_initial_compiler_flags INTERFACE LIBSOLV_SOLVABLE_PREPEND_DEP ) target_compile_definitions(zypp_initial_compiler_flags INTERFACE _FILE_OFFSET_BITS=64 LIBSOLV_SOLVABLE_PREPEND_DEP ) target_compile_definitions(zypp_initial_compiler_flags INTERFACE $<$>:ZYPP_NDEBUG NDEBUG> ) target_compile_options( zypp_initial_compiler_flags INTERFACE $<$>:-O2>) target_link_options ( zypp_initial_compiler_flags INTERFACE $<$>:-O2>) find_package(FindPkgConfig, QUIET) FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options unit_test_framework thread) IF (Boost_FOUND) MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}") target_include_directories( zypp_initial_compiler_flags INTERFACE ${Boost_INCLUDE_DIRS}) target_link_directories( zypp_initial_compiler_flags INTERFACE ${Boost_LIBRARY_DIRS}) ENDIF(Boost_FOUND) FIND_PACKAGE(Gettext REQUIRED) IF (GETTEXT_FOUND) MESSAGE(STATUS "Found Gettext: ${GETTEXT_SOURCE}") target_include_directories( zypp_initial_compiler_flags INTERFACE ${GETTEXT_INCLUDE_DIR}) ELSE (GETTEXT_FOUND) MESSAGE( FATAL_ERROR "Gettext not found" ) ENDIF (GETTEXT_FOUND) FIND_PACKAGE(CURL REQUIRED) IF ( NOT CURL_FOUND) MESSAGE( FATAL_ERROR " curl not found" ) ELSE ( NOT CURL_FOUND) target_include_directories( zypp_initial_compiler_flags INTERFACE ${CURL_INCLUDE_DIRS}) ENDIF( NOT CURL_FOUND) FIND_PACKAGE(LibXml2 REQUIRED) IF ( NOT LIBXML2_FOUND) MESSAGE( FATAL_ERROR " libxml not found" ) ELSE ( NOT LIBXML2_FOUND) target_include_directories( zypp_initial_compiler_flags INTERFACE ${LIBXML2_INCLUDE_DIR}) cmake_push_check_state(RESET) set(CMAKE_REQUIRED_INCLUDES ${LIBXML2_INCLUDE_DIR} ${CMAKE_REQUIRED_INCLUDES}) set(CMAKE_REQUIRED_LIBRARIES ${LIBXML2_LIBRARIES} ) set(CMAKE_REQUIRED_QUIET FALSE ) check_symbol_exists( xmlCtxtSetErrorHandler "libxml/SAX2.h" XMLCTXTSETERRORHANDLER_FOUND ) IF(${XMLCTXTSETERRORHANDLER_FOUND}) target_compile_definitions( zypp_initial_compiler_flags INTERFACE HAVE_LIBXML2_XMLCTXTSETERRORHANDLER ) ENDIF() cmake_pop_check_state() ENDIF( NOT LIBXML2_FOUND) FIND_PACKAGE(ZLIB REQUIRED) IF ( NOT ZLIB_FOUND) MESSAGE( FATAL_ERROR " zlib not found" ) ELSE ( NOT ZLIB_FOUND) target_include_directories( zypp_initial_compiler_flags INTERFACE ${ZLIB_INCLUDE_DIR}) ENDIF( NOT ZLIB_FOUND) FIND_PACKAGE(YAML-CPP REQUIRED) IF ( NOT YAML-CPP_FOUND) MESSAGE( FATAL_ERROR " yaml-cpp not found" ) ELSE ( NOT YAML-CPP_FOUND) target_include_directories( zypp_initial_compiler_flags INTERFACE ${YAML_CPP_INCLUDE_DIR}) IF ( NOT YAML_CPP_LIBRARIES ) # Must have been found by config insted of module, use target instead. SET( YAML_CPP_LIBRARIES "yaml-cpp" ) ENDIF ( NOT YAML_CPP_LIBRARIES ) ENDIF( NOT YAML-CPP_FOUND) #Allow to override the libsolv install location if( ZYPP_STACK_BUILD ) set ( LibSolv_FOUND TRUE ) SET ( LibSolv_INCLUDE_DIRS ${ZYPP_STACK_INCLUDE_DIRS} ) SET ( LibSolv_LIBRARIES libsolvext libsolv ) else() if ( LibSolv_USE_STATIC_LIBS ) MESSAGE( STATUS "Require static libsolv libraries..." ) endif() FIND_PACKAGE(LibSolv REQUIRED ext) IF ( NOT LibSolv_FOUND ) MESSAGE( FATAL_ERROR " libsolv not found" ) ELSE() # static case: Assert libsolv.a ist the last one linked SET(LibSolv_LIBRARIES ${LibSolv_LIBRARIES} ${LIBSOLV_LIBRARY}) ENDIF() # detecting libsolv features, so we know which libraries to link this is still required even if we were asked to build # without zstd support cmake_push_check_state(RESET) set(CMAKE_REQUIRED_INCLUDES ${LibSolv_INCLUDE_DIRS} ${CMAKE_REQUIRED_INCLUDES}) CHECK_SYMBOL_EXISTS( LIBSOLVEXT_FEATURE_ZLIB_COMPRESSION "solv/solvversion.h" SOLV_NEED_ZLIB ) CHECK_SYMBOL_EXISTS( LIBSOLVEXT_FEATURE_LZMA_COMPRESSION "solv/solvversion.h" SOLV_NEED_LZMA ) CHECK_SYMBOL_EXISTS( LIBSOLVEXT_FEATURE_BZIP2_COMPRESSION "solv/solvversion.h" SOLV_NEED_BZIP2 ) CHECK_SYMBOL_EXISTS( LIBSOLVEXT_FEATURE_ZSTD_COMPRESSION "solv/solvversion.h" SOLV_NEED_ZSTD ) cmake_pop_check_state() # no check for system zchunk, default is usually to use the libsolv internal libs #CHECK_SYMBOL_EXISTS( LIBSOLVEXT_FEATURE_ZCHUNK_COMPRESSION "solv/solvversion.h" SOLV_NEED_ZCHUNK ) #if ( SOLV_NEED_ZCHUNK ) # FIND_PACKAGE(PkgConfig REQUIRED) # PKG_CHECK_MODULES(ZCHUNK zck REQUIRED) # set(LibSolv_LIBRARIES ${LibSolv_LIBRARIES} ${ZCHUNK_LIBRARIES}) #endif () if ( SOLV_NEED_ZLIB ) FIND_PACKAGE (ZLIB REQUIRED) SET(LibSolv_LIBRARIES ${LibSolv_LIBRARIES} ${ZLIB_LIBRARY}) endif () if ( SOLV_NEED_LZMA ) FIND_LIBRARY(LZMA_LIBRARY NAMES lzma liblzma REQUIRED) SET(LibSolv_LIBRARIES ${LibSolv_LIBRARIES} ${LZMA_LIBRARY}) endif () if ( SOLV_NEED_BZIP2 ) FIND_PACKAGE (BZip2 REQUIRED) SET(LibSolv_LIBRARIES ${LibSolv_LIBRARIES} ${BZIP2_LIBRARIES}) endif () if ( SOLV_NEED_ZSTD ) FIND_LIBRARY (ZSTD_LIBRARY NAMES zstd REQUIRED) SET(LibSolv_LIBRARIES ${LibSolv_LIBRARIES} ${ZSTD_LIBRARY}) endif () endif( ZYPP_STACK_BUILD ) target_include_directories( zypp_initial_compiler_flags INTERFACE ${LibSolv_INCLUDE_DIRS} ) pkg_search_module(GPGME gpgme>=1.8.0) IF ( GPGME_FOUND ) MESSAGE(STATUS "Found gpgme ${GPGME_VERSION}" ) target_include_directories( zypp_initial_compiler_flags INTERFACE ${GPGME_INCLUDE_DIRS} ) target_link_directories( zypp_initial_compiler_flags INTERFACE ${GPGME_LIBRARY_DIRS} ) ELSE() FIND_PACKAGE(Gpgme REQUIRED) IF ( NOT GPGME_PTHREAD_FOUND ) MESSAGE( FATAL_ERROR " gpgme not found" ) ELSE() target_include_directories( zypp_initial_compiler_flags INTERFACE ${GPGME_INCLUDES} ) target_link_directories( zypp_initial_compiler_flags INTERFACE ${GPGME_LIBRARY_DIR} ) SET(GPGME_LIBRARIES ${GPGME_PTHREAD_LIBRARIES}) ENDIF() ENDIF() FIND_PACKAGE(OpenSSL REQUIRED) FIND_PACKAGE(Udev) IF ( NOT UDEV_FOUND ) MESSAGE(WARNING "No udev found. CD device detection will be poor") ELSE ( NOT UDEV_FOUND ) target_compile_definitions( zypp_initial_compiler_flags INTERFACE HAVE_UDEV) ENDIF ( NOT UDEV_FOUND ) IF( DISABLE_LIBPROXY ) MESSAGE( STATUS "libproxy support disabled" ) ELSE( DISABLE_LIBPROXY ) target_compile_definitions( zypp_initial_compiler_flags INTERFACE WITH_LIBPROXY_SUPPORT) ENDIF( DISABLE_LIBPROXY ) FIND_PROGRAM( DOXYGEN doxygen ) IF ( NOT DOXYGEN ) IF ( DISABLE_AUTODOCS ) MESSAGE( STATUS "doxygen is not available. Can't build the documentation." ) ELSE ( DISABLE_AUTODOCS ) MESSAGE( FATAL_ERROR "doxygen not found: install doxygen to build the documentation!" ) ENDIF ( DISABLE_AUTODOCS ) ELSE ( NOT DOXYGEN ) MESSAGE( STATUS "doxygen found: ${DOXYGEN}" ) ENDIF ( NOT DOXYGEN ) if (ENABLE_CLANG_TIDY) FIND_PROGRAM( CLANG-TIDY clang-tidy ) if ( CLANG-TIDY ) message( "Enabling clang-tidy checks") set( ZYPP_CXX_CLANG_TIDY ${CLANG-TIDY} ) else ( CLANG-TIDY ) message(WARNING "clang-tidy not found.") endif( CLANG-TIDY ) endif(ENABLE_CLANG_TIDY) if ( ENABLE_CPPCHECK ) FIND_PROGRAM( CPPCHECK cppcheck ) if ( CPPCHECK ) message( "Enabling cppcheck") set(ZYPP_CXX_CPPCHECK ${CPPCHECK};--std=c++17;--suppress=rethrowNoCurrentException) else ( CPPCHECK ) message(WARNING "cppcheck not found.") endif( CPPCHECK ) endif(ENABLE_CPPCHECK) # https://bugzilla.gnome.org/show_bug.cgi?id=784550 IF (ENABLE_ZCHUNK_COMPRESSION) MESSAGE("Building with zchunk support enabled.") PKG_CHECK_MODULES (ZCHUNK zck REQUIRED) message("ZCHUNK FLAGS ${ZCHUNK_CFLAGS} ") target_compile_options( zypp_initial_compiler_flags INTERFACE ${ZCHUNK_CFLAGS} ) target_link_options( zypp_initial_compiler_flags INTERFACE ${ZCHUNK_CFLAGS} ) target_compile_definitions( zypp_initial_compiler_flags INTERFACE ENABLE_ZCHUNK_COMPRESSION=1 ) ENDIF(ENABLE_ZCHUNK_COMPRESSION) IF(ENABLE_SIGC_BLOCK_WORKAROUND) message("Building with sigcpp block workaround") target_compile_definitions( zypp_initial_compiler_flags INTERFACE LIBZYPP_USE_SIGC_BLOCK_WORKAROUND=1) ENDIF(ENABLE_SIGC_BLOCK_WORKAROUND) pkg_check_modules ( SIGCPP REQUIRED sigc++-2.0 ) target_include_directories( zypp_initial_compiler_flags INTERFACE ${SIGCPP_INCLUDE_DIRS} ) pkg_check_modules ( LIBGLIB REQUIRED glib-2.0 ) target_include_directories( zypp_initial_compiler_flags INTERFACE ${LIBGLIB_INCLUDE_DIRS} ) #usage requirements for all libs add_library( zypp_initial_lib_compiler_flags INTERFACE) target_compile_options( zypp_initial_lib_compiler_flags INTERFACE "-fPIC" "-rdynamic" "-Wl,--no-allow-shlib-undefined" "-Wl,--no-undefined") target_link_options ( zypp_initial_lib_compiler_flags INTERFACE "-fPIC" "-rdynamic" "-Wl,--no-allow-shlib-undefined" "-Wl,--no-undefined" ) #usage requirements for all executables add_library( zypp_initial_exe_compiler_flags INTERFACE) target_compile_options( zypp_initial_exe_compiler_flags INTERFACE "-fpie" "-pie" "-Wl,--no-undefined" ) target_link_options ( zypp_initial_exe_compiler_flags INTERFACE "-fpie" "-pie" "-Wl,--no-undefined" ) INCLUDE( zypp/VERSION.cmake ) MATH( EXPR LIBZYPP_NUMVERSION "${LIBZYPP_MAJOR} * 10000 + ${LIBZYPP_MINOR} * 100 + ${LIBZYPP_PATCH}" ) MATH( EXPR LIBZYPP_CURRENT "${LIBZYPP_MAJOR} * 100 + ${LIBZYPP_MINOR}" ) MATH( EXPR LIBZYPP_AGE "${LIBZYPP_MINOR} - ${LIBZYPP_COMPATMINOR}" ) # Libtool wanted current:patch:age # But cmake is not libtool, it wants the verbatim suffix to libzypp.so MATH( EXPR LIBZYPP_SO_FIRST "${LIBZYPP_CURRENT}-${LIBZYPP_AGE}" ) SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" ) INCLUDE(CTest) ENABLE_TESTING() # add vendoring subdir add_subdirectory(external) # we add the top level projects conditionally. This way we can exclude them from # each others source tarball. ( not needed with _multibuild? ) if (BUILD_LIBZYPP) add_subdirectory(zypp) MESSAGE(STATUS "ZyppConfig.cmake will be installed in ${LIB_INSTALL_DIR}/cmake/Zypp") INSTALL( FILES ${zypp-libs_SOURCE_DIR}/cmake/modules/ZyppConfig.cmake DESTINATION ${LIB_INSTALL_DIR}/cmake/Zypp ) INSTALL( FILES ${zypp-libs_SOURCE_DIR}/cmake/modules/ZyppCommon.cmake DESTINATION ${LIB_INSTALL_DIR}/cmake/Zypp ) endif() if (BUILD_LIBZYPPNG) OPTION (EXPORT_NG_API "Export experimental libzypp API" OFF) OPTION (INSTALL_NG_BINARIES "Installs the NG binaries, disabled for now since we are not actively using them." OFF) add_subdirectory(zyppng) endif() IF ( ENABLE_BUILD_TRANS ) ADD_SUBDIRECTORY( po ) ELSE ( ENABLE_BUILD_TRANS ) ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL ) ENDIF ( ENABLE_BUILD_TRANS ) libzypp-17.38.7/COPYING000066400000000000000000000022131517367357200144430ustar00rootroot00000000000000/*---------------------------------------------------------------------\ | ____ _ __ __ ___ | | |__ / \ / / . \ . \ | | / / \ V /| _/ _/ | | / /__ | | | | | | | | /_____||_| |_| |_| | | | \---------------------------------------------------------------------*/ Copyright (C) 2000-2002 Ximian, Inc. Copyright (C) 2005-2018 SUSE LINUX Products GmbH, Nuernberg, Germany. ZYpp is licensed under the GNU General Public License version 2 or later. The text of the GNU General Public License can be viewed at http://www.gnu.org/licenses/gpl.html As a special exception, you have permission to link this program with the following libraries and distribute executables, as long as you follow the requirements of the GNU GPL in regard to all of the software in the executable aside from the following libraries: - OpenSSL (http://www.openssl.org) libzypp-17.38.7/cmake/000077500000000000000000000000001517367357200144725ustar00rootroot00000000000000libzypp-17.38.7/cmake/modules/000077500000000000000000000000001517367357200161425ustar00rootroot00000000000000libzypp-17.38.7/cmake/modules/FindGpgme.cmake000066400000000000000000000351661517367357200210170ustar00rootroot00000000000000# Taken from gpgmepp project # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # - Try to find the gpgme library # # Algorithm: # - Windows: # On Windows, there's three gpgme variants: gpgme{,-glib,-qt}. # - The variant used determines the event loop integration possible: # - gpgme: no event loop integration possible, only synchronous operations supported # - gpgme-glib: glib event loop integration possible, only asynchronous operations supported # - gpgme-qt: qt event loop integration possible, only asynchronous operations supported # - GPGME_{VANILLA,GLIB,QT}_{FOUND,LIBRARIES} will be set for each of the above # - GPGME_INCLUDES is the same for all of the above # - GPGME_FOUND is set if any of the above was found # - *nix: # There's also three variants: gpgme{,-pthread,-pth}. # - The variant used determines the multithreaded use possible: # - gpgme: no multithreading support available # - gpgme-pthread: multithreading available using POSIX threads # - gpgme-pth: multithreading available using GNU PTH (cooperative multithreading) # - GPGME_{VANILLA,PTH,PTHREAD}_{FOUND,LIBRARIES} will be set for each of the above # - GPGME_INCLUDES is the same for all of the above # - GPGME_FOUND is set if any of the above was found # # GPGME_LIBRARY_DIR - the directory where the libraries are located # # THIS IS ALMOST A 1:1 COPY OF FindAssuan.cmake in kdepim. # Any changes here likely apply there, too. # include(FeatureSummary) # do away with crappy condition repetition on else/endfoo set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS_gpgme_saved ${CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS} ) set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) #if this is built-in, please replace, if it isn't, export into a MacroToBool.cmake of its own macro( macro_bool_to_bool FOUND_VAR ) foreach( _current_VAR ${ARGN} ) if ( ${FOUND_VAR} ) set( ${_current_VAR} TRUE ) else() set( ${_current_VAR} FALSE ) endif() endforeach() endmacro() #HACK: local copy... MACRO(MACRO_BOOL_TO_01 FOUND_VAR ) FOREACH (_current_VAR ${ARGN}) IF(${FOUND_VAR}) SET(${_current_VAR} 1) ELSE(${FOUND_VAR}) SET(${_current_VAR} 0) ENDIF(${FOUND_VAR}) ENDFOREACH(_current_VAR) ENDMACRO(MACRO_BOOL_TO_01) if ( WIN32 ) # On Windows, we don't have a gpgme-config script, so we need to # look for the stuff ourselves: # in cmake, AND and OR have the same precedence, there's no # subexpressions, and expressions are evaluated short-circuit'ed # IOW: CMake if() suxx. # Starting with CMake 2.6.3 you can group if expressions with (), but we # don't require 2.6.3 but 2.6.2, we can't use it. Alex set( _seem_to_have_cached_gpgme false ) if ( GPGME_INCLUDES ) if ( GPGME_VANILLA_LIBRARIES OR GPGME_QT_LIBRARIES OR GPGME_GLIB_LIBRARIES ) set( _seem_to_have_cached_gpgme true ) endif() endif() if ( _seem_to_have_cached_gpgme ) macro_bool_to_bool( GPGME_VANILLA_LIBRARIES GPGME_VANILLA_FOUND ) macro_bool_to_bool( GPGME_GLIB_LIBRARIES GPGME_GLIB_FOUND ) macro_bool_to_bool( GPGME_QT_LIBRARIES GPGME_QT_FOUND ) # this would have been preferred: #set( GPGME_*_FOUND macro_bool_to_bool(GPGME_*_LIBRARIES) ) if ( GPGME_VANILLA_FOUND OR GPGME_GLIB_FOUND OR GPGME_QT_FOUND ) set( GPGME_FOUND true ) else() set( GPGME_FOUND false ) endif() else() set( GPGME_FOUND false ) set( GPGME_VANILLA_FOUND false ) set( GPGME_GLIB_FOUND false ) set( GPGME_QT_FOUND false ) find_path( GPGME_INCLUDES gpgme.h ${CMAKE_INCLUDE_PATH} ${CMAKE_INSTALL_PREFIX}/include ) find_library( _gpgme_vanilla_library NAMES gpgme libgpgme gpgme-11 libgpgme-11 PATHS ${CMAKE_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib ) find_library( _gpgme_glib_library NAMES gpgme-glib libgpgme-glib gpgme-glib-11 libgpgme-glib-11 PATHS ${CMAKE_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib ) find_library( _gpgme_qt_library NAMES gpgme-qt libgpgme-qt gpgme-qt-11 libgpgme-qt-11 PATHS ${CMAKE_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib ) find_library( _gpg_error_library NAMES gpg-error libgpg-error gpg-error-0 libgpg-error-0 PATHS ${CMAKE_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib ) set( GPGME_INCLUDES ${GPGME_INCLUDES} ) if ( _gpgme_vanilla_library AND _gpg_error_library ) set( GPGME_VANILLA_LIBRARIES ${_gpgme_vanilla_library} ${_gpg_error_library} ) set( GPGME_VANILLA_FOUND true ) set( GPGME_FOUND true ) endif() if ( _gpgme_glib_library AND _gpg_error_library ) set( GPGME_GLIB_LIBRARIES ${_gpgme_glib_library} ${_gpg_error_library} ) set( GPGME_GLIB_FOUND true ) set( GPGME_FOUND true ) endif() if ( _gpgme_qt_library AND _gpg_error_library ) set( GPGME_QT_LIBRARIES ${_gpgme_qt_library} ${_gpg_error_library} ) set( GPGME_QT_FOUND true ) set( GPGME_FOUND true ) endif() endif() # these are Unix-only: set( GPGME_PTHREAD_FOUND false ) set( GPGME_PTH_FOUND false ) set( HAVE_GPGME_PTHREAD 0 ) set( HAVE_GPGME_PTH 0 ) macro_bool_to_01( GPGME_FOUND HAVE_GPGME ) macro_bool_to_01( GPGME_VANILLA_FOUND HAVE_GPGME_VANILLA ) macro_bool_to_01( GPGME_GLIB_FOUND HAVE_GPGME_GLIB ) macro_bool_to_01( GPGME_QT_FOUND HAVE_GPGME_QT ) else() # not WIN32 # On *nix, we have the gpgme-config script which can tell us all we # need to know: # see WIN32 case for an explanation of what this does: set( _seem_to_have_cached_gpgme false ) if ( GPGME_INCLUDES ) if ( GPGME_VANILLA_LIBRARIES OR GPGME_PTHREAD_LIBRARIES OR GPGME_PTH_LIBRARIES ) set( _seem_to_have_cached_gpgme true ) endif() endif() if ( _seem_to_have_cached_gpgme ) macro_bool_to_bool( GPGME_VANILLA_LIBRARIES GPGME_VANILLA_FOUND ) macro_bool_to_bool( GPGME_PTHREAD_LIBRARIES GPGME_PTHREAD_FOUND ) macro_bool_to_bool( GPGME_PTH_LIBRARIES GPGME_PTH_FOUND ) if ( GPGME_VANILLA_FOUND OR GPGME_PTHREAD_FOUND OR GPGME_PTH_FOUND ) set( GPGME_FOUND true ) else() set( GPGME_FOUND false ) endif() else() set( GPGME_FOUND false ) set( GPGME_VANILLA_FOUND false ) set( GPGME_PTHREAD_FOUND false ) set( GPGME_PTH_FOUND false ) find_program( _GPGMECONFIG_EXECUTABLE NAMES gpgme-config ) # if gpgme-config has been found if ( _GPGMECONFIG_EXECUTABLE ) message( STATUS "Found gpgme-config at ${_GPGMECONFIG_EXECUTABLE}" ) exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE GPGME_VERSION ) set( _GPGME_MIN_VERSION "1.1.7" ) if ( ${GPGME_VERSION} VERSION_LESS ${_GPGME_MIN_VERSION} ) message( STATUS "The installed version of gpgme is too old: ${GPGME_VERSION} (required: >= ${_GPGME_MIN_VERSION})" ) else() message( STATUS "Found gpgme v${GPGME_VERSION}, checking for flavours..." ) exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE _gpgme_config_vanilla_libs RETURN_VALUE _ret ) if ( _ret ) set( _gpgme_config_vanilla_libs ) endif() exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --thread=pthread --libs OUTPUT_VARIABLE _gpgme_config_pthread_libs RETURN_VALUE _ret ) if ( _ret ) set( _gpgme_config_pthread_libs ) endif() exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --thread=pth --libs OUTPUT_VARIABLE _gpgme_config_pth_libs RETURN_VALUE _ret ) if ( _ret ) set( _gpgme_config_pth_libs ) endif() # append -lgpg-error to the list of libraries, if necessary foreach ( _flavour vanilla pthread pth ) if ( _gpgme_config_${_flavour}_libs AND NOT _gpgme_config_${_flavour}_libs MATCHES "lgpg-error" ) set( _gpgme_config_${_flavour}_libs "${_gpgme_config_${_flavour}_libs} -lgpg-error" ) endif() endforeach() if ( _gpgme_config_vanilla_libs OR _gpgme_config_pthread_libs OR _gpgme_config_pth_libs ) exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE _GPGME_CFLAGS ) if ( _GPGME_CFLAGS ) string( REGEX REPLACE "(\r?\n)+$" " " _GPGME_CFLAGS "${_GPGME_CFLAGS}" ) string( REGEX REPLACE " *-I" ";" GPGME_INCLUDES "${_GPGME_CFLAGS}" ) endif() foreach ( _flavour vanilla pthread pth ) if ( _gpgme_config_${_flavour}_libs ) set( _gpgme_library_dirs ) set( _gpgme_library_names ) string( TOUPPER "${_flavour}" _FLAVOUR ) string( REGEX REPLACE " +" ";" _gpgme_config_${_flavour}_libs "${_gpgme_config_${_flavour}_libs}" ) foreach( _flag ${_gpgme_config_${_flavour}_libs} ) if ( "${_flag}" MATCHES "^-L" ) string( REGEX REPLACE "^-L" "" _dir "${_flag}" ) file( TO_CMAKE_PATH "${_dir}" _dir ) set( _gpgme_library_dirs ${_gpgme_library_dirs} "${_dir}" ) elseif( "${_flag}" MATCHES "^-l" ) string( REGEX REPLACE "^-l" "" _name "${_flag}" ) set( _gpgme_library_names ${_gpgme_library_names} "${_name}" ) endif() endforeach() set( GPGME_${_FLAVOUR}_FOUND true ) foreach( _name ${_gpgme_library_names} ) set( _gpgme_${_name}_lib ) # if -L options were given, look only there if ( _gpgme_library_dirs ) find_library( _gpgme_${_name}_lib NAMES ${_name} PATHS ${_gpgme_library_dirs} NO_DEFAULT_PATH ) endif() # if not found there, look in system directories if ( NOT _gpgme_${_name}_lib ) find_library( _gpgme_${_name}_lib NAMES ${_name} ) endif() # if still not found, then the whole flavour isn't found if ( NOT _gpgme_${_name}_lib ) if ( GPGME_${_FLAVOUR}_FOUND ) set( GPGME_${_FLAVOUR}_FOUND false ) set( _not_found_reason "dependant library ${_name} wasn't found" ) endif() endif() set( GPGME_${_FLAVOUR}_LIBRARIES ${GPGME_${_FLAVOUR}_LIBRARIES} "${_gpgme_${_name}_lib}" ) endforeach() #check_c_library_exists_explicit( gpgme gpgme_check_version "${_GPGME_CFLAGS}" "${GPGME_LIBRARIES}" GPGME_FOUND ) if ( GPGME_${_FLAVOUR}_FOUND ) message( STATUS " Found flavour '${_flavour}', checking whether it's usable...yes" ) else() message( STATUS " Found flavour '${_flavour}', checking whether it's usable...no" ) message( STATUS " (${_not_found_reason})" ) endif() endif() endforeach( _flavour ) # ensure that they are cached # This comment above doesn't make sense, the four following lines seem to do nothing. Alex set( GPGME_INCLUDES ${GPGME_INCLUDES} ) set( GPGME_VANILLA_LIBRARIES ${GPGME_VANILLA_LIBRARIES} ) set( GPGME_PTHREAD_LIBRARIES ${GPGME_PTHREAD_LIBRARIES} ) set( GPGME_PTH_LIBRARIES ${GPGME_PTH_LIBRARIES} ) if ( GPGME_VANILLA_FOUND OR GPGME_PTHREAD_FOUND OR GPGME_PTH_FOUND ) set( GPGME_FOUND true ) else() set( GPGME_FOUND false ) endif() endif() endif() endif() endif() # these are Windows-only: set( GPGME_GLIB_FOUND false ) set( GPGME_QT_FOUND false ) set( HAVE_GPGME_GLIB 0 ) set( HAVE_GPGME_QT 0 ) macro_bool_to_01( GPGME_FOUND HAVE_GPGME ) macro_bool_to_01( GPGME_VANILLA_FOUND HAVE_GPGME_VANILLA ) macro_bool_to_01( GPGME_PTHREAD_FOUND HAVE_GPGME_PTHREAD ) macro_bool_to_01( GPGME_PTH_FOUND HAVE_GPGME_PTH ) endif() # WIN32 | Unix set( _gpgme_flavours "" ) if ( GPGME_VANILLA_FOUND ) set( _gpgme_flavours "${_gpgme_flavours} vanilla" ) endif() if ( GPGME_GLIB_FOUND ) set( _gpgme_flavours "${_gpgme_flavours} Glib" ) endif() if ( GPGME_QT_FOUND ) set( _gpgme_flavours "${_gpgme_flavours} Qt" ) endif() if ( GPGME_PTHREAD_FOUND ) set( _gpgme_flavours "${_gpgme_flavours} pthread" ) endif() if ( GPGME_PTH_FOUND ) set( _gpgme_flavours "${_gpgme_flavours} pth" ) endif() # determine the library in one of the found flavours, can be reused e.g. by FindQgpgme.cmake, Alex foreach(_currentFlavour vanilla glib qt pth pthread) if(NOT GPGME_LIBRARY_DIR) get_filename_component(GPGME_LIBRARY_DIR "${_gpgme_${_currentFlavour}_lib}" PATH) endif() endforeach() if ( NOT Gpgme_FIND_QUIETLY ) if ( GPGME_FOUND ) message( STATUS "Usable gpgme flavours found: ${_gpgme_flavours}" ) else() message( STATUS "No usable gpgme flavours found." ) endif() endif() if ( Gpgme_FIND_REQUIRED AND NOT GPGME_FOUND ) message( FATAL_ERROR "Did not find GPGME" ) endif() if ( WIN32 ) set( _gpgme_homepage "http://www.gpg4win.org" ) else() set( _gpgme_homepage "http://www.gnupg.org/related_software/gpgme" ) endif() set_package_properties(Gpgme PROPERTIES DESCRIPTION "The GnuPG Made Easy (GPGME) library)" URL ${_gpgme_homepage}) set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS_gpgme_saved ) libzypp-17.38.7/cmake/modules/FindOpenSSL.cmake000066400000000000000000000064551517367357200212420ustar00rootroot00000000000000# - Try to find the OpenSSL encryption library # Once done this will define # # OPENSSL_FOUND - system has the OpenSSL library # OPENSSL_INCLUDE_DIR - the OpenSSL include directory # OPENSSL_LIBRARIES - The libraries needed to use OpenSSL if (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES) # in cache already SET(OPENSSL_FOUND TRUE) else (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES) FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h /usr/include/ /usr/local/include/ $ENV{ProgramFiles}/OpenSSL/include/ $ENV{SystemDrive}/OpenSSL/include/ ) if(WIN32 AND MSVC) # /MD and /MDd are the standard values - if somone wants to use # others, the libnames have to change here too # see http://www.openssl.org/support/faq.html#PROG2 for their meaning FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd PATHS $ENV{ProgramFiles}/OpenSSL/lib/VC/ $ENV{SystemDrive}/OpenSSL/lib/VC/ ) FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD PATHS $ENV{ProgramFiles}/OpenSSL/lib/VC/ $ENV{SystemDrive}/OpenSSL/lib/VC/ ) FIND_LIBRARY(LIB_EAY_DEBUG NAMES libeay32MDd PATHS $ENV{ProgramFiles}/OpenSSL/lib/VC/ $ENV{SystemDrive}/OpenSSL/lib/VC/ ) FIND_LIBRARY(LIB_EAY_RELEASE NAMES libeay32MD PATHS $ENV{ProgramFiles}/OpenSSL/lib/VC/ $ENV{SystemDrive}/OpenSSL/lib/VC/ ) IF(MSVC_IDE) IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE) SET(OPENSSL_LIBRARIES optimized ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} debug ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG}) ELSE(SSL_EAY_DEBUG AND SSL_EAY_RELEASE) MESSAGE(FATAL_ERROR "Could not find the debug and release version of openssl") ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE) ELSE(MSVC_IDE) STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) SET(OPENSSL_LIBRARIES ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG}) ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) SET(OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE}) ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) ENDIF(MSVC_IDE) MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE LIB_EAY_DEBUG LIB_EAY_RELEASE) else(WIN32 AND MSVC) FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD libeay32 libeay32MD PATHS /usr/lib /usr/local/lib ) FIND_LIBRARY(CRYPTO_LIBRARIES crypto PATHS /usr/lib /usr/local/lib ) endif(WIN32 AND MSVC) if (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES) set(OPENSSL_FOUND TRUE) endif (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES) if (CRYPTO_LIBRARIES) set(CRYPTO_FOUND TRUE) message(STATUS "Found libcrypto: ${CRYPTO_LIBRARIES}") endif (CRYPTO_LIBRARIES) if (OPENSSL_FOUND) if (NOT OpenSSL_FIND_QUIETLY) message(STATUS "Found OpenSSL: ${OPENSSL_LIBRARIES}") endif (NOT OpenSSL_FIND_QUIETLY) else (OPENSSL_FOUND) if (OpenSSL_FIND_REQUIRED) message(FATAL_ERROR "Could NOT find OpenSSL") endif (OpenSSL_FIND_REQUIRED) endif (OPENSSL_FOUND) MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES) endif (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES) libzypp-17.38.7/cmake/modules/FindReadline.cmake000066400000000000000000000023341517367357200214720ustar00rootroot00000000000000# - Find readline library # This module looks for the GNU gettext tools. This module defines the # following values: # if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) # Already in cache, be silent set(READLINE_FIND_QUIETLY TRUE) endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) set(READLINE_LIBRARY) set(READLINE_INCLUDE_DIR) FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h /usr/include /usr/include/readline /usr/local/include /usr/include/readline ) # make find_library look only for shared lib # otherwise it would find the static libreadline.a SET(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so") FIND_LIBRARY(READLINE_LIBRARY readline PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 ) SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP}) if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) MESSAGE( STATUS "readline found: includes in ${READLINE_INCLUDE_DIR}, library in ${READLINE_LIBRARY}") set(READLINE_FOUND TRUE) else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) MESSAGE( STATUS "readline not found") endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY) libzypp-17.38.7/cmake/modules/FindRpm.cmake000066400000000000000000000052461517367357200205120ustar00rootroot00000000000000 if(RPM_INCLUDE_DIR AND RPM_LIBRARY) # Already in cache, be silent set(RPM_FIND_QUIETLY TRUE) endif(RPM_INCLUDE_DIR AND RPM_LIBRARY) set(RPM_LIBRARY) set(RPMIO_LIBRARY) set(RPM_INCLUDE_DIR) FIND_PATH(RPM_INCLUDE_DIR rpm/rpmdb.h /usr/include /usr/local/include ) set(RPM_SUSPECT_VERSION "RPM_SUSPECT_VERSION-NOTFOUND" ) if ( RPM_INCLUDE_DIR ) FIND_PATH(RPM_SUSPECT_VERSION rpm/rpm4compat.h ${RPM_INCLUDE_DIR} NO_DEFAULT_PATH ) if ( RPM_SUSPECT_VERSION ) set(RPM_SUSPECT_VERSION "5.x" ) else ( RPM_SUSPECT_VERSION ) set(RPM_SUSPECT_VERSION "4.x" ) endif ( RPM_SUSPECT_VERSION ) endif ( RPM_INCLUDE_DIR ) FIND_LIBRARY(RPM_LIBRARY NAMES rpm PATHS /usr/lib /usr/local/lib ) FIND_LIBRARY(RPMIO_LIBRARY NAMES rpmio PATHS /usr/lib /usr/local/lib ) if(RPM_INCLUDE_DIR AND RPM_LIBRARY AND RPMIO_LIBRARY) MESSAGE( STATUS "rpm found: includes in ${RPM_INCLUDE_DIR}, library in ${RPM_LIBRARY}, librpmio in ${RPMIO_LIBRARY} (suspect ${RPM_SUSPECT_VERSION})") if ( "${RPM_SUSPECT_VERSION}" STREQUAL "4.x" ) set( ZYPP_RPM_VERSION_INCL "rpm/rpmlib.h" ) else() set( ZYPP_RPM_VERSION_INCL "rpm/rpmtag.h" ) endif() configure_file( "${CMAKE_CURRENT_LIST_DIR}/printrpmver.c.in" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/printrpmver.c" @ONLY ) try_run( RPM_VER_EXITCODE RPM_VER_COMPRESULT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/printrpmver.c" LINK_LIBRARIES ${RPM_LIBRARY} CMAKE_FLAGS -DINCLUDE_DIRECTORIES="${RPM_INCLUDE_DIR}" COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} COMPILE_OUTPUT_VARIABLE RPM_PRINTVER_COMPILE_OUTPUT RUN_OUTPUT_VARIABLE RPM_LIB_VER ) if ( NOT RPM_VER_COMPRESULT OR NOT RPM_VER_EXITCODE EQUAL 0 ) message( WARNING "Could not determine rpm version" ) if ( NOT RPM_VER_COMPRESULT ) message( WARNING "Compilation failed: ") message( WARNING "${RPM_PRINTVER_COMPILE_OUTPUT}") endif() else () string(REGEX MATCHALL "[^.^-]+" RPM_VER_PARTS "${RPM_LIB_VER}") list( LENGTH RPM_VER_PARTS RPM_VER_PARTS_CNT ) if ( RPM_VER_PARTS_CNT GREATER_EQUAL 3 ) list( GET RPM_VER_PARTS 0 RPM_LIB_VER_MAJ ) list( GET RPM_VER_PARTS 1 RPM_LIB_VER_MIN ) list( GET RPM_VER_PARTS 2 RPM_LIB_VER_PATCH ) message ( STATUS "Detected RPM version is: maj:${RPM_LIB_VER_MAJ} min:${RPM_LIB_VER_MIN} patch:${RPM_LIB_VER_PATCH}" ) set(RPM_FOUND TRUE) endif() endif() else(RPM_INCLUDE_DIR AND RPM_LIBRARY AND RPMIO_LIBRARY) MESSAGE( STATUS "rpm not found") endif(RPM_INCLUDE_DIR AND RPM_LIBRARY AND RPMIO_LIBRARY) MARK_AS_ADVANCED(RPM_INCLUDE_DIR RPM_LIBRARY) libzypp-17.38.7/cmake/modules/FindUdev.cmake000066400000000000000000000010251517367357200206460ustar00rootroot00000000000000 SET( UDEV_LIBRARY ) SET( UDEV_INCLUDE_DIR ) FIND_PATH( UDEV_INCLUDE_DIR libudev.h /usr/include /usr/local/include ) FIND_LIBRARY( UDEV_LIBRARY NAMES udev PATHS /usr/lib /usr/local/lib ) # check if udev is usable for us INCLUDE (CheckSymbolExists) SET(CMAKE_REQUIRED_LIBRARIES udev) CHECK_SYMBOL_EXISTS(udev_enumerate_new libudev.h USABLE_UDEV) SET(CMAKE_REQUIRED_LIBRARIES "") FIND_PACKAGE_HANDLE_STANDARD_ARGS( Udev DEFAULT_MSG UDEV_LIBRARY UDEV_INCLUDE_DIR USABLE_UDEV) MARK_AS_ADVANCED( UDEV_LIBRARY UDEV_INCLUDE_DIR ) libzypp-17.38.7/cmake/modules/FindZsync.cmake000066400000000000000000000014461517367357200210600ustar00rootroot00000000000000 if(ZSYNC_INCLUDE_DIR AND ZSYNC_LIBRARY) # Already in cache, be silent set(ZSYNC_FIND_QUIETLY TRUE) endif(ZSYNC_INCLUDE_DIR AND ZSYNC_LIBRARY) set(ZSYNC_LIBRARY) set(ZSYNC_INCLUDE_DIR) FIND_PATH(ZSYNC_INCLUDE_DIR zsync.h /usr/include /usr/local/include ) FIND_LIBRARY(ZSYNC_LIBRARY NAMES zsync PATHS /usr/lib /usr/local/lib ) FIND_LIBRARY(RCKSUM_LIBRARY NAMES rcksum PATHS /usr/lib /usr/local/lib ) if(ZSYNC_INCLUDE_DIR AND ZSYNC_LIBRARY AND RCKSUM_LIBRARY) MESSAGE( STATUS "zsync found: includes in ${ZSYNC_INCLUDE_DIR}, library in ${ZSYNC_LIBRARY}") set(ZSYNC_FOUND TRUE) else(ZSYNC_INCLUDE_DIR AND ZSYNC_LIBRARY) MESSAGE( STATUS "zsync not found") endif(ZSYNC_INCLUDE_DIR AND ZSYNC_LIBRARY AND RCKSUM_LIBRARY) MARK_AS_ADVANCED(ZSYNC_INCLUDE_DIR ZSYNC_LIBRARY RCKSUM_LIBRARY)libzypp-17.38.7/cmake/modules/Findlibproxy.cmake000066400000000000000000000005121517367357200216130ustar00rootroot00000000000000# The "real" libproxy provides its own Findlibproxy.cmake but saner, simpler # alternatives like the PacRunner replacement which *just* queries PacRunner # directly will only provide a .pc file. So use pkg-config to find it... if(NOT PKG_CONFIG_FOUND) include(FindPkgConfig) endif() PKG_CHECK_MODULES( LIBPROXY libproxy-1.0 ) libzypp-17.38.7/cmake/modules/GLibTools.cmake000066400000000000000000000122231517367357200210020ustar00rootroot00000000000000# Taken from https://github.com/GNOME/evolution # # GLibTools.cmake # # Provides functions to run glib tools. # # Functions: # # glib_mkenums(_output_filename_noext _header_templ _src_tmpl _enums_header ...) # runs glib-mkenums to generate enumtypes .h and .c files from multiple # _enums_header using _header_templ and _src_tmpl template files. It searches for files in the current source directory and # exports to the current binary directory. # # An example call is: # glib_mkenums(camel-enumtypes camel-enums.h CAMEL_ENUMTYPES_H) # which uses camel-enums.h as the source of known enums and generates # camel-enumtypes.h which will use the CAMEL_ENUMTYPES_H define # and also generates camel-enumtypes.c with the needed code. # # glib_genmarshal(_output_filename_noext _prefix _marshallist_filename) # runs glib-genmarshal to process ${_marshallist_filename} to ${_output_filename_noext}.c # and ${_output_filename_noext}.h files in the current binary directory, using # the ${_prefix} as the function prefix. # # glib_compile_resources _sourcedir _outputprefix _cname _inxml ...deps) # Calls glib-compile-resources as defined in _inxml and using _outputprefix and_cname as other arguments # beside _sourcedir. The optional arguments are other dependencies. find_program(GLIB_MKENUMS glib-mkenums) if(NOT GLIB_MKENUMS) message(FATAL_ERROR "Cannot find glib-mkenums, which is required to build ${PROJECT_NAME}") endif(NOT GLIB_MKENUMS) function( glib_mkenums _output_filename_noext _header_templ _src_tmpl _enums_header0 ) foreach(_enums_header ${_enums_header0} ${ARGN}) list(APPEND _enums_headers "${CMAKE_CURRENT_SOURCE_DIR}/${_enums_header}") endforeach(_enums_header) message("Generating file ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h") add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h COMMAND ${GLIB_MKENUMS} --template "${CMAKE_CURRENT_SOURCE_DIR}/${_header_templ}" ${_enums_headers} >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${_header_templ}" ${_enums_headers} ) message("Generating file ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c") add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c COMMAND ${GLIB_MKENUMS} --template "${CMAKE_CURRENT_SOURCE_DIR}/${_src_tmpl}" ${_enums_headers} >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${_src_tmpl}" ${_enums_headers} ) endfunction( glib_mkenums ) find_program(GLIB_GENMARSHAL glib-genmarshal) if(NOT GLIB_GENMARSHAL) message(FATAL_ERROR "Cannot find glib-genmarshal, which is required to build ${PROJECT_NAME}") endif(NOT GLIB_GENMARSHAL) function(glib_genmarshal _output_filename_noext _prefix _marshallist_filename) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h COMMAND ${GLIB_GENMARSHAL} --header --skip-source --prefix=${_prefix} "${CMAKE_CURRENT_SOURCE_DIR}/${_marshallist_filename}" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h.tmp COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h.tmp ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h DEPENDS ${_marshallist_filename} ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c COMMAND ${CMAKE_COMMAND} -E echo " #include \\\"${_output_filename_noext}.h\\\"" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp COMMAND ${GLIB_GENMARSHAL} --body --skip-source --prefix=${_prefix} "${CMAKE_CURRENT_SOURCE_DIR}/${_marshallist_filename}" >>${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c DEPENDS ${_marshallist_filename} ) endfunction(glib_genmarshal) find_program(GLIB_COMPILE_RESOURCES glib-compile-resources) if(NOT GLIB_COMPILE_RESOURCES) message(FATAL_ERROR "Cannot find glib-compile-resources, which is required to build ${PROJECT_NAME}") endif(NOT GLIB_COMPILE_RESOURCES) macro(glib_compile_resources _sourcedir _outputprefix _cname _inxml) add_custom_command( OUTPUT ${_outputprefix}.h COMMAND ${GLIB_COMPILE_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${_inxml} --target=${_outputprefix}.h --sourcedir=${_sourcedir} --c-name ${_cname} --generate-header DEPENDS ${_inxml} ${ARGN} VERBATIM ) add_custom_command( OUTPUT ${_outputprefix}.c COMMAND ${GLIB_COMPILE_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${_inxml} --target=${_outputprefix}.c --sourcedir=${_sourcedir} --c-name ${_cname} --generate-source DEPENDS ${_inxml} ${ARGN} VERBATIM ) endmacro(glib_compile_resources) libzypp-17.38.7/cmake/modules/GObjectIntrospection.cmake000066400000000000000000000175321517367357200232520ustar00rootroot00000000000000include(CMakeParseArguments) include(FindPkgConfig) set(_PKG_CONFIG_MODULE "gobject-introspection-1.0") pkg_check_modules(GOBJECT_INTROSPECTION REQUIRED ${_PKG_CONFIG_MODULE}) ############################################################################### # Helpers ############################################################################### # this macro will run "pkg-config --variable=VARIABLE ${_PKG_CONFIG_MODULE}" # and store the result in OUTPUT_VARIABLE macro(_pkg_config_variable VARIABLE OUTPUT_VARIABLE) execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${VARIABLE} ${_PKG_CONFIG_MODULE} OUTPUT_VARIABLE ${OUTPUT_VARIABLE} OUTPUT_STRIP_TRAILING_WHITESPACE ) endmacro(_pkg_config_variable) # this macro will prefix every item in _list with _prefix and return it in # _newlist. macro(_gir_list_prefix _newlist _list _prefix) set(${_newlist}) foreach(_item IN LISTS ${_list}) list(APPEND ${_newlist} ${_prefix}${_item}) endforeach(_item) endmacro(_gir_list_prefix) ############################################################################### # use the pkg-config to grab a bunch of variables from the # gobject-introspection.pc file ############################################################################### _pkg_config_variable(g_ir_scanner GIR_SCANNER) _pkg_config_variable(g_ir_compiler GIR_COMPILER) # CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT is only set when the variable is # actually set, so we need to create another variable to track that. if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE INTERNAL "holds the default install path if cmake set it") mark_as_advanced(_INSTALL_PREFIX) endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # check if cmake_install_prefix was specified, if so build our paths using that if(_INSTALL_PREFIX) _pkg_config_variable(girdir GIR_GIRDIR) _pkg_config_variable(typelibdir GIR_TYPELIBDIR) else(_INSTALL_PREFIX) set(GIR_GIRDIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/gir-1.0") set(GIR_TYPELIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/girepository-1.0") endif(_INSTALL_PREFIX) ############################################################################### # The main function ############################################################################### function(gobject_introspection _FIRST_ARG) set(options QUIET VERBOSE) set(oneValueArgs FILENAME FORMAT LIBRARY NAMESPACE NSVERSION PROGRAM PROGRAM_ARG ) set(multiValueArgs BUILT_SOURCES CFLAGS COMPILER_ARGS HEADERS IDENTIFIER_PREFIXES PACKAGES SCANNER_ARGS SOURCES SYMBOL_PREFIXES ) CMAKE_PARSE_ARGUMENTS(GIR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) if(GIR_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keys given to ADD_GIR_INTROSPECTION(): \"${GIR_UNPARSED_ARGUMENTS}\"") endif(GIR_UNPARSED_ARGUMENTS) ########################################################################### # make sure that the user set some variables... ########################################################################### if(NOT GIR_FILENAME) message(FATAL_ERROR "No gir filename given") endif(NOT GIR_FILENAME) if(NOT GIR_NAMESPACE) # the caller didn't give us a namespace, try to grab it from the filename string(REGEX REPLACE "([^-]+)-.*" "\\1" GIR_NAMESPACE "${GIR_FILENAME}") if(NOT GIR_NAMESPACE) message(FATAL_ERROR "No namespace given and couldn't find one in FILENAME") endif(NOT GIR_NAMESPACE) endif(NOT GIR_NAMESPACE) if(NOT GIR_NSVERSION) # the caller didn't give us a namespace version, try to grab it from the filemenu string(REGEX REPLACE ".*-([^-]+).gir" "\\1" GIR_NSVERSION "${GIR_FILENAME}") if(NOT GIR_NSVERSION) message(FATAL_ERROR "No namespace version given and couldn't find one in FILENAME") endif(NOT GIR_NSVERSION) endif(NOT GIR_NSVERSION) if(NOT GIR_CFLAGS) get_directory_property(GIR_CFLAGS INCLUDE_DIRECTORIES) _gir_list_prefix(GIR_REAL_CFLAGS GIR_CFLAGS "-I") endif(NOT GIR_CFLAGS) ########################################################################### # Fix up some of our arguments ########################################################################### if(GIR_VERBOSE) set(GIR_VERBOSE "--verbose") else(GIR_VERBOSE) set(GIR_VERBOSE "") endif(GIR_VERBOSE) if(GIR_QUIET) set(GIR_QUIET "--quiet") else(GIR_QUIET) set(GIR_QUIET "") endif(GIR_QUIET) if(GIR_FORMAT) set(GIR_FORMAT "--format=${GIR_FORMAT}") endif(GIR_FORMAT) # if library is set, we need to prepend --library= on to it if(GIR_LIBRARY) set(GIR_REAL_LIBRARY "--library=${GIR_LIBRARY}") endif(GIR_LIBRARY) # if program has been set, we prepend --program= on to it if(GIR_PROGRAM) set(GIR_PROGRAM "--program=${GIR_PROGRAM}") endif(GIR_PROGRAM) # if program_arg has been set, we prepend --program-arg= on to it if(GIR_PROGRAM_ARG) set(GIR_PROGRAM_ARG "--program-arg=${GIR_PROGRAM_ARG}") endif(GIR_PROGRAM_ARG) ########################################################################### # Clean up any of the multivalue items that all need to be prefixed ########################################################################### # if the user specified IDENTIFIER_PREFIXES we need to prefix each with --identifier-prefix if(GIR_IDENTIFIER_PREFIXES) _gir_list_prefix(GIR_REAL_IDENTIFIER_PREFIXES GIR_IDENTIFIER_PREFIXES "--identifier-prefix=") endif(GIR_IDENTIFIER_PREFIXES) # if the user specified SYMBOL_PREFIXES we need to prefix each with --symbol-prefix= if(GIR_SYMBOL_PREFIXES) _gir_list_prefix(GIR_REAL_SYMBOL_PREFIXES GIR_SYMBOL_PREFIXES "--symbol-prefix=") endif(GIR_SYMBOL_PREFIXES) # if the user specified PACKAGES we need to prefix each with --pkg if(GIR_PACKAGES) _gir_list_prefix(GIR_REAL_PACKAGES GIR_PACKAGES "--pkg=") endif(GIR_PACKAGES) # if the user specified BUILT_SOURCES, we need to get their paths since # they could be in CMAKE_CURRENT_BUILD_DIR if(GIR_BUILT_SOURCES) set(GIR_REAL_BUILT_SOURCES) foreach(ITEM ${GIR_BUILT_SOURCES}) get_source_file_property(LOCATION ${ITEM} LOCATION) list(APPEND GIR_REAL_BUILT_SOURCES "${LOCATION}") endforeach(ITEM) endif(GIR_BUILT_SOURCES) ########################################################################### # Add the custom commands ########################################################################### set(ENV{CFLAGS} ${GIR_REAL_CFLAGS}) add_custom_command( OUTPUT ${GIR_FILENAME} COMMAND ${GIR_SCANNER} ${GIR_SCANNER_ARGS} --strict --warn-all --namespace=${GIR_NAMESPACE} --nsversion=${GIR_NSVERSION} ${GIR_REAL_CFLAGS} ${GIR_FORMAT} ${GIR_REAL_LIBRARY} ${GIR_PROGRAM} ${GIR_PROGRAM_ARGS} ${GIR_QUIET} ${GIR_VERBOSE} ${GIR_REAL_IDENTIFIER_PREFIXES} ${GIR_REAL_SYMBOL_PREFIXES} ${GIR_REAL_PACKAGES} --no-libtool -L${CMAKE_CURRENT_BINARY_DIR} --output=${CMAKE_CURRENT_BINARY_DIR}/${GIR_FILENAME} ${GIR_SOURCES} ${GIR_REAL_BUILT_SOURCES} DEPENDS ${GIR_LIBRARY} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} VERBATIM ) add_custom_target("gir_${GIR_FILENAME}" ALL DEPENDS ${GIR_LIBRARY} ${GIR_FILENAME}) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_FILENAME} DESTINATION ${GIR_GIRDIR} ) # create the name of the typelib string(REPLACE ".gir" ".typelib" GIR_TYPELIB "${GIR_FILENAME}") add_custom_command( COMMAND ${GIR_COMPILER} ${GIR_COMPILER_ARGS} ${CMAKE_CURRENT_BINARY_DIR}/${GIR_FILENAME} --output=${CMAKE_CURRENT_BINARY_DIR}/${GIR_TYPELIB} OUTPUT ${GIR_TYPELIB} DEPENDS ${GIR_FILENAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) add_custom_target("typelib_${GIR_TYPELIB}" ALL DEPENDS ${GIR_LIBRARY} ${GIR_FILENAME} ${GIR_TYPELIB}) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_TYPELIB} DESTINATION ${GIR_TYPELIBDIR} ) string(TOUPPER ${GIR_LIBRARY} GIR_TARGET) set(${GIR_TARGET}_GIR_TARGETS "gir_${GIR_FILENAME}" "typelib_${GIR_TYPELIB}" PARENT_SCOPE) endfunction(gobject_introspection) libzypp-17.38.7/cmake/modules/ZyppCommon.cmake000066400000000000000000000122151517367357200212600ustar00rootroot00000000000000include(GNUInstallDirs) # Library IF ( DEFINED LIB ) SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" ) ELSE ( DEFINED LIB ) SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" ) ENDIF ( DEFINED LIB ) MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" ) # Headers IF (DEFINED INCLUDE) SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE}") else (DEFINED INCLUDE) SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include") ENDIF (DEFINED INCLUDE) MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}") # system configuration dir (etc) IF( NOT DEFINED SYSCONFDIR ) IF ( ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr" ) # if installing in usr, set sysconfg to etc SET( SYSCONFDIR /etc ) ELSE ( ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr" ) SET ( SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc" ) ENDIF ( ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr" ) ENDIF( NOT DEFINED SYSCONFDIR ) MESSAGE(STATUS "Config files will be installed in ${SYSCONFDIR}" ) # install directory for private executables that are not for the user SET ( ZYPP_LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/zypp" ) SET ( ZYPPNG_LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/zyppng" ) # usr INSTALL_PREFIX IF( DEFINED CMAKE_INSTALL_PREFIX ) SET( INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} ) ELSE( DEFINED CMAKE_INSTALL_PREFIX ) SET( INSTALL_PREFIX /usr ) ENDIF( DEFINED CMAKE_INSTALL_PREFIX ) # system configuration dir (etc) IF( NOT DEFINED MANDIR ) SET( MANDIR ${INSTALL_PREFIX}/share/man ) ENDIF( NOT DEFINED MANDIR ) MESSAGE( "** Manual files will be installed in ${MANDIR}" ) #################################################################### # CONFIGURATION # #################################################################### IF( NOT DEFINED DOC_INSTALL_DIR ) SET( DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/packages/${PACKAGE}" CACHE PATH "The install dir for documentation (default prefix/share/doc/packages/${PACKAGE})" FORCE ) ENDIF( NOT DEFINED DOC_INSTALL_DIR ) #################################################################### # INCLUDES # #################################################################### SET( ZYPPCOMMON_CXX_STANDARD 17 ) #SET (CMAKE_INCLUDE_DIRECTORIES_BEFORE ON) #INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} SYSTEM ) #################################################################### # RPM SPEC # #################################################################### function( SPECFILE_EXT ) endfunction() MACRO(SPECFILE) MESSAGE(STATUS "Writing spec file...") CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/${PACKAGE}.spec.cmake ${PROJECT_BINARY_DIR}/package/${PACKAGE}.spec @ONLY) MESSAGE(STATUS "I hate you rpm-lint...!!!") IF (EXISTS ${PROJECT_SOURCE_DIR}/package/${PACKAGE}-rpmlint.cmake) CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/package/${PACKAGE}-rpmlint.cmake ${PROJECT_BINARY_DIR}/package/${PACKAGE}-rpmlintrc @ONLY) ENDIF (EXISTS ${PROJECT_SOURCE_DIR}/package/${PACKAGE}-rpmlint.cmake) ENDMACRO(SPECFILE) #################################################################### # INSTALL # #################################################################### MACRO(GENERATE_PACKAGING PACKAGE VERSION) # The following components are regex's to match anywhere (unless anchored) # in absolute path + filename to find files or directories to be excluded # from source tarball. SET (CPACK_SOURCE_IGNORE_FILES # hidden files "/\\\\..+$" # temporary files "\\\\.swp$" # backup files "~$" # others "\\\\.#" "/#" "/build/" "/_build/" # used before "/CVS/" "\\\\.o$" "\\\\.lo$" "\\\\.la$" "Makefile\\\\.in$" ) SET(CPACK_PACKAGE_VENDOR "SUSE LLC") SET( CPACK_GENERATOR "TBZ2") SET( CPACK_SOURCE_GENERATOR "TBZ2") SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" ) SET( CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}" ) INCLUDE(CPack) SPECFILE() if ( ZYPP_STACK_BUILD ) set( target_prefix "${PROJECT_NAME}_" ) endif() ADD_CUSTOM_TARGET( ${target_prefix}svncheck COMMAND "cd ${PROJECT_SOURCE_DIR} && git status --porcelain | awk '{print}END{if(NR)exit(1)}'" ) SET( AUTOBUILD_COMMAND COMMAND ${CMAKE_COMMAND} -E rm -f ${PROJECT_BINARY_DIR}/package/*.tar.bz2 COMMAND ${CMAKE_MAKE_PROGRAM} package_source COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${PROJECT_BINARY_DIR}/package COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 COMMAND ${CMAKE_COMMAND} -E copy \"${PROJECT_SOURCE_DIR}/package/${PACKAGE}.changes\" \"${PROJECT_BINARY_DIR}/package/${PACKAGE}.changes\" ) ADD_CUSTOM_TARGET( ${target_prefix}srcpackage_local ${AUTOBUILD_COMMAND} ) ADD_CUSTOM_TARGET( ${target_prefix}srcpackage COMMAND "${CMAKE_MAKE_PROGRAM} ${target_prefix}svncheck" ${AUTOBUILD_COMMAND} ) ENDMACRO(GENERATE_PACKAGING) function( GENERATE_PACKAGING_EXT ) endfunction() libzypp-17.38.7/cmake/modules/ZyppConfig.cmake000066400000000000000000000031671517367357200212430ustar00rootroot00000000000000 IF (DEFINED ZYPP_PREFIX) MESSAGE(STATUS "ZYpp library prefix set to ${ZYPP_PREFIX}") ELSE (DEFINED ZYPP_PREFIX) MESSAGE(STATUS "ZYpp path not set. Looking for it.") ENDIF (DEFINED ZYPP_PREFIX) if(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY) # Already in cache, be silent SET(ZYPP_FIND_QUIETLY TRUE) endif(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY) set(ZYPP_LIBRARY) set(ZYPP_INCLUDE_DIR) IF (DEFINED ZYPP_PREFIX) MESSAGE( STATUS "Looking in ${ZYPP_PREFIX}") FIND_PATH(ZYPP_INCLUDE_DIR zypp/ZYpp.h ${ZYPP_PREFIX}/include NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) FIND_LIBRARY(ZYPP_LIBRARY NAMES zypp PATHS ${ZYPP_PREFIX}/lib ${ZYPP_PREFIX}/lib64 NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) FIND_LIBRARY(ZYPP_TUI_LIBRARY NAMES zypp-tui PATHS ${ZYPP_PREFIX}/lib ${ZYPP_PREFIX}/lib64 NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) ELSE (DEFINED ZYPP_PREFIX) FIND_PATH(ZYPP_INCLUDE_DIR zypp/ZYpp.h /usr/include /usr/local/include ) FIND_LIBRARY(ZYPP_LIBRARY NAMES zypp PATHS /usr/lib /usr/local/lib ) FIND_LIBRARY(ZYPP_TUI_LIBRARY NAMES zypp-tui PATHS /usr/lib /usr/local/lib ) ENDIF (DEFINED ZYPP_PREFIX) if(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY) MESSAGE( STATUS "ZYpp found: includes in ${ZYPP_INCLUDE_DIR}, library in ${ZYPP_LIBRARY}, tui library in ${ZYPP_TUI_LIBRARY}") set(ZYPP_FOUND TRUE) else(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY) MESSAGE( FATAL "ZYpp not found") endif(ZYPP_INCLUDE_DIR AND ZYPP_LIBRARY) MARK_AS_ADVANCED(ZYPP_INCLUDE_DIR ZYPP_LIBRARY) libzypp-17.38.7/cmake/modules/printrpmver.c.in000066400000000000000000000002051517367357200213000ustar00rootroot00000000000000#include #include <@ZYPP_RPM_VERSION_INCL@> int main ( int argc , char* argv[] ) { printf("%s\n", rpmEVR); return 0; } libzypp-17.38.7/external/000077500000000000000000000000001517367357200152345ustar00rootroot00000000000000libzypp-17.38.7/external/CMakeLists.txt000066400000000000000000000054301517367357200177760ustar00rootroot00000000000000# libzypp/external/CMakeLists.txt # ----------------------------------------------------------------------------- # Polyfill Targets (Offline-Safe) # ----------------------------------------------------------------------------- # These targets expose the vendored headers to the rest of the libzypp build. # They do NOT attempt to download anything during a normal build. add_library(zypp_ranges_polyfill INTERFACE) target_include_directories(zypp_ranges_polyfill INTERFACE $) add_library(zypp_span_polyfill INTERFACE) target_include_directories(zypp_span_polyfill INTERFACE $) # ----------------------------------------------------------------------------- # Developer Maintenance Targets (Run Manually) # ----------------------------------------------------------------------------- # These targets are strictly for developers to update the vendored polyfills # prior to committing them to the repository. They require network access. set(RANGE_VERSION "bf32251d65673fe170d602777c087786c529ead8") set(RANGE_URL "https://raw.githubusercontent.com/tcbrindle/NanoRange/${RANGE_VERSION}") add_custom_target(update-ranges COMMAND ${CMAKE_COMMAND} -E echo "Fetching ranges polyfill v${RANGE_VERSION}..." COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/nanorange COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/nanorange/include/nanorange COMMAND curl -sSL ${RANGE_URL}/single_include/nanorange.hpp -o ${CMAKE_CURRENT_SOURCE_DIR}/nanorange/include/nanorange/nanorange.hpp COMMAND curl -sSL ${RANGE_URL}/LICENSE_1_0.txt -o ${CMAKE_CURRENT_SOURCE_DIR}/nanorange/LICENSE_1_0.txt COMMAND ${CMAKE_COMMAND} -E echo "range polyfill successfully updated." WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Updating vendored range polyfill headers" ) set(TCB_SPAN_VERSION "836dc6a0efd9849cb194e88e4aa2387436bb079b") # Provide a specific tag or commit hash here set(TCB_SPAN_URL "https://raw.githubusercontent.com/tcbrindle/span/${TCB_SPAN_VERSION}") add_custom_target(update-span COMMAND ${CMAKE_COMMAND} -E echo "Fetching tcb-span ${TCB_SPAN_VERSION}..." COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/tcb-span COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/tcb-span/include/tcb COMMAND curl -sSL ${TCB_SPAN_URL}/include/tcb/span.hpp -o ${CMAKE_CURRENT_SOURCE_DIR}/tcb-span/include/tcb/span.hpp COMMAND curl -sSL ${TCB_SPAN_URL}/LICENSE_1_0.txt -o ${CMAKE_CURRENT_SOURCE_DIR}/tcb-span/LICENSE_1_0.txt COMMAND ${CMAKE_COMMAND} -E echo "tcb-span successfully updated." WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Updating vendored tcb-span header" ) libzypp-17.38.7/external/nanorange/000077500000000000000000000000001517367357200172045ustar00rootroot00000000000000libzypp-17.38.7/external/nanorange/LICENSE_1_0.txt000066400000000000000000000024721517367357200214730ustar00rootroot00000000000000Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. libzypp-17.38.7/external/nanorange/include/000077500000000000000000000000001517367357200206275ustar00rootroot00000000000000libzypp-17.38.7/external/nanorange/include/nanorange/000077500000000000000000000000001517367357200225775ustar00rootroot00000000000000libzypp-17.38.7/external/nanorange/include/nanorange/nanorange.hpp000066400000000000000000021653371517367357200253010ustar00rootroot00000000000000// nanorange.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_HPP_INCLUDED #define NANORANGE_HPP_INCLUDED // nanorange/algorithm.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_ALGORITHM_HPP_INCLUDED #define NANORANGE_ALGORITHM_HPP_INCLUDED // Algorithms reimplemented in Nanorange // nanorange/algorithm/adjacent_find.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_ALGORITHM_ADJACENT_FIND_HPP_INCLUDED #define NANORANGE_ALGORITHM_ADJACENT_FIND_HPP_INCLUDED // nanorange/range.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_RANGES_HPP_INCLUDED #define NANORANGE_RANGES_HPP_INCLUDED // nanorange/detail/iterator/algorithm_requirements.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_DETAIL_ITERATOR_ALGORITHM_REQUIREMENTS_HPP_INCLUDED #define NANORANGE_DETAIL_ITERATOR_ALGORITHM_REQUIREMENTS_HPP_INCLUDED // nanorange/detail/functional/comparisons.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_DETAIL_FUNCTIONAL_COMPARISONS_HPP_INCLUDED #define NANORANGE_DETAIL_FUNCTIONAL_COMPARISONS_HPP_INCLUDED // nanorange/detail/concepts/comparison.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_DETAIL_CONCEPTS_COMPARISON_HPP_INCLUDED #define NANORANGE_DETAIL_CONCEPTS_COMPARISON_HPP_INCLUDED // nanorange/detail/concepts/core.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_DETAIL_CONCEPTS_CORE_HPP_INCLUDED #define NANORANGE_DETAIL_CONCEPTS_CORE_HPP_INCLUDED // nanorange/detail/macros.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_DETAIL_MACROS_HPP_INCLUDED #define NANORANGE_DETAIL_MACROS_HPP_INCLUDED #include #ifdef NANORANGE_NO_DEPRECATION_WARNINGS #define NANO_DEPRECATED #define NANO_DEPRECATED_FOR(x) #else #define NANO_DEPRECATED [[deprecated]] #define NANO_DEPRECATED_FOR(x) [[deprecated(x)]] #endif #ifdef __has_cpp_attribute #if __has_cpp_attribute(no_unique_address) >= 201803L #define NANO_NO_UNIQUE_ADDRESS [[no_unique_address]] #else #define NANO_NO_UNIQUE_ADDRESS #endif // __has_cpp_attribute(no_unique_address) #else #define NANO_NO_UNIQUE_ADDRESS #endif // defined(__has_cpp_attribute) #define NANO_CONCEPT inline constexpr bool #define NANO_BEGIN_NAMESPACE \ \ namespace nano \ { \ \ inline namespace ranges \ { #define NANO_END_NAMESPACE \ } \ } #define NANO_INLINE_VAR(type, name) \ inline namespace function_objects { \ inline constexpr type name{}; \ } #if defined(_LIBCPP_VERSION) #define NANO_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_NAMESPACE_STD #define NANO_END_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD #elif defined(_MSVC_STL_VERSION) #define NANO_BEGIN_NAMESPACE_STD _STD_BEGIN #define NANO_END_NAMESPACE_STD _STD_END #elif defined(_GLIBCXX_DEBUG) #ifndef NANORANGE_NO_STD_FORWARD_DECLARATIONS #define NANORANGE_NO_STD_FORWARD_DECLARATIONS #endif #else #define NANO_BEGIN_NAMESPACE_STD namespace std { #define NANO_END_NAMESPACE_STD } #endif #if defined(_MSC_VER) #define NANO_MSVC_LAMBDA_PIPE_WORKAROUND 1 #endif #endif // nanorange/type_traits.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_TYPE_TRAITS_HPP_INCLUDED #define NANORANGE_TYPE_TRAITS_HPP_INCLUDED // nanorange/detail/common_reference.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_DETAIL_COMMON_REFERENCE_HPP_INCLUDED #define NANORANGE_DETAIL_COMMON_REFERENCE_HPP_INCLUDED // nanorange/detail/type_traits.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef NANORANGE_DETAIL_TYPE_TRAITS_HPP_INCLUDED #define NANORANGE_DETAIL_TYPE_TRAITS_HPP_INCLUDED #include NANO_BEGIN_NAMESPACE template struct remove_cvref { using type = std::remove_cv_t>; }; template using remove_cvref_t = typename remove_cvref::type; template struct type_identity { using type = T; }; template using type_identity_t = typename type_identity::type; namespace detail { template struct conditional { template using type = T; }; template <> struct conditional { template using type = U; }; template using conditional_t = typename conditional::template type; template