You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.2 KiB

  1. From 3d94e052f987bc35452592acf9f6fcb0d4ee4db4 Mon Sep 17 00:00:00 2001
  2. From: David Woodhouse <dwmw2@infradead.org>
  3. Date: Wed, 10 Jun 2020 11:39:17 +0100
  4. Subject: [PATCH] Allow libbsd to be explicitly disabled
  5. When building for a minimal environment like OpenWRT we want to avoid the
  6. dependency on libbsd even if it did happen to be built and available in
  7. the buildroot at the time minizip is compiled.
  8. https://github.com/openwrt/packages/issues/12471
  9. ---
  10. CMakeLists.txt | 6 +++++-
  11. 1 file changed, 5 insertions(+), 1 deletion(-)
  12. diff --git a/CMakeLists.txt b/CMakeLists.txt
  13. index 0de10cf..217359a 100644
  14. --- a/CMakeLists.txt
  15. +++ b/CMakeLists.txt
  16. @@ -17,6 +17,7 @@ option(MZ_PKCRYPT "Enables PKWARE traditional encryption" ON)
  17. option(MZ_WZAES "Enables WinZIP AES encryption" ON)
  18. option(MZ_LIBCOMP "Enables Apple compression" OFF)
  19. option(MZ_OPENSSL "Enables OpenSSL for encryption" OFF)
  20. +option(MZ_LIBBSD "Enable libbsd random functionality" ON)
  21. option(MZ_BRG "Enables Brian Gladman's encryption library" OFF)
  22. option(MZ_SIGNING "Enables zip signing support" ON)
  23. option(MZ_COMPRESS_ONLY "Only support compression" OFF)
  24. @@ -275,7 +276,7 @@ if(UNIX)
  25. endif()
  26. endif()
  27. - if(NOT HAVE_ARC4RANDOM_BUF)
  28. + if(MZ_LIBBSD AND NOT HAVE_ARC4RANDOM_BUF)
  29. find_package(PkgConfig REQUIRED)
  30. pkg_check_modules(LIBBSD libbsd)
  31. @@ -288,6 +289,8 @@ if(UNIX)
  32. list(APPEND MINIZIP_INC ${LIBBSD_INCLUDE_DIRS})
  33. link_directories(${LIBBSD_LIBRARY_DIRS})
  34. endif()
  35. + else()
  36. + set(MZ_LIBBSD FALSE)
  37. endif()
  38. endif()
  39. endif()
  40. @@ -935,6 +938,7 @@ add_feature_info(MZ_PKCRYPT MZ_PKCRYPT "Enables PKWARE traditional encryption")
  41. add_feature_info(MZ_WZAES MZ_WZAES "Enables WinZIP AES encryption")
  42. add_feature_info(MZ_LIBCOMP MZ_LIBCOMP "Enables Apple compression")
  43. add_feature_info(MZ_OPENSSL MZ_OPENSSL "Enables OpenSSL for encryption")
  44. +add_feature_info(MZ_LIBBSD MZ_LIBBSD "Build with libbsd for random functionality")
  45. add_feature_info(MZ_BRG MZ_BRG "Enables Brian Gladman's encryption library")
  46. add_feature_info(MZ_SIGNING MZ_SIGNING "Enables zip signing support")
  47. add_feature_info(MZ_COMPRESS_ONLY MZ_COMPRESS_ONLY "Only support compression")
  48. --
  49. 2.17.1