Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

[LINUX] build a .tar.gz to be unpacked anywhere. #433

Merged
merged 8 commits into from
May 5, 2014

Conversation

radicaled
Copy link
Contributor

Generates a .tar.gz based off the current Linux build.

Includes 2 simple scripts, install.sh and uninstall.sh, that install/uninstall desktop and command-line entries for brackets.

According to adobe/brackets/issues/5021 this binary tarball might make actual packaging easier for maintainers.

This is the easiest way for non-Debian systems to run Brackets without
creating a package for each distribution. The output can also be used to
ease packaging for other systems (hopefully).
Categories=Development
Exec=brackets %U
Icon=brackets
MimeType=text/html;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we define more mimetypes here? For CSS and JavaScript for example.

Now supports:
text/html
text/css
text/javascript
application/javascript
When passed the -c parameter, uninstall.sh will remove the user's local
Brackets configuration.
@radicaled
Copy link
Contributor Author

@ingorichter how are my changes?

@ingorichter ingorichter self-assigned this Apr 18, 2014
@ingorichter
Copy link
Contributor

@radicaled That looks good to me. I'll give it a try later today. Thanks

@ingorichter
Copy link
Contributor

@radicaled I tried it out and the tar.gz is properly generated. What do you think of copying the whole folder to the final destination instead of creating links? I accidentally removed the brackets directory and I wasn't able to start Brackets anymore. This could be confusing for the end user.
Is ~/.local the right place to install applications? It seems that this was primarily intended for apps to store preferences and app data. Perhaps you could install it into /usr/local or /opt/.
Ubuntu didn't show the icon and couldn't find Brackets. I wonder if we need to call xdg-desktop-menu/xdg-desktop-icon in order to make them appear. What do you think?

@radicaled
Copy link
Contributor Author

~/.local is where configuration files, .desktop files, and command line binaries that only apply to the currently logged in user go. You don't put the actual application files there.

For instance, when you download the Linux version of RubyMine or WebStorm or any of IntelliJ's excellent IDE products, you unzip them to whatever location you'd like them to be (in my case they're in ~/Development/RubyMine). Then they create the appropriate links within ~/.local to their command line binaries ("mine" for RubyMine), and create a .desktop file so that the application is recognized by the currently running GUI.

install.sh does the same thing here. A side-effect of this, and probably a benefit, is that you can install Brackets without having to use sudo.

The actual location where you unzip a .tar.gz like this is entirely up to the user: you could actually unzip it to /opt/ directly and run the install scripts from there. I could alter the install.sh to copy all of the unzipped files to a location like /opt despite its currently unzipped location, but you will have some seriously cranky Linux users to contend with.

RE Ubuntu, I don't really know why Unity isn't monitoring ~/.local/applications. I can call xdg-desktop-menu as part of the install / uninstall script, though.

Run ./uninstall to remove these files.

Requires libudev.so.0. You may need to do this:
ln -s /usr/lib64/libudev.so.1 /usr/lib64/libudev.so.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to do this similar to the debian package? See https://github.com/adobe/brackets-shell/blob/master/installer/linux/debian/package-root/DEBIAN/postinst#L81.

We create a symlink to libudev next to the brackets executable without affecting the global /usr/ dir. Chromium does the same thing.

Also, for completeness, if we can't make this change, then we should add a 32-bit example ln command. I guess I should ask, have you tested this build on 32 and 64-bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only tested this on on 64-bit. 32-bit is a bit of a rarity for Linux these days. However, the technique is still the same -- it's just a different directory.

I will modify install.sh to make a local symlink.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will modify install.sh to make a local symlink. [for libudev.so.0]

Looking into it, I probably shouldn't do this. Distributions store their library files in different locations. I might end up writing a pretty gnarly bash script to support every distro and its library paths. I will update the README instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the last script on this wiki page from node-webkit https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0. Seems like reasonable approach without getting too gnarly?

@jasonsanjose
Copy link
Member

Great work @radicaled! Thanks for your help.

A few suggestions for moving forward:

@ingorichter
Copy link
Contributor

@jasonsanjose I have only tested it briefly yesterday on 64 bit Linux. So the symlink won't probably work 32 bit Linux.

Only seems to be Unity that is not watching ~/.local/share/applications
right now.
@radicaled
Copy link
Contributor Author

Latest changes should now register .desktop file for Ubuntu's Unity.

Let me know if it's OK: if not I will provision a fresh Ubuntu VM and take a closer look.

@radicaled
Copy link
Contributor Author

@jasonsanjose I can't find your comment, so I'm replying to it here:

What about the last script on this wiki page from node-webkit https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0. Seems like reasonable approach without getting too gnarly?

I guess that works -- anyone running a distribution not in that list should have the know-how to perform the symlink themselves, I hope.

Only works on Ubuntu, Fedora, SUSE, and Arch.
@radicaled
Copy link
Contributor Author

The install script has been augmented with the technique outlined here: https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0

Seems to work beautifully.

What's next?

@ingorichter
Copy link
Contributor

I'll give a test run tomorrow morning. Thank you for working on this.

@ingorichter
Copy link
Contributor

@radicaled This looks good to me and Brackets shows up in the menu. There are two things that could be added to the brackets.desktop file:

  • A comment like "Code the Web" (that's what we say on brackets.io)
  • A version to indicate the sprint

But these are nice to haves. If there are no other issues or objections, I'm going to merge it before we branch into release, since I'd like to build the archive for the upcoming release.

ingorichter added a commit that referenced this pull request May 5, 2014
[LINUX] build a .tar.gz to be unpacked anywhere.
@ingorichter ingorichter merged commit fd54035 into adobe:master May 5, 2014
ingorichter added a commit that referenced this pull request Dec 8, 2015
[LINUX] build a .tar.gz to be unpacked anywhere.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants