-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command line creation of OSX app bundles #1
Comments
I think your theory about the different environment is most likely correct. I load some openCL kernel code from a file for example. How can I see the normal error output of my code when I run it with open? How can I detect that I'm running from inside an app bundle and find the proper resources from within haskell? |
I cloned your repository and I get the following output from `hs-sdl-mac-0.1.0.0: configure -- While building package hs-sdl-mac-0.1.0.0 using: |
From my first post:
The console app is at
Use
Homebrew removes write access to the files it installs, and
and re-run |
I've patched |
Ok, that's working. I'm working on the executable-path stuff, I'll let you know how that goes. |
I think I almost have this working, unfortunately the when I try to add a file to the resources list field of the MacApp structure it does not seem to be able to find that file regardless of trying multiple places including the root directory of my project. Any ideas on this? |
What's the error message? As a test, when I add README.md to the resources field for this project,
it builds as
In particular,
And opening the Resources directory shows README.md being there. |
Got it, whitespace at the end of the string was tripping it up. Do you have a minute to get on Skype to talk about completing the bounty? |
Great! I don't use Skype, but you can email me at nanotech@nanotechcorp.net and we can talk there. |
cabal-macosx
does almost all of this already, so that's what I've used in this sample project. It works with both cabal and stack. The missing pieces were:Cabal
custom-setup
support in stack. This actually was implemented just recently, but is not in a released version yet. The workaround meanwhile is to add the setup dependencies to the main library's dependency list and addexplicit-setup-deps
to thestack.yaml
.Rez is no longer needed to build modern Mac apps and can just be totally removed from the build process.
In
LSOpenURLsWithRole() failed with error -10810 for the file...
,-10810
is listed as an unknown internal error, but in my experience it has meant that the program has crashed before it has registered with launch services. This can be because of the difference in environment between running from the command line and from launch services (open
and Finder). Running the program from the command line inherits the current working directory and environment variables, while running fromopen
or Finder starts with a standard environment and a different current working directory unrelated to your shell's. File assets accessed by relative path, or expecting your shell'sPATH
when running subprocesses are typical culprits. Standard output and error are written to the Console app when run from launch services, which may help debug this.As I don't have your program, I can't determine if this is the exact cause, but whether this sample project runs will be a good indicator.
Continuing with the requirements:
Aside from documentation and tests, the only other mention or use of Carbon in
cabal-macosx
is in theLSRequiresCarbon
key in the default plist, however the documentation for it saysSo whether it's there or not should not matter at all on any recent OS version.
Integrating common libraries like SDL2 and OpenCL is mostly a matter of chasing their shared library dependencies and including them in the bundle, which
cabal-macosx
does.I haven't added resources aside from an icon to this sample project, but it is supported by
cabal-macosx
.The text was updated successfully, but these errors were encountered: