summaryrefslogtreecommitdiff
path: root/CMake
AgeCommit message (Collapse)Author
2020-12-15Use XXH3 for cache, hash table hashingJulian Andres Klode
XXH3 is faster than both our CRC32c implementation as well as DJB hash for hash table hashing, so meh, let's switch to it.
2020-11-05Rename CMake find_package helpers to avoid developer warningsDavid Kalnischkies
| CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message): | The package name passed to `find_package_handle_standard_args` (Berkeley) | does not match the name of the calling package (BerkeleyDB). This can lead | to problems in calling code that expects `find_package` result variables | (e.g., `_FOUND`) to follow a certain pattern. | Call Stack (most recent call first): | CMake/FindBerkeleyDB.cmake:57 (find_package_handle_standard_args) | CMakeLists.txt:83 (find_package) | This warning is for project developers. Use -Wno-dev to suppress it. And indeed, we checked for BERKLEY_DB_FOUND which was not defined so our HAVE_BDB was not set – just that it is never used, so it wasn't noticed.
2020-08-04CMake/Translations: Replace master with primaryJulian Andres Klode
2020-07-14CMake: Rename add_slaves() to add_links()Julian Andres Klode
Sorry!
2020-05-25Stub out i18n methods for -DUSE_NLS=OFFDavid Kalnischkies
Replacing the macros with stub inline functions allows for more versatile usage, e.g. fixing this compile error: In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/c++locale.h:41, from /usr/include/c++/9/bits/localefwd.h:40, from /usr/include/c++/9/ios:41, from /usr/include/c++/9/ostream:38, from /usr/include/c++/9/iostream:39, from include/apt-pkg/configuration.h:30, from ../apt-pkg/contrib/netrc.cc:16: /usr/include/c++/9/clocale:54:11: error: ‘::setlocale’ has not been declared 54 | using ::setlocale; Gbp-Dch: Ignore
2020-05-25Allow FMV SSE4.2 detection to succeed on clangDavid Kalnischkies
As the builtins were used in the feature test also in the default branch clang fails to compile the test helpfully complaining that you need to compile with sse4.2 to use that while on gcc it is optimized out as unused code and produces only a warning for that… removing the code from the default branch fixes this problem, but we adapt the code some more to avoid compilers optimizing it out in the future just in case.
2020-05-08Use "po4a --porefs file" instead of undocumented compat nolineDavid Kalnischkies
References: https://github.com/mquinson/po4a/commit/329f472a378d42c7a33e8110e5091be61480a0fc
2020-05-08Drop nowrap from po4a --porefs as it is no longer supportedDavid Kalnischkies
Upstream says it had no effect before, so it seems safe to adapt. References: https://github.com/mquinson/po4a/commit/ac1e97305b6073ed87fa8cf0a2e32f9b1255d0f1
2020-01-14hashes: Use Libgcrypt for hashing purposesJulian Andres Klode
Switch the code of the Hashes class to use libgcrypt, which allows us to use hardware-accelerated implementations of SHA1 and friends.
2020-01-07Only define likely/unlikely if APT_COMPILING_APT setJulian Andres Klode
This ensures that we do not leak simple words like that.
2019-06-12Run unifdef -DAPT_{8,9,10,15}_CLEANER_HEADERSJulian Andres Klode
2019-05-03Prevent shutdown while running dpkgJulian Andres Klode
As long as we are running dpkg, keep an inhibitor that blocks us from shutting down. LP: #1820886
2019-02-04Correctly handle feature detection for sse4.2 and crc32Julian Andres Klode
Mistakingly used #define instead of #cmakedefine
2019-02-04Detect function multiversioning and sse4.2/crc32, enables i386Julian Andres Klode
This fixes the build on kfreebsd-amd64, and due to the detection of sse4.2, should also enable the sse4.2 on i386.
2018-05-07Remove obsolete RCS keywordsGuillem Jover
Prompted-by: Jakub Wilk <jwilk@debian.org>
2018-03-12apt-pkg: Add support for zstdJulian Andres Klode
zstd is a compression algorithm developed by facebook. At level 19, it is about 6% worse in size than xz -6, but decompression is multiple times faster, saving about 40% install time, especially with eatmydata on cloud instances.
2017-11-20Translate shared documentation parts againJulian Andres Klode
We accidentally did not translate the entity file, but should have. This makes apt.ent translatable again. This generates the target multiple times, but surprisingly, that works just fine, so let's just keep it that way, as it's clean code otherwise.
2017-10-26CMake: Get rid of some debugging messagesJulian Andres Klode
This fixes a regression introduced in commit 43b9eb5bac15666fdc0346aca7031fab0fa5e064 CMake: methods: Cleanup link libraries, use OBJECT libraries Gbp-Dch: ignore
2017-10-23CMake: methods: Cleanup link libraries, use OBJECT librariesJulian Andres Klode
Use OBJECT libraries for http and connect stuff, and move the seccomp link expression into a global link_libraries() call. This also fixes a bug where only the http target pulled in the gnutls header arguments despite gnutls being used in connect.cc, and thus by mirror and ftp as well. Adjust translation support to ignore TARGET_OBJECTS sources and add the OBJECT libraries to the translated files.
2017-10-22Sandbox methods with seccomp-BPF; except cdrom, gpgv, rshJulian Andres Klode
This reduces the number of syscalls to about 140 from about 350 or so, significantly reducing security risks. Also change prepare-release to ignore the architecture lists in the build dependencies when generating the build-depends package for travis. We might want to clean up things a bit more and/or move it somewhere else.
2017-09-09Directly link against libudev on Linux systemsJulian Andres Klode
We previously dlopen()ed it, but it seems painful to do that without any real gain, except for possibly not having libudev in the address space and not having code #ifdefed for Linux. The latter means that we are a bit more likely to break stuff for non-Linux systems now if we play with udev, but at least we don't end up with it silently breaking because of a libudev ABI break. The existing function pointers in the struct were renamed and kept for compat purposes. Fixes Debian/apt#48 Also adjust prepare-release to strip [linux-any] from build-depends for travis.
2017-07-26reimplement and document auth.confDavid Kalnischkies
We have support for an netrc-like auth.conf file since 0.7.25 (closing 518473), but it was never documented in apt that it even exists and netrc seems to have fallen out of usage as a manpage for it no longer exists making the feature even more arcane. On top of that the code was a bit of a mess (as it is written in c-style) and as a result the matching of machine tokens to URIs also a bit strange by checking for less specific matches (= without path) first. We now do a single pass over the stanzas. In practice early adopters of the undocumented implementation will not really notice the differences and the 'new' behaviour is simpler to document and more usual for an apt user. Closes: #811181
2017-07-20Use C++11 threading support instead of pthreadJulian Andres Klode
This makes the code easier to read.
2017-01-19fix various typos reported by spellintianDavid Kalnischkies
Most of them in (old) code comments. The two instances of user visible string changes the po files of the manpages are fixed up as well. Gbp-Dch: Ignore Reported-By: spellintian
2017-01-17Read dpkg tables to handle architecture wildcardsJulian Andres Klode
Our implementation of wildcards was rudimentary. It worked for some common ones, but it was also broken: For example, armel matched any-armel, but should match any-arm. With this commit, we load the correct tables from dpkg. Supported are both triplets and quadruplet tables (the latter introduced in dpkg 1.18.11). There are some odd things we have to deal with in the cache filter for historical and API reasons: * The character "*" must be accepted as an alternative to any - in fact it may appear anywhere in the wildcard as we also allow fnmatch() style wildcard matching on the commandline. * The code might get passed an arch with a minus at the end, for example the cmdline "install apt:any-arm-" will first try to check if any-arm- is a valid architecture. We deal with this by rejecting any wildcard ending in a minus. * Triplets are actually implemented by extending them to faux quadruplets - by prepending a "base" component for the architecture tuple, and "any" if there is a wildcard component. Once we have constructed a wildcard, it is transformed into an fnmatch() expression for historical reasons. In the future, we should really get a tuple class and implement matching in a better, more explicit way. This does for now though - it passes all the test cases and accepts all things it should accept. Closes: #748936 Thanks: James Clarke <jrtc27@jrtc27.com> for the initial patch
2016-08-26CMake: Add missing iconv dependencyJulian Andres Klode
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
2016-08-26Make root group configurable via ROOT_GROUPJulian Andres Klode
This is needed on BSD where root's default group is wheel, not root.
2016-08-26Make directory paths configurableJulian Andres Klode
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 /.
2016-08-26CMake: Handle Berkeley DB on FreeBSDJulian Andres Klode
The BSD systems still ship their own db.h with a historical BSD implementation, which is preferred by CMake, as it searches its default path first. We thus have to disable the DEFAULT_PATH for the search, unfortunately. We also need to pass the correct include directory to the target. Furthermore, on FreeBSD the library is called db-<VERSION>, so let's add db-5 to the list of allowed names. Gbp-Dch: ignore
2016-08-26CMake: Add FindLZ4 and FindLZMAJulian Andres Klode
This makes things work with /usr/local on FreeBSD. Gbp-Dch: ignore
2016-08-26CMake: Handle endian.h locations on other platformsJulian Andres Klode
Gbp-Dch: ignore
2016-08-23CMake: Discover docbook stylesheet in other locationsJulian Andres Klode
Distributions seem to install this stuff all over the place, so let's add a common list of paths we know about.
2016-08-23CMake: Add Large File SupportJulian Andres Klode
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
2016-08-20CMake: Fix uninitialized variablesJulian Andres Klode
This fixes some actual bugs for PROJECT and BZIP2_INCLUDE_DIR. Gbp-Dch: ignore
2016-08-20CMake: Translations: Build byproduct before outputJulian Andres Klode
This can lead to an inconsistent state otherwise, with the output being updated and the byproduct not; for example, when the build was manually interrupted.
2016-08-19CMake: Install config and logging directoriesJulian Andres Klode
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...
2016-08-19CMake: Translations: Pass --previous to msgmergeJulian Andres Klode
When updating our .po files, pass --previous to msgmerge to make it easier for translators to translate fuzzy strings. Thanks: Guillem Jover for the suggestion.
2016-08-19CMake: Translations: Don't rebuild .mo for line number changesJulian Andres Klode
If only the line numbers changed in a file without any of the translatable strings changing, the .po and .mo files were rebuilt, making building simple code changes somewhat annoying. We can work around this by passing --add-location=file to msgcomm when we are creating the temporary .pot file used for building the .mo files.
2016-08-11CMake: Use COPYONLY instead of @ONLYJulian Andres Klode
I don't know what happened back in 2009 when I wrote this, but it seems I used the wrong option. These files should not have any variable substitution done to them.
2016-08-10Add statvfs.h.in to CMake directoryJulian Andres Klode
Gbp-Dch: ignore
2016-08-10CMake: Rewrite existing Documentation support and add doxygenJulian Andres Klode
This can now build all documentation. It should also be fairly reusable for other projects, as long as they follow the same naming scheme for the po4a output files and set the PACKAGE_* variables used here. We could have done all translations in a single call to po4a like the makefile based buildsystem does. While that would have made the output slightly nicer, this solution offers a huge performance gain because it can translate the documents in parallel, which also means that the xsltproc stage does not have to wait for all translations to be done first. You might think that the add_custom_command() should list the actual output files as BYPRODUCTS. This is not true however: Because the files are not always generated, Ninja will think missing byproducts mean that the target is out of date - which is not what we want. Finally, also add the missing doxygen support. Note that the packaging script cleans up some md5 and map files created by doxygen, otherwise it is fairly boring.
2016-08-10CMake: Misc: Extract command path_join() from TranslationsJulian Andres Klode
This abstracts the joining of paths a bit better than having basically the same code twice in the Translations module. Gbp-Dch: ignore
2016-08-10CMake: Check for ptsname_r() againJulian Andres Klode
This was dropped in autotools as I found no use of the HAVE_PTSNAME_R macro. Turns out it was typoed as HAVE_PTS_NAME_R. Fix the #ifdef and add checks to CMake for it. Closes: #833674
2016-08-10CMake: Translations: Build .pot in po binary dir, not project oneJulian Andres Klode
This was cluttering up things all over the place. Gbp-Dch: ignore
2016-08-10CMake: Translations: Allow excluding languages from translationJulian Andres Klode
This seems to be needed for the hebrew translations. Gbp-Dch: ignore
2016-08-10CMake: Translations: Avoid rebuilding .mo if .pot did not changeJulian Andres Klode
Use the witness/byproducts approach to build the translations. A byproduct of a command is like an output, but may be older than the input. Here, we generate a normal template with headers in the normal way as a witness (and for Launchpad translations), but we also generate a .pot-tmp0 template file without a header that gets copied to a .pot-tmp byproduct only if it changed. This way, the .pot-tmp is only updated if an actual string translation changed. We also create a custom target for the .pot file that we'll depend on later in the overall target creating the mo files to ensure that the template is build before we try to build mo files. Then we make the msgmerge depend on the .pot-tmp instead of the .pot file, which means that msgmerge and msgfmt only get re-run if a string change occured. Gbp-Dch: ignore
2016-08-10CMake: Translations: Add a statistics targetJulian Andres Klode
This is really useful stuff to have. Gbp-Dch: ignore
2016-08-10CMake: Translations: Build apt-all.pot and update .po filesJulian Andres Klode
Merge all the per-domain templates into one template file using msgcomm, stripping any line numbers in the input files, and sorting the output per file. This should create reasonably stable .pot and .po files that do not change just because files move around. It should also be resilient against some line changes, as long as one translated line is not moved before/after another translated line. Gbp-Dch: ignore
2016-08-10CMake: Translations: Add support for shell scriptsJulian Andres Klode
Rework the arguments to apt_add_translation_domain so a user can specify TARGETS and SCRIPTS, the latter being Shell scripts. For each language (TARGETS being C++, SCRIPTS being Shell), a separate template is generated via xgettext. Those templates are then merged together by using msgcomm. In case there are no Shell scripts in the translation domain, msgcomm will receive /dev/null instead of a shell translation template. This also reintroduces line numbers, as msgcomm would otherwise re-order the merged files not only by filename, but also by message string. It's unclear why it does that, it could just leave strings within a file alone. In contrast to the old build system, we use xgettext for shell scripts instead of bash --dump-strings, as it's just easier to use the same tool for everything. We also create valid headers.
2016-08-10CMake: Translations: Write a .po file before writing a .mo fileJulian Andres Klode
This makes debugging things easier. Gbp-Dch: ignore