jetbrains.idea-community: add darwin support
This commit is contained in:
parent
82fe35cd29
commit
01f0c10ba2
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, makeDesktopItem, makeWrapper, patchelf, p7zip
|
{ stdenv, lib, makeDesktopItem, makeWrapper, patchelf, p7zip
|
||||||
, coreutils, gnugrep, which, git, unzip, libsecret, libnotify
|
, coreutils, gnugrep, which, git, unzip, libsecret, libnotify
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ with stdenv; lib.makeOverridable mkDerivation rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper patchelf p7zip unzip ];
|
nativeBuildInputs = [ makeWrapper patchelf p7zip unzip ];
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = lib.optionalString (!stdenv.isDarwin) ''
|
||||||
get_file_size() {
|
get_file_size() {
|
||||||
local fname="$1"
|
local fname="$1"
|
||||||
echo $(ls -l $fname | cut -d ' ' -f5)
|
echo $(ls -l $fname | cut -d ' ' -f5)
|
||||||
@ -63,7 +63,7 @@ with stdenv; lib.makeOverridable mkDerivation rec {
|
|||||||
item=${desktopItem}
|
item=${desktopItem}
|
||||||
|
|
||||||
makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${execName}" \
|
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 [
|
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [
|
||||||
# Some internals want libstdc++.so.6
|
# Some internals want libstdc++.so.6
|
||||||
stdenv.cc.cc.lib libsecret
|
stdenv.cc.cc.lib libsecret
|
||||||
|
@ -134,7 +134,7 @@ let
|
|||||||
as IntelliJ.
|
as IntelliJ.
|
||||||
'';
|
'';
|
||||||
maintainers = with maintainers; [ edwtjo ];
|
maintainers = with maintainers; [ edwtjo ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -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";
|
url = "https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-11_0_2-linux-x64-b${version}.tar.gz";
|
||||||
sha256 = "121yzgvkfx7lq0k9s8wjnhz09a564br5y7zlkxgh191sbm2i7zdi";
|
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
|
else
|
||||||
throw "unsupported system: ${stdenv.hostPlatform.system}";
|
throw "unsupported system: ${stdenv.hostPlatform.system}";
|
||||||
|
|
||||||
@ -28,20 +33,20 @@ let drv = stdenv.mkDerivation rec {
|
|||||||
jrePath=$out/jre
|
jrePath=$out/jre
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = lib.optionalString (!stdenv.isDarwin) ''
|
||||||
find $out -type f -perm -0100 \
|
find $out -type f -perm -0100 \
|
||||||
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||||
--set-rpath "$rpath" {} \;
|
--set-rpath "$rpath" {} \;
|
||||||
find $out -name "*.so" -exec patchelf --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
|
stdenv.cc.cc stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt libGL
|
||||||
alsaLib fontconfig freetype pango gtk2 cairo gdk-pixbuf atk zlib
|
alsaLib fontconfig freetype pango gtk2 cairo gdk-pixbuf atk zlib
|
||||||
(placeholder "out")
|
(placeholder "out")
|
||||||
] ++ (with xorg; [
|
] ++ (with xorg; [
|
||||||
libX11 libXext libXtst libXi libXp libXt libXrender libXxf86vm
|
libX11 libXext libXtst libXi libXp libXt libXrender libXxf86vm
|
||||||
])) + ":${placeholder "out"}/lib/jli";
|
])) + ":${placeholder "out"}/lib/jli");
|
||||||
|
|
||||||
passthru.home = drv;
|
passthru.home = drv;
|
||||||
|
|
||||||
@ -61,6 +66,6 @@ let drv = stdenv.mkDerivation rec {
|
|||||||
homepage = "https://bintray.com/jetbrains/intellij-jdk/";
|
homepage = "https://bintray.com/jetbrains/intellij-jdk/";
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
maintainers = with maintainers; [ edwtjo ];
|
maintainers = with maintainers; [ edwtjo ];
|
||||||
platforms = with platforms; [ "x86_64-linux" ];
|
platforms = with platforms; [ "x86_64-linux" "x86_64-darwin" ];
|
||||||
};
|
};
|
||||||
}; in drv
|
}; in drv
|
||||||
|
Loading…
Reference in New Issue
Block a user