This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 616
[LINUX] build a .tar.gz to be unpacked anywhere. #433
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
96e2782
[LINUX] build a .tar.gz to be unpacked anywhere.
radicaled 4c5a74b
Linux .tar.gz script should clean up after itself.
radicaled 4d6f1db
Linux .tar.gz: support more mimetypes via brackets.desktop
radicaled d447b90
Linux uninstall script: optionally remove Brackets config.
radicaled 14cdd46
Call xdg-desktop-menu for GUIs not monitoring ~/.local.
radicaled 3b5782f
Augment README.md.
radicaled cb55b22
When possible, automatically symlink to libudev.so.0
radicaled e2b2017
Fix up some Markdown rendering errors in README.md.
radicaled File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Setup | ||
===== | ||
|
||
Run ./install to install the .desktop file and brackets command line tool to your ~/.local directory. | ||
Run ./uninstall to remove these files. | ||
|
||
Requires libudev.so.0. install.sh will attempt to symlink this file automatically if it exists. | ||
|
||
If you see a libudev-related error message, you may need to do this: | ||
|
||
# 64-bit Fedora system. | ||
ln -s /usr/lib64/libudev.so.1 /usr/lib64/libudev.so.0 | ||
# 32-bit Fedora system | ||
ln -s /usr/lib/libudev.so.1 /usr/lib/libudev.so.0 | ||
|
||
If you are unsure of your library directory, you can run the following command and examine its output to find the right path: | ||
|
||
ldd Brackets | ||
# Sample output: | ||
# libpangocairo-1.0.so.0 => /lib64/libpangocairo-1.0.so.0 (0x00007f482aed6000) | ||
# libatk-1.0.so.0 => /lib64/libatk-1.0.so.0 (0x00007f482acb3000) | ||
|
||
In the example above, the library path is /lib64. | ||
|
||
Happy hacking. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Desktop Entry] | ||
Name=Brackets | ||
Type=Application | ||
Categories=Development | ||
Exec=brackets %U | ||
Icon=brackets | ||
MimeType=text/html;text/css;application/javascript;text/javascript; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
echo 'installing brackets to your ~/.local directory' | ||
|
||
curDir=$(pwd) | ||
|
||
mkdir -p ~/.local/share/applications | ||
mkdir -p ~/.local/bin | ||
|
||
# Setup our brackets.desktop file. | ||
cp brackets.desktop temp.desktop | ||
execPath="$curDir/brackets" | ||
iconPath="$curDir/brackets.svg" | ||
|
||
sed -i 's|Exec=brackets|Exec='$execPath'|g' temp.desktop | ||
sed -i 's|Icon=brackets|Icon='$iconPath'|g' temp.desktop | ||
cp temp.desktop ~/.local/share/applications/brackets.desktop | ||
rm temp.desktop | ||
|
||
# Run xdg-desktop-menu to register the .desktop file. | ||
# This is for Unity's benefit: Gnome 3 and KDE 4 both watch ~/.local/share/applications and install .desktop files automatically. | ||
# Copy-pasta this straight from the .deb's postinst script. | ||
XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`" | ||
if [ ! -x "$XDG_DESKTOP_MENU" ]; then | ||
echo "Error: Could not find xdg-desktop-menu" >&2 | ||
exit 1 | ||
fi | ||
"$XDG_DESKTOP_MENU" install ~/.local/share/applications/brackets.desktop --novendor | ||
|
||
# Symlink brackets executable to our current location... where-ever that is. | ||
rm -f ~/.local/bin/brackets | ||
ln -s $execPath ~/.local/bin/brackets | ||
|
||
# Try to symlink libudev.so.0 to the current directory. | ||
# Gratefully borrowed from https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0 | ||
paths=( | ||
"/lib/x86_64-linux-gnu/libudev.so.1" # Ubuntu, Xubuntu, Mint | ||
"/usr/lib64/libudev.so.1" # SUSE, Fedora | ||
"/usr/lib/libudev.so.1" # Arch, Fedora 32bit | ||
"/lib/i386-linux-gnu/libudev.so.1" # Ubuntu 32bit | ||
) | ||
for i in "${paths[@]}" | ||
do | ||
if [ -f $i ] | ||
then | ||
ln -sf "$i" $curDir/libudev.so.0 | ||
break | ||
fi | ||
done | ||
|
||
echo 'installed brackets to ~/.local' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
echo 'uninstalling brackets from your ~/.local directory' | ||
echo 'run with -c to remove ~/.config/Brackets' | ||
|
||
removeConfig=false | ||
|
||
while getopts c opt; do | ||
case $opt in | ||
c) | ||
removeConfig=true | ||
;; | ||
esac | ||
done | ||
|
||
shift $((OPTIND - 1)) | ||
|
||
if [ "$removeConfig" = true ]; then | ||
echo 'deleting ~/.config/Brackets' | ||
rm -rf ~/.config/Brackets | ||
fi | ||
|
||
# Safety first: only uninstall files we know about. | ||
|
||
rm -f ~/.local/bin/brackets | ||
rm -f ~/.local/share/applications/brackets.desktop | ||
|
||
echo 'finished uninstall brackets from your ~/.local directory' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps you want to have another option to remove everything created under |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# grunt-contrib-copy doesn't preserve permissions | ||
# https://github.com/gruntjs/grunt/issues/615 | ||
chmod 755 debian/package-root/opt/brackets/brackets | ||
chmod 755 debian/package-root/opt/brackets/Brackets | ||
chmod 755 debian/package-root/opt/brackets/Brackets-node | ||
|
||
# set permissions on subdirectories | ||
find debian -type d -exec chmod 755 {} \; | ||
|
||
# delete old package | ||
rm -f brackets.tar.gz | ||
|
||
# Move everything we'll be using to a temporary directory for easy clean-up | ||
mkdir -p archive/out | ||
cp -r debian/package-root/opt/brackets archive/out | ||
|
||
# Add brackets.svg | ||
cp debian/package-root/usr/share/icons/hicolor/scalable/apps/brackets.svg archive/out/brackets | ||
|
||
# Add the modified brackets.desktop file (call brackets instead of /opt/brackets/brackets) | ||
cp archive/brackets.desktop archive/out/brackets | ||
|
||
# Add the install.sh and uninstall.sh files. | ||
cp archive/install.sh archive/out/brackets | ||
cp archive/uninstall.sh archive/out/brackets | ||
# README.md too. | ||
cp archive/README.md archive/out/brackets | ||
|
||
tar -cf brackets.tar -C archive/out brackets/ | ||
|
||
gzip brackets.tar | ||
|
||
# Clean-up after ourselves once the tarball has been generated. | ||
rm -rf archive/out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen this usage of
.local
. Does this meanbrackets
will still be in the users'PATH
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know how/if this might conflict with an existing debian package install?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~/.local/bin
: yes. Both Ubuntu and Fedora add ~/.local/bin to the user's $PATH.Conflict: if for some reason you were to install the debian and then this .tar.gz through
install.sh
you'll end up with two desktop icons and twobrackets
executables in the command line. I'm not sure which one takes precedence. Based on Fedora's default.bash_profile
, I'd say that the one in~/.local/bin
will take precedence.File system wise, no conflicts unless for some reason you unzipped the archive directly on top of the location used by the .deb package.