Merge pull request #28303 from chris-martin/pr/sublime3-zip-fix

sublime3: fix package re-zipping
This commit is contained in:
Jörg Thalheim 2017-08-16 14:35:50 +01:00 committed by GitHub
commit 34d8ff1809

View File

@ -31,20 +31,19 @@ in let
dontStrip = true; dontStrip = true;
dontPatchELF = true; dontPatchELF = true;
buildInputs = [ makeWrapper ]; buildInputs = [ makeWrapper zip unzip ];
# make exec.py in Default.sublime-package use own bash with # make exec.py in Default.sublime-package use own bash with
# an LD_PRELOAD instead of "/bin/bash" # an LD_PRELOAD instead of "/bin/bash"
patchPhase = '' patchPhase = ''
mkdir Default.sublime-package-fix mkdir Default.sublime-package-fix
( cd Default.sublime-package-fix ( cd Default.sublime-package-fix
${unzip}/bin/unzip ../Packages/Default.sublime-package > /dev/null unzip -q ../Packages/Default.sublime-package
substituteInPlace "exec.py" --replace \ substituteInPlace "exec.py" --replace \
"[\"/bin/bash\"" \ "[\"/bin/bash\"" \
"[\"$out/sublime_bash\"" "[\"$out/sublime_bash\""
zip -q ../Packages/Default.sublime-package **/*
) )
${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 rm -r Default.sublime-package-fix
''; '';
@ -85,14 +84,17 @@ in stdenv.mkDerivation {
name = "sublimetext3-${build}"; name = "sublimetext3-${build}";
phases = [ "installPhase" ]; phases = [ "installPhase" ];
inherit sublime;
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
ln -s ${sublime}/sublime_text $out/bin/subl ln -s $sublime/sublime_text $out/bin/subl
ln -s ${sublime}/sublime_text $out/bin/sublime ln -s $sublime/sublime_text $out/bin/sublime
ln -s ${sublime}/sublime_text $out/bin/sublime3 ln -s $sublime/sublime_text $out/bin/sublime3
mkdir -p $out/share/applications mkdir -p $out/share/applications
ln -s ${sublime}/sublime_text.desktop $out/share/applications/sublime_text.desktop ln -s $sublime/sublime_text.desktop $out/share/applications/sublime_text.desktop
ln -s ${sublime}/Icon/256x256/ $out/share/icons ln -s $sublime/Icon/256x256/ $out/share/icons
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {