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

Commit 5fa26db

Browse files
committed
Merge pull request #297 from adobe/jasonsanjose/linux-sprint-29
Linux Sprint 29
2 parents 8eda324 + 3c9610b commit 5fa26db

File tree

18 files changed

+332
-155
lines changed

18 files changed

+332
-155
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ libcef_dll
3939
tools
4040

4141
/installer/mac/staging/
42-
/installer/linux/brackets.deb
43-
/installer/linux/debian/usr/lib/
42+
/installer/linux/*.deb
43+
/installer/linux/debian/package-root/opt/*
44+
/installer/linux/debian/package-root/DEBIAN/control
4445
/installer/win/staging/
4546
*.wixpdb
4647
*.wixobj

Gruntfile.js

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,39 @@ module.exports = function (grunt) {
2727

2828
var common = require("./tasks/common")(grunt),
2929
resolve = common.resolve,
30+
platform = common.platform(),
3031
staging;
31-
32-
if (common.platform() === "mac") {
32+
33+
if (platform === "mac") {
3334
staging = "installer/mac/staging/<%= build.name %>.app/Contents";
34-
} else if (common.platform() === "win") {
35+
} else if (platform === "win") {
3536
staging = "installer/win/staging";
3637
} else {
37-
staging = "installer/linux/debian/usr/lib/brackets";
38+
staging = "installer/linux/debian/package-root/opt/brackets";
3839
}
3940

4041
grunt.initConfig({
4142
"pkg": grunt.file.readJSON("package.json"),
43+
"config-json": staging + "/www/config.json",
4244
"curl-dir": {
43-
/* linux not supported yet */
44-
/*
45-
linux: {
46-
dest : "<%= cef_zip %>",
47-
src : "https://docs.google.com/file/d/0B7as0diokeHxeTNqZFIyNWZKSWM/edit?usp=sharing"
45+
/* linux */
46+
/* FIXME (jasonsanjose) no 32-bit 3.1547.1354, revert to cef.version variable for the next CEF upgrade */
47+
"cef-linux32": {
48+
"dest" : "downloads/",
49+
"src" : "http://dev.brackets.io/cef/cef_binary_3.1547.1357_linux32_release.zip"
50+
},
51+
"cef-linux64": {
52+
"dest" : "downloads/",
53+
"src" : "http://dev.brackets.io/cef/cef_binary_<%= cef.version %>_linux64_release.zip"
54+
},
55+
"node-linux32": {
56+
"dest" : "downloads/",
57+
"src" : "http://nodejs.org/dist/v<%= node.version %>/node-v<%= node.version %>-linux-x86.tar.gz"
58+
},
59+
"node-linux64": {
60+
"dest" : "downloads/",
61+
"src" : "http://nodejs.org/dist/v<%= node.version %>/node-v<%= node.version %>-linux-x64.tar.gz"
4862
},
49-
*/
5063
/* mac */
5164
"cef-mac": {
5265
"dest" : "downloads/",
@@ -71,7 +84,7 @@ module.exports = function (grunt) {
7184
"downloads" : ["downloads"],
7285
"installer-mac" : ["installer/mac/*.dmg"],
7386
"installer-win" : ["installer/win/*.msi"],
74-
"installer-linux" : ["installer/linux/brackets.deb"],
87+
"installer-linux" : ["installer/linux/debian/*.deb"],
7588
"staging-mac" : ["installer/mac/staging"],
7689
"staging-win" : ["installer/win/staging"],
7790
"staging-linux" : ["<%= build.staging %>"],
@@ -114,7 +127,7 @@ module.exports = function (grunt) {
114127
"files": [
115128
{
116129
"expand" : true,
117-
"cwd" : "out/Release",
130+
"cwd" : "out/Release/",
118131
"src" : [
119132
"lib/**",
120133
"locales/**",
@@ -124,6 +137,14 @@ module.exports = function (grunt) {
124137
"devtools_resources.pak"
125138
],
126139
"dest" : "<%= build.staging %>"
140+
},
141+
{
142+
"expand" : true,
143+
"cwd" : "installer/linux/debian/",
144+
"src" : [
145+
"brackets.desktop"
146+
],
147+
"dest" : "<%= build.staging %>"
127148
}
128149
]
129150
},

installer/linux/build_installer.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
# grunt-contrib-copy doesn't preserve permissions
44
# https://github.com/gruntjs/grunt/issues/615
5-
chmod 775 installer/linux/debian/usr/lib/brackets/Brackets
5+
chmod 775 debian/package-root/opt/brackets/Brackets
6+
chmod 755 debian/package-root/DEBIAN/prerm
7+
chmod 755 debian/package-root/DEBIAN/postrm
8+
chmod 755 debian/package-root/DEBIAN/postinst
69

710
# set permissions on subdirectories
8-
find installer/linux/debian -type d -exec chmod 755 {} \;
11+
find debian -type d -exec chmod 755 {} \;
912

1013
# delete old package
11-
rm -f installer/linux/brackets.deb
14+
rm -f brackets.deb
1215

13-
fakeroot dpkg-deb --build installer/linux/debian
14-
mv installer/linux/debian.deb installer/linux/brackets.deb
16+
fakeroot dpkg-deb --build debian/package-root
17+
mv debian/package-root.deb brackets.deb
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Desktop Entry]
22
Name=Brackets
33
Type=Application
4-
Categories=Application
5-
Exec=/usr/lib/brackets/Brackets %U
4+
Categories=Development
5+
Exec=/opt/brackets/Brackets %U
66
Icon=brackets
77
MimeType=text/html;

installer/linux/debian/DEBIAN/control renamed to installer/linux/debian/control

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Package: brackets
2-
Version: 0.27.0
3-
Section: base
2+
Version: <%= version %>
3+
Section: devel
44
Priority: optional
5-
Architecture: i386
6-
Installed-Size: 128819
7-
Depends: bash (>= 2.05a-11), libnss3-1d (>= 3.14.3), libnspr4-0d (>= 3.14.3)
5+
Architecture: <%= arch %>
6+
Installed-Size: <%= size %>
7+
Depends: bash (>= 2.05a-11), libnss3-1d (>= 3.14.3), libnspr4-0d (>= 3.14.3), libudev0 (>= 147) | libudev1 (>= 198)
88
Maintainer: Jason San Jose <[email protected]>
99
Description: Brackets
1010
Brackets is an open-source editor for web design and development
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
4+
# Use of this source code is governed by a BSD-style license that can be
5+
# found in the LICENSE file.
6+
7+
# Add icons to the system icons
8+
XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null`"
9+
if [ ! -x "$XDG_ICON_RESOURCE" ]; then
10+
echo "Error: Could not find xdg-icon-resource" >&2
11+
exit 1
12+
fi
13+
for icon in "/opt/brackets/appshell"*.png; do
14+
size="${icon##*/appshell}"
15+
"$XDG_ICON_RESOURCE" install --novendor --size "${size%.png}" "$icon" "brackets"
16+
done
17+
18+
# Add an entry to the system menu
19+
XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`"
20+
UPDATE_MENUS="`which update-menus 2> /dev/null`"
21+
if [ ! -x "$XDG_DESKTOP_MENU" ]; then
22+
echo "Error: Could not find xdg-desktop-menu" >&2
23+
exit 1
24+
fi
25+
"$XDG_DESKTOP_MENU" install /opt/brackets/brackets.desktop --novendor
26+
27+
if [ -x "$UPDATE_MENUS" ]; then
28+
update-menus
29+
fi
30+
31+
DEFAULT_ARCH="`uname -m`"
32+
33+
get_lib_dir() {
34+
if [ "$DEFAULT_ARCH" = "i686" ]; then
35+
LIBDIR=lib/i386-linux-gnu
36+
elif [ "$DEFAULT_ARCH" = "x86_64" ]; then
37+
LIBDIR=lib/x86_64-linux-gnu
38+
else
39+
echo Unknown CPU Architecture: "$DEFAULT_ARCH"
40+
exit 1
41+
fi
42+
}
43+
44+
# Fedora 18 now has libudev.so.1. http://crbug.com/145160
45+
# Same for Ubuntu 13.04. http://crbug.com/226002
46+
LIBUDEV_0=libudev.so.0
47+
LIBUDEV_1=libudev.so.1
48+
49+
add_udev_symlinks() {
50+
get_lib_dir
51+
if [ -f "/$LIBDIR/$LIBUDEV_0" -o -f "/usr/$LIBDIR/$LIBUDEV_0" -o -f "/lib/$LIBUDEV_0" ]; then
52+
return 0
53+
fi
54+
55+
if [ -f "/$LIBDIR/$LIBUDEV_1" ]; then
56+
ln -snf "/$LIBDIR/$LIBUDEV_1" "/opt/brackets/$LIBUDEV_0"
57+
elif [ -f "/usr/$LIBDIR/$LIBUDEV_1" ];
58+
then
59+
ln -snf "/usr/$LIBDIR/$LIBUDEV_1" "/opt/brackets/$LIBUDEV_0"
60+
else
61+
echo "$LIBUDEV_1" not found in "$LIBDIR" or "/usr/$LIBDIR".
62+
exit 1
63+
fi
64+
}
65+
66+
remove_udev_symlinks() {
67+
rm -rf "/opt/brackets/$LIBUDEV_0"
68+
}
69+
70+
remove_udev_symlinks
71+
add_udev_symlinks
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
rm -rf "/opt/brackets/libudev.so.0"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
4+
# Use of this source code is governed by a BSD-style license that can be
5+
# found in the LICENSE file.
6+
7+
action="$1"
8+
if [ "$2" = "in-favour" ]; then
9+
# Treat conflict remove as an upgrade.
10+
action="upgrade"
11+
fi
12+
# Don't clean-up just for an upgrade.`
13+
if [ "$action" = "upgrade" ] ; then
14+
exit 0
15+
fi
16+
17+
# Remove icons from the system icons
18+
XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null`"
19+
if [ ! -x "$XDG_ICON_RESOURCE" ]; then
20+
echo "Error: Could not find xdg-icon-resource" >&2
21+
exit 1
22+
fi
23+
for icon in "/opt/brackets/appshell"*.png; do
24+
size="${icon##*/appshell}"
25+
"$XDG_ICON_RESOURCE" uninstall --size "${size%.png}" "brackets"
26+
done
27+
28+
# Remove the entry from the system menu
29+
XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`"
30+
UPDATE_MENUS="`which update-menus 2> /dev/null`"
31+
if [ ! -x "$XDG_DESKTOP_MENU" ]; then
32+
echo "Error: Could not find xdg-desktop-menu" >&2
33+
exit 1
34+
fi
35+
"$XDG_DESKTOP_MENU" uninstall /opt/brackets/brackets.desktop
36+
37+
if [ -x "$UPDATE_MENUS" ]; then
38+
update-menus
39+
fi
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
/opt/brackets/Brackets
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a
4+
copy of this software and associated documentation files (the "Software"),
5+
to deal in the Software without restriction, including without limitation
6+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
7+
and/or sell copies of the Software, and to permit persons to whom the
8+
Software is furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19+
DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)