autc04 / Retro68

a gcc-based cross-compiler for classic 68K and PPC Macintoshes
GNU General Public License v3.0
556 stars 54 forks source link

Homebrew package #87

Open easybe opened 5 years ago

easybe commented 5 years ago

I would really love to be able to install this awesome toolchain with brew without having to compile everything.

Here my first attempt to create a Homebrew package (requiring https://github.com/autc04/Retro68/pull/85):

https://github.com/easybe/homebrew-core/blob/retro68/Formula/retro68.rb

I guess we won't be able to have Apple's Universal Interfaces as part of the binary package though.

Anyway, currently the install fails here:

Building target libraries and samples for 68K...
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-gcc
-- Check for working C compiler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-g++
-- Check for working CXX compiler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-gcc
CMake Warning (dev) at AutomatedTests/CMakeLists.txt:16 (set):
  implicitly converting 'String' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at AutomatedTests/CMakeLists.txt:30 (set):
  implicitly converting 'String' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/retro68-20190810-19743-10o6mdp/Retro68-0.0/build/build-target
Scanning dependencies of target AsmTest
Scanning dependencies of target EmptyTest
Scanning dependencies of target RetroConsole
Scanning dependencies of target retrocrt
[  0%] Building ASM object TestApps/CMakeFiles/AsmTest.dir/AsmTest.s.obj
[  0%] Building C object TestApps/CMakeFiles/EmptyTest.dir/EmptyTest.c.obj
[  2%] Building CXX object Console/CMakeFiles/RetroConsole.dir/retro/Console.cc.obj
[  2%] Building C object libretro/CMakeFiles/retrocrt.dir/malloc.c.obj
[  3%] Linking C executable AsmTest.code.bin
[  4%] Linking C executable EmptyTest.code.bin
/usr/local/Cellar/retro68/0.0/lib/gcc/m68k-apple-macos/8.2.0/../../../../m68k-apple-macos/bin/ld.real: cannot find -lretrocrt
collect2: error: ld returned 1 exit status
make[2]: *** [TestApps/AsmTest.code.bin] Error 1
make[1]: *** [TestApps/CMakeFiles/AsmTest.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/local/Cellar/retro68/0.0/lib/gcc/m68k-apple-macos/8.2.0/../../../../m68k-apple-macos/bin/ld.real: cannot find -lretrocrt
collect2: error: ld returned 1 exit status
make[2]: *** [TestApps/EmptyTest.code.bin] Error 1
make[1]: *** [TestApps/CMakeFiles/EmptyTest.dir/all] Error 2
[  5%] Building C object libretro/CMakeFiles/retrocrt.dir/syscalls.c.obj
[  6%] Building CXX object Console/CMakeFiles/RetroConsole.dir/retro/ConsoleWindow.cc.obj
[  6%] Building CXX object Console/CMakeFiles/RetroConsole.dir/retro/InitConsole.cc.obj
[  7%] Building C object libretro/CMakeFiles/retrocrt.dir/consolehooks.c.obj
[  8%] Building C object libretro/CMakeFiles/retrocrt.dir/start.c.obj
[  8%] Building C object libretro/CMakeFiles/retrocrt.dir/relocate.c.obj
[  9%] Building C object libretro/CMakeFiles/retrocrt.dir/MultiSegApp.c.obj
[ 10%] Building ASM object libretro/CMakeFiles/retrocrt.dir/LoadSeg.s.obj
[ 11%] Building C object libretro/CMakeFiles/retrocrt.dir/qdglobals.c.obj
[ 12%] Linking C static library libretrocrt.a
[ 12%] Built target retrocrt
[ 13%] Linking CXX static library libRetroConsole.a
[ 13%] Built target RetroConsole
make: *** [all] Error 2
/usr/bin/curl --version
/usr/libexec/java_home --xml --failfast
/usr/libexec/java_home --xml --failfast
/usr/local/Homebrew/Library/Homebrew/debrew.rb:13:in `raise'
BuildError: Failed executing: ../build-toolchain.bash --prefix=/usr/local/Cellar/retro68/0.0

Any idea what is going wrong?

autc04 commented 5 years ago

Strange.

Looks like it tries to build the apps in TestApps before it builds the runtime library, libretrocrt. Which is strange, since those apps should probably link to libretrocrt.

The C compiler should automatically try to link to libretrocrt, so I haven't been telling CMake to link to libretro. But in add_application.cmake, linbe 81, the add_application macro tells CMake that linking an application requires the libretro target to be built first. Is this not working any more?

easybe commented 5 years ago
brew install --verbose --debug https://raw.githubusercontent.com/easybe/homebrew-core/retro68/Formula/retro68.rb
autc04 commented 5 years ago

I'm on it. It is indeed a problem related to the order things are built in (no idea yet why that stopped working), and there also seems to be another problem later on:

In file included from /tmp/retro68-20190812-4702-3w0zzt/Retro68-0.0/LaunchAPPL/Server/OpenTptStream.cc:28:
/usr/local/Cellar/retro68/0.0/CIncludes/OpenTransportProviders.h:2333:5: error: 'FSSpec' does not name a type
 2333 |     FSSpec      modemScript;
      |     ^~~~~~

... probably related to the exact UniversalInterfaces version being used.

autc04 commented 5 years ago

I'll probably have some more time to look into it this evening.

autc04 commented 5 years ago

Try again now. I've fiddled with the build order stuff and worked around the OpenTransportProviders error.

easybe commented 5 years ago

Thank you very much. Now we get a different error though:

Building target libraries and samples for 68K...
-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-gcc
-- Check for working C compiler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-g++
-- Check for working CXX compiler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /usr/local/Cellar/retro68/0.0/bin/m68k-apple-macos-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/retro68-20190813-57969-1fhxrlf/Retro68-0.0/build/build-target
Scanning dependencies of target LaunchAPPLCommon
Scanning dependencies of target retrocrt
Scanning dependencies of target RetroConsole
[  3%] Building CXX object LaunchAPPL/Common/CMakeFiles/LaunchAPPLCommon.dir/Stream.cc.obj
[  4%] Building CXX object Console/CMakeFiles/RetroConsole.dir/retro/Console.cc.obj
[  3%] Building CXX object LaunchAPPL/Common/CMakeFiles/LaunchAPPLCommon.dir/ReliableStream.cc.obj
[  4%] Building C object libretro/CMakeFiles/retrocrt.dir/malloc.c.obj
[  4%] Building C object libretro/CMakeFiles/retrocrt.dir/syscalls.c.obj
[  5%] Building C object libretro/CMakeFiles/retrocrt.dir/consolehooks.c.obj
[  6%] Building CXX object Console/CMakeFiles/RetroConsole.dir/retro/ConsoleWindow.cc.obj
[  7%] Building C object libretro/CMakeFiles/retrocrt.dir/start.c.obj
[  8%] Building C object libretro/CMakeFiles/retrocrt.dir/relocate.c.obj
[  8%] Building C object libretro/CMakeFiles/retrocrt.dir/MultiSegApp.c.obj
[  9%] Building ASM object libretro/CMakeFiles/retrocrt.dir/LoadSeg.s.obj
[ 10%] Building C object libretro/CMakeFiles/retrocrt.dir/qdglobals.c.obj
[ 11%] Linking CXX static library libLaunchAPPLCommon.a
[ 11%] Built target LaunchAPPLCommon
[ 11%] Building CXX object Console/CMakeFiles/RetroConsole.dir/retro/InitConsole.cc.obj
[ 12%] Linking C static library libretrocrt.a
[ 12%] Built target retrocrt
Scanning dependencies of target TestLaunchAPPLCommon
[ 12%] Building CXX object LaunchAPPL/Common/CMakeFiles/TestLaunchAPPLCommon.dir/Test.cc.obj
Scanning dependencies of target LaunchAPPLServer
[ 12%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/LaunchAPPLServer.cc.obj
Scanning dependencies of target PascalTrapCPP
[ 13%] Building CXX object AutomatedTests/CMakeFiles/PascalTrapCPP.dir/PascalTrapCPP.cc.obj
[ 14%] Linking CXX static library libRetroConsole.a
[ 14%] Built target RetroConsole
[ 15%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/AppLauncher.cc.obj
[ 16%] Building C object AutomatedTests/CMakeFiles/PascalTrapCPP.dir/Test.c.obj
[ 17%] Linking CXX executable TestLaunchAPPLCommon
[ 18%] Linking CXX executable PascalTrapCPP.code.bin
[ 18%] Built target PascalTrapCPP
[ 19%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/ToolLauncher.cc.obj
[ 19%] Built target TestLaunchAPPLCommon
[ 20%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/StatusDisplay.cc.obj
Scanning dependencies of target PascalTrap
[ 21%] Building C object AutomatedTests/CMakeFiles/PascalTrap.dir/PascalTrap.c.obj
Scanning dependencies of target File
[ 22%] Building C object AutomatedTests/CMakeFiles/File.dir/File.c.obj
Scanning dependencies of target Exceptions
[ 23%] Building C object AutomatedTests/CMakeFiles/PascalTrap.dir/Test.c.obj
[ 24%] Building CXX object AutomatedTests/CMakeFiles/Exceptions.dir/Exceptions.cc.obj
[ 25%] Building C object AutomatedTests/CMakeFiles/File.dir/Test.c.obj
[ 26%] Building C object AutomatedTests/CMakeFiles/Exceptions.dir/Test.c.obj
[ 26%] Linking C executable PascalTrap.code.bin
[ 26%] Linking C executable File.code.bin
[ 26%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/AboutBox.cc.obj
[ 26%] Built target PascalTrap
[ 27%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/Preferences.cc.obj
[ 27%] Built target File
[ 28%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/OpenTptStream.cc.obj
[ 28%] Linking CXX executable Exceptions.code.bin
[ 28%] Built target Exceptions
[ 28%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/OpenTptConnectionProvider.cc.obj
Scanning dependencies of target Segments
[ 29%] Building C object AutomatedTests/CMakeFiles/Segments.dir/Segment1.c.obj
Scanning dependencies of target StdIO
[ 30%] Building C object AutomatedTests/CMakeFiles/StdIO.dir/StdIO.c.obj
[ 31%] Building C object AutomatedTests/CMakeFiles/Segments.dir/Segment2.c.obj
[ 31%] Building C object AutomatedTests/CMakeFiles/StdIO.dir/Test.c.obj
[ 31%] Building C object AutomatedTests/CMakeFiles/Segments.dir/Test.c.obj
[ 32%] Linking C executable StdIO.code.bin
[ 33%] Linking C executable Segments.code.bin
[ 33%] Built target StdIO
[ 34%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/SharedFileStream.cc.obj
[ 34%] Built target Segments
[ 35%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/SharedFileProvider.cc.obj
Scanning dependencies of target Empty
Scanning dependencies of target Log
[ 36%] Building C object AutomatedTests/CMakeFiles/Empty.dir/Empty.c.obj
[ 37%] Building C object AutomatedTests/CMakeFiles/Log.dir/Log.c.obj
[ 37%] Building C object AutomatedTests/CMakeFiles/Empty.dir/Test.c.obj
[ 38%] Building C object AutomatedTests/CMakeFiles/Log.dir/Test.c.obj
[ 39%] Linking C executable Empty.code.bin
[ 39%] Built target Empty
[ 40%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/SerialConnectionProvider.cc.obj
[ 40%] Linking C executable Log.code.bin
[ 40%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/MacSerialStream.cc.obj
[ 40%] Built target Log
[ 41%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/MacTCPStream.cc.obj
Scanning dependencies of target Exceptions_APPL
[ 42%] Generating Exceptions.bin, Exceptions.APPL, Exceptions.dsk, Exceptions.ad, %Exceptions.ad
[ 42%] Built target Exceptions_APPL
[ 43%] Building CXX object LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/TCPConnectionProvider.cc.obj
Scanning dependencies of target ReallyEmpty
[ 44%] Building C object AutomatedTests/CMakeFiles/ReallyEmpty.dir/ReallyEmpty.c.obj
Scanning dependencies of target Init
[ 45%] Building C object AutomatedTests/CMakeFiles/ReallyEmpty.dir/Test.c.obj
[ 46%] Building CXX object AutomatedTests/CMakeFiles/Init.dir/Init.cc.obj
[ 46%] Linking C executable ReallyEmpty.code.bin
[ 46%] Built target ReallyEmpty
[ 47%] Building C object AutomatedTests/CMakeFiles/Init.dir/Test.c.obj
Scanning dependencies of target StdIO_APPL
[ 48%] Generating StdIO.bin, StdIO.APPL, StdIO.dsk, StdIO.ad, %StdIO.ad
Scanning dependencies of target ZeroInitialized
[ 49%] Building C object AutomatedTests/CMakeFiles/ZeroInitialized.dir/ZeroInitialized.c.obj
[ 49%] Built target StdIO_APPL
[ 49%] Linking CXX executable Init.code.bin
[ 49%] Building C object AutomatedTests/CMakeFiles/ZeroInitialized.dir/Test.c.obj
[ 49%] Built target Init
Scanning dependencies of target Timeout
[ 50%] Building C object AutomatedTests/CMakeFiles/Timeout.dir/Timeout.c.obj
[ 51%] Linking CXX executable LaunchAPPLServer.code.bin
[ 52%] Linking C executable ZeroInitialized.code.bin
Scanning dependencies of target File_APPL
[ 53%] Generating File.bin, File.APPL, File.dsk, File.ad, %File.ad
/usr/local/Cellar/retro68/0.0/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/ld.real: cannot find -lOpenTransport
/usr/local/Cellar/retro68/0.0/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/ld.real: cannot find -lOpenTransportApp
/usr/local/Cellar/retro68/0.0/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/ld.real: cannot find -lOpenTptInet
collect2: error: ld returned 1 exit status
make[2]: *** [LaunchAPPL/Server/LaunchAPPLServer.code.bin] Error 1
make[1]: *** [LaunchAPPL/Server/CMakeFiles/LaunchAPPLServer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 54%] Building C object AutomatedTests/CMakeFiles/Timeout.dir/Test.c.obj
[ 54%] Built target ZeroInitialized
[ 54%] Built target File_APPL
[ 54%] Linking C executable Timeout.code.bin
[ 54%] Built target Timeout
make: *** [all] Error 2
autc04 commented 5 years ago

Okay... this time, we're having a Universal Interfaces problem.

The package you are downloading doesn't include the 68K OpenTransport libraries (OpenTransport.o) that mine contains. Mine's a version of 3.4 from somewhere, I'll try to track down my source tomorrow.

The good news is that we're already at the "optional" parts of Retro68 (well, the parts that could be made optional should anyone want to add the necessary pumbing to the CMakeLists and build-toolchain.sh files).

easybe commented 5 years ago

Cool, we are getting there 😄

Actually, I have successfully built everything with the Universal Interfaces from MPW GM recently. MPW used to be available on Apple's FTP (which IMHO would be the preferred source) and can still be downloaded here. Using something that can be found in https://staticky.com/dl/ftp.apple.com/developer/Development_Kits/ just makes the most sense to me though.

autc04 commented 5 years ago

So apparently, the OpenTransport 68K libraries weren't part of the Universal Interfaces package, they were just distributed with MPW. Interestingly, the PPC versions of those libraries are more likely to be included, probably because 68K .o files were specific to MPW, while PPC .o files actually followed a documented standard format (IBM's XCOFF).

There's a separate OpenTransport SDK available as well.

So I think our options are...

easybe commented 5 years ago

OK, got the build to work now 🍾. Thank you very much for the support.

Next step would be to create a version tag/release of this repo. Would that be possible?

Further, I will try to find a good way to not have the files form Apple in the binary packages/bottles. I think this should easily be possible by implementing post_install. Worst case we have a script that the user has to run after brew install.

easybe commented 5 years ago

Please review https://github.com/autc04/Retro68/pull/89. Cheers.

easybe commented 5 years ago

Thanks for merging https://github.com/autc04/Retro68/pull/89. I would also add an option to build-toolchain.bash to remove the interfaces and libraries after the build. What do you think?

autc04 commented 5 years ago

Yes, unless you'd rather do that in the build formula. If it's in build-toolchain, it should probably be documented as being "for use by packaging scripts".

autc04 commented 5 years ago

I've played around a bit more with the interfaces-and-libraries.sh script. I've made it store a list of installed library files in $PREFIX/apple-libraries.txt, and I've added a function removeInterfacesAndLibraries() that removes all libraries.

One minor thing that I'll probably take care of tomorrow is the fact that build-toolchain copies the PEFBinaryFormat.h header from the universal interfaces because that's needed for the host side tools to build.

easybe commented 5 years ago

Cool, thank you very much. I will make use of it in the Formula.

BTW, now we have a mix of spaces and tabs. I do not really care which one we use (but prefer spaces) but it should be one or the other.

easybe commented 5 years ago

I've updated the Formula. Building now...

autc04 commented 5 years ago

Something is still going wrong... I broke something, and just pushed a fix. Also, I noticed that apparently homebrew's cp_r command does not copy old-fashioned resource forks with the libraries (which shouldn't really be a problem, as there's a fallback, but if you know an easy way to fix it...)

easybe commented 5 years ago

I‘ll use cp -r instead. I do not know if Ruby can do that. Maybe the experts that will review it will have a better solution...

easybe commented 5 years ago

So, build was successfully now. But, when trying to build my application I got:

1:1: error: could not open /usr/local/Cellar/retro68/0.1/m68k-apple-macos/RIncludes/Retro68APPL.r

autc04 commented 5 years ago

Oh...

I didn't think of that. The cmake build (in libretro/CMakeLists.txt) installs Retro68APPL.r into RIncludes, but my "remove apple interfaces" implementation removes all files in RIncludes. I'm going to bed for today, no idea how much time for this I'll have in the evenings during the week, but it shouldn't take long to come up with a fix for this...

easybe commented 5 years ago

Please review https://github.com/autc04/Retro68/pull/90.

easybe commented 5 years ago

The test still fails :(

brew test --verbose --debug retro68.rb
...
==> cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/local/Cellar/retro68/0.1/m68k-apple-macos/cmake/retro68.toolchain.cmake
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/local/Cellar/retro68/0.1/bin/m68k-apple-macos-gcc
-- Check for working C compiler: /usr/local/Cellar/retro68/0.1/bin/m68k-apple-macos-gcc -- broken
CMake Error at /usr/local/Cellar/cmake/3.15.2/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/usr/local/Cellar/retro68/0.1/bin/m68k-apple-macos-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /tmp/retro68-test-20190820-97385-198hf3m/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_95675/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_95675.dir/build.make CMakeFiles/cmTC_95675.dir/build
    Building C object CMakeFiles/cmTC_95675.dir/testCCompiler.c.obj
    /usr/local/Cellar/retro68/0.1/bin/m68k-apple-macos-gcc   -Os -w -pipe -march=core2 -mmacosx-version-min=10.13 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk    -o CMakeFiles/cmTC_95675.dir/testCCompiler.c.obj   -c /tmp/retro68-test-20190820-97385-198hf3m/build/CMakeFiles/CMakeTmp/testCCompiler.c
    m68k-apple-macos-gcc: error: unrecognized argument in option '-march=core2'
    m68k-apple-macos-gcc: note: valid arguments to '-march=' are: 68000 68010 68020 68030 68040 68060 cpu32 isaa isaaplus isab isac
    m68k-apple-macos-gcc: error: unrecognized command line option '-mmacosx-version-min=10.13'
    make[1]: *** [CMakeFiles/cmTC_95675.dir/testCCompiler.c.obj] Error 1
    make: *** [cmTC_95675/fast] Error 2

  CMake will not be able to correctly generate this project.

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.15)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/tmp/retro68-test-20190820-97385-198hf3m/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/retro68-test-20190820-97385-198hf3m/build/CMakeFiles/CMakeError.log".
/usr/bin/curl --version
/usr/libexec/java_home --xml --failfast
/usr/libexec/java_home --xml --failfast
autc04 commented 5 years ago

Just brewed it again. I can manually build a sample without problems. However, I can't run brew test:

wolfgang@brubeck ~/Projects % brew test --verbose --debug retro68
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/opt/retro68/.brew/retro68.rb
Error: retro68 is not linked
wolfgang@brubeck ~/Projects % brew link retro68
Linking /usr/local/Cellar/retro68/0.1... 
Error: Could not symlink share/gcc-9.1.0/python/libstdcxx/__init__.py
Target /usr/local/share/gcc-9.1.0/python/libstdcxx/__init__.py
is a symlink belonging to gcc. You can unlink it:
  brew unlink gcc

To force the link and overwrite all conflicting files:
  brew link --overwrite retro68

To list all files that would be deleted:
  brew link --overwrite --dry-run retro68

I have gcc 9 installed as a brew bottle. And apparently, gcc 9 installs quite a few files into the retro68/ prefix that conflict with the non-crosscompiler version of gcc 9. For now, the formula should probably be keg-only.

autc04 commented 5 years ago

Okay, after unlinking gcc and brew link retro68 I can run the tests...

The problem seems to be that brew pollutes the environment with lots of environment variables, most importantly CFLAGS and CXXFLAGS, that get picked up by cmake but that are incompatible with non-Apple compilers. Not sure if we should just add exporrt CFLAGS= CXXFLAGS= to the test, or whether something else should be done in the long run.

easybe commented 5 years ago

Thanks for the hint. Got it to work.

Could you create a release/tag now? Then I can finish the formula and create a PR. Cheers.

autc04 commented 5 years ago

v2019.8 is tagged.

easybe commented 5 years ago

Thank you very much.

I think I'm getting there. Unfortunately, I found a last small blocker for the package: https://github.com/autc04/Retro68/pull/91

We will need another tag. Or, you could also re-create/move v2019.8, both works for me.

autc04 commented 5 years ago

There's v2019.8.2 now.

easybe commented 5 years ago

OK, https://github.com/Homebrew/homebrew-core/pull/43442, let's see what happens...

autc04 commented 5 years ago

Great!

easybe commented 5 years ago

For some reason the builds failed on Jenkins 😞

https://jenkins.brew.sh/job/Homebrew%20Core%20Pull%20Requests/version=high_sierra/47122/console https://jenkins.brew.sh/job/Homebrew%20Core%20Pull%20Requests/version=sierra/47122/console https://jenkins.brew.sh/job/Homebrew%20Core%20Pull%20Requests/version=mojave/47122/console

Also, regarding the feedback we got it looks like we cannot install the interfaces in post_install. However, I have an idea how to still make the package easily useable. I will create a PR in this repo.

autc04 commented 5 years ago

The formula really needs to depend on bison, as Apple only includes bison version 2. The error message was very well hidden in the middle of the log, because Rez used to be optional. And that's now bug #92.

autc04 commented 5 years ago

It looks like we might need to do two things:

  1. Make installing interfaces after the fact more convenient, maybe by installing the relevant scripts along with the other stuff.
  2. Allow building the whole thing without Apple's interfaces at first.

The problem with 2. is that the libretro runtime library as well as the RetroConsole library need them, of course.

I've started looking at how to use the executor source code to rig up a replacement for the the most important parts of the UniversalInterfaces. That would be incomplete, but it would be based on a clean-room reimplementation, so it could be included. But don't expect anything from me on that front before a 2019.9 version, or even later...

easybe commented 5 years ago
  1. That is what I am working on
  2. I do not know if that is necessary
easybe commented 5 years ago

OK, so they rejected the PR and suggested to create an own tap. Still, I will finish the changes I had in mind and then look into creating an own tap.

autc04 commented 5 years ago

Too bad. In the meantime, I'm making some progress with my "Multiversal Interfaces" project. It's not enough to compile Retro68 yet, but I am now convinced it can get far enough to be at least a good place to start for people who install Retro68. The original Universal Interfaces can then be made optional.

easybe commented 5 years ago

I am working on following tap now: https://github.com/easybe/homebrew-retro68

Unfortunately, when building with Azure Pipelines on macOS 10.14 I get following error:

==> ../build-toolchain.bash --prefix=/usr/local/Cellar/retro68/2019.9.1
Last 15 lines from /Users/vsts/Library/Logs/Homebrew/retro68/02.build-toolchain.bash:
                 from /usr/local/Cellar/retro68/2019.9.1/CIncludes/Carbon.h:21,
                 from /tmp/retro68-20190911-1198-1alq06r/Retro68-2019.9.1/Samples/Raytracer/raytracer2.cc:27:
/usr/local/Cellar/retro68/2019.9.1/powerpc-apple-macos/include/threads.h:30:10: fatal error: machine/_threads.h: No such file or directory
   30 | #include <machine/_threads.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Samples/Raytracer/CMakeFiles/Raytracer.dir/raytracer.c.obj] Error 1
make[1]: *** [Samples/Raytracer/CMakeFiles/Raytracer.dir/all] Error 2make[2]: 
*** [Samples/Raytracer/CMakeFiles/Raytracer2.dir/raytracer2.cc.obj] Error 1make[1]: *** Waiting for unfinished jobs....

make[1]: *** [Samples/Raytracer/CMakeFiles/Raytracer2.dir/all] Error 2
[ 16%] Linking CXX static library libRetroConsoleCarbon.a
[ 16%] Built target Dialog
[ 16%] Built target RetroConsole
make: *** [all] Error 2

I get the same on by machine which runs macOS 10.13.

autc04 commented 5 years ago

I haven't built this often enough on my Mac recently... It looks like a case-insensitivity problem related to threads.h (a newlib header) and Threads.h (an Apple header), which can't exist in the same directory on a Mac. I thought I had fixed this with commit 57d99dfbed28d62e0ab054b600830d633f540ad4, did I mess that up?

autc04 commented 5 years ago

Yes, I did. Should be fixed with 92c055052661235ca49c5addd568270778b6d004.

autc04 commented 5 years ago

It should now be possible to build Retro68 without the Universal Interfaces :-)

easybe commented 5 years ago

That is good news, thanks.

I am on vacation at the moment. But, I'll see what I can do.

Would it also be possible to compile very simple test programs without the interfaces?

autc04 commented 5 years ago

No hurry, just wanted to let you know, enjoy your vacation!

Definitely possible to compile test programs; in fact, all the included samples compile, only the LaunchAPPLServer is unusable due to missing features and a crash.

easybe commented 5 years ago

I tested it here: https://dev.azure.com/spam0686/spam/_build/results?buildId=58

But, using the --no-carbon option won't work. I would like to build the toolchains for all three targets. Is this not possible (at the moment)?

autc04 commented 5 years ago

Yes, Carbon support just isn't there yet. It should be possible to get it to a level where it can build the toolchain and maybe even some of the samples, but we'll probably have to ask users to install the Apple interfaces for any serious Carbon development. Vacation coming up on my end, so don't expect anything before November.

easybe commented 5 years ago

we'll probably have to ask users to install the Apple interfaces for any serious Carbon development

I think that is fine. I have a patch to facilitate that. It would just be good if we could build the toolchain and have a simple test for it.

No hurry, enjoy your vacation. I'll be enjoying mine for another 2 weeks...

b- commented 3 years ago

Sorry to bump, but is there any update regarding a homebrew package? Especially for TigerBrew.

I'm sure you know better than I do, but compiling this on a G4 is kind of painful. :) but I can't imagine it would be that difficult to make a tap for TigerBrew that would let one install a precompiled version.

Thanks!

easybe commented 3 years ago

Where I left off: https://github.com/easybe/homebrew-tap/blob/retro68/Formula/retro68.rb

It would have to be revised. Maybe switched to GitHub Actions.

However, building on/for PPC is a whole different story. There are most certainly no PPC-based runners provided by GitHub. And, I do not know if cross-compiling is possible.

b- commented 3 years ago
        Cool, I’ll see what I can make of that. Thanks! I might set up my own build server if it becomes something I really am interested in.---- On Fri, 12 Nov 2021 01:33:18 -0500  Ezra ***@***.***> wrote ---- 

Where I left off: https://github.com/easybe/homebrew-tap/blob/retro68/Formula/retro68.rb It would have to be revised. Maybe switched to GitHub Actions. However, building on/for PPC is a whole different story. There are most certainly no PPC-based runners provided by GitHub. and I do not know if cross-compiling is possible.

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

superdave commented 3 years ago

I could also donate some build server cycles if need be.

easybe commented 3 years ago

From reading http://maniacsvault.net/articles/powerpccross I understand that cross-compiling should be possible...