Script to Compile the latest github for retroarch+cores for iOS

Ok, managed to compile chailove thanks to you, will be up in the buildbot and IPA iOS 10 & 11+ soon!

1 Like

hi @jet082 - how did you compile the ā€œpuaeā€ core?

If i use the -Wno-error-Wimplicit-function-declaration i get:

In file included from sources/src/audio.c:28:
./sources/src/include/driveclick.h:33:13: error: conflicting types for 'driveclick_mix'
extern void driveclick_mix (uae_s16*, int, int);

Thereā€™s probably an easy way to get this to compile but iā€™m just too lazy at the moment to look at itā€¦

It just compiles for me. I didnā€™t need to do anything. I even got it to compile for tvos by making the standard set of changes.

There must be something strange with your setup. I recommend deleting the directory and refetching it.

Ah my upstream was pointing to the wrong repo - I was able to build it ok, and made a PR for compiling using the tvOS SDK - thanks!

@jet082 Thanks for making this script! I set it up, but I am in general not able to build any core. Lots of missing files and I read very often

clang: warning: no such sysroot directory: ā€˜-cā€™ [-Wmissing-sysroot]

Am I missing anything? Am on Catalina and using Xcode beta

Tried also building without your script, same.

Building for macos is working :thinking:

Thanks

Can somebody please compile Mame_libretro core for IOS 6 ?

Thanks

@URBANsUNITED

Please turn debug mode on (set debug to True) and upload the file failedLog.txt in your output directory.

Hi @jet082

I did that earlier already to see if I can get any hintsā€¦

Thatā€™s the way Iā€™ve set up the script:

libretroSuperDir = os.path.expanduser("~/Retroarch-Stuff/libretro-super")
retroarchDir = os.path.expanduser("~/Retroarch-Stuff/libretro-super/retroarch")
outputDir = os.path.expanduser("~/Retroarch-Stuff/output")
coreArchiveDir = os.path.expanduser("~/Retroarch-Stuff/core-archive")
developerName = "xxx Name exists"
profileName = "~/Retroarch-Stuff/Profile.mobileprovision"
finalPackage = "tvos-arm64"
listOfFallbacks = ["ios-arm64"]
extension = "dylib"
debug = False
manualSigning = False

I set up the dirs as stated: 17

Maybe youā€™ll find the reasonā€¦

Logfile

Thanks

URBANsUNITED

@URBANsUNITED

So, can you run open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg and finish that installation. Then see if you can compile 2048 by running libretro-build-tvos-arm64 2048. If it does not succeed, can you verify you are using xcode correctly in cli via xcode-select -p. It should print out something like /Applications/Xcode-beta.app/Contents/Developer.

edit:

suggesting 2048 instead of gw since gw doesnā€™t build on tvos without a tweak or two (it should still build in your script though and be included in your final IPA since you have ios-arm64 as a fallback. It OUGHT to work too).

Also, a minor thing - your profile name needs to be a string - not the filename. Like mine is ā€œSamuel.ā€ But since you have manual signing set to false, that shouldnā€™t matter really.

Soā€¦ Looks like Iā€™ve found the problem. You pointed me in the right direction. Xcode Beta wasnā€™t installed, was in Downloads and Xcode 10 was still installed.

  1. uninstalled Xcode 10
  2. Copied XCode 11 beta into Apps
  3. sudo xcode-select -s /Applications/Xcode-beta.app
  4. xcode-select -p to see if /Applications/Xcode-beta.app/Contents/Developer shows up
  5. ibretro-build-tvos-arm64 2048
  6. Profit! :star_struck::100:

This is my current result: Attempting to build gw with tvos-arm64

Failed to build gw with tvos-arm64

Attempting to build gw with ios-arm64

Successfully built gw with ios-arm64

Attempting to build freeintv with tvos-arm64

Successfully built freeintv with tvos-arm64

Attempting to build parallel_n64 with tvos-arm64

Failed to build parallel_n64 with tvos-arm64

Attempting to build parallel_n64 with ios-arm64

Failed to build parallel_n64 with ios-arm64

Attempting to build mesen-s with tvos-arm64

Failed to build mesen-s with tvos-arm64

Attempting to build mesen-s with ios-arm64

Failed to build mesen-s with ios-arm64

Attempting to build openlara with tvos-arm64

Failed to build openlara with tvos-arm64

Attempting to build openlara with ios-arm64

Failed to build openlara with ios-arm64

Attempting to build px68k with tvos-arm64

Successfully built px68k with tvos-arm64

Attempting to build mame2010 with tvos-arm64

Failed to build mame2010 with tvos-arm64

Attempting to build mame2010 with ios-arm64

Failed to build mame2010 with ios-arm64

Attempting to build mame2015 with tvos-arm64

So, Iā€™ve gotten pretty tired of having to build every core each time. As a result, the next update to my script will keep a small local database (using tinydb, most likely) of which revisions your last build of each core is representative of. It will also keep track of which revisions failed to build. Then, it will only build those cores that have had updates since your last build. It will therefore skip cores you have already built (and just pull those in from your archive) and also cores that wonā€™t build. This should, rather substantially, reduce the amount of time the script takes to run. Likely by multiple hours.

I would also like to move the zipping over to python rather than pulling in the zip command.

Thatā€™s the goal, anyway.

The downside is that it will now require a module to be installed. Itā€™s fairly easy to install pip though and install tinydb that way, so hopefully the extra step will not be too bad.

Okay, the script has been updated.

It now uses tinydb to manage which packages have been installed and with which versions. If you have tried and succeeded or failed to build a particular version of a particular package for a particular target architecture, it will not attempt to build it again. Unless the package updates, of course. This saves many, many hours.

If you would like to rebuild a package anyway, simply edit the file buildDatabase.json in your output directory. Then find the core+platform combo and set buildSuccess to -1. Or, if you want to rebuild everything, simply delete the json file entirely.

The script also now uses gitpython to manage git updating, etc. There is a new option to toss local changes, in case you want to be as close to the github as possible (and to avoid potential pull conflicts, etc). However, if you have local changes you want to keep (for example, the fixes I posted in the op), you can keep them if you set eraseLocalChanges to False.

All of this does add a new step. Before running the new script for the first time, please run sudo easy_install pip; sudo pip install tinydb; sudo pip install gitpython

(Note that the first time you run the script, it will still rebuild all packages. But this is only the first time you do so)

Hi!

I really like the new database feature, but it doesnā€™t work:

python /Volumes/osX_DaTa/-=Benutzer=-/Andreas/Retroarch-Stuff/Script.py

Traceback (most recent call last): File ā€œ/Volumes/osX_DaTa/-=Benutzer=-/Andreas/Retroarch-Stuff/Script.pyā€, line 37, in coreArchiveDatabase = tinydb.TinyDB(os.path.join(outputDir, ā€œbuildDatabase.jsonā€)) NameError: name ā€˜tinydbā€™ is not defined

Itā€™s installed:

Requirement already satisfied: tinydb in /Library/Python/2.7/site-packages (3.14.1)

Btw. Iā€™ve compiled all cores, but the Retroarch files was only 8,4mb sized

All finished! Your IPA file is located at /Volumes/osX_DaTa/-=Benutzer=-/Andreas/Retroarch-Stuff/output/tvos-arm64-e1a7b82b2ee08f85b1683c7240aeb64cb8862827-2019_09_15_11_48_AM.ipa

19 ios-arm64 cores

70 tvos-arm64 cores

But all are still under libretro-super -> dist

Strangeā€¦

Can you open a python widow and just say import tinydb and see if it imports properly?

If it does, you copy/pasted the script incorrectly (Iā€™m guessing you didnā€™t copy the top line or something?).

As for the IPA file - can you tell me whatā€™s in your coreArchiveDir? Also, it makes no sense for them to be in dist, since those ought to be cleaned up whenever cleanup() is run at the start of the script. Are you modifying it?

It was the missing first line. Sorry :see_no_evil:

Corearchivedir is empty except the 5 cores dirs and ios-arm64 + tvos-arm64 s two tiny files No I didnā€™t modify the script. Left it original except the dev nameā€¦

With the new script is looks like that it is working. The first files poppin into their dirs within the core-archive

So, it seems to work now

Sorry againā€¦

Yeah in this release (that you are using) I fixed a handful of bugs that might have caused your troubles earlier regarding cores copying over. Tell me if it works fine this time - and then run it again and see if it properly skips the right cores. Iā€™d love to hear if it works!

Nope, canā€™t finish:

And now, we build your IPA...
Traceback (most recent call last):
  File "/Volumes/osX_DaTa/-=Benutzer=-/Andreas/Retroarch-Stuff/Script.py", line 239, in <module>
    finalBuild()
  File "/Volumes/osX_DaTa/-=Benutzer=-/Andreas/Retroarch-Stuff/Script.py", line 227, in finalBuild
    finalBuildDirectory = glob.glob(os.path.join(retroarchDir, "pkg", finalBuildTranslation[finalPackage]["endPlacement"], "build", "Release*/*.app"))[0]
IndexError: list index out of range

The database function works:

You've already tried and failed to build this version of sameboy for ios-arm64
You've already tried and failed to build this version of handy for tvos-arm64
You've already built this version of handy for ios-arm64. No need to rebuild...
You've already tried and failed to build this version of vecx for tvos-arm64

Attempting to build flycast with tvos-arm64
Failed to build flycast with tvos-arm64
Attempting to build flycast with ios-arm64
Failed to build flycast with ios-arm64

Failed to fetch test - RetroArch recipe problem! 

But no IPA

EDIT Maybe the reason is that my Signing Team is gone. Checking atmā€¦ Changed back to mineā€¦

Edit 2

No that wasnā€™t the reason

Building by Xcode succedesā€¦

If you are building for tvOS, make sure that manualSigning is set to False and that eraseLocalChanges is set to False as well.

Then open the project file with xcode, set your team and save and exit, then try to run the script again. It SHOULD work.

You wonā€™t believe it.

The script finishes building my IPA file WITH modules now!

I had checked my project file more than 3 times and always had to change to ā€œmanuell signingā€ within. I did the same steps as I did with the former script version. But there was all fine. Very odd!

The save option is greyed out, so you canā€™t save. I had to close the project to make the changes saved. But I didnā€™t do these steps before and the script builded my IPA file even thoughā€¦

So, the script, the database etc. all is working very nicely!

Many thanks for this fantastic job and patience with me :wink:

I will put all the unwanted stuff to the ā€œstuffToRemoveā€ section to trim my end file and setup. And after this I will try to build the cores which I want but didnā€™t build. Will seeā€¦

Maybe you can add a feature to check out libretro-super and retroarch to be up to date there too? But only whith a query if you want to updateā€¦

Many thanks again :star_struck:

URBANsUNITED :raising_hand_man:

Both of those repositories are also kept up to date automatically via updateSomeDir(libretroSuperDir) and updateSomeDir(retroarchDir). However, they are not built into the database system.