pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wxGTK32: add macOS support, from dbj%NetBSD.org@localhost



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%gatalith.at@localhost>
Pushed By:	wiz
Date:		Thu Jul 21 12:35:41 2022 +0200
Changeset:	ba30f8a143fa00a776a915a6406e7573855156b3

Modified Files:
	wxGTK32/Makefile
	wxGTK32/PLIST
	wxGTK32/distinfo
	wxGTK32/patches/patch-build_cmake_setup.cmake
Added Files:
	wxGTK32/PLIST.Darwin
	wxGTK32/PLIST.gtk3
	wxGTK32/patches/patch-src_unix_utilsunx.cpp

Log Message:
wxGTK32: add macOS support, from dbj%NetBSD.org@localhost

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ba30f8a143fa00a776a915a6406e7573855156b3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 wxGTK32/Makefile                              | 37 +++++++++++++----------
 wxGTK32/PLIST                                 |  3 --
 wxGTK32/PLIST.Darwin                          | 42 +++++++++++++++++++++++++++
 wxGTK32/PLIST.gtk3                            |  4 +++
 wxGTK32/distinfo                              |  3 +-
 wxGTK32/patches/patch-build_cmake_setup.cmake | 33 ++++++++++++++-------
 wxGTK32/patches/patch-src_unix_utilsunx.cpp   | 38 ++++++++++++++++++++++++
 7 files changed, 130 insertions(+), 30 deletions(-)

diffs:
diff --git a/wxGTK32/Makefile b/wxGTK32/Makefile
index 3feed16d25..3cb3a20ea4 100644
--- a/wxGTK32/Makefile
+++ b/wxGTK32/Makefile
@@ -19,25 +19,31 @@ USE_CMAKE=		yes
 USE_LANGUAGES=		c c++
 CMAKE_ARGS+=		-DCMAKE_DISABLE_PRECOMPILE_HEADERS:BOOL=ON
 
-TO_UNWRAP=	${WRKSRC}/lib/wx/config/gtk3-unicode-3.2
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} != "Darwin"
+WX_CONFIG=		lib/wx/config/gtk3-unicode-3.2
+.else
+WX_CONFIG=		lib/wx/config/osx_cocoa-unicode-3.2
+.endif
 
 # Installation rules in cmake are not using DESTDIR properly, do it manually
 # https://github.com/wxWidgets/wxWidgets/issues/22647
 # CMake Error: failed to create symbolic link '/usr/pkg/bin/wx-config': Permission denied
 # CMake Error: failed to create symbolic link '/usr/pkg/bin/wxrc': Permission denied
 post-install:
-	cd ${DESTDIR}${PREFIX}/bin && ${LN} -s ../lib/wx/config/gtk3-unicode-3.2 wx-config
-	cd ${DESTDIR}${PREFIX}/bin && ${LN} -s wxrc-3.2 wxrc
-post-build:
-	${SED} -e "s,EGREP=.*,EGREP=${EGREP}," \
-		-e 's/echo.*cc\"/echo \"${CC}\"/' \
-		-e 's/echo.*c\+\+\"/echo \"${CXX}\"/' \
-		-e 's/echo.*c\+\+\ -o\"/echo \"${CXX} -o\"/' \
-		${TO_UNWRAP} > ${TO_UNWRAP}.new && \
-	${MV} ${TO_UNWRAP}.new ${TO_UNWRAP} && \
-	${CHMOD} 755 ${TO_UNWRAP}
+	cd ${DESTDIR}${PREFIX}/bin && [ -L wx-config ] || ${LN} -s ../${WX_CONFIG} wx-config
+	cd ${DESTDIR}${PREFIX}/bin && [ -L wxrc ] || ${LN} -s wxrc-3.2 wxrc
 
-.include "../../mk/bsd.prefs.mk"
+SUBST_CLASSES+=		unwrap
+SUBST_STAGE.unwrap=	post-build
+SUBST_FILES.unwrap=	${WX_CONFIG}
+SUBST_SED.unwrap=	-e "s,EGREP=.*,EGREP=${EGREP},"
+SUBST_SED.unwrap+=	-e 's,echo.*/${CC}",echo "${CC}",'
+SUBST_SED.unwrap+=	-e 's,echo.*/${CXX}",echo "${CXX}",'
+SUBST_SED.unwrap+=	-e 's,echo.*/${CXX} -o",echo "${CXX} -o",'
+
+PLIST_SRC+=	${PLIST_SRC_DFLT}
 
 # https://github.com/wxWidgets/wxWidgets/issues/22646
 .if ${OPSYS} != "Linux"
@@ -47,6 +53,10 @@ CMAKE_ARGS+=		-DwxUSE_JOYSTICK:BOOL=OFF
 .if ${OPSYS} != "Darwin"
 .include "../../sysutils/libnotify/buildlink3.mk"
 .include "../../x11/gtk3/buildlink3.mk"
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../textproc/gspell/buildlink3.mk"
+.include "../../www/webkit-gtk/buildlink3.mk"
+PLIST_SRC+=	PLIST.gtk3
 .endif
 
 .include "../../archivers/libmspack/buildlink3.mk"
@@ -55,7 +65,6 @@ CMAKE_ARGS+=		-DwxUSE_JOYSTICK:BOOL=OFF
 .include "../../devel/glib2/buildlink3.mk"
 .include "../../devel/pcre2/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
-.include "../../graphics/MesaLib/buildlink3.mk"
 .include "../../devel/SDL2/buildlink3.mk"
 .include "../../graphics/png/buildlink3.mk"
 .include "../../graphics/tiff/buildlink3.mk"
@@ -66,10 +75,8 @@ CMAKE_ARGS+=		-DwxUSE_JOYSTICK:BOOL=OFF
 .include "../../multimedia/gst-plugins1-base/buildlink3.mk"
 .include "../../security/libsecret/buildlink3.mk"
 .include "../../textproc/expat/buildlink3.mk"
-.include "../../textproc/gspell/buildlink3.mk"
 # curl not checked by cmake but used by webrequest_curl.h
 # https://github.com/wxWidgets/wxWidgets/issues/22648
 .include "../../www/curl/buildlink3.mk"
-.include "../../www/webkit-gtk/buildlink3.mk"
 .include "../../mk/dlopen.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/wxGTK32/PLIST b/wxGTK32/PLIST
index 0ac6241874..8f8dbcc15f 100644
--- a/wxGTK32/PLIST
+++ b/wxGTK32/PLIST
@@ -1558,6 +1558,3 @@ lib/libwx_gtk3u_webview-3.2.so.0.0.0
 lib/libwx_gtk3u_xrc-3.2.so
 lib/libwx_gtk3u_xrc-3.2.so.0
 lib/libwx_gtk3u_xrc-3.2.so.0.0.0
-lib/wx/3.2/web-extensions/webkit2_extu-3.2.so
-lib/wx/config/gtk3-unicode-3.2
-lib/wx/include/gtk3-unicode-3.2/wx/setup.h
diff --git a/wxGTK32/PLIST.Darwin b/wxGTK32/PLIST.Darwin
new file mode 100644
index 0000000000..2a330b2d3a
--- /dev/null
+++ b/wxGTK32/PLIST.Darwin
@@ -0,0 +1,42 @@
+@comment $NetBSD$
+lib/libwx_osx_cocoau_adv-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_adv-3.2.0.dylib
+lib/libwx_osx_cocoau_adv-3.2.dylib
+lib/libwx_osx_cocoau_aui-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_aui-3.2.0.dylib
+lib/libwx_osx_cocoau_aui-3.2.dylib
+lib/libwx_osx_cocoau_core-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_core-3.2.0.dylib
+lib/libwx_osx_cocoau_core-3.2.dylib
+lib/libwx_osx_cocoau_gl-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_gl-3.2.0.dylib
+lib/libwx_osx_cocoau_gl-3.2.dylib
+lib/libwx_osx_cocoau_html-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_html-3.2.0.dylib
+lib/libwx_osx_cocoau_html-3.2.dylib
+lib/libwx_osx_cocoau_media-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_media-3.2.0.dylib
+lib/libwx_osx_cocoau_media-3.2.dylib
+lib/libwx_osx_cocoau_propgrid-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_propgrid-3.2.0.dylib
+lib/libwx_osx_cocoau_propgrid-3.2.dylib
+lib/libwx_osx_cocoau_qa-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_qa-3.2.0.dylib
+lib/libwx_osx_cocoau_qa-3.2.dylib
+lib/libwx_osx_cocoau_ribbon-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_ribbon-3.2.0.dylib
+lib/libwx_osx_cocoau_ribbon-3.2.dylib
+lib/libwx_osx_cocoau_richtext-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_richtext-3.2.0.dylib
+lib/libwx_osx_cocoau_richtext-3.2.dylib
+lib/libwx_osx_cocoau_stc-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_stc-3.2.0.dylib
+lib/libwx_osx_cocoau_stc-3.2.dylib
+lib/libwx_osx_cocoau_webview-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_webview-3.2.0.dylib
+lib/libwx_osx_cocoau_webview-3.2.dylib
+lib/libwx_osx_cocoau_xrc-3.2.0.0.0.dylib
+lib/libwx_osx_cocoau_xrc-3.2.0.dylib
+lib/libwx_osx_cocoau_xrc-3.2.dylib
+lib/wx/config/osx_cocoa-unicode-3.2
+lib/wx/include/osx_cocoa-unicode-3.2/wx/setup.h
diff --git a/wxGTK32/PLIST.gtk3 b/wxGTK32/PLIST.gtk3
new file mode 100644
index 0000000000..342d1b07cd
--- /dev/null
+++ b/wxGTK32/PLIST.gtk3
@@ -0,0 +1,4 @@
+@comment $NetBSD$
+lib/wx/3.2/web-extensions/webkit2_extu-3.2.so
+lib/wx/config/gtk3-unicode-3.2
+lib/wx/include/gtk3-unicode-3.2/wx/setup.h
diff --git a/wxGTK32/distinfo b/wxGTK32/distinfo
index 245b09fc85..a17aa98e83 100644
--- a/wxGTK32/distinfo
+++ b/wxGTK32/distinfo
@@ -5,5 +5,6 @@ SHA512 (wxWidgets-3.2.0.tar.bz2) = e55e7c5ac7abcacf2ecff7c22e367db17ff5a077d3d5d
 Size (wxWidgets-3.2.0.tar.bz2) = 25296814 bytes
 SHA1 (patch-build_cmake_init.cmake) = 5b203660ee4c1376b2d8083be73fdcd0c1d09833
 SHA1 (patch-build_cmake_lib_base_CMakeLists.txt) = bec7be2f64bb4629a60d2b4f169e8feb215408e3
-SHA1 (patch-build_cmake_setup.cmake) = a3d99b0363a17ac80083126e1ccb1b8a9d29d679
+SHA1 (patch-build_cmake_setup.cmake) = 277ae3c5bf4f04d057402f0b626d09d1e9749ca8
 SHA1 (patch-src_unix_dialup.cpp) = 1c62d37508e45a0095ef062f7d450529e9b557e7
+SHA1 (patch-src_unix_utilsunx.cpp) = be61cc3931e8aa8cf790cfedf6f916a84970f074
diff --git a/wxGTK32/patches/patch-build_cmake_setup.cmake b/wxGTK32/patches/patch-build_cmake_setup.cmake
index 25b8a9a607..aa33d13195 100644
--- a/wxGTK32/patches/patch-build_cmake_setup.cmake
+++ b/wxGTK32/patches/patch-build_cmake_setup.cmake
@@ -17,10 +17,13 @@ https://github.com/wxWidgets/wxWidgets/pull/22644
      wx_check_c_source_compiles("
          return 0; }
          #if defined(__BSD__)
-@@ -308,6 +308,18 @@ if(UNIX)
+@@ -308,9 +308,23 @@ if(UNIX)
          l += fs.f_blocks;
          l += fs.f_bavail;"
          HAVE_STATFS)
+-    if(HAVE_STATFS)
+-        set(WX_STATFS_T "struct statfs")
+-        wx_check_cxx_source_compiles("
 +    wx_check_c_source_compiles("
 +        return 0; }
 +        #include <sys/statvfs.h>
@@ -33,21 +36,29 @@ https://github.com/wxWidgets/wxWidgets/pull/22644
 +        l += fs.f_blocks;
 +        l += fs.f_bavail;"
 +        HAVE_STATVFS)
-     if(HAVE_STATFS)
-         set(WX_STATFS_T "struct statfs")
-         wx_check_cxx_source_compiles("
-@@ -324,9 +336,8 @@ if(UNIX)
++    if(HAVE_STATVFS)
++      set(WX_STATFS_T "struct statvfs")
++    elseif(HAVE_STATFS)
++      set(WX_STATFS_T "struct statfs")
++      wx_check_cxx_source_compiles("
+             return 0; }
+             #if defined(__BSD__)
+             #include <sys/param.h>
+@@ -322,12 +336,7 @@ if(UNIX)
+             int foo() {
+             struct statfs fs;
              statfs(\"/\", &fs);"
-             HAVE_STATFS_DECL)
-     else()
+-            HAVE_STATFS_DECL)
+-    else()
 -        # TODO: implement statvfs checks
-         if(HAVE_STATVFS)
+-        if(HAVE_STATVFS)
 -            set(WX_STATFS_T statvfs_t)
-+            set(WX_STATFS_T "struct statvfs")
-         endif()
+-        endif()
++        HAVE_STATFS_DECL)
      endif()
  
-@@ -611,7 +622,7 @@ if(wxUSE_DATETIME)
+     if(NOT HAVE_STATFS AND NOT HAVE_STATVFS)
+@@ -611,7 +620,7 @@ if(wxUSE_DATETIME)
  endif()
  
  cmake_push_check_state(RESET)
diff --git a/wxGTK32/patches/patch-src_unix_utilsunx.cpp b/wxGTK32/patches/patch-src_unix_utilsunx.cpp
new file mode 100644
index 0000000000..6f90ef1479
--- /dev/null
+++ b/wxGTK32/patches/patch-src_unix_utilsunx.cpp
@@ -0,0 +1,38 @@
+$NetBSD$
+
+cmake: prefer statvfs (to statfs)
+https://github.com/wxWidgets/wxWidgets/pull/22643
+
+--- src/unix/utilsunx.cpp.orig	2022-07-06 14:19:50.000000000 +0000
++++ src/unix/utilsunx.cpp
+@@ -85,7 +85,11 @@
+ // different platforms and even different versions of the same system (Solaris
+ // 7 and 8): if you want to test for this, don't forget that the problems only
+ // appear if the large files support is enabled
+-#ifdef HAVE_STATFS
++#if defined(HAVE_STATVFS)
++    #include <sys/statvfs.h>
++
++    #define wxStatfs statvfs
++#elif defined(HAVE_STATFS)
+     #ifdef __BSD__
+         #include <sys/param.h>
+         #include <sys/mount.h>
+@@ -99,15 +103,9 @@
+         // some systems lack statfs() prototype in the system headers (AIX 4)
+         extern "C" int statfs(const char *path, struct statfs *buf);
+     #endif
+-#endif // HAVE_STATFS
+-
+-#ifdef HAVE_STATVFS
+-    #include <sys/statvfs.h>
+-
+-    #define wxStatfs statvfs
+-#endif // HAVE_STATVFS
++#endif // HAVE_STATVFS/HAVE_STATFS
+ 
+-#if defined(HAVE_STATFS) || defined(HAVE_STATVFS)
++#if defined(HAVE_STATVFS) || defined(HAVE_STATFS)
+     // WX_STATFS_T is detected by configure
+     #define wxStatfs_t WX_STATFS_T
+ #endif


Home | Main Index | Thread Index | Old Index