Merge pull request #45110 from flokli/sqldeveloper

sqldeveloper: simplify, add darwin support
This commit is contained in:
Jörg Thalheim 2018-08-16 15:20:46 +02:00 committed by GitHub
commit 1fd75a1003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{ stdenv, makeDesktopItem, makeWrapper, requireFile, unzip, openjdk }:
{ stdenv, makeDesktopItem, makeWrapper, requireFile, unzip, jdk }:
let
version = "17.4.1.054.0712";
@ -46,29 +46,23 @@ in
nix-prefetch-url --type sha256 file:///path/to/${name}
'';
# obtained by `sha256sum sqldeveloper-${version}-no-jre.zip`
sha256 = "7e92ca94d02489002db291c96f1d67f9b2501a8967ff3457103fcf60c1eb154a";
};
buildInputs = [ makeWrapper unzip ];
buildCommand = ''
mkdir -p $out/bin
echo >$out/bin/sqldeveloper '#! ${stdenv.shell}'
echo >>$out/bin/sqldeveloper 'export JAVA_HOME=${openjdk}/lib/openjdk'
echo >>$out/bin/sqldeveloper 'export JDK_HOME=$JAVA_HOME'
echo >>$out/bin/sqldeveloper "cd $out/lib/${name}/sqldeveloper/bin"
echo >>$out/bin/sqldeveloper '${stdenv.shell} sqldeveloper "$@"'
chmod +x $out/bin/sqldeveloper
unpackCmd = "unzip $curSrc";
mkdir -p $out/lib/
cd $out
unzip ${src}
mv sqldeveloper $out/lib/${name}
installPhase = ''
mkdir -p $out/libexec $out/share/{applications,pixmaps}
mv * $out/libexec/
install -D -m 444 $out/lib/$name/icon.png $out/share/pixmaps/sqldeveloper.png
mkdir -p $out/share/applications
mv $out/libexec/icon.png $out/share/pixmaps/sqldeveloper.png
cp ${desktopItem}/share/applications/* $out/share/applications
makeWrapper $out/libexec/sqldeveloper/bin/sqldeveloper $out/bin/sqldeveloper \
--set JAVA_HOME ${jdk.home} \
--run "cd $out/libexec/sqldeveloper/bin"
'';
meta = with stdenv.lib; {
@ -84,7 +78,7 @@ in
'';
homepage = http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/;
license = licenses.unfree;
platforms = [ "x86_64-linux" "x86_64-darwin" ];
maintainers = [ maintainers.ardumont ];
platforms = platforms.linux;
};
}