From 8887f6c09c27dd5f6dfeecc4c766ec9f67d95f7a Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Fri, 13 Sep 2019 19:25:09 +0200 Subject: [PATCH] [libpng] Replace find_library() with a simple set() for linking libm on UNIX (#8079) --- ports/libpng/CONTROL | 2 +- ports/libpng/fix-libm-unix.patch | 12 ++++++++++++ ports/libpng/portfile.cmake | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ports/libpng/fix-libm-unix.patch diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL index c77b2a9d15..bc06e8debd 100644 --- a/ports/libpng/CONTROL +++ b/ports/libpng/CONTROL @@ -1,5 +1,5 @@ Source: libpng -Version: 1.6.37-3 +Version: 1.6.37-4 Build-Depends: zlib Homepage: https://github.com/glennrp/libpng Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. diff --git a/ports/libpng/fix-libm-unix.patch b/ports/libpng/fix-libm-unix.patch new file mode 100644 index 0000000000..0abd20879e --- /dev/null +++ b/ports/libpng/fix-libm-unix.patch @@ -0,0 +1,12 @@ +diff -ur a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2019-04-14 20:10:32.000000000 +0200 ++++ b/CMakeLists.txt 2019-09-06 14:14:39.425498139 +0200 +@@ -44,7 +44,7 @@ + endif() + + if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) +- find_library(M_LIBRARY m) ++ set(M_LIBRARY m) + else() + # libm is not needed and/or not available + set(M_LIBRARY "") diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 7e4fc8b042..24858f26c6 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF master PATCHES use-abort-on-all-platforms.patch + fix-libm-unix.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)