2020-05-29 06:06:01 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
2021-12-06 16:07:01 +00:00
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2020-05-29 06:06:01 +00:00
|
|
|
, makeWrapper
|
2023-10-09 19:29:22 +00:00
|
|
|
, alsa-lib
|
2020-05-29 06:06:01 +00:00
|
|
|
, at-spi2-atk
|
2023-10-09 19:29:22 +00:00
|
|
|
, at-spi2-core
|
|
|
|
, cairo
|
|
|
|
, cups
|
|
|
|
, curl
|
|
|
|
, dbus
|
|
|
|
, expat
|
|
|
|
, gdk-pixbuf
|
|
|
|
, glib
|
2020-05-29 06:06:01 +00:00
|
|
|
, gnutar
|
2023-10-09 19:29:22 +00:00
|
|
|
, gtk3
|
|
|
|
, icu
|
2021-12-06 16:07:01 +00:00
|
|
|
, libdrm
|
2023-10-09 19:29:22 +00:00
|
|
|
, libunwind
|
|
|
|
, libuuid
|
|
|
|
, libxkbcommon
|
2021-12-06 16:07:01 +00:00
|
|
|
, mesa
|
2023-10-09 19:29:22 +00:00
|
|
|
, nspr
|
|
|
|
, nss
|
|
|
|
, openssl
|
|
|
|
, pango
|
|
|
|
, systemd
|
2021-12-06 16:07:01 +00:00
|
|
|
, xorg
|
2023-10-09 19:29:22 +00:00
|
|
|
, zlib
|
2020-05-29 06:06:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
# from justinwoo/azuredatastudio-nix
|
|
|
|
# https://github.com/justinwoo/azuredatastudio-nix/blob/537c48aa3981cd1a82d5d6e508ab7e7393b3d7c8/default.nix
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "azuredatastudio";
|
|
|
|
desktopName = "Azure Data Studio";
|
|
|
|
comment = "Data Management Tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.";
|
|
|
|
genericName = "Text Editor";
|
|
|
|
exec = "azuredatastudio --no-sandbox --unity-launch %F";
|
|
|
|
icon = "azuredatastudio";
|
2022-03-05 16:20:37 +00:00
|
|
|
startupNotify = true;
|
|
|
|
startupWMClass = "azuredatastudio";
|
|
|
|
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
|
|
|
|
mimeTypes = [ "text/plain" "inode/directory" "application/x-azuredatastudio-workspace" ];
|
|
|
|
keywords = [ "azuredatastudio" ];
|
|
|
|
actions.new-empty-window = {
|
|
|
|
name = "New Empty Window";
|
|
|
|
exec = "azuredatastudio --no-sandbox --new-window %F";
|
|
|
|
icon = "azuredatastudio";
|
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
urlHandlerDesktopItem = makeDesktopItem {
|
|
|
|
name = "azuredatastudio-url-handler";
|
|
|
|
desktopName = "Azure Data Studio - URL Handler";
|
|
|
|
comment = "Azure Data Studio";
|
|
|
|
genericName = "Text Editor";
|
|
|
|
exec = "azuredatastudio --no-sandbox --open-url %U";
|
|
|
|
icon = "azuredatastudio";
|
2022-03-05 16:20:37 +00:00
|
|
|
startupNotify = true;
|
|
|
|
startupWMClass = "azuredatastudio";
|
|
|
|
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
|
|
|
|
mimeTypes = [ "x-scheme-handler/azuredatastudio" ];
|
|
|
|
keywords = [ "azuredatastudio" ];
|
|
|
|
noDisplay = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
in
|
2020-05-29 06:06:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
pname = "azuredatastudio";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.48.1";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
desktopItems = [ desktopItem urlHandlerDesktopItem ];
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
name = "${pname}-${version}.tar.gz";
|
|
|
|
url = "https://azuredatastudio-update.azurewebsites.net/${version}/linux-x64/stable";
|
2024-07-27 06:49:29 +00:00
|
|
|
sha256 = "sha256-JDNdMy0Wk6v2pMKS+NzSbsrffaEG2IneZO+K9pBFX48=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2021-12-06 16:07:01 +00:00
|
|
|
copyDesktopItems
|
2020-05-29 06:06:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libuuid
|
|
|
|
at-spi2-core
|
|
|
|
at-spi2-atk
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
cp ${targetPath}/resources/app/resources/linux/code.png $out/share/pixmaps/azuredatastudio.png
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
# 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}
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
sqltoolsserviceRpath = lib.makeLibraryPath [
|
2020-05-29 06:06:01 +00:00
|
|
|
stdenv.cc.cc
|
|
|
|
libunwind
|
|
|
|
libuuid
|
|
|
|
icu
|
|
|
|
openssl
|
|
|
|
zlib
|
|
|
|
curl
|
|
|
|
];
|
|
|
|
|
|
|
|
# this will most likely need to be updated when azuredatastudio's version changes
|
2024-07-27 06:49:29 +00:00
|
|
|
sqltoolsservicePath = "${targetPath}/resources/app/extensions/mssql/sqltoolsservice/Linux/4.11.1.1";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
rpath = lib.concatStringsSep ":" [
|
2023-10-09 19:29:22 +00:00
|
|
|
(lib.makeLibraryPath [
|
|
|
|
alsa-lib
|
|
|
|
at-spi2-atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
mesa
|
|
|
|
nss
|
|
|
|
nspr
|
|
|
|
libdrm
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libxshmfence
|
|
|
|
libxkbcommon
|
|
|
|
xorg.libxkbfile
|
|
|
|
pango
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
systemd
|
|
|
|
])
|
2020-05-29 06:06:01 +00:00
|
|
|
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 = {
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with lib.maintainers; [ xavierzwirtz ];
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Data management tool that enables working with SQL Server, Azure SQL DB and SQL DW";
|
2020-05-29 06:06:01 +00:00
|
|
|
homepage = "https://docs.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2020-05-29 06:06:01 +00:00
|
|
|
license = lib.licenses.unfreeRedistributable;
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "azuredatastudio";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
}
|