Skip to content

Commit

Permalink
sublime3: replace hardcoded /bin/bash with /usr/bin/env
Browse files Browse the repository at this point in the history
exec.py in Default.package-sublime calls /bin/bash with subprocess.
See Issue NixOS#12011. Because of this builds could not be started from
withtin Sublime Text.
  • Loading branch information
mogria committed Mar 2, 2017
1 parent 85a1dd2 commit e6dccbc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkgs/applications/editors/sublime3/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ fetchurl, stdenv, glib, xorg, cairo, gtk2, pango, makeWrapper, openssl, bzip2,
pkexecPath ? "/run/wrappers/bin/pkexec", libredirect,
gksuSupport ? false, gksu}:
gksuSupport ? false, gksu, unzip, zip }:

assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
assert gksuSupport -> gksu != null;
Expand Down Expand Up @@ -33,6 +33,21 @@ in let
dontPatchELF = true;
buildInputs = [ makeWrapper ];

# make exec.py in Default.sublime-package use "/usr/bin/env bash"
# instead of "/bin/bash"
patchPhase = ''
mkdir Default.sublime-package-fix
( cd Default.sublime-package-fix
${unzip}/bin/unzip ../Packages/Default.sublime-package > /dev/null
substituteInPlace "exec.py" --replace \
'["/bin/bash"' \
'["/usr/bin/env", "bash"'
)
${zip}/bin/zip -j Default.sublime-package.zip Default.sublime-package-fix/* > /dev/null
mv Default.sublime-package.zip Packages/Default.sublime-package
rm -r Default.sublime-package-fix
'';

buildPhase = ''
for i in sublime_text plugin_host crash_reporter; do
patchelf \
Expand Down

0 comments on commit e6dccbc

Please sign in to comment.