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

dcmtk: fix environ for macOS #27063

Merged
merged 1 commit into from
Dec 21, 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
7 changes: 5 additions & 2 deletions graphics/dcmtk/Portfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

Check warning on line 1 in graphics/dcmtk/Portfile

View workflow job for this annotation

GitHub Actions / macos-14

port test dcmtk-static: Warning: dcmtk-static is configured to build for the architecture(s) 'arm64', but did not install any Mach-O files.

Check warning on line 1 in graphics/dcmtk/Portfile

View workflow job for this annotation

GitHub Actions / macos-15

port test dcmtk-static: Warning: dcmtk-static is configured to build for the architecture(s) 'arm64', but did not install any Mach-O files.

Check warning on line 1 in graphics/dcmtk/Portfile

View workflow job for this annotation

GitHub Actions / macos-13

port test dcmtk-static: Warning: dcmtk-static is configured to build for the architecture(s) 'x86_64', but did not install any Mach-O files.

PortSystem 1.0
PortGroup active_variants 1.1
Expand Down Expand Up @@ -40,6 +40,9 @@
# avoid self-conflict
patchfiles install_path_fix_part2.patch

# https://github.com/DCMTK/dcmtk/pull/112
patchfiles-append 0001-ofstub.cc-fix-environ-for-Apple.patch

configure.cppflags-replace -I${prefix}/include -isystem${prefix}/include

depends_lib path:include/turbojpeg.h:libjpeg-turbo \
Expand All @@ -50,7 +53,7 @@
port:tiff \
port:zlib

depends_build-append port:pkgconfig
depends_build-append path:bin/pkg-config:pkgconfig

configure.args-append -DDCMTK_WITH_TIFF=ON \
-DDCMTK_WITH_OPENJPEG=OFF \
Expand Down Expand Up @@ -156,7 +159,7 @@
# builds and works only on 10.6 for ppc builds. Make sure
# this patch cannot be applied elsewhere, and also not used
# if legacy_dispatch is chosen.
patchfiles-append 0001-Revert-Fixed-OFSemaphore-for-macOS.patch
patchfiles-append 0002-Revert-Fixed-OFSemaphore-for-macOS.patch
}

default_variants +ssl
Expand Down
25 changes: 25 additions & 0 deletions graphics/dcmtk/files/0001-ofstub.cc-fix-environ-for-Apple.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 881965da18dee93aa38570a0d2fe292c37365bd8 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Fri, 13 Dec 2024 17:03:57 +0800
Subject: [PATCH] ofstub.cc: fix environ for Apple

---
ofstd/libsrc/ofstub.cc | 5 +++++
1 file changed, 5 insertions(+)

diff --git ofstd/libsrc/ofstub.cc ofstd/libsrc/ofstub.cc
index c1df7068e..bba147e26 100644
--- ofstd/libsrc/ofstub.cc
+++ ofstd/libsrc/ofstub.cc
@@ -141,6 +141,11 @@ static OFString getLastErrorString()
return OFString();
}

+#elif defined(__APPLE__)
+
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+
#else /* _WIN32 */

extern char** environ; // required to exist by the Single Unix Specification
29 changes: 0 additions & 29 deletions graphics/dcmtk/files/patch-fix-powerpc.diff

This file was deleted.