Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I embed CEF3 into my OSX application?

I like to use the Chromium browser instead of the WebKit browser in my OS X project.

  1. I downloaded the binary files at https://cefbuilds.com
  2. I builded with cmake that creates a cef.xcodeproj.
  3. Once I open that and want to build it. It first gives me problems because virtual bool Execute needs to be override. When I solved that error it goes a lot futher but crashes at:

    cefsimple /bin/sh: tools/make_more_helpers.sh: /bin/bash: bad interpreter: Operation not permitted
    make: *** [cefsimple_buildpart_2] Error 126
    Command /bin/sh failed with exit code 2
    

Can anyone explain what I'm doing wrong?

like image 674
Mark Avatar asked Oct 30 '22 15:10

Mark


1 Answers

In OS X versions 10.7.4 and above extended attributes are added to executable files (including shell scripts) and handled by the security settings you have defined for your account. For example checking the xattr on one of your build scripts might look similar to this:

$ ls -l@ make_more_helpers.sh
-rwxr-xr-x@  1 Hellman  staff  3564 Sep  2 07:02 make_more_helpers.sh
         com.apple.quarantine          23

When Xcode tries to execute the script (again depending on your security settings) it will look at the extended attributes and determine whether or not to allow it to execute. If it finds that the creator of the script has not been approved you will receive an error such as:

make_more_helpers.sh: /bin/bash: bad interpreter: Operation not permitted

Fortunately it's an easy fix and there are quite a few ways to remedy it. One such way would be to associate scripts that are part of projects you build with Xcode. You could also open the script in an editor that is allowed to run scripts and re-save it, or just recursively scan your build directory for files with quarantine attributes and remove the attribute:

xattr -rd com.apple.quarantine /path/to/build

After you do this you should notice that doing another ls -l@ on your script the @ following the permissions and the com.apple.quarantine should be removed. Now when you try building your project the script should be allowed to execute and succeed.

↳ https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/ShellScripting/BeforeYouBegin/BeforeYouBegin.html

like image 183
l'L'l Avatar answered Nov 15 '22 06:11

l'L'l