Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] vscodium: init at 1.33.1 #60423

Merged
merged 17 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,28 @@
, unzip, libsecret, libXScrnSaver, wrapGAppsHook
, gtk2, atomEnv, at-spi2-atk, autoPatchelfHook
, systemd, fontconfig
, isInsiders ? false }:
, isInsiders ? false

let
executableName = "code" + lib.optionalString isInsiders "-insiders";
longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
shortName = "Code" + lib.optionalString isInsiders " - Insiders";
# Attributes inherit from specific versions
, version, src, sha256, meta, sourceRoot
angristan marked this conversation as resolved.
Show resolved Hide resolved
, executableName, longName, shortName, name
, ...
}:

let
inherit (stdenv.hostPlatform) system;

plat = {
"i686-linux" = "linux-ia32";
"x86_64-linux" = "linux-x64";
"x86_64-darwin" = "darwin";
}.${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";
# 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 name src sourceRoot;

passthru = {
inherit executableName;
Expand Down Expand Up @@ -117,23 +107,4 @@ in
preFixup = lib.optionalString (system == "i686-linux" || system == "x86_64-linux") ''
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ systemd fontconfig ]})
'';

meta = with stdenv.lib; {
veprbl marked this conversation as resolved.
Show resolved Hide resolved
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" ];
};
}
62 changes: 62 additions & 0 deletions pkgs/applications/editors/vscode/vscode.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{ stdenv, lib, callPackage, fetchurl, fetchpatch, ... } @ args:

callPackage ./generic.nix (args // rec {

# How can I get plat and archive_fmt from generic.nix?
#inherit plat archive_fmt;

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";

inherit (stdenv.hostPlatform) system;
angristan marked this conversation as resolved.
Show resolved Hide resolved

version = "1.33.1";

# Same here, I have trouble getting isInsiders, and I don't understand its purpose since it is not used anywhere else in the repo
#executableName = "code" + lib.optionalString isInsiders "-insiders";
#longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
#shortName = "Code" + lib.optionalString isInsiders " - Insiders";

executableName = "code";
longName = "Visual Studio Code";
shortName = "Code";

name = "vscode-${version}";

sha256 = {
"i686-linux" = "0n2k134yx0zirddi5xig4zihn73s8xiga11pwk90f01wp1i0hygg";
"x86_64-linux" = "0ljijcqfyrfck5imldis3hx9d9iacnspgnm58kvlziam8y0imwzv";
"x86_64-darwin" = "00fg106rggsbng90k1jjp1c6nmnwni5s0fgmbz6k45shfa3iqamc";
}.${system};

src = fetchurl {
name = "VSCode_${version}_${plat}.${archive_fmt}";
url = "https://vscode-update.azurewebsites.net/${version}/${plat}/stable";
inherit sha256;
};

# I don't know how to split meta between the files. "platforms" should be shared
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" ];
};
})
59 changes: 59 additions & 0 deletions pkgs/applications/editors/vscode/vscodium.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{ stdenv, lib, callPackage, fetchurl, fetchpatch, ... } @ args:
angristan marked this conversation as resolved.
Show resolved Hide resolved
angristan marked this conversation as resolved.
Show resolved Hide resolved

callPackage ./generic.nix (args // rec {

# How can I get plat and archive_fmt from generic.nix?
#inherit plat archive_fmt;

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";

inherit (stdenv.hostPlatform) system;

version = "1.33.1";

executableName = "vscodium";
longName = "VSCodium";
shortName = "Codium";

name = "vscodium-${version}";

sha256 = {
"i686-linux" = "c45be9ff32a5acef91befc85d545402daac5cef627fe8f17fea40ae387b35b22";
"x86_64-linux" = "7a87f19bc48cbe017321c72da244d879a7da364b92b3a89b742d437ffcd585d3";
"x86_64-darwin" = "e393be5dd82ea1900e3a0597b6cb2e4c924b6acda4297d9d3eff5abcc857f32c";
}.${system};

src = fetchurl {
name = "VSCodium_${version}_${plat}.${archive_fmt}";
angristan marked this conversation as resolved.
Show resolved Hide resolved
url = "https://github.com/VSCodium/vscodium/releases/download/${version}/VSCodium-${plat}-${version}.tar.gz";
inherit sha256;
};

sourceRoot = ".";

# I don't know how to split meta between the files. "platforms" should be shared
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" ];
};
})
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20390,14 +20390,16 @@ 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 {};

vscode-utils = callPackage ../misc/vscode-extensions/vscode-utils.nix {};

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 { };
Expand Down