I see a lot of bundles here I'd like to get my hands on
http://svn.textmate.org/trunk/Bundles/
The problem is I don't know how to install them. I've read the section 5 of manual dedicated to bundles, but there's no example how to install those from SVN.
I see the existing ones have the extension .tmbundle, but those on SVN are done differently.
Try installing the bundle "GetBundles". It will help you pick new bundles in a nice GUI. I've been using it myself and it's definitely better than manually installing bundles.
mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd !$
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
osascript -e 'tell app "TextMate" to reload bundles'
Then, go to "Bundles" - "GetBundles" - "Get Bundles". (source)
Alternatively, you can just put your .tmbundles into ~/Library/Application Support/TextMate/Bundles, as you may have seen from the code above.
Download a bundle by going to its page, e.g. https://github.com/textmate/matlab.tmbundle and clicking the Download ZIP button.
Unzip it.
Change the name of the folder from
matlab.tmbundle-master
to
matlab.tmbundle
Now you can open it.
Or you can just download them and double click to install, as long as the extension reads tmbundle, that's how I do it.
Related
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.
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.
I want to install the ES6 language syntax highlighting at https://github.com/Benvie/JavaScriptNext.tmLanguage for TextMate 2. I cloned the repo, but it has a .tmLanguage directory with multiple files (.tmTheme, .tmLanguage, etc.).
Apparently, TM2 only supports everything inside a .tmBundle. Is there any clean way to just install the language support?
I just ran into this as well. There's a (closed, unfortunately) pull request that makes possible what you and I wanted. To get it working, I used dhensche's fork and performed the following:
Quit TextMate 2
Run the following:
git clone git#github.com:dhensche/JavaScriptNext.tmLanguage.git
cd JavaScriptNext.tmLanguage
./create-bundle.sh
cp -R JavaScriptNext.tmbundle ~/Library/Application\ Support/Avian/Pristine\ Copy/Bundles/
Re-launch TextMate 2, open an ES6 file, and select "JavaScript Next" from the toolbar along the bottom of the editor.
Hopefully Benvie will integrate proper TextMate 2 support in the build process soon, since it's not far off, as dhensche demonstrated.
Update
The JavaScriptNext.tmLanguage became obsolete since the official TextMate Javascript bundle now supports the new ES features.
Old answer below:
To have the most up-to-date version you should create a new bundle in the Bundle Editor File → New (⌘N), name it for convenience JavaScript Next:
Then, from the repo, open every .tmLanguage/.tmPreferences/.tmTheme file you want to use, and add it to your newly created bundle:
Now you should be able to select the JavaScript Next grammar:
Done!
I'm trying to create a xulrunner app for OS X 10.9+. I need it to be standalone, i.e. to not require any extra additional software (including Firefox) to be installed on the box along with the app.
I was not able to google up an up-to-date guide on how to do that. It seems that I've hit every issue described here: https://bugzilla.mozilla.org/show_bug.cgi?id=923979
One of the last ones is:
$ open MyApp.app
LSOpenURLsWithRole() failed with error -10810 for the file /Path/To/MyApp.app.
Here is an what I have so far:
https://drive.google.com/file/d/0BxRquYs2Nx92ZTZaVjk0QThMN2c/view?usp=sharing
How can I create an OS X .app for a modern (v36+) xulrunner application?
You are on the right track, there is just one major issue you are facing.
If you were to run you application by the command line, you would get some output like this.
$ SampleApplication.app/Contents/MacOS/xulrunner
Mozilla XULRunner 33.0
Usage: xulrunner [OPTIONS]
xulrunner APP-FILE [APP-OPTIONS...]
OPTIONS
--app specify APP-FILE (optional)
-h, --help show this message
-v, --version show version
--gre-version print the GRE version string on stdout
APP-FILE
Application initialization file.
APP-OPTIONS
Application specific options
As we can see, the executable did not automatically run the Contents/Resources/application.ini like the tutorials say it will. This is a known issue, and the popular workaround among XULRunner users is to create a stub shell script to pass the required argument to the xulrunner binary.
Here is a script I've whipped up to do just that.
#!/bin/sh
runpath="`dirname "$0"`"
contentsdir="`cd "$runpath"/.. > /dev/null && pwd`"
exec "$runpath/xulrunner" --app "$contentsdir/Resources/application.ini"
Save this text to a file in your MacOS directory and give it executable permissions. For sake of example, I will use sampleapplication. Here is the command to set executable permissions.
chmod +x sampleapplication
Now, modify your Info.plist to execute this script instead of executing xulrunner directly by setting the CFBundleExecutable entry to match your stub shell script.
<key>CFBundleExecutable</key>
<string>sampleapplication</string>
Now when you run your application, it should work. If you are getting an error saying "The application cannot be opened because its executable is missing", you may want to rename the application bundle, or follow the advice in that question to avoid the caching issue.
Bonus Info
You can remove the Contents/Frameworks/XUL.framework directory, it is no longer used and placing the XUL.framework contents in the MacOS folder is now the correct place to put them.
You should also copy the dependentlibs.list file from the Contents/MacOS to the Contents/Resources directory, although XULRunner 33 seems to be getting on fine without it.
I was wondering if the following is possible.
I have a BASH script that I want to make available for some people but I wanted them to only have to "install" the program and not messing around with terminal, so I thought a .deb would be cool.
So what would the "install" do?
Simple. I want to move the script and an icon to a folder (any folder, but I was wondering some hidden folder in Home) and then run a script that creates a launcher in the Applications menu for the first script. It seems there isn't much to it, but for what I've searched, there doesn't seem to be a lot of info...
How can I accomplish this?
By the way, I'm using Ubuntu 11.04.
Basically (install and) run dh-make to set up the debian/ directory, edit the generated files (mainly remove the many you do not need, and fill in a package description and any dependencies in debian/control), then debuild-us -uc -b.
You may also have to set up a simple Makefile for debian/rules to call; it probably only needs an install target to copy the binary to $(DESTDIR)/usr/bin.
Binaries install into /usr/bin and you should not try to override that. The way to have a menu is to add a .desktop file.
Once you have a good .deb you will need to set up a repo for distributing it. The simplest solution is probably to set up a launchpad.net account and create a personal PPA there.
It's not hard to find more information on these topics, but of course, you need to know what to look for. The canonical documentation is the Debian New Maintainer's Guide.
Found this video on youtube that explains IN FULL the process of creating a *.deb for a script or program and even mentions how to do it for a C program.
Full guide in how to build simple *.deb package
Has one bug, btw, that the author, during the making of the *.deb, didn't notice. The path in the *.desktop file for the EXEC parameter is wrong in the example.