Xcode5 post-archive script for Sparkle package no longer works - xcode

Xcode 5 seems to have changed the way it stores the build application package (xxx.app) such that ditto no longer works. In the ../BuildProductsPath/Release/ directory, the app is actually a symlink to .../InstallationBuildProductsLocation/Applications/...
MyApp.app -> ~/Library/Developer/Xcode/DerivedData/MyApp-emwilkqhlayanxahjpexlpbbkato/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp
This breaks the ditto command I was using to create a zip file of the application to put on my Sparkle update server.
Anyone have an updated script for building the Sparkle XML and ZIP files? Or know what environment variable I need to use to locate my actual binary after the Archive phase?
Here's the relevant lines from the post-archive script:
ARCHIVE_FILENAME="$HOME/Desktop/$PROJECT_NAME-$VERSION_STRING.zip"
cd "$BUILT_PRODUCTS_DIR"
ditto -ck --keepParent "$PROJECT_NAME.app" "$ARCHIVE_FILENAME"
That's from the sample script on the Sparkle website.

Turns out that in Xcode5 you need to pull the app package from the archive directory, not the Built Products directory. This works:
ARCHIVE_FILENAME="$HOME/Desktop/$PROJECT_NAME-$VERSION_STRING.zip"
ditto -ck --keepParent "${ARCHIVE_PRODUCTS_PATH}/Applications/${PROJECT_NAME}.app" "$ARCHIVE_FILENAME"

Related

Why the same zip file doesn't work in MacOS?

This is quite strange for me. I have an APP file (.app) which works on my MacOS. I want to upload it into the AWS S3 so I zip it as .app file is considered as a folder. When I download the zip file and unzip it, the app doesn't work anymore.
I even tried zipping it in terminal
zip -yr myapp.zip myapp.app
And when I download it, I also tried unzipping it in terminal
unzip myapp.zip -d myapp-folder
But that was also doesn't work. I checked the app size and they are identical. Any idea why it happens? and how can I fix it?
zip/unzip don't preserve file attributes (including extended attributes). To fix this, use ditto tool instead of zip/unzip.
The same rule for just copying files: use ditto instead of cp

Appimage make package issue

I need to release my program which wrote in ruby. first of all I would like to make ruby to appimage package to client linux.
now I make the "ruby-img" folder and put the desktop file down looks like:
[Desktop Entry]
Categories=Development;
Icon=ruby
Name=ruby
Type=Application
Exec=ruby
the ruby what I use was compiled --prefix to "/app" folder, the folder is "/app/ruby" that contains "/app/ruby/bin, /app/ruby/lib ..." and then I copied /app/ruby entire folder to "ruby-img" folder, it looks like "ruby-img/app/ruby, ruby-img/usr ..." then I make the symbol link as "ln -r -s app/ruby/bin/ruby usr/bin/." in "ruby-img" folder.
and using appimagetools to create ruby-x86-64.AppImage. but can not run. some ruby lib can not found, (it looks like running ruby.AppImage, ruby lib path still find in /app/ruby/lib, but not in "ruby-img/app/ruby/lib", if i renamed /app/ruby it will occurs error)
i have tried recompile ruby --prefix to /usr/local/ruby or /tmp/ruby ... then copy to "ruby-img" and make some relative things, fix desktop file, but still can't run ruby.AppImage what appimagetool created.
any idea can help me ? thanks
I think you ran into the same problem as I did. Check https://github.com/AppImage/AppImageKit/issues/1004#issuecomment-1018423834

Adding an addon to Zotero using bash?

While trying to install and configure Zotero using a bash script, I'm encountering some difficulties in adding an .xpi addon using bash. The documentation says:
To install a plugin in Zotero, download its .xpi file to your
computer. Then, in Zotero, click “Tools → Add-Ons”, then drag the .xpi
for the plugin onto the Add-Ons window that opens.
My closest approach was simulating the "open with" option and chosing "Zotero". However, even when using "open with" manually, Zotero assumes the incoming file is a literature file instead of an addon file. So the implementation:
#!/bin/bash
zotero some.xpi
Analogous to option 1 of this answer, launches Zotero, yet it does not (prompt the user to) install the add-on.
I did not yet find an API or method to load the add-on automatically. Hence I would like to ask: How can I add an arbitrary .xpi add-on for Zotero from a bash script?
The instructions in the documentation did not work for me, so I found out another method:
One can
Download the Zotero standalone version
Get the add-on source code
Compile the add-on into a build directory that contains an install.rdf file
Copy this build directory into the /modules/ directory of the Zotero Standalone Build repository
Compile the Zotero Standalone Build repository into a build (exported to /staging/<your system architecture>/)
Add the instructions to include the new addon when Zotero loads, into the /staging/<your system architecture>/defaults/prefs.js file.
Start zotero using: ./zotero.
git clone --recursive https://github.com/zotero/zotero-standalone-build
...
npm run build
git clone git#github.com<your zotero extension>.git
# Switch out build file to add additional plugin
cp -r "src/build.sh" "src/submodules/zotero/zotero-standalone-build/build.sh"
..
npm build
...
staging/Zotero_linux-x86_64/zotero -purgecaches
I created a modified build.sh file for the zotero-standalone-build which adds the extensions to the prefs.js file with:
echo 'pref("extensions.something.unopkgPaths", "{}");' >> "$APPDIR/defaults/preferences/prefs.js"
echo 'pref("extensions.something.version", "");' >> "$APPDIR/defaults/preferences/prefs.js"
echo 'pref("extensions.something.installed", false);' >> "$APPDIR/defaults/preferences/prefs.js"
echo 'pref("extensions.something.skipInstallation", false);' >> "$APPDIR/defaults/preferences/prefs.js"
The build command specifics depend on the addon you want to include.

How to debug Mac OS X pkg?

I built a Mac OS X bundle Frequon Invaders.app, and it runs fine. The executable was created with Go. Then I packaged it like this:
$ pkgbuild --component 'Frequon Invaders.app' --install-location /Applications FrequonInvaders.pkg
pkgbuild: Adding component at /Users/Dad/Documents/projects/Frequon-Invaders-2.2/installer-macos/Frequon Invaders.app
pkgbuild: Wrote package to FrequonInvaders.pkg
When I open FrequonInvaders.pkg in Finder, I get a "install Frequon Invaders" window that lets me go through the motions of installing it, and the Summary part says "Installation was successful". But when I look in /Applications, it's not there. Indeed none of the files in the bundle were installed.
[Updated] After looking around, I found that the package appears to have been installed right on top of the original place that Frequon Invaders.app was originally built. It seems that the --install-location /Applications was completely ignored!
Question:
How do I use pkgbuild to build a package that is really installed where install-location said to install it?
How to debug Mac OS X pkg?
Debugging .pkg files is tricky because there's no easy way to get verbose output.
sudo installer -pkg my_package.pkg -target / -verbose
This may help understand the step that's failing but it really doesn't help narrow the problem down...
Next, you can use a utility like The Unarchiver to extract the .pkg file. Your scripts will need to be extracted twice by this utility.
Note: If you prefer the command line:
xar -xf my_package.pkg # extract pkg
tar -xf Scripts # extract scripts
From there, you can attempt to troubleshoot what's going wrong with the scripts.
But in my case, the only way I was able to debug the scripts were to run the package over and over echoing debug statements to a file.
For example:
# preinstall
echo "here!" >> /Users/Tom/Desktop/debug.txt
for such simple installers it is always better to use a tool to do the work for you. I usually use the Packages tool
http://s.sudre.free.fr/Software/Packages/about.html
which is free and really really good.

exporting a project in rubymine

I've created a project and now want to export it to another folder so I can do work on it. The project itself is a repository so thats why I don't just want to copy and paste the files (since I'll get the hidden .git files with it).
Is there a simple way to export a project in rubymine?
If you use GitHub you could push all current files to your repo, then (assuming you are on a *nix command line) mkdir and/or cd into the NEW folder that you want to work in. You could then perform a:
$ git clone git#github.com:username/projectyouwanttomove.git
Let me know if that helps or not.

Resources