From e4b146b125a05642d1a984b22b012e0bf9fd0cfc Mon Sep 17 00:00:00 2001 From: Stanislas Date: Tue, 21 May 2019 20:17:01 +0200 Subject: [PATCH] vscodium: init at 1.33.1 (#60423) --- .../vscode/{default.nix => generic.nix} | 51 +++-------------- pkgs/applications/editors/vscode/vscode.nix | 55 +++++++++++++++++++ pkgs/applications/editors/vscode/vscodium.nix | 54 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +- 4 files changed, 119 insertions(+), 45 deletions(-) rename pkgs/applications/editors/vscode/{default.nix => generic.nix} (65%) create mode 100644 pkgs/applications/editors/vscode/vscode.nix create mode 100644 pkgs/applications/editors/vscode/vscodium.nix diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/generic.nix similarity index 65% rename from pkgs/applications/editors/vscode/default.nix rename to pkgs/applications/editors/vscode/generic.nix index 04e084dfc3b..10a981f59bf 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -2,38 +2,18 @@ , unzip, libsecret, libXScrnSaver, wrapGAppsHook , gtk2, atomEnv, at-spi2-atk, autoPatchelfHook , systemd, fontconfig -, isInsiders ? false }: + +# Attributes inherit from specific versions +, version, src, meta, sourceRoot +, executableName, longName, shortName, pname +}: let - executableName = "code" + lib.optionalString isInsiders "-insiders"; - longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders"; - shortName = "Code" + lib.optionalString isInsiders " - Insiders"; - inherit (stdenv.hostPlatform) system; - - plat = { - "i686-linux" = "linux-ia32"; - "x86_64-linux" = "linux-x64"; - "x86_64-darwin" = "darwin"; - }.${system}; - - sha256 = { - "i686-linux" = "0n2k134yx0zirddi5xig4zihn73s8xiga11pwk90f01wp1i0hygg"; - "x86_64-linux" = "0ljijcqfyrfck5imldis3hx9d9iacnspgnm58kvlziam8y0imwzv"; - "x86_64-darwin" = "00fg106rggsbng90k1jjp1c6nmnwni5s0fgmbz6k45shfa3iqamc"; - }.${system}; - - archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz"; in stdenv.mkDerivation rec { - name = "vscode-${version}"; - version = "1.33.1"; - src = fetchurl { - name = "VSCode_${version}_${plat}.${archive_fmt}"; - url = "https://vscode-update.azurewebsites.net/${version}/${plat}/stable"; - inherit sha256; - }; + inherit pname version src sourceRoot; passthru = { inherit executableName; @@ -118,22 +98,5 @@ in gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ systemd fontconfig ]}) ''; - meta = with stdenv.lib; { - description = '' - Open source source code editor developed by Microsoft for Windows, - Linux and macOS - ''; - longDescription = '' - Open source source code editor developed by Microsoft for Windows, - Linux and macOS. It includes support for debugging, embedded Git - control, syntax highlighting, intelligent code completion, snippets, - and code refactoring. It is also customizable, so users can change the - editor's theme, keyboard shortcuts, and preferences - ''; - homepage = https://code.visualstudio.com/; - downloadPage = https://code.visualstudio.com/Updates; - license = licenses.unfree; - maintainers = with maintainers; [ eadwu synthetica ]; - platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; - }; + inherit meta; } diff --git a/pkgs/applications/editors/vscode/vscode.nix b/pkgs/applications/editors/vscode/vscode.nix new file mode 100644 index 00000000000..4300abf626c --- /dev/null +++ b/pkgs/applications/editors/vscode/vscode.nix @@ -0,0 +1,55 @@ +{ stdenv, lib, callPackage, fetchurl, fetchpatch, isInsiders ? false }: + +let + inherit (stdenv.hostPlatform) system; + + plat = { + "i686-linux" = "linux-ia32"; + "x86_64-linux" = "linux-x64"; + "x86_64-darwin" = "darwin"; + }.${system}; + + archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz"; + + sha256 = { + "i686-linux" = "0n2k134yx0zirddi5xig4zihn73s8xiga11pwk90f01wp1i0hygg"; + "x86_64-linux" = "0ljijcqfyrfck5imldis3hx9d9iacnspgnm58kvlziam8y0imwzv"; + "x86_64-darwin" = "00fg106rggsbng90k1jjp1c6nmnwni5s0fgmbz6k45shfa3iqamc"; + }.${system}; +in + callPackage ./generic.nix rec { + + version = "1.33.1"; + pname = "vscode"; + + executableName = "code" + lib.optionalString isInsiders "-insiders"; + longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders"; + shortName = "Code" + lib.optionalString isInsiders " - Insiders"; + + src = fetchurl { + name = "VSCode_${version}_${plat}.${archive_fmt}"; + url = "https://vscode-update.azurewebsites.net/${version}/${plat}/stable"; + inherit sha256; + }; + + sourceRoot = ""; + + meta = with stdenv.lib; { + description = '' + Open source source code editor developed by Microsoft for Windows, + Linux and macOS + ''; + longDescription = '' + Open source source code editor developed by Microsoft for Windows, + Linux and macOS. It includes support for debugging, embedded Git + control, syntax highlighting, intelligent code completion, snippets, + and code refactoring. It is also customizable, so users can change the + editor's theme, keyboard shortcuts, and preferences + ''; + homepage = https://code.visualstudio.com/; + downloadPage = https://code.visualstudio.com/Updates; + license = licenses.unfree; + maintainers = with maintainers; [ eadwu synthetica ]; + platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; + }; + } diff --git a/pkgs/applications/editors/vscode/vscodium.nix b/pkgs/applications/editors/vscode/vscodium.nix new file mode 100644 index 00000000000..2b85cf8294e --- /dev/null +++ b/pkgs/applications/editors/vscode/vscodium.nix @@ -0,0 +1,54 @@ +{ stdenv, lib, callPackage, fetchurl, fetchpatch }: + +let + inherit (stdenv.hostPlatform) system; + + plat = { + "i686-linux" = "linux-ia32"; + "x86_64-linux" = "linux-x64"; + "x86_64-darwin" = "darwin"; + }.${system}; + + archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz"; + + sha256 = { + "i686-linux" = "c45be9ff32a5acef91befc85d545402daac5cef627fe8f17fea40ae387b35b22"; + "x86_64-linux" = "7a87f19bc48cbe017321c72da244d879a7da364b92b3a89b742d437ffcd585d3"; + "x86_64-darwin" = "e393be5dd82ea1900e3a0597b6cb2e4c924b6acda4297d9d3eff5abcc857f32c"; + }.${system}; +in + callPackage ./generic.nix rec { + + version = "1.33.1"; + pname = "vscodium"; + + executableName = "vscodium"; + longName = "VSCodium"; + shortName = "Codium"; + + src = fetchurl { + url = "https://github.com/VSCodium/vscodium/releases/download/${version}/VSCodium-${plat}-${version}.${archive_fmt}"; + inherit sha256; + }; + + sourceRoot = "."; + + meta = with stdenv.lib; { + description = '' + Open source source code editor developed by Microsoft for Windows, + Linux and macOS (VS Code without MS branding/telemetry/licensing) + ''; + longDescription = '' + Open source source code editor developed by Microsoft for Windows, + Linux and macOS. It includes support for debugging, embedded Git + control, syntax highlighting, intelligent code completion, snippets, + and code refactoring. It is also customizable, so users can change the + editor's theme, keyboard shortcuts, and preferences + ''; + homepage = https://github.com/VSCodium/vscodium; + downloadPage = https://github.com/VSCodium/vscodium/releases; + license = licenses.mit; + maintainers = with maintainers; []; + platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2153fa916e0..2c873fd7fdf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20610,7 +20610,7 @@ in vorbis-tools = callPackage ../applications/audio/vorbis-tools { }; - vscode = callPackage ../applications/editors/vscode { }; + vscode = callPackage ../applications/editors/vscode/vscode.nix { }; vscode-with-extensions = callPackage ../applications/editors/vscode/with-extensions.nix {}; @@ -20618,6 +20618,8 @@ in vscode-extensions = recurseIntoAttrs (callPackage ../misc/vscode-extensions {}); + vscodium = callPackage ../applications/editors/vscode/vscodium.nix { }; + vue = callPackage ../applications/misc/vue { }; vuze = callPackage ../applications/networking/p2p/vuze { };