From 7d3db4f491094fa460328cf7e5a073f9f8d8296a Mon Sep 17 00:00:00 2001 From: Bryan Gardiner Date: Wed, 25 Jan 2017 21:17:49 -0800 Subject: [PATCH] squirrel-sql: init at 3.7.1 --- .../tools/database/squirrel-sql/default.nix | 69 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 73 insertions(+) create mode 100644 pkgs/development/tools/database/squirrel-sql/default.nix diff --git a/pkgs/development/tools/database/squirrel-sql/default.nix b/pkgs/development/tools/database/squirrel-sql/default.nix new file mode 100644 index 000000000000..afac17e121ad --- /dev/null +++ b/pkgs/development/tools/database/squirrel-sql/default.nix @@ -0,0 +1,69 @@ +# 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 + version = "3.7.1"; +in stdenv.mkDerivation rec { + name = "squirrel-sql-${version}"; + + src = fetchurl { + url = "mirror://sourceforge/project/squirrel-sql/1-stable/${version}-plainzip/squirrelsql-${version}-standard.zip"; + sha256 = "1v141ply57k5krwbnnmz4mbs9hs8rbys0bkjz69gvxlqjizyiq23"; + }; + + buildInputs = [ + jre makeWrapper stdenv unzip + ]; + + unpackPhase = '' + unzip ${src} + ''; + + buildPhase = '' + cd squirrelsql-${version}-standard + chmod +x squirrel-sql.sh + ''; + + installPhase = '' + 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 + ''; + + desktopItem = makeDesktopItem { + name = "squirrel-sql"; + exec = "squirrel-sql"; + comment = meta.description; + desktopName = "SQuirreL SQL"; + genericName = "SQL Client"; + categories = "Development;"; + icon = "squirrel-sql"; + }; + + meta = { + description = "Universal SQL Client"; + homepage = http://squirrel-sql.sourceforge.net/; + license = stdenv.lib.licenses.lgpl21; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ khumba ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a1f9a6fe4fb3..7c52c377ec7f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5443,6 +5443,10 @@ with pkgs; squeak = callPackage ../development/compilers/squeak { }; + squirrel-sql = callPackage ../development/tools/database/squirrel-sql { + drivers = [ mysql_jdbc postgresql_jdbc ]; + }; + stalin = callPackage ../development/compilers/stalin { }; metaBuildEnv = callPackage ../development/compilers/meta-environment/meta-build-env { };