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

Linux Sprint 29 #297

Merged
merged 18 commits into from
Aug 20, 2013
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ libcef_dll
tools

/installer/mac/staging/
/installer/linux/brackets.deb
/installer/linux/debian/usr/lib/
/installer/linux/*.deb
/installer/linux/debian/package-root/opt/*
/installer/linux/debian/package-root/DEBIAN/control
/installer/win/staging/
*.wixpdb
*.wixobj
Expand Down
42 changes: 31 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,38 @@ module.exports = function (grunt) {

var common = require("./tasks/common")(grunt),
resolve = common.resolve,
platform = common.platform(),
staging;

if (common.platform() === "mac") {
if (platform === "mac") {
staging = "installer/mac/staging/<%= build.name %>.app/Contents";
} else if (common.platform() === "win") {
} else if (platform === "win") {
staging = "installer/win/staging";
} else {
staging = "installer/linux/debian/usr/lib/brackets";
staging = "installer/linux/debian/package-root/opt/brackets";
}

grunt.initConfig({
"pkg": grunt.file.readJSON("package.json"),
"config-json": staging + "/www/config.json",
"curl-dir": {
/* linux not supported yet */
/*
linux: {
dest : "<%= cef_zip %>",
src : "https://docs.google.com/file/d/0B7as0diokeHxeTNqZFIyNWZKSWM/edit?usp=sharing"
/* linux */
"cef-linux32": {
"dest" : "downloads/",
"src" : "http://dev.brackets.io/cef/cef_binary_<%= cef.version %>_linux32_release.zip"
},
"cef-linux64": {
"dest" : "downloads/",
"src" : "http://dev.brackets.io/cef/cef_binary_<%= cef.version %>_linux64_release.zip"
},
"node-linux32": {
"dest" : "downloads/",
"src" : "http://nodejs.org/dist/v<%= node.version %>/node-v<%= node.version %>-linux-x86.tar.gz"
},
"node-linux64": {
"dest" : "downloads/",
"src" : "http://nodejs.org/dist/v<%= node.version %>/node-v<%= node.version %>-linux-x64.tar.gz"
},
*/
/* mac */
"cef-mac": {
"dest" : "downloads/",
Expand All @@ -71,7 +83,7 @@ module.exports = function (grunt) {
"downloads" : ["downloads"],
"installer-mac" : ["installer/mac/*.dmg"],
"installer-win" : ["installer/win/*.msi"],
"installer-linux" : ["installer/linux/brackets.deb"],
"installer-linux" : ["installer/linux/debian/*.deb"],
"staging-mac" : ["installer/mac/staging"],
"staging-win" : ["installer/win/staging"],
"staging-linux" : ["<%= build.staging %>"],
Expand Down Expand Up @@ -114,7 +126,7 @@ module.exports = function (grunt) {
"files": [
{
"expand" : true,
"cwd" : "out/Release",
"cwd" : "out/Release/",
Copy link
Contributor

Choose a reason for hiding this comment

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

@jasonsanjose what's the significance of this change? I noticed that we mostly put the trailing slash on directory names but there are a few instances where we don't. Just curious.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just for consistency. I thought this was the last oddball. Was there more?

Copy link
Contributor

Choose a reason for hiding this comment

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

At least 4 other places have directory names that do not end in a forward slash. Probably not a big deal -- I was just curious if Linux had some special requirement.

"src" : [
"lib/**",
"locales/**",
Expand All @@ -124,6 +136,14 @@ module.exports = function (grunt) {
"devtools_resources.pak"
],
"dest" : "<%= build.staging %>"
},
{
"expand" : true,
"cwd" : "installer/linux/debian/",
"src" : [
"brackets.desktop"
],
"dest" : "<%= build.staging %>"
}
]
},
Expand Down
13 changes: 8 additions & 5 deletions installer/linux/build_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

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

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

# delete old package
rm -f installer/linux/brackets.deb
rm -f brackets.deb

fakeroot dpkg-deb --build installer/linux/debian
mv installer/linux/debian.deb installer/linux/brackets.deb
fakeroot dpkg-deb --build debian/package-root
mv debian/package-root.deb brackets.deb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Brackets
Type=Application
Categories=Application
Exec=/usr/lib/brackets/Brackets %U
Categories=Development
Exec=/opt/brackets/Brackets %U
Icon=brackets
MimeType=text/html;
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Package: brackets
Version: 0.27.0
Section: base
Version: <%= version %>
Section: devel
Priority: optional
Architecture: i386
Installed-Size: 128819
Depends: bash (>= 2.05a-11), libnss3-1d (>= 3.14.3), libnspr4-0d (>= 3.14.3)
Architecture: <%= arch %>
Installed-Size: <%= size %>
Depends: bash (>= 2.05a-11), libnss3-1d (>= 3.14.3), libnspr4-0d (>= 3.14.3), libudev0 (>= 147) | libudev1 (>= 198)
Maintainer: Jason San Jose <jasonsj@adobe.com>
Description: Brackets
Brackets is an open-source editor for web design and development
Expand Down
67 changes: 67 additions & 0 deletions installer/linux/debian/package-root/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/sh

# Add icons to the system icons
XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null`"
if [ ! -x "$XDG_ICON_RESOURCE" ]; then
echo "Error: Could not find xdg-icon-resource" >&2
exit 1
fi
for icon in "/opt/brackets/appshell"*.png; do
size="${icon##*/appshell}"
"$XDG_ICON_RESOURCE" install --novendor --size "${size%.png}" "$icon" "brackets"
done

# Add an entry to the system menu
XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`"
UPDATE_MENUS="`which update-menus 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 /opt/brackets/brackets.desktop --novendor

if [ -x "$UPDATE_MENUS" ]; then
update-menus
fi

DEFAULT_ARCH="`uname -m`"

get_lib_dir() {
if [ "$DEFAULT_ARCH" = "i686" ]; then
LIBDIR=lib/i386-linux-gnu
elif [ "$DEFAULT_ARCH" = "x86_64" ]; then
LIBDIR=lib/x86_64-linux-gnu
else
echo Unknown CPU Architecture: "$DEFAULT_ARCH"
exit 1
fi
}

# Fedora 18 now has libudev.so.1. http://crbug.com/145160
# Same for Ubuntu 13.04. http://crbug.com/226002
LIBUDEV_0=libudev.so.0
LIBUDEV_1=libudev.so.1

add_udev_symlinks() {
get_lib_dir
if [ -f "/$LIBDIR/$LIBUDEV_0" -o -f "/usr/$LIBDIR/$LIBUDEV_0" -o -f "/lib/$LIBUDEV_0" ]; then
return 0
fi

if [ -f "/$LIBDIR/$LIBUDEV_1" ]; then
ln -snf "/$LIBDIR/$LIBUDEV_1" "/opt/brackets/$LIBUDEV_0"
elif [ -f "/usr/$LIBDIR/$LIBUDEV_1" ];
then
ln -snf "/usr/$LIBDIR/$LIBUDEV_1" "/opt/brackets/$LIBUDEV_0"
else
echo "$LIBUDEV_1" not found in "$LIBDIR" or "/usr/$LIBDIR".
exit 1
fi
}

remove_udev_symlinks() {
rm -rf "/opt/brackets/$LIBUDEV_0"
}

remove_udev_symlinks
add_udev_symlinks
2 changes: 2 additions & 0 deletions installer/linux/debian/package-root/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
rm -rf "/opt/brackets/libudev.so.0"
39 changes: 39 additions & 0 deletions installer/linux/debian/package-root/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to add to 3rd party code

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to wait for legal before merging?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll ping @julianasuh. The source is from Chromium's debian packaging scripts here http://src.chromium.org/viewvc/chrome/trunk/src/chrome/installer/linux/.

# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

action="$1"
if [ "$2" = "in-favour" ]; then
# Treat conflict remove as an upgrade.
action="upgrade"
fi
# Don't clean-up just for an upgrade.`
if [ "$action" = "upgrade" ] ; then
exit 0
fi

# Remove icons from the system icons
XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null`"
if [ ! -x "$XDG_ICON_RESOURCE" ]; then
echo "Error: Could not find xdg-icon-resource" >&2
exit 1
fi
for icon in "/opt/brackets/appshell"*.png; do
size="${icon##*/appshell}"
"$XDG_ICON_RESOURCE" uninstall --size "${size%.png}" "brackets"
done

# Remove the entry from the system menu
XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`"
UPDATE_MENUS="`which update-menus 2> /dev/null`"
if [ ! -x "$XDG_DESKTOP_MENU" ]; then
echo "Error: Could not find xdg-desktop-menu" >&2
exit 1
fi
"$XDG_DESKTOP_MENU" uninstall /opt/brackets/brackets.desktop

if [ -x "$UPDATE_MENUS" ]; then
update-menus
fi
2 changes: 2 additions & 0 deletions installer/linux/debian/package-root/usr/bin/brackets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
/opt/brackets/Brackets
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
?package(brackets):needs="x11" \
section="Development" \
hints="Code Editor" \
title="Brackets" \
icon="/opt/brackets/appshell32.png" \
command="/usr/bin/brackets"
2 changes: 0 additions & 2 deletions installer/linux/debian/usr/bin/brackets

This file was deleted.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"guid": "0.0.10",
"grunt-curl": "0.5.0",
"grunt-shell": "0.2.1",
"q": "0.9.2"
"q": "0.9.2",
"semver": "2.0.11"
},
"scripts": {
"postinstall": "grunt"
}
}
}
77 changes: 0 additions & 77 deletions scripts/setup_linux_build.sh

This file was deleted.

Loading