From 6cf4bed3f0549016d3cbdafb853bc390aea82a1e Mon Sep 17 00:00:00 2001 From: Xavier Zwirtz Date: Thu, 20 Feb 2020 01:17:44 -0600 Subject: [PATCH] azuredatastudio: init at 1.15.1 --- .../misc/azuredatastudio/default.nix | 115 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 117 insertions(+) create mode 100644 pkgs/applications/misc/azuredatastudio/default.nix diff --git a/pkgs/applications/misc/azuredatastudio/default.nix b/pkgs/applications/misc/azuredatastudio/default.nix new file mode 100644 index 000000000000..902bef5f12ec --- /dev/null +++ b/pkgs/applications/misc/azuredatastudio/default.nix @@ -0,0 +1,115 @@ +{ stdenv +, lib +, fetchurl +, makeWrapper +, libuuid +, libunwind +, icu +, openssl +, zlib +, curl +, at-spi2-core +, at-spi2-atk +, gnutar +, atomEnv +, kerberos +}: + +# from justinwoo/azuredatastudio-nix +# https://github.com/justinwoo/azuredatastudio-nix/blob/537c48aa3981cd1a82d5d6e508ab7e7393b3d7c8/default.nix + +stdenv.mkDerivation rec { + + pname = "azuredatastudio"; + version = "1.17.1"; + + src = fetchurl { + url = "https://azuredatastudiobuilds.blob.core.windows.net/releases/${version}/azuredatastudio-linux-${version}.tar.gz"; + sha256 = "0px9n9vyjvyddca4x7d0zindd0dim7350vkjg5dd0506fm8dc38k"; + }; + + nativeBuildInputs = [ + makeWrapper + ]; + + buildInputs = [ + libuuid + at-spi2-core + at-spi2-atk + ]; + + phases = "unpackPhase fixupPhase"; + + # change this to azuredatastudio-insiders for insiders releases + edition = "azuredatastudio"; + targetPath = "$out/${edition}"; + + unpackPhase = '' + mkdir -p ${targetPath} + ${gnutar}/bin/tar xf $src --strip 1 -C ${targetPath} + ''; + + sqltoolsserviceRpath = stdenv.lib.makeLibraryPath [ + stdenv.cc.cc + libunwind + libuuid + icu + openssl + zlib + curl + ]; + + # this will most likely need to be updated when azuredatastudio's version changes + sqltoolsservicePath = "${targetPath}/resources/app/extensions/mssql/sqltoolsservice/Linux/2.0.0-release.56"; + + rpath = stdenv.lib.concatStringsSep ":" [ + atomEnv.libPath + ( + stdenv.lib.makeLibraryPath [ + libuuid + at-spi2-core + at-spi2-atk + stdenv.cc.cc.lib + kerberos + ] + ) + targetPath + sqltoolsserviceRpath + ]; + + fixupPhase = '' + fix_sqltoolsservice() + { + mv ${sqltoolsservicePath}/$1 ${sqltoolsservicePath}/$1_old + patchelf \ + --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \ + ${sqltoolsservicePath}/$1_old + + makeWrapper \ + ${sqltoolsservicePath}/$1_old \ + ${sqltoolsservicePath}/$1 \ + --set LD_LIBRARY_PATH ${sqltoolsserviceRpath} + } + + fix_sqltoolsservice MicrosoftSqlToolsServiceLayer + fix_sqltoolsservice MicrosoftSqlToolsCredentials + fix_sqltoolsservice SqlToolsResourceProviderService + + patchelf \ + --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \ + ${targetPath}/${edition} + + mkdir -p $out/bin + makeWrapper \ + ${targetPath}/bin/${edition} \ + $out/bin/azuredatastudio \ + --set LD_LIBRARY_PATH ${rpath} + ''; + + meta = { + maintainers = with stdenv.lib.maintainers; [ xavierzwirtz ]; + description = "A data management tool that enables working with SQL Server, Azure SQL DB and SQL DW"; + homepage = "https://docs.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio"; + license = lib.licenses.unfreeRedistributable; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f95c26e52123..78713bc16e9f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15947,6 +15947,8 @@ in mssql_jdbc = callPackage ../servers/sql/mssql/jdbc { }; + azuredatastudio = callPackage ../applications/misc/azuredatastudio { }; + miniflux = callPackage ../servers/miniflux { }; nagios = callPackage ../servers/monitoring/nagios { };