libimobiledevice: Fix build on OSX < 10.7

This commit is contained in:
commitmaniac
2025-11-07 19:34:00 -05:00
committed by Zhenfu Shi
parent 3ffe1da353
commit 9c30fe366e
2 changed files with 33 additions and 1 deletions
+7 -1
View File
@@ -6,7 +6,7 @@ PortGroup openssl 1.0
github.setup libimobiledevice libimobiledevice 1.4.0
github.tarball_from archive
revision 0
revision 1
categories devel
@@ -43,6 +43,12 @@ depends_lib-append port:libplist \
port:libtatsu \
port:libusbmuxd
# Undefined symbols "_environ", referenced from: _t_initrand in libsrp6a-sha512.a(t_misc.o)
# Remove after a new release or accomodate it when updating the devel port
patch.pre_args-replace \
-p0 -p1
patchfiles 0001-libsrp6a-sha512-fix-environ-for-Apple.patch
pre-configure {
system -W ${worksrcpath} "echo ${version} > .tarball-version"
}
@@ -0,0 +1,26 @@
From 8d143c95a0ceb4e0bff3a33863349ec712662117 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <barracuda@macos-powerpc.org>
Date: Sun, 2 Nov 2025 11:14:38 +0800
Subject: [PATCH] libsrp6a-sha512: fix environ for Apple
---
3rd_party/libsrp6a-sha512/t_misc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/3rd_party/libsrp6a-sha512/t_misc.c b/3rd_party/libsrp6a-sha512/t_misc.c
index abd8e5571..34b9509ce 100644
--- a/3rd_party/libsrp6a-sha512/t_misc.c
+++ b/3rd_party/libsrp6a-sha512/t_misc.c
@@ -77,7 +77,12 @@ SHA1_CTX randctxt;
* tricks with variable ordering and sometimes define quirky
* environment variables like $WINDOWID or $_.
*/
+#ifdef __APPLE__
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
extern char ** environ;
+#endif
static void
t_envhash(unsigned char * out)