Statically linking fontconfig: disable `fonts.conf` file - fontconfig

My application statically links libfontconfig.a on macOS, but does not ship with any fontconfig configuration files.
Each time the application starts, it gives a warning about fonts.conf not found. After that it falls back on default fontconfig settings and everything works great. Is there a way to build or configure fontconfig to never use fonts.conf and instead always use default settings?

I think, the question's itself is actually about to find out this missing file.
Currently your application's details are unclear, such as target platform Mac OS X or iOS (so this answer could be updated if OP provides more information) but I think you have deleted fonts.conf accidentally and:
According to Synopsis of man fonts-conf or online manual. For Linux fonts.conf is normally located:
/etc/fonts/fonts.conf
/etc/fonts/fonts.dtd
/etc/fonts/conf.d
$XDG_CONFIG_HOME/fontconfig/conf.d
$XDG_CONFIG_HOME/fontconfig/fonts.conf
~/.fonts.conf.d
~/.fonts.conf
But in your case this file is must be shipped with your application, because Mac OS X and iOS apps don't rely on dependencies. So I tried to find a fonts.conf file on my MacBook with:
sudo /usr/libexec/locate.updatedb
locate fonts.conf
Incidentally I have found it under GIMP:
/Applications/GIMP.app/Contents/Resources/etc/fonts/fonts.conf
Later on I have decided to search it in GitHub and I found it under these repositories:
1|https://github.com/EricssonResearch/cerbero/blob/master/data/xcode/templates/ios/GStreamer%20Base.xctemplate/fontconfig/fonts.conf
2|https://github.com/xil3f/podofo_iOS_sample/blob/cd0be2d225d0bdfbe3c0ec163fb4cce67534825f/fonts/fonts.conf
These files are nearly identical.
For a cross-platform Linux-originated Mac OS X app it's located in: ./Contents/Resources/etc/fonts/fonts.conf
For iOS sample apps it's located in: ./fontconfig/fonts.conf or ./fonts/fonts.conf
So these locations can give you an idea about where to put fonts.conf file on your project.
You can either try to put these fonts.conf files above to necessary location(s) or you can use this sample configuration file provided by Apple Open Source for OS X:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/System/Library/Fonts</dir>
<dir>/Library/Fonts</dir>
<dir>~/Library/Fonts</dir>
</fontconfig>
P.S. Please OP leave a comment so we can improve the answer together.

Related

Unity3d OSX "Application can't be opened"

I'm using a PC and I've created a build for Mac standalone.
I shared the file with my test user by zipping and emailing the build, but when he tries to run the application he sees this error:
The application "SomeApp.app" can't be opened.
After some searching, I learned that I need to do chmod to open the file. Can anyone tell me how to do that on a Mac?
The zip format doesn't have easy support for Unix-like file permissions, so your transfer process is stripping any permission flags that OSX uses to recognize files within that zip that are supposed to be executable. This can also happen with other file transfer solutions, so it's something to watch out for.
The best solution would be to create an archive which does keep those permissions, such as a tar archive.
Failing that, you can have a Mac user open a terminal and set the permission flag manually:
chmod a+x SomeApp.app/Contents/MacOS/*
(Replace SomeApp.app with whatever your .app folder is named)
I had the same issue, I left an answer here, at the bottom: https://forum.unity.com/threads/mac-build-breaking-when-uploaded-to-storage.1093330/
The problem was not with the .zip, but rather with the build itself. Ran fine on my Mac, did NOT run fine once I uploaded it and downloaded it again (or if anyone else downloaded it).
Edited 12/8/2021, as per EmiOB's suggestion, to add the text of my answer (same as in the link):
This worked for me on 2020.3.16f1:
In the Unity Editor: Build Settings, check the box that lets you make an XCode project (requires having XCode installed, I believe I have Xcode 11)
Open the XCode project
Build
That solved my problem :)

Is there a method for sharing and syncing the iOS simulator Applications folder

Our sales team often needs to give demos of apps currently in development. We've used a variety of methods to get them installed on their laptops but everything has been very manual.
The initial method we were using had us downloading the source code and compiling each and every project for each and every salesman. Very time consuming and annoying.
Then we got a little smarter and realized that we could copy out the Applications folder for the iOS simulator and just past that over the iOS simulator's Applications folder on each salesman's laptop. Much better, but still the manual part of copying them all over to each laptop.
So I started poking around about some folder syncing options for macs and came across this technique http://www.youtube.com/watch?v=iWoXPWlu_Dk
Very awesome and seemed to meet my need exactly. I had one central shared folder I could throw new iOS applications into and then the salesmen's laptops would automagically sync with that applications folder and new apps would just appear with no need to ever have their laptops here.
Unfortunately, the iOS simulator does not seem to be recognizing the Applications folder when it's a symbolic link or alias. Is there some Mac magic that could make this work? (I'm a Windows guy normally, just recently been working in the iOS world, so there could be something basic I'm missing here).
I'd love to have the Applications folder /Application Support/iPhone Simulator/5.1/Applications be a shared folder that syncs automatically for them, grabbing any new applications we have ready for demos (and getting them updates to old ones). Just seems like a nice smooth way to get them early builds.
We've used services like TestFlight for the actual devices and that's a great option for that, but when they don't have a device handy or are just blasting through demos on their laptops we'd love to have a nice easy process for keeping them up to date with new builds for their simulator install.
First a bit of background, you don't really need this, but I like teaching :).
On Unix, and now MacOS, there are two basic kinds of links. 'normal' links, and symbolic links. Alias, on windows, unix and mac are a kind of symbolic link: the link contains a reference to the original file. Normal, or hard links create a second directory entry that points to the data, if you delete the original file, the OS knows that there is still another entry pointing to it, so it only actually deletes the file (or directory) when all hard links have been removed. The disadvantage of hard links is that they have to be on the same file system, so that the file system can keep count of how many hard links there are.
OK, I've just installed Dropbox, and it seems that it creates a real folder in the user's home directory, so unless you're a complicated disk partitioning scheme, or file vault 1, where the user's home directory is actually an encrypted disk image, you can use a hard link. It also means that you don't need to copy or sync, as Dropbox is already doing that.
One thing not corrected, but didn't actually point out is that in your post, you seem to be copying to /Application Support, not ~/Library/Application Support or /Library/Application Support. Since you've got the basic scheme working without dropbox, I'll assume that is a typo.
Before I give you the commands, you might want to delete the old iPhone Simulator Applications directory with the Finder, instead of using the rm command, as the rm command is potentially very destructive.
OK, finally, the commands to do the linking; the quotes are important whenever filenames contain spaces. This example is for ~/Library
rm -rf "~/Library/Application Support/iPhone Simulator/5.1/Applications"
ln "~/Dropbox/Simulator Applications" "~/Library/Application Support/iPhone Simulator/5.1/Applications"
This should work, you can stop reading now, the rest is just more education :)
Tilde (~) is a short cut for the users home directory. Use the commands without this to work on /Library instead.
If you want to be sure you've got the exact path, you can drag files and folders from a finder window into the terminal, the path gets pasted instead of the file.
If you're messing with stuff in the root filesystem, you might need superuser rights. If you are logged in with an admin account, you can run single commands with superuser access as follows.
sudo ln "/Library/Application Support/iPhone Simulator" fred
The shell asks for your password, and then runs the command for you as superuser.
sudo remembers the authorization for a few minutes, then you have to authenticate again.
Haven't tested this since I only have one Mac, but give this a try:
Install Dropbox
Create a shared folder there and copy your apps from /Users/USERNAME/Library/Application Support/iPhone Simulator/5.1/Applications
Create a shell script to copy them back to the simulator's location, and add it to the shared folder. It should look something like this:
#!/bin/sh
cp -R ~/Dropbox/Appfolder/appname ~/Library/Application Support/iPhone Simulator/5.1/Applications/
Have your users sync their dropboxes to get the files, then run the shell script to copy the files.

Compile existing Lua app using XCode for iOS5

We had a freelance developer that went rogue and now I'm left with a Lua-based app with no build files.
I have a degree in computer science, but have no experience with Lua, so I'm wondering how I can compile this (or any Lua app) with XCode for iOS.
It's a fairly simple app. It appears as though it loads in images for navigation and displays other images as content.
How do I tell XCode to compile Lua for iOS though? I have all the files in XCode and it's compiling, but clearly its ignoring the .lua files and compiling the application shell.
I have Lua downloaded by source and also installed it via MacPorts. I read that I need to link lua.h and luac.h but I don't see how to add it as a build target.
Any advise or direction would be much appreciated.
These are the files I have:
Source Code/
build.settings
Clinical_Data/
page4a_2_Anim.lua
page4a_3_Anim.lua
page4a_4_Anim.lua
page4a_5_Anim.lua
page4b_2_Anim.lua
page4b_3_Anim.lua
page4b_4_Anim.lua
page4d_2_Anim.lua
page4d_3_Anim.lua
page4d_4_Anim.lua
config.lua
home.lua
Icon-72.png
images/
<*.png files>
main.lua
manifests/
CaseStudy.manifest.txt
ClinicalData.manifest.txt
Experience.manifest.txt
Home.manifest.txt
NavElements.manifest.txt
Pathology.manifest.txt
References.manifest.txt
Restasis.manifest.txt
menu.lua
page4a_2_Anim.lua
page4a_3_Anim.lua
page4a_4_Anim.lua
page4a_5_Anim.lua
page4b_2_Anim.lua
page4b_3_Anim.lua
page4b_4_Anim.lua
page4d_2_Anim.lua
page4d_3_Anim.lua
page4d_4_Anim.lua
parser.lua
pdfs/
<*.pdf files>
section.lua
slide.lua
slideView.lua
ui.lua
It's probably linking lua from your installed lua code. There'll be a -llua in your link code. Somewhere in your source files there'll be a
luaL_loadfile(L, file);
command. This loads the lua file.
If it's corona it might have a different way to load - haven't used it.
If you need an IDE http://www.eclipse.org/koneki/ldt/ is superb. You can remote debug your app very easily.
It looks like it may be corona from anscamobile.com.
You can download a trial version from their site to see if it compiles.

UUID mismatch detected with the loaded library AFTER INSTALLING SPIRE when trying to run an App from XCode [iOS 5.0.1]

I've read about this argument here: UUID mismatch detected with the loaded library
The most voted solution didn't work for me, because I'm sure in my case the problem is Spire.
When I try to run my App [iOS 5.0 targeted] in Xcode 4.2 onto my iPhone 4 [iOS 5.0.1 JB] the output in the console is:
warning: UUID mismatch detected with the loaded library - on disk is:
/Users/myusername/Library/Developer/Xcode/iOS DeviceSupport/5.0.1 (9A405)/Symbols/System/Library/Frameworks/CoreLocation.framework/CoreLocation
unable to load symbol file: warning: Unable to read symbols for /Library/MobileSubstrate/MobileSubstrate.dylib (file not found).
warning: No copy of MobileSubstrate.dylib found locally, reading from memory on remote device. This may slow down the debug session.
Before installing Spire I didn't have any Xcode problem. I've read that somebody already found a solution: https://stackoverflow.com/a/8930742/1203837 but I'm not so practical in approaching the proposed one that I'm going to report also here:
If you have Spire installed and you updated to 5.0.1 you need to uninstall Spire or update dyld_shared_cache which Spire is using...Spire dyld cache is at /var/spire. You need to extract cache appropriate to your current firmware from ipsw.
I really would NOT uninstall Spire, so please help me to find out how to "update dyld_shared_cache which Spire is using" .
EDIT: thanks to kexik I've tested a fully working workaround for the problem.
Whatever device you have installed Spire in, here is the step-by-step guide (Mac OS):
download the original iPhone 4S ipsw ( link )
rename it from .ipsw to .zip
extract it (normally, by double-clicking it in Mac OS X)
download vfdecrypt ( link ) ed unzip it into the same extracted folder of the ipsw.
Open Terminal and navigate into the ipsw extraxted folder (tip: type cd then drag-and-drop directly the folder into the Terminal window)
Run the command:
./vfdecrypt -i 038-3763-001.dmg -o decrypted.dmg -k a31ffd506c6711c5a0c52c9f0a2f7208a2f63ad9dd40506e70d80ea20a981eb1312bc774
NOTE:
-i 038-3763-001.dmg
Is relative to the biggest .dmg in all the ones you can find into the extracted ipsw folder (referred to the Root File System)
-o decrypted.dmg
Is relative to the name of the output decrypted file, I called "decrypted" (the extension .dmg is fixed)
-k a31ffd506c6711c5a0c52c9f0a2f7208a2f63ad9dd40506e70d80ea20a981eb1312bc774
Is relative to the VFDecrypt Key exactly for iPhone 4S iOS 5.0.1 and 038-3763-001.dmg image. Source is theiPhoneWiki
Wait until the process terminates (You'll see a new prompt line)
Open (mount) decrypted.dmg (double-click it) and here it is the iPhone 4S root file system.
Navigate into the folder
/System/Library/Caches/com.apple.dyld
Make a copy of the (only) file dyld_shared_cache_armv7 (i.e. on your desktop) and rename it to dyld_shared_cache_armv7.new
Copy it (I used DiskAid) into your iDevice file system at the path
/var/spire
Navigate into that path (I used iFile Cydia App directly on my iPhone) and rename the original dyld_shared_cache_armv7 in dyld_shared_cache_armv7.bak. Rename now the recently copied dyld_shared_cache_armv7.new in dyld_shared_cache_armv7. Check that the new dyld_shared_cache_armv7 has the same properties than the dyld_shared_cache_armv7.bak (I had to add the execute property to the new file), than delete dyld_shared_cache_armv7.bak (I suggest also to backup that file before deleting it in case of problems).
Save, exit iFile, unplug from your Mac and reboot your device.
Reopen XCode and plug your device in. It probably won't be automatically detected. In this case open the Organizer (Window -> Organizer) and delete the current iPhone (or iPod touch, or iPad) profile (mine one had the the yellow light instead of the green one near the name), unplug it, reboot Xcode, reopen Organizer and wait your device profile auto installation process.
NOW your device should be fully working debugging your Apps! My iPhone 4 GSM iOS 5.0.1 JB with Spire installed does.
Hope this guide will help whoever have the same problem.
Thanks again kexik for his suggestions!
Find an ipsw for which there is the decryption key. Then uzip that ipsw and search iphone wiki for that particular firmware - there you will find a key as well as the name of .dmg file with root filesystem. Extract that dmg (using vfdecrypt or dmg decryptor) in extracted filesystem look for /System/Library/Caches/dyld.../dyld_shared_cache and copy that file to the place on the device I mentioned.
Sorry for not giving exact instructions, I wrote it from my memory. If needed, let me know and I will prepare more exact step-by-step. ;)

How to run phone gap with xcode4?

Since moving to XCode4, I have been getting errors like:
/VERSION: No such file or directory
cp: /javascripts/phonegap..js: No such file or directory
cp: /javascripts/phonegap..min.js: No such file or directory
error: /VERSION: No such file or directory
for projects that were working under XCode3.
Open XCodes Preferences, and navigate to Source Trees. If there is no PhoneGapLib entry there, try adding a new setting with the following values:
Setting Name: PHONEGAPLIB
Display Name: Phone Gap Lib
Path: /Users//Documents/PhoneGapLib
Note that the path should be to the location of your PhoneGapLib folder, and that it may not be in your documents folder, depending on how you installed PhoneGap.
I just learned about a great web service recently made available by Nitobi (makes of PG), which will automatically generate the necessary PhoneGap files you need for use in Xcode 4.
Just enter your project name, hit a button and they'll generate a zip file for you to download. This lets you set up a new project without messing with the command line.
You could set up a new project, then migrate your older project files over.
Did you search Google for this error?
I'm a bit of a noob with PhoneGap and Xcode still, but I know there have been recent issues with PG and Xcode 4. Perhaps you're experiencing the same issues as the commenters to this post: PhoneGap + XCode4 (and more specifically, here).