Skip to content
Permalink
Browse files

libzip: Fix include path order

Fixes build failure when upgrading from older version.

Closes: https://trac.macports.org/ticket/56246
  • Loading branch information
ryandesign committed Apr 9, 2018
1 parent 9ca502e commit 56005de486d09c5472933e7d00b8c220235375c0
Showing with 45 additions and 0 deletions.
  1. +2 −0 archivers/libzip/Portfile
  2. +43 −0 archivers/libzip/files/include-order.patch
@@ -27,6 +27,8 @@ depends_build-append \
depends_lib-append port:bzip2 \
port:zlib

patchfiles include-order.patch

configure.args-append \
-DENABLE_COMMONCRYPTO:Bool=OFF \
-DENABLE_GNUTLS:Bool=OFF \
@@ -0,0 +1,43 @@
Search libzip source path before other include paths.
https://github.com/nih-at/libzip/commit/4cd3c601cb48be89cd9e6e5082cc7bbe47e8a003
--- lib/CMakeLists.txt.orig
+++ lib/CMakeLists.txt
@@ -179,7 +179,7 @@ ELSE(WIN32)
)
ENDIF(WIN32)

-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..)
+INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..)

ADD_CUSTOM_TARGET(update_zip_err_str
COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh ${CMAKE_CURRENT_SOURCE_DIR}/zip.h ${CMAKE_CURRENT_SOURCE_DIR}/zip_err_str.c
--- regress/CMakeLists.txt.orig
+++ regress/CMakeLists.txt
@@ -1,8 +1,6 @@
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
IF(NOT HAVE_GETOPT)
SET(SRC_EXTRA_FILES ../src/getopt.c)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/../src)
ENDIF()

SET(TEST_PROGRAMS
@@ -203,8 +201,6 @@ FOREACH(CASE ${EXTRA_TESTS})
SET_TESTS_PROPERTIES(${CASE} PROPERTIES SKIP_RETURN_CODE 77)
ENDFOREACH()

-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../lib
- ${CMAKE_CURRENT_SOURCE_DIR}/../src
- ${CMAKE_CURRENT_BINARY_DIR}/..)
+INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../lib ${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_CURRENT_BINARY_DIR}/..)

ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
--- src/CMakeLists.txt.orig
+++ src/CMakeLists.txt
@@ -1,5 +1,4 @@
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../lib
- ${CMAKE_CURRENT_BINARY_DIR}/..)
+INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../lib ${CMAKE_CURRENT_BINARY_DIR}/..)

CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
IF(NOT HAVE_GETOPT)

0 comments on commit 56005de

Please sign in to comment.
You can’t perform that action at this time.