summaryrefslogtreecommitdiff
path: root/CMake
Commit message (Collapse)AuthorAgeFilesLines
* hashes: Use Libgcrypt for hashing purposesJulian Andres Klode2020-01-141-0/+25
| | | | | Switch the code of the Hashes class to use libgcrypt, which allows us to use hardware-accelerated implementations of SHA1 and friends.
* Only define likely/unlikely if APT_COMPILING_APT setJulian Andres Klode2020-01-071-0/+3
| | | | This ensures that we do not leak simple words like that.
* Run unifdef -DAPT_{8,9,10,15}_CLEANER_HEADERSJulian Andres Klode2019-06-121-5/+0
|
* Prevent shutdown while running dpkgJulian Andres Klode2019-05-032-0/+27
| | | | | | | As long as we are running dpkg, keep an inhibitor that blocks us from shutting down. LP: #1820886
* Correctly handle feature detection for sse4.2 and crc32Julian Andres Klode2019-02-041-4/+4
| | | | Mistakingly used #define instead of #cmakedefine
* Detect function multiversioning and sse4.2/crc32, enables i386Julian Andres Klode2019-02-042-0/+39
| | | | | This fixes the build on kfreebsd-amd64, and due to the detection of sse4.2, should also enable the sse4.2 on i386.
* Remove obsolete RCS keywordsGuillem Jover2018-05-071-1/+0
| | | | Prompted-by: Jakub Wilk <jwilk@debian.org>
* apt-pkg: Add support for zstdJulian Andres Klode2018-03-122-0/+28
| | | | | | | 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.
* Translate shared documentation parts againJulian Andres Klode2017-11-201-9/+22
| | | | | | | 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.
* CMake: Get rid of some debugging messagesJulian Andres Klode2017-10-261-2/+0
| | | | | | | | | | This fixes a regression introduced in commit 43b9eb5bac15666fdc0346aca7031fab0fa5e064 CMake: methods: Cleanup link libraries, use OBJECT libraries Gbp-Dch: ignore
* CMake: methods: Cleanup link libraries, use OBJECT librariesJulian Andres Klode2017-10-231-0/+5
| | | | | | | | | | | | 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.
* Sandbox methods with seccomp-BPF; except cdrom, gpgv, rshJulian Andres Klode2017-10-222-0/+28
| | | | | | | | | | | | 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.
* Directly link against libudev on Linux systemsJulian Andres Klode2017-09-092-0/+28
| | | | | | | | | | | | | | | | | | | 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.
* reimplement and document auth.confDavid Kalnischkies2017-07-261-0/+1
| | | | | | | | | | | | | | | | | | 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
* Use C++11 threading support instead of pthreadJulian Andres Klode2017-07-201-3/+0
| | | | This makes the code easier to read.
* fix various typos reported by spellintianDavid Kalnischkies2017-01-191-1/+1
| | | | | | | | 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
* Read dpkg tables to handle architecture wildcardsJulian Andres Klode2017-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* CMake: Add missing iconv dependencyJulian Andres Klode2016-08-261-0/+20
| | | | | | | | | | | | 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
* Make root group configurable via ROOT_GROUPJulian Andres Klode2016-08-261-0/+3
| | | | | This is needed on BSD where root's default group is wheel, not root.
* Make directory paths configurableJulian Andres Klode2016-08-261-0/+9
| | | | | | | 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 /.
* CMake: Handle Berkeley DB on FreeBSDJulian Andres Klode2016-08-261-3/+14
| | | | | | | | | | | | | 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
* CMake: Add FindLZ4 and FindLZMAJulian Andres Klode2016-08-262-0/+50
| | | | | | This makes things work with /usr/local on FreeBSD. Gbp-Dch: ignore
* CMake: Handle endian.h locations on other platformsJulian Andres Klode2016-08-262-0/+15
| | | | Gbp-Dch: ignore
* CMake: Discover docbook stylesheet in other locationsJulian Andres Klode2016-08-231-3/+31
| | | | | Distributions seem to install this stuff all over the place, so let's add a common list of paths we know about.
* CMake: Add Large File SupportJulian Andres Klode2016-08-231-0/+148
| | | | | | | | 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
* CMake: Fix uninitialized variablesJulian Andres Klode2016-08-202-1/+4
| | | | | | This fixes some actual bugs for PROJECT and BZIP2_INCLUDE_DIR. Gbp-Dch: ignore
* CMake: Translations: Build byproduct before outputJulian Andres Klode2016-08-201-4/+4
| | | | | | 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.
* CMake: Install config and logging directoriesJulian Andres Klode2016-08-191-0/+13
| | | | | | 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...
* CMake: Translations: Pass --previous to msgmergeJulian Andres Klode2016-08-191-1/+1
| | | | | | | | 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.
* CMake: Translations: Don't rebuild .mo for line number changesJulian Andres Klode2016-08-191-1/+4
| | | | | | | | | | 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.
* CMake: Use COPYONLY instead of @ONLYJulian Andres Klode2016-08-111-1/+1
| | | | | | 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.
* Add statvfs.h.in to CMake directoryJulian Andres Klode2016-08-101-0/+13
| | | | Gbp-Dch: ignore
* CMake: Rewrite existing Documentation support and add doxygenJulian Andres Klode2016-08-102-92/+259
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* CMake: Misc: Extract command path_join() from TranslationsJulian Andres Klode2016-08-102-14/+11
| | | | | | | This abstracts the joining of paths a bit better than having basically the same code twice in the Translations module. Gbp-Dch: ignore
* CMake: Check for ptsname_r() againJulian Andres Klode2016-08-101-0/+3
| | | | | | | | 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
* CMake: Translations: Build .pot in po binary dir, not project oneJulian Andres Klode2016-08-101-17/+17
| | | | | | This was cluttering up things all over the place. Gbp-Dch: ignore
* CMake: Translations: Allow excluding languages from translationJulian Andres Klode2016-08-101-4/+19
| | | | | | This seems to be needed for the hebrew translations. Gbp-Dch: ignore
* CMake: Translations: Avoid rebuilding .mo if .pot did not changeJulian Andres Klode2016-08-101-4/+21
| | | | | | | | | | | | | | | | | | | | | 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
* CMake: Translations: Add a statistics targetJulian Andres Klode2016-08-101-0/+14
| | | | | | This is really useful stuff to have. Gbp-Dch: ignore
* CMake: Translations: Build apt-all.pot and update .po filesJulian Andres Klode2016-08-101-2/+44
| | | | | | | | | | | | | 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
* CMake: Translations: Add support for shell scriptsJulian Andres Klode2016-08-101-6/+48
| | | | | | | | | | | | | | | | | | | | 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.
* CMake: Translations: Write a .po file before writing a .mo fileJulian Andres Klode2016-08-101-3/+6
| | | | | | This makes debugging things easier. Gbp-Dch: ignore
* CMake: Translations: Pass some additional arguments to commandsJulian Andres Klode2016-08-101-1/+2
| | | | | | | | This gets rid of the line numbers, adds the plural keyword, and makes msgfmt print statistics, so we know how well translated we are. Gbp-Dch: ignore
* CMake: Translations: Make po templates depend on input filesJulian Andres Klode2016-08-101-0/+3
| | | | | | | I wondered why the template was not rebuilt after I changed a file, now I have the answer. Gbp-Dch: ignore
* CMake: Set PACKAGE_MAIL variableJulian Andres Klode2016-08-101-1/+1
| | | | | | | This is needed in a lot of places. Also adjust config.h.in to use it instead of the bare email address. Gbp-Dch: ignore
* CMake: Improve handling of vendor filesJulian Andres Klode2016-08-102-8/+30
| | | | | | | | | | | | | | | | | First of all, instead of creating the files at configure time, generate the files using normal target. This has the huge advantage that they are rebuilt if their input changes. While we are at it, also add dependencies on the vendor entity files. This also fixes the path to the vendor script, which was given relatively before, which obviously won't work when running from inside a deeper subdirectory. To speed things up, pass the --vendor option to getinfo, so we do not have to find out the current vendor in getinfo all over again. Gbp-Dch: ignore
* CMake: Add initial support for documentation buildingJulian Andres Klode2016-08-061-0/+134
| | | | | | | | | | Build HTML docbook guides (untranslated) and manual pages (including translations). Also install the examples in the example subdirectory. Translation of docbook guides has not been implemented yet, but should be easy to do. The code also needs some cleanup to automatically detect the available translations.
* CMake: Add support for building and installing .mo filesJulian Andres Klode2016-08-061-0/+53
| | | | | | | | | | | | | | Introduce support for building translation domain-specific templates, merging them with the translations, and building a language-specific .mo file. The invocation of xgettext is done in the project source directory, not in the current source directory, and all paths are made relative to the project root, in order to have clean templates. This only supports the C++ source code for now, it unfortunately does not handle the shell scripts of deselect yet.
* CMake: Add basic CMake build systemJulian Andres Klode2016-08-064-0/+197
Introduce an initial CMake buildsystem. This build system can build a fully working apt system without translation or documentation. The FindBerkelyDB module is from kdelibs, with some small adjustements to also look in db5 directories. Initial work on this CMake build system started in 2009, and was resumed in August 2016.