Skip to content

Instantly share code, notes, and snippets.

@cognifloyd
Last active December 5, 2020 03:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cognifloyd/f4ff46e3dcfd48ca9827c32e04a8fe90 to your computer and use it in GitHub Desktop.
Save cognifloyd/f4ff46e3dcfd48ca9827c32e04a8fe90 to your computer and use it in GitHub Desktop.
Gentoo Prefix Bootstrap for Mac OS X Catalina
Please see https://github.com/cognifloyd/prefix/blob/wip_darwin/scripts/bootstrap-prefix.sh
@cognifloyd
Copy link
Author

cognifloyd commented Nov 27, 2020

rev10 gets mostly through stage2. It finishes all the llvm deps, but does not build llvm yet.

Take note of cognifloyd_update_tree as this changes a couple of things in the portage tree to get this far.

Three things in bash-5.1_rc3.ebuild:

  • add return 0 to the top of is_release function so it reuses the readline we just built.
  • add { and } to the sed regex where it is looking for $(RL_...) it also needs to handle ${RL_...}
  • comment out this line: [[ "${PV}" == *_rc* ]] || \ just before KEYWORDS= which serves to make it available on x64-macos despite being a rc.

Significant version bump for binutils-apple including a new ebuild and updated patches. I'm posting these changes at https://bugs.gentoo.org/693444

adjust cmake ebuild and a cmake patch:

  • cmake-3.13.4-prefix-dirs.patch adds the MacOS.sdk Frameworks path. Adjust the Darwin.cmake section to look like this:
 # Older OS X linkers do not report their framework search path
@@ -132,6 +132,9 @@ endif()
 
 # set up the default search directories for frameworks
 set(CMAKE_SYSTEM_FRAMEWORK_PATH
+  @GENTOO_PORTAGE_EPREFIX@MacOSX.sdk/System/Library/Frameworks
+  @GENTOO_PORTAGE_EPREFIX@Frameworks
+  @GENTOO_PORTAGE_EPREFIX@usr/lib
   ~/Library/Frameworks
   )
 if(_CMAKE_OSX_SYSROOT_PATH)
@@ -178,13 +181,15 @@ if(CMAKE_OSX_SYSROOT)
   endif()
  • add this to cmake_src_bootstrap in cmake-3.13.5.ebuild (I put it right after the sed ... bootstrap lines):
	local sdk_frameworks="${EPREFIX}/MacOSX.sdk/System/Library/Frameworks"
	if [[ -d "${sdk_frameworks}" ]]; then
		# ensure frameworks are found for darwin prefix
		append-cflags $(test-flags-CC "-F${sdk_frameworks}")
		append-cxxflags $(test-flags-CXX "-F${sdk_frameworks}")
	fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment