diff --git a/pkgs/applications/editors/jetbrains/common.nix b/pkgs/applications/editors/jetbrains/common.nix index f535d7bff47c..bca85c01016a 100644 --- a/pkgs/applications/editors/jetbrains/common.nix +++ b/pkgs/applications/editors/jetbrains/common.nix @@ -1,4 +1,4 @@ -{ stdenv, makeDesktopItem, makeWrapper, patchelf, p7zip +{ stdenv, lib, makeDesktopItem, makeWrapper, patchelf, p7zip , coreutils, gnugrep, which, git, unzip, libsecret, libnotify }: @@ -28,7 +28,7 @@ with stdenv; lib.makeOverridable mkDerivation rec { nativeBuildInputs = [ makeWrapper patchelf p7zip unzip ]; - patchPhase = '' + patchPhase = lib.optionalString (!stdenv.isDarwin) '' get_file_size() { local fname="$1" echo $(ls -l $fname | cut -d ' ' -f5) @@ -63,7 +63,7 @@ with stdenv; lib.makeOverridable mkDerivation rec { item=${desktopItem} makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${execName}" \ - --prefix PATH : "$out/libexec/${name}:${stdenv.lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \ + --prefix PATH : "$out/libexec/${name}:${lib.optionalString (stdenv.isDarwin) "${jdk}/jdk/Contents/Home/bin:"}${stdenv.lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \ --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ # Some internals want libstdc++.so.6 stdenv.cc.cc.lib libsecret diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index a302be304e57..16a1c01363d8 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -134,7 +134,7 @@ let as IntelliJ. ''; maintainers = with maintainers; [ edwtjo ]; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; }; }); diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix index 1349b7f0dddc..a6e3dfff4e03 100644 --- a/pkgs/development/compilers/jetbrains-jdk/default.nix +++ b/pkgs/development/compilers/jetbrains-jdk/default.nix @@ -14,6 +14,11 @@ let drv = stdenv.mkDerivation rec { url = "https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-11_0_2-linux-x64-b${version}.tar.gz"; sha256 = "121yzgvkfx7lq0k9s8wjnhz09a564br5y7zlkxgh191sbm2i7zdi"; } + else if stdenv.hostPlatform.system == "x86_64-darwin" then + fetchurl { + url = "https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-11_0_2-osx-x64-b${version}.tar.gz"; + sha256 = "1ly6kf59knvzbr2pjkc9fqyzfs28pdvnqg5pfffr8zp14xm44zmd"; + } else throw "unsupported system: ${stdenv.hostPlatform.system}"; @@ -28,20 +33,20 @@ let drv = stdenv.mkDerivation rec { jrePath=$out/jre ''; - postFixup = '' + postFixup = lib.optionalString (!stdenv.isDarwin) '' 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 ([ + rpath = lib.optionalString (!stdenv.isDarwin) (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 zlib (placeholder "out") ] ++ (with xorg; [ libX11 libXext libXtst libXi libXp libXt libXrender libXxf86vm - ])) + ":${placeholder "out"}/lib/jli"; + ])) + ":${placeholder "out"}/lib/jli"); passthru.home = drv; @@ -61,6 +66,6 @@ let drv = stdenv.mkDerivation rec { homepage = "https://bintray.com/jetbrains/intellij-jdk/"; license = licenses.gpl2; maintainers = with maintainers; [ edwtjo ]; - platforms = with platforms; [ "x86_64-linux" ]; + platforms = with platforms; [ "x86_64-linux" "x86_64-darwin" ]; }; }; in drv