termux-packages/packages/weechat/cmake-FindPerl.cmake.patch

74 lines
1.9 KiB
Diff

diff -u -r ../weechat-2.7/cmake/FindPerl.cmake ./cmake/FindPerl.cmake
--- ../weechat-2.7/cmake/FindPerl.cmake 2019-12-08 08:48:53.000000000 +0000
+++ ./cmake/FindPerl.cmake 2019-12-11 22:43:40.749343000 +0000
@@ -28,57 +28,16 @@
# PERL_CFLAGS = perl compiler options for compiling
# PERL_LFLAGS = perl compiler options for linking
-if(PERL_FOUND)
- # Already in cache, be silent
- set(PERL_FIND_QUIETLY TRUE)
-endif()
-
-find_program(PERL_EXECUTABLE
- NAMES perl perl5
- PATHS /usr/bin /usr/local/bin /usr/pkg/bin
+set(PERL_EXECUTABLE "@TERMUX_PREFIX@/bin/perl")
+set(PERL_INCLUDE_PATH "@TERMUX_PREFIX@/include/perl/")
+set(PERL_LIBRARY "@TERMUX_PREFIX@/lib")
+set(PERL_LFLAGS "-lperl")
+set(PERL_FOUND TRUE)
+
+mark_as_advanced(
+ PERL_EXECUTABLE
+ PERL_INCLUDE_PATH
+ PERL_LIBRARY
+ PERL_CFLAGS
+ PERL_LFLAGS
)
-
-if(PERL_EXECUTABLE)
-
- execute_process(
- COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \"\$Config{archlibexp}/CORE\""
- OUTPUT_VARIABLE PERL_INTERNAL_DIR
- )
-
- execute_process(
- COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ccopts
- OUTPUT_VARIABLE PERL_CFLAGS
- )
-
- execute_process(
- COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ldopts
- OUTPUT_VARIABLE PERL_LFLAGS
- )
-
- # remove the new lines from the output by replacing them with empty strings
- string(REPLACE "\n" "" PERL_INTERNAL_DIR "${PERL_INTERNAL_DIR}")
- string(REPLACE "\n" "" PERL_CFLAGS "${PERL_CFLAGS}")
- string(REPLACE "\n" "" PERL_LFLAGS "${PERL_LFLAGS}")
-
- find_path(PERL_INCLUDE_PATH
- NAMES perl.h
- PATHS ${PERL_INTERNAL_DIR}
- )
-
- find_library(PERL_LIBRARY
- NAMES perl
- PATHS /usr/lib /usr/local/lib /usr/pkg/lib ${PERL_INTERNAL_DIR}
- )
-
- if(PERL_LIBRARY AND PERL_INCLUDE_PATH)
- set(PERL_FOUND TRUE)
- endif()
-
- mark_as_advanced(
- PERL_EXECUTABLE
- PERL_INCLUDE_PATH
- PERL_LIBRARY
- PERL_CFLAGS
- PERL_LFLAGS
- )
-endif()