From 4de4200ec2717e777bbf99ed82d1b4344f078ec2 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 8 Mar 2018 09:33:39 +0100 Subject: apt-pkg: Add support for zstd 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. --- CMake/FindZstd.cmake | 25 +++++++++++++++++++++++++ CMake/config.h.in | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 CMake/FindZstd.cmake (limited to 'CMake') diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake new file mode 100644 index 000000000..68118049b --- /dev/null +++ b/CMake/FindZstd.cmake @@ -0,0 +1,25 @@ +# - Try to find ZSTD +# Once done, this will define +# +# ZSTD_FOUND - system has ZSTD +# ZSTD_INCLUDE_DIRS - the ZSTD include directories +# ZSTD_LIBRARIES - the ZSTD library +find_package(PkgConfig) + +pkg_check_modules(ZSTD_PKGCONF libzstd) + +find_path(ZSTD_INCLUDE_DIRS + NAMES zstd.h + PATHS ${ZSTD_PKGCONF_INCLUDE_DIRS} +) + + +find_library(ZSTD_LIBRARIES + NAMES zstd + PATHS ${ZSTD_PKGCONF_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ZSTD DEFAULT_MSG ZSTD_INCLUDE_DIRS ZSTD_LIBRARIES) + +mark_as_advanced(ZSTD_INCLUDE_DIRS ZSTD_LIBRARIES) diff --git a/CMake/config.h.in b/CMake/config.h.in index cfaa14ed1..bd0da8649 100644 --- a/CMake/config.h.in +++ b/CMake/config.h.in @@ -17,6 +17,9 @@ /* Define if we have the lz4 library for lz4 */ #cmakedefine HAVE_LZ4 +/* Define if we have the zstd library for zst */ +#cmakedefine HAVE_ZSTD + /* Define if we have the udev library */ #cmakedefine HAVE_UDEV -- cgit v1.2.3