2017-01-26 06:17:49 +01:00
|
|
|
# To enable specific database drivers, override this derivation and pass the
|
|
|
|
# driver packages in the drivers argument (e.g. mysql_jdbc, postgresql_jdbc).
|
|
|
|
{ stdenv, fetchurl, makeDesktopItem, makeWrapper, unzip
|
|
|
|
, jre
|
|
|
|
, drivers ? []
|
|
|
|
}:
|
|
|
|
let
|
2018-12-18 12:28:01 +01:00
|
|
|
version = "3.9.0";
|
2017-01-26 06:17:49 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "squirrel-sql-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/project/squirrel-sql/1-stable/${version}-plainzip/squirrelsql-${version}-standard.zip";
|
2018-12-18 12:28:01 +01:00
|
|
|
sha256 = "0b16l7p7klagxnwkx2az4mbyd35kv4aj8xxbwm27pp3spz9dk8m0";
|
2017-01-26 06:17:49 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 12:28:01 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper unzip ];
|
|
|
|
buildInputs = [ jre ];
|
2017-01-26 06:17:49 +01:00
|
|
|
|
|
|
|
unpackPhase = ''
|
2018-12-18 12:28:01 +01:00
|
|
|
runHook preUnpack
|
2017-01-26 06:17:49 +01:00
|
|
|
unzip ${src}
|
2018-12-18 12:28:01 +01:00
|
|
|
runHook postUnpack
|
2017-01-26 06:17:49 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2018-12-18 12:28:01 +01:00
|
|
|
runHook preBuild
|
2017-01-26 06:17:49 +01:00
|
|
|
cd squirrelsql-${version}-standard
|
|
|
|
chmod +x squirrel-sql.sh
|
2018-12-18 12:28:01 +01:00
|
|
|
runHook postBuild
|
2017-01-26 06:17:49 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-12-18 12:28:01 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2017-01-26 06:17:49 +01:00
|
|
|
mkdir -p $out/share/squirrel-sql
|
|
|
|
cp -r . $out/share/squirrel-sql
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp=""
|
|
|
|
for pkg in ${builtins.concatStringsSep " " drivers}; do
|
|
|
|
if test -n "$cp"; then
|
|
|
|
cp="$cp:"
|
|
|
|
fi
|
|
|
|
cp="$cp"$(echo $pkg/share/java/*.jar | tr ' ' :)
|
|
|
|
done
|
|
|
|
makeWrapper $out/share/squirrel-sql/squirrel-sql.sh $out/bin/squirrel-sql \
|
|
|
|
--set CLASSPATH "$cp" \
|
|
|
|
--set JAVA_HOME "${jre}"
|
|
|
|
|
|
|
|
mkdir -p $out/share/icons/hicolor/32x32/apps
|
|
|
|
ln -s $out/share/squirrel-sql/icons/acorn.png \
|
|
|
|
$out/share/icons/hicolor/32x32/apps/squirrel-sql.png
|
|
|
|
ln -s ${desktopItem}/share/applications $out/share
|
2018-12-18 12:28:01 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2017-01-26 06:17:49 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "squirrel-sql";
|
|
|
|
exec = "squirrel-sql";
|
|
|
|
comment = meta.description;
|
|
|
|
desktopName = "SQuirreL SQL";
|
|
|
|
genericName = "SQL Client";
|
|
|
|
categories = "Development;";
|
|
|
|
icon = "squirrel-sql";
|
|
|
|
};
|
|
|
|
|
2018-12-18 12:28:01 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-01-26 06:17:49 +01:00
|
|
|
description = "Universal SQL Client";
|
|
|
|
homepage = http://squirrel-sql.sourceforge.net/;
|
2018-12-18 12:28:01 +01:00
|
|
|
license = licenses.lgpl21;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ khumba ];
|
2017-01-26 06:17:49 +01:00
|
|
|
};
|
|
|
|
}
|