osxcross icon indicating copy to clipboard operation
osxcross copied to clipboard

Success Stories?

Open h0tw1r3 opened this issue 8 years ago • 23 comments

osxcross is pretty much awesome sauce.

What do you think about adding a Wiki page of success stories.

http://build.btolab.com/project/uxme/macosx/

h0tw1r3 avatar Aug 31 '15 01:08 h0tw1r3

I also thought about creating a wiki for OSXCross, but I haven't started one yet, it's all a lot of work as a one-man project maintainer...

Any help would be more than welcome!

a Wiki page of success stories.

Better not because of: https://github.com/tpoechtrager/osxcross/issues/4

tpoechtrager avatar Aug 31 '15 16:08 tpoechtrager

So far Godot builds nicely with it, and it's a pretty complex codebase.

reduz avatar Sep 05 '15 12:09 reduz

Hey reduz, is there a tutorial on how to use osxcross with godot?

purpleorangegames avatar Sep 07 '15 15:09 purpleorangegames

it just works, install it as the page describes and then use the environment var OSXCROSS_ROOT to wherever you did the osxcross git checkout

On Mon, Sep 7, 2015 at 12:48 PM, PurpleOrangeGames <[email protected]

wrote:

Hey reduz, is there a tutorial on how to use osxcross with godot?

— Reply to this email directly or view it on GitHub https://github.com/tpoechtrager/osxcross/issues/45#issuecomment-138328353 .

reduz avatar Sep 07 '15 15:09 reduz

We didn't have much success with iOS though, not quite sure I understand how to do it.. so help is appreciated.

On Mon, Sep 7, 2015 at 12:51 PM, Juan Linietsky [email protected] wrote:

it just works, install it as the page describes and then use the environment var OSXCROSS_ROOT to wherever you did the osxcross git checkout

On Mon, Sep 7, 2015 at 12:48 PM, PurpleOrangeGames < [email protected]> wrote:

Hey reduz, is there a tutorial on how to use osxcross with godot?

— Reply to this email directly or view it on GitHub https://github.com/tpoechtrager/osxcross/issues/45#issuecomment-138328353 .

reduz avatar Sep 07 '15 15:09 reduz

@reduz:

SDK

$ git clone https://github.com/LubosD/darling-dmg.git
$ cd darling-dmg
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=RELEASE
$ make -j ...
$ cd ../..

$ mkdir xcode

$ ./darling-dmg/build/darling-dmg </path/to>/Xcode_6.4.dmg xcode
[...]
Everything looks OK, disk mounted

$ cd xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

$ ll
total 1
drwxrwxr-t 1 root root  0 Jun 20 13:43 iPhoneOS.sdk/
lrwxr-xr-x 1 root root 12 Jun 23 00:05 iPhoneOS8.4.sdk -> iPhoneOS.sdk/ # 8.4 is a symlink

$ mktemp -d
/tmp/tmp.lF1Lf5wspl

$ mkdir /tmp/tmp.lF1Lf5wspl/iPhoneOS8.4.sdk

$ cp -r iPhoneOS.sdk/* /tmp/tmp.lF1Lf5wspl/iPhoneOS8.4.sdk # do not copy the symlink
$ cp -r ../../../../Toolchains/XcodeDefault.xctoolchain/usr/include/c++/* /tmp/tmp.lF1Lf5wspl/iPhoneOS8.4.sdk/usr/include/c++

$ cd /tmp/tmp.lF1Lf5wspl
$ tar -cf - * | xz -9 -c - > iPhoneOS8.4.sdk.tar.xz

TOOLCHAIN

$ git clone https://github.com/tpoechtrager/cctools-port.git

$ cd cctools-port/usage_examples/ios_toolchain

$ ./build.sh </path/to>/iPhoneOS8.4.sdk.tar.xz armv7 # arm64 is untested

$ cat ~/tmp/test.cpp
#include <iostream>

int main() {
  std::cout << "Hello World" << std::endl;
  return 0;
}

$ arm-apple-darwin11-clang++ -stdlib=libc++ ~/tmp/test.cpp
$ file a.out 
a.out: Mach-O arm_v7 executable

$ arm-apple-darwin11-otool -L a.out 
a.out:
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 235.1.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1214.5.1)

Hope this helps :smile:

tpoechtrager avatar Sep 07 '15 18:09 tpoechtrager

That's an amazing response @tpoechtrager. Thank you very much for the detailed instructions :)

aidansteele avatar Sep 07 '15 20:09 aidansteele

Hey @tpoechtrager, I really like your work! It's saved me loads of time :) Just thought I'd post this snippet for anyone who might have lost their symlinks in the SDK:

SDK=~/deps/SDK/MacOSX10.9.sdk
FRAMEWORKS=`find ${SDK} -name "*.framework" -type d`
for FRAMEWORK in $FRAMEWORKS; do
  if [ -d "${FRAMEWORK}/Headers" ]; then
    [ -d "${FRAMEWORK}/Versions/A/Headers" ] && ln -s ${FRAMEWORK}/Versions/A/Headers/* ${FRAMEWORK}/Headers/ 2> /dev/null
    [ -d "${FRAMEWORK}/Versions/B/Headers" ] && ln -s ${FRAMEWORK}/Versions/B/Headers/* ${FRAMEWORK}/Headers/ 2> /dev/null
    [ -d "${FRAMEWORK}/Versions/C/Headers" ] && ln -s ${FRAMEWORK}/Versions/C/Headers/* ${FRAMEWORK}/Headers/ 2> /dev/null
  fi
  if [ -d "${FRAMEWORK}/Frameworks" ]; then
    [ -d "${FRAMEWORK}/Versions/A/Frameworks" ] && ln -s ${FRAMEWORK}/Versions/A/Frameworks/* ${FRAMEWORK}/Frameworks/ 2> /dev/null
    [ -d "${FRAMEWORK}/Versions/B/Frameworks" ] && ln -s ${FRAMEWORK}/Versions/B/Frameworks/* ${FRAMEWORK}/Frameworks/ 2> /dev/null
    [ -d "${FRAMEWORK}/Versions/C/Frameworks" ] && ln -s ${FRAMEWORK}/Versions/C/Frameworks/* ${FRAMEWORK}/Frameworks/ 2> /dev/null
  fi
done

ghost avatar Oct 08 '15 07:10 ghost

I finally got Qt 5.5 with qtwebkit to compile :) Thanks so much for all the effort @tpoechtrager :+1: It's nice being able to compile for linux, windows and osx from a single ubuntu machine :) We are probably moving over to travis-ci, but it was a really fun challenge getting all our dependencies to compile for mac from linux :P

rynomster avatar Oct 09 '15 10:10 rynomster

@SDCDev @rynomster Glad to hear that! :-)

tpoechtrager avatar Oct 10 '15 17:10 tpoechtrager

Thank you @tpoechtrager for the iOS explanation, it works like a charm!

Here is how we are cross building our apps with toolchains made with osxcross and cctools-port. Maybe you find useful which lines we are using. We are building static libraries such SDL2, libicu, expat, freetype, etc. Those prefixed with a "+" are the script commands:

OS X: https://ci.easyrpg.org/job/osx-toolchain/lastSuccessfulBuild/consoleFull https://ci.easyrpg.org/job/liblcf-osx/lastSuccessfulBuild/consoleFull https://ci.easyrpg.org/job/player-osx/lastSuccessfulBuild/consoleFull

iOS: https://ci.easyrpg.org/job/ios-toolchain/lastSuccessfulBuild/consoleFull https://ci.easyrpg.org/job/liblcf-ios/lastSuccessfulBuild/consoleFull https://ci.easyrpg.org/job/player-ios/lastSuccessfulBuild/consoleFull

iOS result demo video

Just a note for building latest SDL2 for iOS: you need to enable ARC (by passing -fobjc-arc, check the ios-toolchain link above) and clang will need to find an additional library (/usr/lib/llvm-3.5/lib/arc/libarclite_iphoneos.a in our debian host case) for the compiler test, which can be found in one of SDK folder. When the build fails with "cannot create executables", check the file SDL2 config.log to see which is the right path missing in your distro. This file is available when unpacking the SDK in Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a. If you are using an older Xcode version, there is some related reference about this.

Hope this helps :+1:.

fdelapena avatar Oct 15 '15 15:10 fdelapena

Hi there. I was glad to com across this thread, and across your work tpoechtrager ;-) I think that I may find some help so I ask my question here : I cross build llvm+clang for iOS8.4 (arm64) successfully, see here :

http://stackoverflow.com/questions/32808144/how-to-cross-compile-clang-llvm-3-7-0-for-ios8-x-on-ipad-mini-3

(i'm using XCode 7 to which I re-added the 8.4 sdk) for the whole story and now I have a linking "problem" --> I don't have any linker... ;-) So I naturally started to look for methods to build binutils for iOS8.4 (arm64), without much success, and came across your cctools port. I would like to build cctools for iOS8.4 (arm64), how could I do it ?

Thx in advance,

MEF

PS : sorry for this way of contacting you, btw... (did not have any other)

MisesEnForce avatar Oct 18 '15 18:10 MisesEnForce

@MisesEnForce I answered your questions on StackOverflow.

  • https://stackoverflow.com/questions/32808144/how-to-cross-compile-clang-llvm-3-7-0-for-ios8-x-on-ipad-mini-3
  • https://stackoverflow.com/questions/33198629/almost-naked-ios8-4-how-to-get-a-linker

tpoechtrager avatar Oct 19 '15 10:10 tpoechtrager

@tpoechtrager Excellent work!

fxfactorial avatar Dec 01 '15 01:12 fxfactorial

@rynomster, can you tell me how you built Qt 5.5?

Wohlstand avatar Dec 01 '15 01:12 Wohlstand

@fxfactorial: Thanks!

tpoechtrager avatar Dec 01 '15 19:12 tpoechtrager

@Wohlstand if you need ssl support, you'll need to first compile openssl. If you need to compile qtwebkit you need flex and icu, and to compile icu. I made a custom spec called macx-clang-linux. I've automated the process using gitian on lxc, you can checkout https://github.com/shadowproject/shadow/blob/master/contrib/gitian-descriptors/qt-osx.yml If you need help understanding it, let me know. Sorry about the late reply, I only saw my mail now.

rynomster avatar Dec 14 '15 07:12 rynomster

@tpoechtrager

I took this, built on it, and wrapped it up in nixpkgs !

Now all you need to do is:

nix-env -i clang ios-cross-compile

(some instructions will come up for the SDK, which of course I can't resdistribute) and you'll have the compiler installed.

fxfactorial avatar Feb 22 '16 19:02 fxfactorial

@tpoechtrager

Thanks so much for this! It worked like a charm for my needs.

cprevallet avatar Aug 16 '16 16:08 cprevallet

@tpoechtrager

I have been looking for this solution for some time and glad it was brought to my attention. Xsaitekpanels (github.com/sparker256/xsaitekpanels) is now using osxcross so I can build the complete multiplatform package on my Ubuntu 16.04 LTS machine.

Thank you Bill

sparker256 avatar Nov 15 '17 20:11 sparker256

@rynomster did you enabled macOS builds on Linux for travis? Are there any issues regarding Apple SDK's license agreement?

rraallvv avatar Dec 06 '17 16:12 rraallvv

New success story: we used osxcross to build ImHex for MacOS arm64 (M1) The package isn't properly signed for now, but it's probably an error with our build system rather than osxcross

For anyone interested: CI ImHex build Dockerfile oscross dockerfile available as a package here

iTrooz avatar Nov 20 '23 23:11 iTrooz

Just want to share that we've built a game made with Unity using xcbuild and osxcross, because I'm too lazy to copy it to a Mac

I've written a blog in Chinese, and I think Google Translate works well there: https://zhuanlan.zhihu.com/p/686139717

Most of the runtime is implemented by Unity and IL2CPP, and the iOS UI part is only a simplest full screen canvas, so it's relatively easy to use open source tools to finish the remaining building procedure

woct0rdho avatar Mar 09 '24 11:03 woct0rdho