Skip to content

Commit fc82b8a

Browse files
committed
weechat: fix linking to correct libs
1 parent 18f5ddb commit fc82b8a

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

irc/weechat/Portfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ PortGroup cmake 1.1
55
PortGroup conflicts_build 1.0
66

77
# Need strndup()
8-
PortGroup legacysupport 1.0
8+
PortGroup legacysupport 1.1
99
legacysupport.newest_darwin_requires_legacy 10
1010

1111
name weechat
1212
version 4.5.0
13-
revision 0
13+
revision 1
1414
checksums rmd160 322aba1c2fffc882ceb34c21c08183d1ef6139c5 \
1515
sha256 b85e800af0f7c9f2d60d72c0f7e56abbaa60274a4d47be17407907292da30398 \
1616
size 2745516
@@ -63,6 +63,9 @@ license_noconflict asciidoctor
6363

6464
patchfiles no-extra-gcc-warnings.patch
6565

66+
# https://github.com/weechat/weechat/pull/2221
67+
patchfiles-append fix-linking.patch
68+
6669
configure.args-append \
6770
-DENABLE_GUILE=OFF \
6871
-DENABLE_JAVASCRIPT=OFF \

irc/weechat/files/fix-linking.patch

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From a776fb1867b92dee37c1a6c58de499087c98050c Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= <[email protected]>
3+
Date: Sat, 21 Dec 2024 15:03:21 +0100
4+
Subject: [PATCH] core: fix detection of dl library
5+
6+
This fixes the linking to curl and ncurses on macOS.
7+
---
8+
CMakeLists.txt | 4 +---
9+
1 file changed, 1 insertion(+), 3 deletions(-)
10+
11+
diff --git a/CMakeLists.txt b/CMakeLists.txt
12+
index 5d15a35489f..d235060983a 100644
13+
--- CMakeLists.txt
14+
+++ CMakeLists.txt
15+
@@ -247,9 +247,7 @@ find_library(DL_LIBRARY
16+
PATHS /lib /usr/lib /usr/libexec /usr/local/lib /usr/local/libexec
17+
)
18+
if(DL_LIBRARY)
19+
- string(REGEX REPLACE "/[^/]*$" "" DL_LIBRARY_PATH "${DL_LIBRARY}")
20+
- set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${DL_LIBRARY_PATH}")
21+
- list(APPEND EXTRA_LIBS dl)
22+
+ list(APPEND EXTRA_LIBS ${DL_LIBRARY})
23+
endif()
24+
25+
add_subdirectory(icons)
26+
27+
From c73fcbfd3310998c4488af6bdd1fbc4b72604d76 Mon Sep 17 00:00:00 2001
28+
From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= <[email protected]>
29+
Date: Sat, 21 Dec 2024 14:42:12 +0100
30+
Subject: [PATCH] core: add option POST_BUILD in add_custom_command
31+
32+
This fixes the following CMake warning:
33+
34+
CMake Warning (dev) at src/gui/curses/normal/CMakeLists.txt:73 (add_custom_command):
35+
Exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD must be given. Assuming
36+
POST_BUILD to preserve backward compatibility.
37+
38+
Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
39+
Run "cmake --help-policy CMP0175" for policy details. Use the cmake_policy
40+
command to set the policy and suppress this warning.
41+
This warning is for project developers. Use -Wno-dev to suppress it.
42+
---
43+
src/gui/curses/normal/CMakeLists.txt | 1 +
44+
1 file changed, 1 insertion(+)
45+
46+
diff --git a/src/gui/curses/normal/CMakeLists.txt b/src/gui/curses/normal/CMakeLists.txt
47+
index 1716905a809..43c48de74c8 100644
48+
--- src/gui/curses/normal/CMakeLists.txt
49+
+++ src/gui/curses/normal/CMakeLists.txt
50+
@@ -72,6 +72,7 @@ target_link_libraries(${EXECUTABLE}
51+
# It may be removed in future.
52+
add_custom_command(
53+
TARGET ${EXECUTABLE}
54+
+ POST_BUILD
55+
COMMAND ${CMAKE_COMMAND} -E remove -f "weechat-curses${CMAKE_EXECUTABLE_SUFFIX}"
56+
COMMAND ${CMAKE_COMMAND} -E create_symlink "weechat${CMAKE_EXECUTABLE_SUFFIX}" "weechat-curses${CMAKE_EXECUTABLE_SUFFIX}"
57+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"

0 commit comments

Comments
 (0)