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

Linux universal installer #316

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ tools

/installer/mac/staging/
/installer/linux/*.deb
/installer/linux/debian/package-root/opt/*
/installer/linux/debian/package-root/DEBIAN/control
/installer/linux/*.pkg.tar*
/installer/linux/linux/INFO
/installer/linux/arch/PKGBUILD
/installer/linux/arch/*/
/installer/linux/ubuntu/control
/installer/linux/ubuntu/*/
/installer/linux/staging/
/installer/win/staging/
*.wixpdb
*.wixobj
Expand Down
7 changes: 4 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function (grunt) {
} else if (platform === "win") {
staging = "installer/win/staging";
} else {
staging = "installer/linux/debian/package-root/opt/brackets";
staging = "installer/linux/staging";
}

grunt.initConfig({
Expand Down Expand Up @@ -84,7 +84,8 @@ module.exports = function (grunt) {
"downloads" : ["downloads"],
"installer-mac" : ["installer/mac/*.dmg"],
"installer-win" : ["installer/win/*.msi"],
"installer-linux" : ["installer/linux/debian/*.deb"],
"installer-linux" : ["installer/linux/*.deb",
"installer/linux/*.pkg.tar*"],
"staging-mac" : ["installer/mac/staging"],
"staging-win" : ["installer/win/staging"],
"staging-linux" : ["<%= build.staging %>"],
Expand Down Expand Up @@ -142,7 +143,7 @@ module.exports = function (grunt) {
},
{
"expand" : true,
"cwd" : "installer/linux/debian/",
"cwd" : "installer/linux/linux/",
"src" : [
"brackets.desktop",
"brackets"
Expand Down
104 changes: 104 additions & 0 deletions installer/linux/arch/PKGBUILD.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Maintainer: Brackets Team <[email protected]>
pkgname=brackets
pkgver=
pkgrel=1
pkgdesc="A code editor for HTML, CSS and JavaScript. "
arch=("i686" "x86_64")
url="http://brackets.io"
license=("MIT")
depends=("brackets-lib" "gconf" "nodejs" "nspr" "systemd")
Copy link
Member

Choose a reason for hiding this comment

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

What/Where is brackets-lib?

Copy link
Author

Choose a reason for hiding this comment

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

This package from aur fix mess with some libraries names. Symlinks should have own packages, because of possibility of breaking system after uninstalling package with symlinks.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason brackets-lib needs to be a separate package? Can we consolidate that into this single package?

Copy link

Choose a reason for hiding this comment

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

@jasonsanjose I created this package because to clean up the package and other packages can use it too.

makedepends=("prelink")
optdepends=(
"alsa-lib: <future use>"
Copy link
Member

Choose a reason for hiding this comment

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

Why asla-lib?

Copy link
Author

Choose a reason for hiding this comment

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

Namcap says that some library from brackets (libcef.so if I remember) needs (optional) alsa support. Look at current debian package dependencies (libasound2).

"chromium: to enable Live Preview"
"gnuplot: to enable node benchmarking"
"gtk2: to enable native UI"
"ruby: to enable LiveDevelopment Inspector"
"desktop-file-utils: for update-desktop-database"
"hicolor-icon-theme: for hicolor theme hierarchy"
)
provides=("brackets" "adobe-brackets")
Copy link
Member

Choose a reason for hiding this comment

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

What is adobe-brackets? I don't see that used anywhere.

Copy link
Author

Choose a reason for hiding this comment

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

I saw this in brackets-git. It's probably unnecessary.

conflicts=("brackets-git")
Copy link
Member

Choose a reason for hiding this comment

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

What is brackets-git?

Copy link
Author

Choose a reason for hiding this comment

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

This package from aur fix mess with some libraries names. Symlinks should have own packages, because of possibility of breaking system after uninstalling package with symlinks.

replaces=()
backup=()
options=()
install=${pkgname}.install

source=()


prepare() {
cd "$srcdir"

echo " -> Fixing executable stack..."
execstack -c "Brackets"
}

package() {
cd ${srcdir}

echo " -> Installing program..."
install -dm755 "${pkgdir}/usr/bin"
install -Dm755 \
"Brackets" \
"${pkgdir}/opt/${pkgname}/Brackets"

install -Dm755 \
"brackets" \
"${pkgdir}/opt/${pkgname}/brackets"

ln -s "/opt/${pkgname}/brackets" "${pkgdir}/usr/bin/brackets"

for _file in *.pak; do
install -Dm644 \
"${_file}" \
"${pkgdir}/opt/${pkgname}/${_file}"
done

for _file in "lib/"*; do
local _filename="${_file##*/}"
install -Dm755 \
"${_file}" \
"${pkgdir}/usr/lib/${_filename}"
done

for _file in "locales/"*; do
install -Dm644 \
"${_file}" \
"${pkgdir}/opt/${pkgname}/${_file}"
done

cp -dpr --no-preserve=ownership \
"www" \
"${pkgdir}/opt/${pkgname}/www"

cp -dpr --no-preserve=ownership \
"samples" \
"${pkgdir}/opt/${pkgname}/samples"


echo " -> Installing icons..."
local _icon_dir="usr/share/icons/hicolor"
install -Dm644 \
"${pkgname}.svg" \
"${pkgdir}/${_icon_dir}/scalable/apps/${pkgname}.svg"
for _icon in "appshell"*.png; do
local _icon_size="${_icon##*appshell}"
install -Dm644 \
"${_icon}" \
"${pkgdir}/${_icon_dir}/${_icon_size%.png}x${_icon_size%.png}/apps/${pkgname}.png"
done


echo " -> Installing .desktop file..."
install -Dm755 \
"${pkgname}.desktop" \
"${pkgdir}/usr/share/applications/${pkgname}.desktop"


echo " -> Installing license..."
install -Dm644 \
"license" \
"${pkgdir}/usr/share/licenses/${pkgname}/license"

}
17 changes: 17 additions & 0 deletions installer/linux/arch/brackets.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
post_install() {
xdg-icon-resource forceupdate --theme hicolor &> /dev/null
update-desktop-database -q
update-mime-database usr/share/mime
echo "==> Linux version doesn't always run as expected. See: https://github.com/adobe/brackets/wiki/Linux-Version#known-issues"
echo "==> To use Live Preview with chromium do: # ln -s /usr/bin/chromium /usr/bin/google-chrome"
}

post_upgrade() {
post_install
}

post_remove() {
xdg-icon-resource forceupdate --theme hicolor &> /dev/null
update-desktop-database -q
update-mime-database usr/share/mime
}
57 changes: 57 additions & 0 deletions installer/linux/arch_builder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
#
# Package builder for Arch Linux
#

#
# GLOBAL VARIABLES
#

# brackets version number
VERSION=`. linux/INFO; echo ${MINOR_VERSION}`
Copy link
Member

Choose a reason for hiding this comment

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

Please use the full version, e.g. 0.30.0-9116 from VERSION. Should not need MINOR_VERSION.



#
# FUNCTIONS
#

# create build filesystem
prepare() {
cp -dpr --no-preserve=ownership \
"../staging/" \
"src"
cp -dpr --no-preserve=ownership \
"../linux/." \
"src"

# update pkgbuild file
pkgbuild

# delete old package
rm -f *pkg.tar*
}

# postbuild clean
clean() {
mv *pkg.tar* ../
rm -rf src
rm -rf pkg
rm -f PKGBUILD
}

# update pkgbuild file
pkgbuild() {
awk -v ver=${VERSION} \
'BEGIN{FS="=";OFS="="} {\
sub(/^pkgver=.*/, $1"=sprint"'ver'); \
print}' PKGBUILD.template > PKGBUILD
}


#
# MAIN
#
cd "arch"
prepare
makepkg
clean
39 changes: 25 additions & 14 deletions installer/linux/build_installer.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
#!/bin/bash
#
# Build installer for linux
#
# When add new distro check other possible release files:
# http://linuxmafia.com/faq/Admin/release-files.html

# 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
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 debian -type d -exec chmod 755 {} \;
DISTRO="unknown"

# delete old package
rm -f brackets.deb

fakeroot dpkg-deb --build debian/package-root
mv debian/package-root.deb brackets.deb
# get distribution name from /etc/*release file
if [[ -f /etc/os-release ]]; then
. /etc/os-release; DISTRO=$ID
elif [[ -f /etc/lsb_release ]]; then
. /etc/lsb_release; DISTRO=$DISTRIB_ID
else
echo "Error: non-standard /etc/*release files are currently not supported" 2>&1
exit 1
fi;


# run distro-specified builder
if [[ -f ${DISTRO}_builder.sh ]]; then
bash ${DISTRO}_builder.sh
else
echo "Error: ${DISTRO}_builder.sh not found" 2>&1
echo " Can't build package for distribution \"${DISTRO}\"" 2>&1
exit 1
fi;
1 change: 0 additions & 1 deletion installer/linux/debian/package-root/usr/bin/brackets

This file was deleted.

2 changes: 2 additions & 0 deletions installer/linux/linux/INFO.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VERSION=<%= version %>
MINOR_VERSION=<%= minorVersion %>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: brackets
Version: <%= version %>
Version:
Section: devel
Priority: optional
Architecture: <%= arch %>
Installed-Size: <%= size %>
Architecture:
Installed-Size:
Pre-Depends: dpkg (>= 1.14.0)
Depends: gconf-service, libasound2 (>= 1.0.23), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.11), libcairo2 (>= 1.6.0), libcups2 (>= 1.4.0), libdbus-1-3 (>= 1.2.14), libexpat1 (>= 1.95.8), libfontconfig1 (>= 2.8.0), libfreetype6 (>= 2.3.9), libgcc1 (>= 1:4.1.1), libgconf-2-4 (>= 2.31.1), libgcrypt11 (>= 1.4.5), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.18.0), libgtk2.0-0 (>= 2.24.0), libnspr4 (>= 1.8.0.10), libnss3 (>= 3.12.6), libpango1.0-0 (>= 1.22.0), libstdc++6 (>= 4.6), libudev0 (>= 147) | libudev1 (>= 198), libx11-6 (>= 2:1.4.99.1), libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrandr2 (>= 2:1.2.0), libxrender1, ca-certificates, libcurl3, lsb-base (>= 3.2), xdg-utils (>= 1.0.2), wget
Maintainer: Brackets Team <[email protected]>
Expand Down
Loading