Note that building for macOS 12.x previously worked before upgrading
to Xcode 14. Building for macOS 13.x never worked.
Cherry-picks upstream change to fix Xcode 14+ build for macOS 12+.
This changes content even on working builds, hence the revbump.
Fixes issue with building bigdecimal with Xcode 14+ for macOS 12+, by
disabling chained fixups and allowing the needed linker option. See
the commit in the fork for more details.
Replaces ugly Portfile hacks for 10.5 x86_64 with proper fixes
developed for ruby27.
Replaces topical patchfiles with consolidated patchfiles derived
from the GitHub fork at fhgwright/ruby.
Fixes a couple of typos in a Portfile comment.
Also adds self as co-maintainer.
TESTED:
Built on OSX 10.4-10.5 ppc, 10.4-10.6 i386, 10.5-10.15 x86_64, and
11.x-13.x arm64, including universal builds for all but 10.4, where
dependency issues prevent building. Also tested all variants in a
subset of cases.
see https://trac.macports.org/ticket/63845
pkg-config in ext/openssl/extconf.rb ignores PKG_CONFIG_PATH.
it leads conflict between openssl-1.1 (from configure args --with-openssl-...)
and openssl-3 (from $prefix/lib/pkgconfig/openssl.pc).
ext/openssl allows compiling without pkgconfig, then commented out pkg_config()
in ext/openssl/extconf.rb.
note: ruby23 or earlier might need same fix.
closes: https://trac.macports.org/ticket/63602
{{{
$ sudo port install ruby30
---> Computing dependencies for ruby30
:
---> Some of the ports you installed have notes:
ruby30 has the following notes:
To make this the default Ruby (i.e., the version run by the 'ruby', 'gem' or 'bundle' commands),
run:
sudo port select --set ruby ruby30
$
$ port notes ruby30
---> ruby30 has the following notes:
To make this the default Ruby (i.e., the version run by the 'ruby', 'gem' or 'bundle' commands),
run:
sudo port select --set ruby ruby30
$
}}}
This includes a patch for some OS version issues common to earlier
Ruby versions:
The OS version conditional in dln.c is comparing an undefined macro to
a sometimes undefined (and essentially useless) macro. However, the
relevant code doesn't seem to be built for any OS version, making the
bug irrelevant. Nevertheless, it's now fixed, since another, similar
fix was needed, anyway, and it might become relevant if something else
changes.
The OS version conditionals in error.c were using another useless
macro for the comparison, this time with a real effect, though only in
a couple of messages related to crash reports on < 10.6. This is now
fixed.
It also includes an updated patch for a 10.4 issue:
The context register naming issue on 10.4 was sort of fixed upstream
but tied to an inappropriate config flag. The patched version uses an
SDK version macro to make the decision.
A newly discovered issue, common to some older Ruby versions, is:
The 10.5 x86_64 build fails if libunwind-headers is active. Since
this is an unusual configuration, and the need for libunwind-headers
seems to be waning, it's not worth fixing "right". This just adds the
usual failure for such cases. It's unknown why this only affects 10.5
x86_64 (and perhaps 10.4 x86_64, though that's untested).
The remaining issues were new in ruby26:
The syntax-checking compiler invocations in transform_mjit_header.rb
require a C99 or later compiler, but don't include compiler flags from
the build. There's code to detect the non-C99 case and add -std=c99
to the real uses, but it relies on matching the error message from the
test case. Recent versions of gcc use locale-dependent quotes which
may break such comparisons, depending on the current locale settings.
The fix recommended by gcc documentation is to run it with LC_ALL=C to
get traditional ASCII quotes. This adds code to apply that
environment to the compiler test invocation.
For some strange reason, using gcc-4.2 for Ruby's coroutine-related
assembler code on x86_64 passes "-arch i386" to the assembler, thereby
causing failures on x86_64 register references. To fix that, cases
with gcc-4.2 and x86_64 targeted now pass the correct architecture in
ASFLAGS.
Also corrects a small typo in the description.
Also fixes some lint errors in the Portfile.
Since this affects the installed code for < 10.6, it includes a
revbump.
Universal builds still fail on 10.4 i386 due to a weird configure bug,
and 10.4 ppc has broken universal dependencies.
TESTED:
Built -universal on 10.4-10.5 ppc, 10.4-10.6 i386, and 10.6-10.15
x86_64. Built +universal on 10.5-10.13.
insert spaces between literal and identifier in config.h.
// before
#define RUBY_ARCH "universal-"RUBY_PLATFORM_OS
#define RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
// after
#define RUBY_ARCH "universal-" RUBY_PLATFORM_OS
#define RUBY_PLATFORM "universal." RUBY_PLATFORM_CPU "-" RUBY_PLATFORM_OS
note: ruby-2.5 or earlier, `configure` does not accept "--with-arch=arm64"
Closes: https://trac.macports.org/ticket/58255
target OS versions: darwin 20 (macOS 11) *or later*
rewrite sdkroot in rbconfig.rb and ruby-*.pc to MacOSX.sdk from MacOS11.x.sdk.
see https://trac.macports.org/ticket/61899
macOS 11 and Xcode 12 changes SDK path for macOS minor versions.
this breaks building ruby binary extentions.
/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk
-> /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk (11.0 removed)
^^^
To fix this problem, port:ruby2x rewrites SDKROOT to "MacOSX.sdk" (symlink)
from "MacOSX11.x.sdk" in rbconfig.rb and ruby-2.x.pc at `post-build`.
Closes: https://trac.macports.org/ticket/61827
Closes: https://trac.macports.org/ticket/61899
Generated with the following command:
rg -l -g Portfile ':openssl\b' ../macports-ports | grep -v '/lang/php/' | grep -v '/aqua/qt5' | xargs ./revbump-ports.sh
revbump-ports.sh is from https://github.com/yan12125/revbump-ports/tree/4a47ad53d5bc1553b86f48dfbf946bc9a466306c
Skipping lang/php and aqua/qt5 as only php*-{ftp,openssl} and
qt*-qtbase subports need revbumping, respectively.