From 35d74be55fccad485b105e97110bb1b153e0de74 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 19 Aug 2016 18:21:04 +0200 Subject: CMake: Install config and logging directories These directories are essential for apt to work, so we should install them in the upstream build system and not just in the debian packaging... --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ed87b34b..ced68285d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,3 +143,16 @@ add_subdirectory(test) # Link update-po4a into the update-po target add_dependencies(update-po update-po4a) + +# Create our directories. +install_empty_directories( + ${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt/apt.conf.d + ${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt/preferences.d + ${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt/sources.list.d + ${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt/trusted.gpg.d + ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/cache/apt/archives/partial + ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/apt/lists/partial + ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/apt/mirrors/partial + ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/apt/periodic + ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/apt +) -- cgit v1.2.3 From 3fbd67460e1c4c38a79d00f09bf3113a39abbeca Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 20 Aug 2016 03:22:24 +0200 Subject: CMake: Add Large File Support This module should cover all sorts of large file supports, as long as they either support the getconf LFS_CFLAGS command; or the _FILE_OFFSET_BITS=64 or _LARGE_FILES macros. Closes: #834767 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ced68285d..b63cfe0e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,12 @@ include(GNUInstallDirs) include(TestBigEndian) find_package(Threads) find_package(PkgConfig) +find_package(LFS REQUIRED) + +# Add large file support +add_compile_options(${LFS_COMPILE_OPTIONS}) +add_definitions(${LFS_DEFINITIONS}) +link_libraries(${LFS_LIBRARIES}) # Set compiler flags set(CMAKE_CXX_STANDARD 11) -- cgit v1.2.3 From ac103d45f63bd9a57ff867a52c7c95616f6daf51 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 18:42:52 +0200 Subject: CMake: Do not add po/ if USE_NLS is OFF Previously, we would have generated all the translations, but not turn them on in the code. Instead, move the Translation crap into po/ and disable po/ alltogether if USE_NLS if OFF. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b63cfe0e8..a43abfb78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,6 @@ endif() # Include stuff include(Misc) -include(Translations) include(CheckIncludeFiles) include(CheckFunctionExists) include(CheckStructHasMember) @@ -144,11 +143,14 @@ add_subdirectory(doc) add_subdirectory(dselect) add_subdirectory(ftparchive) add_subdirectory(methods) -add_subdirectory(po) add_subdirectory(test) +if (USE_NLS) +add_subdirectory(po) + # Link update-po4a into the update-po target add_dependencies(update-po update-po4a) +endif() # Create our directories. install_empty_directories( -- cgit v1.2.3 From bb9fdfe45b1c06f87de857b6ed225b8509003976 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 12:53:10 +0200 Subject: CMake: Define _WITH_GETLINE for FreeBSD Gbp-Dch: ignore --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index a43abfb78..fcb200571 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,9 @@ check_function_exists(ptsname_r HAVE_PTSNAME_R) check_function_exists(timegm HAVE_TIMEGM) test_big_endian(WORDS_BIGENDIAN) +# FreeBSD +add_definitions(-D_WITH_GETLINE=1) + if (CMAKE_USE_PTHREADS_INIT) set(HAVE_PTHREAD 1) endif() -- cgit v1.2.3 From 0fa5d862040a56fbad9a2bd563243f23359a881d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 22 Aug 2016 22:45:19 +0200 Subject: CMake: Handle BSD platforms with sig_t instead of sighandler_t Somewhat annoying, but OK. Might want to switch to something more clever to get rid of the typedef at all. Gbp-Dch: ignore --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index fcb200571..27d0dd5a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,19 @@ if (CMAKE_USE_PTHREADS_INIT) set(HAVE_PTHREAD 1) endif() +include(CheckTypeSize) +set(CMAKE_EXTRA_INCLUDE_FILES "signal.h") +check_type_size("sig_t" SIG_T LANGUAGE "CXX") +check_type_size("sighandler_t" SIGHANDLER_T LANGUAGE "CXX") +set(CMAKE_EXTRA_INCLUDE_FILES) +if (NOT HAVE_SIGHANDLER_T) + if (HAVE_SIG_T) + add_definitions(-Dsighandler_t=sig_t) + else() + message(FATAL_ERROR "Platform defines neither sig_t nor sighandler_t") + endif() +endif() + # Configure some variables like package, version and architecture. set(PACKAGE ${PROJECT_NAME}) set(PACKAGE_MAIL "APT Development Team ") -- cgit v1.2.3 From b10ec8cc7b6b9d181cccacee6b4c1c4c5bdbd510 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 22 Aug 2016 22:54:07 +0200 Subject: CMake: Handle endian.h locations on other platforms Gbp-Dch: ignore --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 27d0dd5a3..08e431740 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,18 @@ if (CMAKE_USE_PTHREADS_INIT) set(HAVE_PTHREAD 1) endif() +CHECK_INCLUDE_FILES(machine/endian.h HAVE_MACHINE_ENDIAN_H) +CHECK_INCLUDE_FILES(sys/endian.h HAVE_SYS_ENDIAN_H) +CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H) +if (NOT HAVE_ENDIAN_H) + if (HAVE_MACHINE_ENDIAN_H OR HAVE_SYS_ENDIAN_H) + configure_file(CMake/endian.h.in ${PROJECT_BINARY_DIR}/include/endian.h) + else() + message(FATAL_ERROR "Cannot find endian.h") + endif() +endif() + + include(CheckTypeSize) set(CMAKE_EXTRA_INCLUDE_FILES "signal.h") check_type_size("sig_t" SIG_T LANGUAGE "CXX") -- cgit v1.2.3 From ad5282bb0c97fd0254b20fb71a59d0f755c3ed65 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 13:42:54 +0200 Subject: CMake: Do not use -lresolv if res_init exists in libc Gbp-Dch: ignore --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 08e431740..8c41534ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,6 +143,14 @@ if (NOT HAVE_SIGHANDLER_T) endif() endif() +# Handle resolving +check_function_exists(res_init HAVE_LIBC_RESOLV) +if(HAVE_LIBC_RESOLV) + set(RESOLV_LIBRARIES) +else() + set(RESOLV_LIBRARIES -lresolv) +endif() + # Configure some variables like package, version and architecture. set(PACKAGE ${PROJECT_NAME}) set(PACKAGE_MAIL "APT Development Team ") -- cgit v1.2.3 From c799c3efe43d7fde53ea4a3c5f976375607a2805 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 14:13:24 +0200 Subject: CMake: Add FindLZ4 and FindLZMA This makes things work with /usr/local on FreeBSD. Gbp-Dch: ignore --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c41534ad..4f4c8b37e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ include(CheckStructHasMember) include(GNUInstallDirs) include(TestBigEndian) find_package(Threads) -find_package(PkgConfig) find_package(LFS REQUIRED) # Add large file support @@ -78,12 +77,13 @@ if (BZIP2_FOUND) set(HAVE_BZ2 1) endif() -pkg_check_modules(LZMA liblzma) +find_package(LZMA) if (LZMA_FOUND) set(HAVE_LZMA 1) endif() -pkg_check_modules(LZ4 liblz4) + +find_package(LZ4) if (LZ4_FOUND) set(HAVE_LZ4 1) endif() -- cgit v1.2.3 From 2c391d850fb405e03bca362caa5c90262c66fe33 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 14:40:46 +0200 Subject: CMake/private-download: Fix statfs includes on FreeBSD On FreeBSD, we have to include sys/params.h and sys/mount.h, not sys/vfs.h. Gbp-Dch: ignore --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f4c8b37e..b2e5bfe9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,14 +89,15 @@ if (LZ4_FOUND) endif() # Mount()ing and stat()ing and friends +check_symbol_exists(statfs sys/vfs.h HAVE_VFS_H) +check_include_files(sys/params.h HAVE_PARAMS_H) +check_symbol_exists(statfs sys/mount.h HAVE_MOUNT_H) +if (NOT HAVE_VFS_H AND NOT HAVE_MOUNT_H) + message(FATAL_ERROR "Can find neither statvfs() nor statfs()") +endif() check_function_exists(statvfs HAVE_STATVFS) if (NOT HAVE_STATVFS) - check_symbol_exists(statfs sys/vfs.h HAVE_VFS_H) - check_symbol_exists(statfs sys/mount.h HAVE_MOUNT_H) - if (NOT HAVE_VFS_H AND NOT HAVE_MOUNT_H) - message(FATAL_ERROR "Can find neither statvfs() nor statfs()") - endif() configure_file(CMake/statvfs.h.in ${PROJECT_BINARY_DIR}/include/statvfs.h COPYONLY) endif() -- cgit v1.2.3 From cede4eda68220a002822194605d436b7ca044afa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 18:48:43 +0200 Subject: CMake: Add support for libintl This basically just links everything to libintl if USE_NLS is on. It would be better to just link those targets that are actually translated, but doing so is a huge PITA. Also move the include_directories() for the build-tree include/ directory to the top of the CMakeLists.txt, otherwise it only gets passed after Intl_INCLUDE_DIRS, which means we will built against installed apt-pkg headers (if any) instead of our own. Gbp-Dch: ignore --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b2e5bfe9c..189a8d570 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,9 @@ # set minimum version project(apt) cmake_minimum_required(VERSION 3.4.0) +# Generic header locations +include_directories(${PROJECT_BINARY_DIR}/include) + enable_testing() @@ -27,6 +30,12 @@ include(TestBigEndian) find_package(Threads) find_package(LFS REQUIRED) +if(USE_NLS) + find_package(Intl REQUIRED) + link_libraries(${Intl_LIBRARIES}) + include_directories(${Intl_INCLUDE_DIRS}) +endif() + # Add large file support add_compile_options(${LFS_COMPILE_OPTIONS}) add_definitions(${LFS_DEFINITIONS}) @@ -166,9 +175,6 @@ endif() configure_file(CMake/config.h.in ${PROJECT_BINARY_DIR}/include/config.h) configure_file(CMake/apti18n.h.in ${PROJECT_BINARY_DIR}/include/apti18n.h) -# Generic header locations -include_directories(${PROJECT_BINARY_DIR}/include) - # Add our subdirectories add_subdirectory(vendor) add_subdirectory(apt-pkg) -- cgit v1.2.3 From 8757a0fdeee00ea6a7cc717188a0e129ad8a553c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 19:41:58 +0200 Subject: Make directory paths configurable This allows other vendors to use different paths, or to build your own APT in /opt for testing. Note that this uses + 1 in some places, as the paths we receive are absolute, but we need to strip of the initial /. --- CMakeLists.txt | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 189a8d570..916090866 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,6 +171,15 @@ if (NOT DEFINED COMMON_ARCH) OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) endif() +# Set various directories +set(STATE_DIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/apt" CACHE PATH "Your /var/lib/apt") +set(CACHE_DIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/cache/apt" CACHE PATH "Your /var/cache/apt") +set(LOG_DIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/apt" CACHE PATH "Your /var/log/apt") +set(CONF_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt" CACHE PATH "Your /etc/apt") +set(LIBEXEC_DIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/apt" CACHE PATH "Your /usr/libexec/apt") +set(BIN_DIR "${CMAKE_INSTALL_FULL_BINDIR}") + + # Configure our configuration headers (config.h and apti18n.h) configure_file(CMake/config.h.in ${PROJECT_BINARY_DIR}/include/config.h) configure_file(CMake/apti18n.h.in ${PROJECT_BINARY_DIR}/include/apti18n.h) @@ -197,13 +206,13 @@ endif() # Create our directories. install_empty_directories( - ${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt/apt.conf.d - ${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt/preferences.d - ${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt/sources.list.d - ${CMAKE_INSTALL_FULL_SYSCONFDIR}/apt/trusted.gpg.d - ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/cache/apt/archives/partial - ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/apt/lists/partial - ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/apt/mirrors/partial - ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/apt/periodic - ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/apt + ${CONF_DIR}/apt.conf.d + ${CONF_DIR}/preferences.d + ${CONF_DIR}/sources.list.d + ${CONF_DIR}/trusted.gpg.d + ${CACHE_DIR}/archives/partial + ${STATE_DIR}/lists/partial + ${STATE_DIR}/mirrors/partial + ${STATE_DIR}/periodic + ${LOG_DIR} ) -- cgit v1.2.3 From 6f1f3c9afdb6ade6a7be110b90c8fc9e603254cf Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 25 Aug 2016 16:25:00 +0200 Subject: Make root group configurable via ROOT_GROUP This is needed on BSD where root's default group is wheel, not root. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 916090866..24c58a0f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,12 @@ if (NOT DEFINED COMMON_ARCH) execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) endif() +if (NOT DEFINED ROOT_GROUP) + execute_process(COMMAND id -gn root + OUTPUT_VARIABLE ROOT_GROUP OUTPUT_STRIP_TRAILING_WHITESPACE) + message(STATUS "Found root group: ${ROOT_GROUP}") +endif() +set(ROOT_GROUP "${ROOT_GROUP}" CACHE STRING "Group of root (e.g.: wheel or root)") # Set various directories set(STATE_DIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/apt" CACHE PATH "Your /var/lib/apt") -- cgit v1.2.3 From 01d207a5076b6fc37a064645b13f2c6550f58b94 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 26 Aug 2016 17:55:28 +0200 Subject: CMake: Add missing iconv dependency FreeBSD has two iconv systems: It ships an iconv.h itself, and symbols for that in the libc. But there's also the port of GNU libiconv, which unfortunately for us, Doxygen depends on. This changes things to prefer a separate libiconv library over the system one; that is, the port on FreeBSD. Gbp-Dch: ignore --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 24c58a0f8..35c75b18a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ include(GNUInstallDirs) include(TestBigEndian) find_package(Threads) find_package(LFS REQUIRED) +find_package(Iconv REQUIRED) if(USE_NLS) find_package(Intl REQUIRED) -- cgit v1.2.3 From 317bb39f3cd6626c74f25d7bdf2907f1b235f553 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 30 Aug 2016 22:20:55 +0200 Subject: Release 1.3~rc3 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 35c75b18a..ee1adf7a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,7 +165,7 @@ endif() # Configure some variables like package, version and architecture. set(PACKAGE ${PROJECT_NAME}) set(PACKAGE_MAIL "APT Development Team ") -set(PACKAGE_VERSION "1.3~rc2") +set(PACKAGE_VERSION "1.3~rc3") if (NOT DEFINED COMMON_ARCH) execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH -- cgit v1.2.3