Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxychains-ng: fix build on older OS and Sonoma #25511

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions devel/proxychains-ng/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

PortSystem 1.0
PortGroup github 1.0
PortGroup legacysupport 1.1

# dprintf
legacysupport.newest_darwin_requires_legacy 10

github.setup rofl0r proxychains-ng 4.17 v
maintainers nomaintainer
Expand All @@ -12,8 +16,6 @@ long_description ${name} is a {*}${description} which hooks calls to \
sockets indynamically linked programs and redirects \
it through one or more socks/http proxies.

platforms darwin

master_sites ${homepage}/archive/
distname ${github.tag_prefix}${version}
worksrcdir ${name}-${version}
Expand All @@ -22,4 +24,21 @@ checksums rmd160 83073f3df35c28c0a8d6ad2b522669c8727a1a8b \
sha256 1a2dc68fcbcb2546a07a915343c1ffc75845f5d9cc3ea5eb3bf0b62a66c0196f \
size 52568

patchfiles-append patch-EAI_OVERFLOW.diff

# https://github.com/rofl0r/proxychains-ng/issues/578
patchfiles-append patch-fix-memcpy.diff

# error: ‘struct <anonymous>’ has no member named ‘in_addr’
compiler.blacklist-append \
*gcc-4.0 *gcc-4.2

platform darwin {
# https://github.com/rofl0r/proxychains-ng/issues/579
if {${os.major} > 22 && [string match *clang* ${configure.compiler}]} {
configure.cflags-append \
-Wno-error=incompatible-function-pointer-types
}
}

destroot.target-append install-config
13 changes: 13 additions & 0 deletions devel/proxychains-ng/files/patch-EAI_OVERFLOW.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- src/libproxychains.c.orig 2024-01-22 01:28:35.000000000 +0800
+++ src/libproxychains.c 2024-08-29 05:25:20.000000000 +0800
@@ -55,6 +55,10 @@
connect_t true___xnet_connect;
#endif

+#ifndef EAI_OVERFLOW
+#define EAI_OVERFLOW EAI_FAIL
+#endif
+
close_t true_close;
close_range_t true_close_range;
connect_t true_connect;
11 changes: 11 additions & 0 deletions devel/proxychains-ng/files/patch-fix-memcpy.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/core.c.orig 2024-01-22 01:28:35.000000000 +0800
+++ src/core.c 2024-08-29 05:32:43.000000000 +0800
@@ -999,7 +999,7 @@
} else if(!node && !(hints->ai_flags & AI_PASSIVE)) {
af = ((struct sockaddr_in *) &space->sockaddr_space)->sin_family = AF_INET;
memcpy(&((struct sockaddr_in *) &space->sockaddr_space)->sin_addr,
- (char[]){127,0,0,1}, 4);
+ ((char[]){127,0,0,1}), 4);
}
if(service) mygetservbyname_r(service, NULL, &se_buf, buf, sizeof(buf), &se);