Skip to content

Commit 4ad5f76

Browse files
committed
wxgtk32, wip
1 parent f8fcecb commit 4ad5f76

16 files changed

+2708
-1
lines changed

_resources/port1.0/group/wxWidgets-1.0.tcl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ PortGroup compiler_blacklist_versions 1.0
174174
## - wxPython-3.0
175175
## - wxWidgets-3.0-cxx11
176176
## - wxWidgets-3.2
177+
## - wxGTK-3.2
178+
## - wxX11-3.2
177179
proc wxWidgets._set {option action args} {
178180
global prefix frameworks_dir os.major
179181
global wxWidgets.name wxWidgets.version wxWidgets.prefix wxWidgets.wxdir
@@ -279,9 +281,17 @@ proc wxWidgets._set {option action args} {
279281
return -code error "incompatible macOS version"
280282
}
281283
}
284+
} elseif {${args} eq "wxGTK-3.2"} {
285+
wxWidgets.name "wxGTK"
286+
wxWidgets.version "3.2"
287+
wxWidgets.port "wxgtk-3.2"
288+
} elseif {${args} eq "wxGTK-3.3"} {
289+
wxWidgets.name "wxGTK"
290+
wxWidgets.version "3.3"
291+
wxWidgets.port "wxgtk-devel"
282292
} else {
283293
# throw an error
284-
ui_error "invalid parameter for wxWidgets.use; use one of:\n\twxWidgets-2.8/wxGTK-2.8/wxWidgets-3.0/wxGTK-3.0/wxPython-3.0/wxWidgets-3.2"
294+
ui_error "invalid parameter for wxWidgets.use; use one of:\n\twxWidgets-2.8/wxGTK-2.8/wxWidgets-3.0/wxGTK-3.0/wxPython-3.0/wxWidgets-3.2/wxGTK-3.2/wxGTK-3.3"
285295
return -code return "invalid parameter for wxWidgets.use"
286296
}
287297
wxWidgets.prefix ${frameworks_dir}/wxWidgets.framework/Versions/${wxWidgets.name}/${wxWidgets.version}

graphics/wxgtk-3.2/Portfile

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# -*- 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
2+
3+
PortSystem 1.0
4+
PortGroup active_variants 1.1
5+
PortGroup cmake 1.1
6+
PortGroup github 1.0
7+
PortGroup legacysupport 1.1
8+
PortGroup select 1.0
9+
PortGroup wxWidgets 1.0
10+
11+
# strnlen
12+
legacysupport.newest_darwin_requires_legacy 10
13+
14+
# remember to bump version of wxWidgets-common
15+
github.setup wxWidgets wxWidgets 3.2.6 v
16+
github.tarball_from releases
17+
revision 0
18+
19+
name wxgtk-3.2
20+
21+
set installname wxGTK
22+
set wxtype gtk3
23+
wxWidgets.use wxGTK-3.2
24+
25+
set branch [join [lrange [split ${version} .] 0 1] .]
26+
27+
categories graphics devel
28+
license wxwidgets-3.1
29+
maintainers {@barracuda156 gmail.com:vital.had} openmaintainer
30+
31+
description C++ framework for cross-platform GUI development
32+
long_description wxWidgets ${branch} is an open-source cross-platform C++ \
33+
GUI framework for Mac OS, Unix, Linux, Windows.
34+
35+
homepage https://www.wxwidgets.org
36+
37+
distname wxWidgets-${version}
38+
use_bzip2 yes
39+
40+
checksums rmd160 d3563f36e842053eb1611e9bf532c3d6833bc0e8 \
41+
sha256 939e5b77ddc5b6092d1d7d29491fe67010a2433cf9b9c0d841ee4d04acb9dce7 \
42+
size 27528560
43+
44+
dist_subdir wxWidgets/${version}
45+
46+
set selectdir ${workpath}/select
47+
select.group wxWidgets
48+
select.file ${selectdir}/${subport}
49+
50+
compiler.c_standard 2011
51+
compiler.cxx_standard 2011
52+
compiler.thread_local_storage yes
53+
54+
depends_build-append \
55+
path:bin/pkg-config:pkgconfig
56+
57+
depends_lib-append path:lib/pkgconfig/cairo.pc:cairo \
58+
port:curl \
59+
port:expat \
60+
path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
61+
port:jbigkit \
62+
port:libGLU \
63+
port:libiconv \
64+
path:include/turbojpeg.h:libjpeg-turbo \
65+
port:libpng \
66+
port:libsdl2 \
67+
port:libsdl2_mixer \
68+
port:mesa \
69+
port:pcre2 \
70+
port:tiff \
71+
port:zlib
72+
73+
require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
74+
require_active_variants gtk3 x11
75+
76+
depends_run port:wxWidgets-common \
77+
port:wxWidgets_select
78+
79+
post-patch {
80+
file mkdir ${selectdir}
81+
system "echo \"${wxWidgets.wxdir}/wx-config\n${wxWidgets.wxdir}/wxrc-${branch}\" > ${select.file}"
82+
}
83+
84+
configure.args-append \
85+
-DCMAKE_INSTALL_PREFIX=${wxWidgets.prefix} \
86+
-DwxBUILD_COMPATIBILITY=3.0 \
87+
-DwxBUILD_MONOLITHIC=OFF \
88+
-DwxBUILD_OPTIMISE=ON \
89+
-DwxBUILD_SHARED=ON \
90+
-DwxBUILD_TESTS=OFF \
91+
-DwxCXX_STANDARD_DEFAULT=11 \
92+
-DwxBUILD_TOOLKIT=gtk3 \
93+
-DwxUSE_AUI=ON \
94+
-DwxUSE_CAIRO_DEFAULT=ON \
95+
-DwxUSE_COMPILER_TLS=ON \
96+
-DwxUSE_DEBUGREPORT=OFF \
97+
-DwxUSE_DISPLAY=ON \
98+
-DwxUSE_EXPAT=sys \
99+
-DwxUSE_GEOMETRY=ON \
100+
-DwxUSE_GLCANVAS_EGL=OFF \
101+
-DwxUSE_GUI=ON \
102+
-DwxUSE_HTML=ON \
103+
-DwxUSE_JOYSTICK=OFF \
104+
-DwxUSE_LIBICONV=sys \
105+
-DwxUSE_LIBJPEG=sys \
106+
-DwxUSE_LIBLZMA=OFF \
107+
-DwxUSE_LIBNOTIFY=OFF \
108+
-DwxUSE_LIBPNG=sys \
109+
-DwxUSE_LIBSDL=OFF \
110+
-DwxUSE_LIBTIFF=sys \
111+
-DwxUSE_MIMETYPE=ON \
112+
-DwxUSE_OPENGL=ON \
113+
-DwxUSE_POSTSCRIPT=ON \
114+
-DwxUSE_PRINTF_POS_PARAMS=ON \
115+
-DwxUSE_REGEX=sys \
116+
-DwxUSE_REPRODUCIBLE_BUILD=OFF \
117+
-DwxUSE_RICHTEXT=ON \
118+
-DwxUSE_SECRETSTORE=ON \
119+
-DwxUSE_SOCKETS=ON \
120+
-DwxUSE_SPELLCHECK=OFF \
121+
-DwxUSE_STC=OFF \
122+
-DwxUSE_STDPATHS=ON \
123+
-DwxUSE_THREADS=ON \
124+
-DwxUSE_UNICODE=ON \
125+
-DwxUSE_UNSAFE_WXSTRING_CONV=OFF \
126+
-DwxUSE_WEBREQUEST=ON \
127+
-DwxUSE_WEBREQUEST_CURL_DEFAULT=OFF \
128+
-DwxUSE_WEBREQUEST_URLSESSION=ON \
129+
-DwxUSE_WEBVIEW=OFF \
130+
-DwxUSE_XLOCALE=ON \
131+
-DwxUSE_XRC=ON \
132+
-DwxUSE_ZLIB=sys
133+
134+
# https://github.com/wxWidgets/wxWidgets/issues/23475
135+
platform darwin {
136+
patchfiles-append \
137+
0001-cfstring-fix.patch \
138+
0002-dirctrlg.cpp-fix.patch \
139+
0003-display-fix.patch \
140+
0004-mimetype-fix.patch \
141+
0005-evtloop_cf-fix.patch \
142+
0006-defs.h-fix.patch \
143+
0007-intl.cpp-fix.patch \
144+
0008-webrequest_urlsession.h-fix.patch \
145+
0009-utils_base.mm-fix.patch \
146+
0010-toolkit.cmake-fix-options.patch
147+
148+
if {${os.platform} < 16} {
149+
patchfiles-append \
150+
1001-Revert-Replace-deprecated-LSGetApplicationForInfo.patch \
151+
1002-Revert-Remove-Cocoa-type-declarations-from-wx-defs.h.patch \
152+
1003-Revert-some-breakages.patch \
153+
1004-utilsunx-no-memset_s.patch
154+
155+
configure.args-replace \
156+
-DwxBUILD_OPTIMISE=ON -DwxBUILD_OPTIMISE=OFF \
157+
-DwxUSE_STDPATHS=ON -DwxUSE_STDPATHS=OFF \
158+
-DwxUSE_WEBREQUEST_CURL_DEFAULT=OFF -DwxUSE_WEBREQUEST_CURL_DEFAULT=ON \
159+
-DwxUSE_WEBREQUEST_URLSESSION=ON -DwxUSE_WEBREQUEST_URLSESSION=OFF \
160+
-DwxUSE_XLOCALE=ON -DwxUSE_XLOCALE=OFF
161+
}
162+
163+
configure.ldflags-append \
164+
-undefined dynamic_lookup
165+
}
166+
167+
post-destroot {
168+
foreach dylib [ exec find ${destroot}${wxWidgets.prefix}/lib -name "\*.dylib" ] {
169+
regsub ":$" ${dylib} "" destroot_dylib_path
170+
regsub ${destroot} ${destroot_dylib_path} "" dylib_path
171+
system "install_name_tool -id ${dylib_path} ${destroot_dylib_path}"
172+
173+
system "install_name_tool -change ${prefix}/lib/libwx_baseu-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_baseu-3.2.0.dylib \
174+
${destroot_dylib_path}"
175+
system "install_name_tool -change ${prefix}/lib/libwx_baseu_net-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_baseu_net-3.2.0.dylib \
176+
${destroot_dylib_path}"
177+
system "install_name_tool -change ${prefix}/lib/libwx_baseu_xml-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_baseu_xml-3.2.0.dylib \
178+
${destroot_dylib_path}"
179+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_adv-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_adv-3.2.0.dylib \
180+
${destroot_dylib_path}"
181+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_aui-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_aui-3.2.0.dylib \
182+
${destroot_dylib_path}"
183+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_core-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_core-3.2.0.dylib \
184+
${destroot_dylib_path}"
185+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_gl-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_gl-3.2.0.dylib \
186+
${destroot_dylib_path}"
187+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_html-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_html-3.2.0.dylib \
188+
${destroot_dylib_path}"
189+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_media-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_media-3.2.0.dylib \
190+
${destroot_dylib_path}"
191+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_propgrid-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_propgrid-3.2.0.dylib \
192+
${destroot_dylib_path}"
193+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_ribbon-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_ribbon-3.2.0.dylib \
194+
${destroot_dylib_path}"
195+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_richtext-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_richtext-3.2.0.dylib \
196+
${destroot_dylib_path}"
197+
system "install_name_tool -change ${prefix}/lib/libwx_gtk3u_xrc-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_gtk3u_xrc-3.2.0.dylib \
198+
${destroot_dylib_path}"
199+
200+
system "install_name_tool -change ${prefix}/lib/libwx_baseu-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_baseu-3.2.0.dylib \
201+
${destroot}${wxWidgets.prefix}/bin/wxrc-3.2"
202+
system "install_name_tool -change ${prefix}/lib/libwx_baseu_xml-3.2.0.dylib ${wxWidgets.prefix}/lib/libwx_baseu_xml-3.2.0.dylib \
203+
${destroot}${wxWidgets.prefix}/bin/wxrc-3.2"
204+
}
205+
206+
set confscript ${wxWidgets.prefix}/lib/wx/config/${wxtype}-unicode-${branch}
207+
ln -sf ${confscript} ${destroot}${wxWidgets.prefix}/bin/wx-config
208+
}
209+
210+
github.livecheck.regex {([0-9.]+)}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
From b7de4ecbb3271f911a223b38826af59c3a8c8757 Mon Sep 17 00:00:00 2001
2+
From: Sergey Fedorov <[email protected]>
3+
Date: Fri, 26 Jul 2024 03:38:45 +0800
4+
Subject: [PATCH 01/10] cfstring: fix
5+
6+
---
7+
include/wx/osx/core/cfstring.h | 18 ++++++++++++++----
8+
src/osx/core/cfstring.cpp | 14 --------------
9+
2 files changed, 14 insertions(+), 18 deletions(-)
10+
11+
diff --git include/wx/osx/core/cfstring.h include/wx/osx/core/cfstring.h
12+
index 6468713139..c61ddcc463 100644
13+
--- include/wx/osx/core/cfstring.h
14+
+++ include/wx/osx/core/cfstring.h
15+
@@ -66,11 +66,10 @@ public:
16+
17+
static wxString AsString( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
18+
static wxString AsStringWithNormalizationFormC( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
19+
-#ifdef __WXMAC__
20+
+#ifdef __OBJC__
21+
static wxString AsString( WX_NSString ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
22+
static wxString AsStringWithNormalizationFormC( WX_NSString ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
23+
-#endif
24+
-#ifdef __OBJC__
25+
+
26+
WX_NSString AsNSString() const { return (WX_OSX_BRIDGE WX_NSString)(CFStringRef) *this; }
27+
#endif
28+
private:
29+
@@ -87,7 +86,7 @@ inline wxCFStringRef wxCFStringRefFromGet(CFStringRef p)
30+
return wxCFStringRef(wxCFRetain(p));
31+
}
32+
33+
-#ifdef __WXMAC__
34+
+#ifdef __OBJC__
35+
/*! @function wxCFStringRefFromGet
36+
@abstract Factory function to create wxCFStringRefRef from a NSString* obtained from a Get-rule function
37+
@param p The NSString pointer to retain and create a wxCFStringRefRef from. May be NULL.
38+
@@ -98,6 +97,17 @@ inline wxCFStringRef wxCFStringRefFromGet(NSString *p)
39+
{
40+
return wxCFStringRefFromGet((WX_OSX_BRIDGE CFStringRef)p);
41+
}
42+
+
43+
+inline wxString wxCFStringRef::AsString( NSString* ref, wxFontEncoding encoding )
44+
+{
45+
+ return AsString( (CFStringRef) ref, encoding );
46+
+}
47+
+
48+
+inline wxString wxCFStringRef::AsStringWithNormalizationFormC( NSString* ref, wxFontEncoding encoding )
49+
+{
50+
+ return AsStringWithNormalizationFormC( (CFStringRef) ref, encoding );
51+
+}
52+
+
53+
#endif
54+
55+
#endif //__WXCFSTRINGHOLDER_H__
56+
diff --git src/osx/core/cfstring.cpp src/osx/core/cfstring.cpp
57+
index 977b316282..288fdddf7a 100644
58+
--- src/osx/core/cfstring.cpp
59+
+++ src/osx/core/cfstring.cpp
60+
@@ -687,17 +687,3 @@ wxString wxCFStringRef::AsString(wxFontEncoding encoding) const
61+
{
62+
return AsString( get(), encoding );
63+
}
64+
-
65+
-#ifdef __WXMAC__
66+
-
67+
-wxString wxCFStringRef::AsString( NSString* ref, wxFontEncoding encoding )
68+
-{
69+
- return AsString( (CFStringRef) ref, encoding );
70+
-}
71+
-
72+
-wxString wxCFStringRef::AsStringWithNormalizationFormC( NSString* ref, wxFontEncoding encoding )
73+
-{
74+
- return AsStringWithNormalizationFormC( (CFStringRef) ref, encoding );
75+
-}
76+
-
77+
-#endif
78+
--
79+
2.45.2
80+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From f1d896c91f2e7ba09397da33fb9363cc493e6a89 Mon Sep 17 00:00:00 2001
2+
From: Sergey Fedorov <[email protected]>
3+
Date: Fri, 26 Jul 2024 11:45:25 +0800
4+
Subject: [PATCH 02/10] dirctrlg.cpp: fix
5+
6+
---
7+
src/generic/dirctrlg.cpp | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git src/generic/dirctrlg.cpp src/generic/dirctrlg.cpp
11+
index 364b0fc36c..f0295dc5aa 100644
12+
--- src/generic/dirctrlg.cpp
13+
+++ src/generic/dirctrlg.cpp
14+
@@ -98,7 +98,7 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI
15+
{
16+
#if defined(wxHAS_FILESYSTEM_VOLUMES) || defined(__APPLE__)
17+
18+
-#if (defined(__WIN32__) || defined(__WXOSX__)) && wxUSE_FSVOLUME
19+
+#if (defined(__WIN32__) || defined(__APPLE__)) && wxUSE_FSVOLUME
20+
// TODO: this code (using wxFSVolumeBase) should be used for all platforms
21+
// but unfortunately wxFSVolumeBase is not implemented everywhere
22+
const wxArrayString as = wxFSVolumeBase::GetVolumes();
23+
--
24+
2.45.2
25+

0 commit comments

Comments
 (0)