2016-09-11 23:24:51 +02:00
|
|
|
{ stdenv, fetchurl, buildEnv, gtk2, glib, gdk_pixbuf, alsaLib, nss, nspr, gconf
|
2016-09-05 18:59:00 +02:00
|
|
|
, cups, libgcrypt_1_5, systemd, makeWrapper, dbus }:
|
2015-11-01 22:23:11 +01:00
|
|
|
let
|
|
|
|
bracketsEnv = buildEnv {
|
|
|
|
name = "env-brackets";
|
|
|
|
paths = [
|
2016-10-22 01:42:57 +02:00
|
|
|
gtk2 glib gdk_pixbuf stdenv.cc.cc.lib alsaLib nss nspr gconf cups libgcrypt_1_5
|
|
|
|
dbus.lib systemd.lib
|
2015-11-01 22:23:11 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "brackets-${version}";
|
2016-10-22 01:42:57 +02:00
|
|
|
version = "1.7";
|
2015-11-01 22:23:11 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/adobe/brackets/releases/download/release-${version}/Brackets.Release.${version}.64-bit.deb";
|
2016-10-22 01:42:57 +02:00
|
|
|
sha256 = "0nsiy3gvp8rd71a0misf6v1kz067kxnszr5mpch9fj4jqmg6nj8m";
|
2015-11-01 22:23:11 +01:00
|
|
|
name = "${name}.deb";
|
|
|
|
};
|
|
|
|
|
2016-10-22 01:42:57 +02:00
|
|
|
phases = [ "installPhase" "fixupPhase" ];
|
2015-11-01 22:23:11 +01:00
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
ar p $src data.tar.xz | tar -C $out -xJ
|
|
|
|
|
|
|
|
mv $out/usr/* $out/
|
|
|
|
rmdir $out/usr
|
|
|
|
ln -sf $out/opt/brackets/brackets $out/bin/brackets
|
|
|
|
|
2016-09-05 18:59:00 +02:00
|
|
|
ln -s ${systemd.lib}/lib/libudev.so.1 $out/opt/brackets/lib/libudev.so.0
|
2015-11-01 22:23:11 +01:00
|
|
|
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${bracketsEnv}/lib:${bracketsEnv}/lib64" \
|
|
|
|
$out/opt/brackets/Brackets
|
|
|
|
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
$out/opt/brackets/Brackets-node
|
|
|
|
|
|
|
|
patchelf \
|
|
|
|
--set-rpath "${bracketsEnv}/lib:${bracketsEnv}/lib64" \
|
|
|
|
$out/opt/brackets/lib/libcef.so
|
|
|
|
|
|
|
|
wrapProgram $out/opt/brackets/brackets \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${bracketsEnv}/lib:${bracketsEnv}/lib64"
|
|
|
|
|
|
|
|
substituteInPlace $out/opt/brackets/brackets.desktop \
|
|
|
|
--replace "Exec=/opt/brackets/brackets" "Exec=brackets"
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s $out/opt/brackets/brackets.desktop $out/share/applications/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An open source code editor for the web, written in JavaScript, HTML and CSS";
|
|
|
|
homepage = http://brackets.io/;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.matejc ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|