diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index 844999b03663..f038682b6c06 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, callPackage, fetchurl , python -, jdk, cmake, libxml2, zlib, python3, ncurses +, jdk, jdk8, cmake, libxml2, zlib, python3, ncurses }: with stdenv.lib; @@ -243,6 +243,27 @@ let rm -r jre64 ''; }); + + buildMps = { name, version, src, license, description, wmClass, ... }: + (mkJetBrainsProduct rec { + inherit name version src wmClass; + # MPS does not yet work with jbrsdk11 as of 2019.1.5 (it starts + # but is unable to generate any project) + jdk = jdk8; + product = "MPS"; + meta = with stdenv.lib; { + homepage = https://www.jetbrains.com/mps/; + inherit license description; + longDescription = '' + A metaprogramming system which uses projectional editing + which allows users to overcome the limits of language + parsers, and build DSL editors, such as ones with tables and + diagrams. + ''; + maintainers = with maintainers; [ rasendubi ]; + platforms = platforms.linux; + }; + }); in { @@ -391,4 +412,17 @@ in update-channel = "WebStorm RELEASE"; }; + mps = buildMps rec { + name = "mps-${version}"; + version = "2019.1.5"; + description = "Create your own domain-specific language"; + license = stdenv.lib.licenses.unfree; + src = fetchurl { + url = "https://download.jetbrains.com/mps/2019.1/MPS-${version}.tar.gz"; + sha256 = "0bq1gxciw9p9nd2h9vcill8rb6ghkjjj7b0dh812vx75rsfwsvl4"; + }; + wmClass = "jetbrains-mps"; + update-channel = "MPS RELEASE"; + }; + } diff --git a/pkgs/development/compilers/jetbrains-jdk/8.nix b/pkgs/development/compilers/jetbrains-jdk/8.nix new file mode 100644 index 000000000000..171c6f44c2b0 --- /dev/null +++ b/pkgs/development/compilers/jetbrains-jdk/8.nix @@ -0,0 +1,75 @@ +{ stdenv, lib, fetchurl, file, glib, libxml2, libav_0_8, ffmpeg, libxslt +, libGL , xorg, alsaLib, fontconfig, freetype, pango, gtk2, cairo +, gdk-pixbuf, atk, zlib }: + +# TODO: Investigate building from source instead of patching binaries. +# TODO: Binary patching for not just x86_64-linux but also x86_64-darwin i686-linux + +let drv = stdenv.mkDerivation rec { + pname = "jbrsdk8"; + version = "212-1586.12"; + + src = if stdenv.hostPlatform.system == "x86_64-linux" then + fetchurl { + url = "https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrsdk-8u${lib.head (lib.splitString "-" version)}-linux-x64-b${lib.elemAt (lib.splitString "-" version) 1}.tar.gz"; + sha256 = "1vdqhkx3fz26s7bj7vw3cbq8856crj19535ix0szvwjpjg6ca8zk"; + } + else + throw "unsupported system: ${stdenv.hostPlatform.system}"; + + nativeBuildInputs = [ file ]; + + unpackCmd = "mkdir jdk; pushd jdk; tar -xzf $src; popd"; + + installPhase = '' + cd .. + + mv $sourceRoot $out + jrePath=$out/jre + ''; + + postFixup = let + arch = "amd64"; + rSubPaths = [ + "lib/${arch}/jli" + "lib/${arch}/server" + "lib/${arch}/xawt" + "lib/${arch}" + ]; + in '' + rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$jrePath/${a}") rSubPaths)}" + find $out -type f -perm -0100 \ + -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "$rpath" {} \; + find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; + ''; + + rpath = lib.makeLibraryPath ([ + stdenv.cc.cc stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt libGL + alsaLib fontconfig freetype pango gtk2 cairo gdk-pixbuf atk + (placeholder "out") + ] ++ (with xorg; [ + libX11 libXext libXtst libXi libXp libXt libXrender libXxf86vm + ])); + + passthru.home = drv; + + meta = with stdenv.lib; { + description = "An OpenJDK fork to better support Jetbrains's products."; + longDescription = '' + JetBrains Runtime is a runtime environment for running IntelliJ Platform + based products on Windows, Mac OS X, and Linux. JetBrains Runtime is + based on OpenJDK project with some modifications. These modifications + include: Subpixel Anti-Aliasing, enhanced font rendering on Linux, HiDPI + support, ligatures, some fixes for native crashes not presented in + official build, and other small enhancements. + + JetBrains Runtime is not a certified build of OpenJDK. Please, use at + your own risk. + ''; + homepage = https://bintray.com/jetbrains/intellij-jbr/; + license = licenses.gpl2; + maintainers = with maintainers; [ rasendubi ]; + platforms = with platforms; [ "x86_64-linux" ]; + }; +}; in drv diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f69d103a7f62..75ac7b280780 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18430,8 +18430,10 @@ in jetbrains = (recurseIntoAttrs (callPackages ../applications/editors/jetbrains { jdk = jetbrains.jdk; + jdk8 = jetbrains.jdk8; }) // { jdk = callPackage ../development/compilers/jetbrains-jdk { }; + jdk8 = callPackage ../development/compilers/jetbrains-jdk/8.nix { }; }); libquvi = callPackage ../applications/video/quvi/library.nix { };