vscode: 1.10.0 -> 1.10.2

In addition to the version bump, this also fixes a broken install phase
on macOS. The install now completes properly on macOS 10.12 and
"bin/code" is now correctly linked to the binary within the bundle.
This commit is contained in:
Winnie Quinn 2017-03-24 16:05:59 -04:00
parent e3c1e37823
commit 1b4151b12f

View File

@ -2,24 +2,24 @@
makeWrapper, libXScrnSaver }:
let
version = "1.10.0";
rev = "49129d126e2c3c5592cfc8a509d872067b69d262";
version = "1.10.2";
rev = "8076a19fdcab7e1fc1707952d652f0bb6c6db331";
channel = "stable";
# The revision can be obtained with the following command (see https://github.com/NixOS/nixpkgs/issues/22465):
# curl -w "%{url_effective}\n" -I -L -s -S https://vscode-update.azurewebsites.net/latest/linux-x64/stable -o /dev/null
sha256 = if stdenv.system == "i686-linux" then "14ip00ysnn6daw7ws3vgnhib18pi7r1z1szfr7s996awbq12ir3i"
else if stdenv.system == "x86_64-linux" then "1krrshsx2pjkr4pc1d6zad664f5khdbhwaq8lpx1aagxxd921mx6"
else if stdenv.system == "x86_64-darwin" then "1y574b4wpkk06a36clajx57ydj7a0scn2gms4070cqaf0afzy19f"
sha256 = if stdenv.system == "i686-linux" then "1rhwrpv17c8j06qja7i58cggzka8jm9v9h27jy22z30yxjz0p241"
else if stdenv.system == "x86_64-linux" then "1c1w7wc39a5vdap8j143ym976p9l9iwns1y28mcgjwrihdlb5wb8"
else if stdenv.system == "x86_64-darwin" then "1zznsn84k79lqirzv950q7caq7c88yh2gglwjc11y8k69awmlpva"
else throw "Unsupported system: ${stdenv.system}";
urlBase = "https://az764295.vo.msecnd.net/${channel}/${rev}/";
urlStr = if stdenv.system == "i686-linux" then
urlBase + "code-${channel}-code_${version}-1488384152_i386.tar.gz"
urlBase + "code-${channel}-code_${version}-1488982317_i386.tar.gz"
else if stdenv.system == "x86_64-linux" then
urlBase + "code-${channel}-code_${version}-1488387854_amd64.tar.gz"
urlBase + "code-${channel}-code_${version}-1488981323_amd64.tar.gz"
else if stdenv.system == "x86_64-darwin" then
urlBase + "VSCode-darwin-${channel}.zip"
else throw "Unsupported system: ${stdenv.system}";
@ -47,17 +47,22 @@ in
then [ unzip makeWrapper libXScrnSaver ]
else [ makeWrapper libXScrnSaver ];
installPhase = ''
mkdir -p $out/lib/vscode $out/bin
cp -r ./* $out/lib/vscode
ln -s $out/lib/vscode/code $out/bin
installPhase =
if stdenv.system == "x86_64-darwin" then ''
mkdir -p $out/lib/vscode $out/bin
cp -r ./* $out/lib/vscode
ln -s $out/lib/vscode/Contents/Resources/app/bin/code $out/bin
'' else ''
mkdir -p $out/lib/vscode $out/bin
cp -r ./* $out/lib/vscode
ln -s $out/lib/vscode/code $out/bin
mkdir -p $out/share/applications
cp $desktopItem/share/applications/* $out/share/applications
mkdir -p $out/share/applications
cp $desktopItem/share/applications/* $out/share/applications
mkdir -p $out/share/pixmaps
cp $out/lib/vscode/resources/app/resources/linux/code.png $out/share/pixmaps/code.png
'';
mkdir -p $out/share/pixmaps
cp $out/lib/vscode/resources/app/resources/linux/code.png $out/share/pixmaps/code.png
'';
postFixup = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") ''
patchelf \