From 4623d4a68af9a14c55b1e2be15f5513af64d5fdd Mon Sep 17 00:00:00 2001 From: sth0 Date: Wed, 3 Jan 2024 19:11:31 -0500 Subject: [PATCH 1/5] Patch ATSFont calls to CGFont calls, update gcc11 to gcc12 --- .../stable/main/finkinfo/sci/r-base41.info | 9 +- .../stable/main/finkinfo/sci/r-base41.patch | 172 ++++++++++++++++-- 2 files changed, 161 insertions(+), 20 deletions(-) diff --git a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info index 88a40a1fba..c9d133bc68 100644 --- a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info +++ b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info @@ -1,7 +1,7 @@ Info2: << Package: r-base41 Version: 4.1.1 -Revision: 3 +Revision: 4 Description: R Framework Type: rversion (4.1) Maintainer: BABA Yoshihiko @@ -17,7 +17,7 @@ BuildDepends: << cairo (>= 1.12.14-1), fink (>= 0.30.0), glib2-dev (>= 2.22.0-1), - gcc11-compiler, + gcc12-compiler, libcurl4, libgettext8-dev, libiconv-dev, @@ -41,12 +41,11 @@ BuildDepends: << Source: http://cran.r-project.org/src/base/R-4/R-%v.tar.gz Source-Checksum: SHA256(515e03265752257d0b7036f380f82e42b46ed8473f54f25c7b67ed25bbbdd364) PatchFile: %n.patch -PatchFile-MD5: da609bf1e8f5a5e069b06e368a2aa98b +PatchFile-Checksum: SHA256(505d7185c5b0d70b434c3a8259a1830d84125a571ffc83865fb2b439d985ce91) PatchScript: << #!/bin/sh -ev #sed 's|@PREFIX@|%p|g' < %{PatchFile} | patch -p1 %{default_script} - # .po files not treated during CompileScript # perl -pi -e 's/R-devel.rpm/%N-dev by Fink/g' src/library/tools/po/R-*.po perl -pi -e 's/R-devel.rpm/%N-dev by Fink/' src/library/tools/R/install.R @@ -197,7 +196,7 @@ SplitOff: << bzip2, bzip2-shlibs, cairo-shlibs (>= 1.12.14-1), - gcc11-shlibs, + gcc12-shlibs, glib2-shlibs (>= 2.22.0-1), gzip, libcurl4-shlibs, diff --git a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.patch b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.patch index b626080edf..b2e0bc44dc 100644 --- a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.patch +++ b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.patch @@ -1,6 +1,6 @@ -diff -ruN R-4.1.0-orig/Makefile.fw R-4.1.0/Makefile.fw ---- R-4.1.0-orig/Makefile.fw 2021-08-06 09:00:56.000000000 +0900 -+++ R-4.1.0/Makefile.fw 2021-08-06 11:40:37.000000000 +0900 +diff -ruN R-4.1.1-orig/Makefile.fw R-4.1.1/Makefile.fw +--- R-4.1.1-orig/Makefile.fw 2023-12-01 18:46:07 ++++ R-4.1.1/Makefile.fw 2023-12-01 18:46:47 @@ -8,7 +8,7 @@ install install-strip: install-R-framework @@ -19,9 +19,9 @@ diff -ruN R-4.1.0-orig/Makefile.fw R-4.1.0/Makefile.fw @( otool=otool ; if otool -D "$(DESTDIR)$(Rexeclibdir)/libR.dylib"|grep 'not an object'>/dev/null; then otool=otool64; fi; \ for lib in Rlapack Rblas R; do \ if test -e "$(DESTDIR)$(Rexeclibdir)/lib$${lib}.dylib"; then $(ECHO) " lib$${lib}"; \ -diff -Nurd R-4.1.1.orig/configure R-4.1.1/configure ---- R-4.1.1.orig/configure 2021-08-02 18:15:58.000000000 -0400 -+++ R-4.1.1/configure 2023-10-14 01:08:54.000000000 -0400 +diff -ruN R-4.1.1-orig/configure R-4.1.1/configure +--- R-4.1.1-orig/configure 2023-12-01 18:46:06 ++++ R-4.1.1/configure 2023-12-01 18:46:47 @@ -3915,8 +3915,8 @@ ## As from R 3.2.0 split up -L... and -lR @@ -71,9 +71,9 @@ diff -Nurd R-4.1.1.orig/configure R-4.1.1/configure #elif LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 28 exit(0); #else -diff -ruN R-4.1.0-orig/src/extra/intl/vasnprintf.c R-4.1.0/src/extra/intl/vasnprintf.c ---- R-4.1.0-orig/src/extra/intl/vasnprintf.c 2021-08-06 09:00:56.000000000 +0900 -+++ R-4.1.0/src/extra/intl/vasnprintf.c 2021-08-06 11:40:37.000000000 +0900 +diff -ruN R-4.1.1-orig/src/extra/intl/vasnprintf.c R-4.1.1/src/extra/intl/vasnprintf.c +--- R-4.1.1-orig/src/extra/intl/vasnprintf.c 2023-12-01 18:46:07 ++++ R-4.1.1/src/extra/intl/vasnprintf.c 2023-12-01 18:46:47 @@ -4006,7 +4006,7 @@ #endif *fbp = dp->conversion; @@ -83,9 +83,151 @@ diff -ruN R-4.1.0-orig/src/extra/intl/vasnprintf.c R-4.1.0/src/extra/intl/vasnpr fbp[1] = '%'; fbp[2] = 'n'; fbp[3] = '\0'; -diff -ruN R-4.1.0-orig/src/main/Makefile.in R-4.1.0/src/main/Makefile.in ---- R-4.1.0-orig/src/main/Makefile.in 2021-08-06 09:01:04.000000000 +0900 -+++ R-4.1.0/src/main/Makefile.in 2021-08-06 17:09:48.000000000 +0900 +diff -ruN R-4.1.1-orig/src/library/grDevices/src/devQuartz.c R-4.1.1/src/library/grDevices/src/devQuartz.c +--- R-4.1.1-orig/src/library/grDevices/src/devQuartz.c 2023-12-01 18:46:07 ++++ R-4.1.1/src/library/grDevices/src/devQuartz.c 2023-12-01 18:48:22 +@@ -558,10 +558,10 @@ + + #pragma mark Quartz Font Cache + +-/* Font lookup is expesive yet frequent. Therefore we cache all used ATS fonts (which are global to the app). */ ++/* Font lookup is expesive yet frequent. Therefore we cache all used CG fonts (which are global to the app). */ + + typedef struct font_cache_entry_s { +- ATSFontRef font; ++ CGFontRef font; + char *family; + int face; + } font_cache_entry_t; +@@ -576,7 +576,7 @@ + + font_cache_t font_cache, *font_cache_tail = &font_cache; + +-static ATSFontRef RQuartz_CacheGetFont(const char *family, int face) { ++static CGFontRef RQuartz_CacheGetFont(const char *family, int face) { + font_cache_t *fc = &font_cache; + while (fc) { + int i = 0, j = fc->fonts; +@@ -590,7 +590,7 @@ + return 0; + } + +-static void RQuartz_CacheAddFont(const char *family, int face, ATSFontRef font) { ++static void RQuartz_CacheAddFont(const char *family, int face, CGFontRef font) { + if (font_cache_tail->fonts >= max_fonts_per_block) + font_cache_tail = font_cache_tail->next = (font_cache_t*) calloc(1, sizeof(font_cache_t)); + { +@@ -646,7 +646,7 @@ + CGFontRef RQuartz_Font(CTXDESC) + { + const char *fontName = NULL, *fontFamily = gc->fontfamily; +- ATSFontRef atsFont = 0; ++ CGFontRef cgFont = 0; + int fontFace = gc->fontface; + if (fontFace < 1 || fontFace > 5) fontFace = 1; /* just being paranoid */ + if (fontFace == 5) +@@ -654,25 +654,23 @@ + else + fontName = RQuartz_LookUpFontName(fontFace, fontFamily[0] ? fontFamily : "default"); + if (fontName) { +- atsFont = RQuartz_CacheGetFont(fontName, 0); /* face is 0 because we are passing a true font name */ +- if (!atsFont) { /* not in the cache, get it */ ++ cgFont = RQuartz_CacheGetFont(fontName, 0); /* face is 0 because we are passing a true font name */ ++ if (!cgFont) { /* not in the cache, get it */ + CFStringRef cfFontName = CFStringCreateWithCString(NULL, fontName, kCFStringEncodingUTF8); +- atsFont = ATSFontFindFromName(cfFontName, kATSOptionFlagsDefault); +- if (!atsFont) +- atsFont = ATSFontFindFromPostScriptName(cfFontName, kATSOptionFlagsDefault); ++ cgFont = CGFontCreateWithFontName(cfFontName); + CFRelease(cfFontName); +- if (!atsFont) { ++ if (!cgFont) { + warning(_("font \"%s\" could not be found for family \"%s\""), fontName, fontFamily); + return NULL; + } +- RQuartz_CacheAddFont(fontName, 0, atsFont); ++ RQuartz_CacheAddFont(fontName, 0, cgFont); + } + } else { /* the real font name could not be looked up. We must use cache and/or find the right font by family and face */ + if (!fontFamily[0]) fontFamily = "Arial"; + /* Arial is the default, because Helvetica doesn't have Oblique + on 10.4 - maybe change later? */ +- atsFont = RQuartz_CacheGetFont(fontFamily, fontFace); +- if (!atsFont) { /* not in the cache? Then we need to find the ++ cgFont = RQuartz_CacheGetFont(fontFamily, fontFace); ++ if (!cgFont) { /* not in the cache? Then we need to find the + proper font name from the family name and face */ + /* as it turns out kATSFontFilterSelectorFontFamily is not + implemented in macOS (!!) so there is no way to query for a +@@ -681,25 +679,24 @@ + char compositeFontName[256]; + /* CFStringRef cfFontName; */ + if (strlen(fontFamily) > 210) error(_("font family name is too long")); +- while (!atsFont) { /* try different faces until exhausted or successful */ ++ while (!cgFont) { /* try different faces until exhausted or successful */ + strcpy(compositeFontName, fontFamily); + if (fontFace == 2 || fontFace == 4) strcat(compositeFontName, " Bold"); + if (fontFace == 3 || fontFace == 4) strcat(compositeFontName, " Italic"); + CFStringRef cfFontName = CFStringCreateWithCString(NULL, compositeFontName, kCFStringEncodingUTF8); +- atsFont = ATSFontFindFromName(cfFontName, kATSOptionFlagsDefault); +- if (!atsFont) atsFont = ATSFontFindFromPostScriptName(cfFontName, kATSOptionFlagsDefault); ++ cgFont = CGFontCreateWithFontName(cfFontName); + CFRelease(cfFontName); +- if (!atsFont) { ++ if (!cgFont) { + if (fontFace == 1) { /* more guessing - fontFace == 1 may need Regular or Roman */ + strcat(compositeFontName," Regular"); + cfFontName = CFStringCreateWithCString(NULL, compositeFontName, kCFStringEncodingUTF8); +- atsFont = ATSFontFindFromName(cfFontName, kATSOptionFlagsDefault); ++ cgFont = CGFontCreateWithFontName(cfFontName); + CFRelease(cfFontName); +- if (!atsFont) { ++ if (!cgFont) { + strcpy(compositeFontName, fontFamily); + strcat(compositeFontName," Roman"); + cfFontName = CFStringCreateWithCString(NULL, compositeFontName, kCFStringEncodingUTF8); +- atsFont = ATSFontFindFromName(cfFontName, kATSOptionFlagsDefault); ++ cgFont = CGFontCreateWithFontName(cfFontName); + CFRelease(cfFontName); + } + } else if (fontFace == 3 || fontFace == 4) { /* Oblique is sometimes used instead of Italic (e.g. in Helvetica) */ +@@ -707,26 +704,26 @@ + if (fontFace == 4) strcat(compositeFontName, " Bold"); + strcat(compositeFontName," Oblique"); + cfFontName = CFStringCreateWithCString(NULL, compositeFontName, kCFStringEncodingUTF8); +- atsFont = ATSFontFindFromName(cfFontName, kATSOptionFlagsDefault); ++ cgFont = CGFontCreateWithFontName(cfFontName); + CFRelease(cfFontName); + } + } +- if (!atsFont) { /* try to fall back to a more plain face */ ++ if (!cgFont) { /* try to fall back to a more plain face */ + if (fontFace == 4) fontFace = 2; + else if (fontFace != 1) fontFace = 1; + else break; +- atsFont = RQuartz_CacheGetFont(fontFamily, fontFace); +- if (atsFont) break; ++ cgFont = RQuartz_CacheGetFont(fontFamily, fontFace); ++ if (cgFont) break; + } + } +- if (!atsFont) ++ if (!cgFont) + warning(_("no font could be found for family \"%s\""), fontFamily); + else +- RQuartz_CacheAddFont(fontFamily, fontFace, atsFont); ++ RQuartz_CacheAddFont(fontFamily, fontFace, cgFont); + } + } + +- return CGFontCreateWithPlatformFont(&atsFont); ++ return cgFont; + } + + #define RQUARTZ_FILL (1) +diff -ruN R-4.1.1-orig/src/main/Makefile.in R-4.1.1/src/main/Makefile.in +--- R-4.1.1-orig/src/main/Makefile.in 2023-12-01 18:46:07 ++++ R-4.1.1/src/main/Makefile.in 2023-12-01 18:46:47 @@ -102,7 +102,7 @@ R_bin_OBJECTS = Rmain.o @WANT_R_SHLIB_FALSE@$(OBJECTS) @WANT_R_SHLIB_FALSE@R_bin_LDADD = $(MAIN_OBJS) $(EXTRA_STATIC_LIBS) $(EXTRA_LIBS) @@ -95,9 +237,9 @@ diff -ruN R-4.1.0-orig/src/main/Makefile.in R-4.1.0/src/main/Makefile.in ## This should depend on MAIN_OBJS not MAIN_LIBS, but we can't use that. ## There is also a dependence on libRblas when that is internal and static. @WANT_R_SHLIB_FALSE@R_bin_DEPENDENCIES = $(MAIN_LIBS) $(EXTRA_STATIC_LIBS)@USE_EXPORTFILES_TRUE@ $(top_builddir)/etc/R.exp -diff -ruN R-4.1.0-orig/src/nmath/standalone/Makefile.in R-4.1.0/src/nmath/standalone/Makefile.in ---- R-4.1.0-orig/src/nmath/standalone/Makefile.in 2021-08-06 09:01:05.000000000 +0900 -+++ R-4.1.0/src/nmath/standalone/Makefile.in 2021-08-06 11:40:37.000000000 +0900 +diff -ruN R-4.1.1-orig/src/nmath/standalone/Makefile.in R-4.1.1/src/nmath/standalone/Makefile.in +--- R-4.1.1-orig/src/nmath/standalone/Makefile.in 2023-12-01 18:46:07 ++++ R-4.1.1/src/nmath/standalone/Makefile.in 2023-12-01 18:46:47 @@ -134,7 +134,7 @@ test: $(srcdir)/test.c From 7ae51e7178ca835e0066121776929a3b923eda4a Mon Sep 17 00:00:00 2001 From: sth0 Date: Fri, 5 Jan 2024 22:36:15 -0500 Subject: [PATCH 2/5] Regress to gcc11 for compatibility with R modules --- 10.9-libcxx/stable/main/finkinfo/sci/r-base41.info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info index c9d133bc68..4531d5678e 100644 --- a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info +++ b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info @@ -17,7 +17,7 @@ BuildDepends: << cairo (>= 1.12.14-1), fink (>= 0.30.0), glib2-dev (>= 2.22.0-1), - gcc12-compiler, + gcc11-compiler, libcurl4, libgettext8-dev, libiconv-dev, @@ -196,7 +196,7 @@ SplitOff: << bzip2, bzip2-shlibs, cairo-shlibs (>= 1.12.14-1), - gcc12-shlibs, + gcc11-shlibs, glib2-shlibs (>= 2.22.0-1), gzip, libcurl4-shlibs, From cc146d73f1e75e4ae4662dad5aded9f63c4fc1f6 Mon Sep 17 00:00:00 2001 From: sth0 Date: Fri, 5 Jan 2024 22:38:34 -0500 Subject: [PATCH 3/5] Bump revision number --- 10.9-libcxx/stable/main/finkinfo/sci/r-base41.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info index 4531d5678e..4b2a1f7269 100644 --- a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info +++ b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info @@ -1,7 +1,7 @@ Info2: << Package: r-base41 Version: 4.1.1 -Revision: 4 +Revision: 5 Description: R Framework Type: rversion (4.1) Maintainer: BABA Yoshihiko From cdb8fa463aed1746d1907d0efebdab3ed0660c63 Mon Sep 17 00:00:00 2001 From: sth0 Date: Fri, 5 Jan 2024 22:38:34 -0500 Subject: [PATCH 4/5] Bump revision number --- 10.9-libcxx/stable/main/finkinfo/sci/r-base41.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info index 4531d5678e..4b2a1f7269 100644 --- a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info +++ b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info @@ -1,7 +1,7 @@ Info2: << Package: r-base41 Version: 4.1.1 -Revision: 4 +Revision: 5 Description: R Framework Type: rversion (4.1) Maintainer: BABA Yoshihiko From 3dcbaa07a0465b95172af865df8851c7f3d9869d Mon Sep 17 00:00:00 2001 From: sth0 Date: Mon, 22 Jan 2024 19:43:22 -0500 Subject: [PATCH 5/5] Added referenced for patch from ATSFontXX to CGFontXX calls. Removed reference to PCRE1 which is not part of this version build. --- 10.9-libcxx/stable/main/finkinfo/sci/r-base41.info | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info index 4b2a1f7269..454e56650b 100644 --- a/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info +++ b/10.9-libcxx/stable/main/finkinfo/sci/r-base41.info @@ -359,12 +359,13 @@ Prevent configure script from detecting new support for utimensat and clock_gettime to avoid datetime.Rout failing in testsuite. Likewise avoid detecting working mktime to prevent failure in reg-tests-1d.Rout. -PCRE1 is preferred to PCRE2 as of 2019-01-14 for R 3.6.0. See: -https://cran.r-project.org/doc/manuals/r-devel/R-admin.html -Depends both on libpcre1 and libpcre2. - Allow newer libcurl. See: https://github.com/fink/fink-distributions/issues/1079 + +Patch to allow usage of CGFontXX in place of ATSFontXX from fxcoudert of +the R-Project. Patch incorporated into existing previous patch due to +slight source version mismatch. +https://bugs.r-project.org/show_bug.cgi?id=18426 << License: GPL Homepage: http://cran.R-project.org/