2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
|
|
|
|
, config
|
|
|
|
, acceptLicense ? config.dyalog.acceptLicense or false
|
|
|
|
|
|
|
|
, autoPatchelfHook
|
|
|
|
, dpkg
|
|
|
|
, makeWrapper
|
|
|
|
, ncurses5
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
, dotnet-sdk_8
|
2023-10-09 19:29:22 +00:00
|
|
|
, dotnetSupport ? false
|
|
|
|
|
|
|
|
, alsa-lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, gtk3
|
|
|
|
, libdrm
|
|
|
|
, libGL
|
|
|
|
, mesa
|
2023-10-09 19:29:22 +00:00
|
|
|
, nss
|
|
|
|
, htmlRendererSupport ? false
|
|
|
|
|
|
|
|
, unixODBC
|
|
|
|
, sqaplSupport ? false
|
|
|
|
|
|
|
|
, zeroFootprintRideSupport ? false
|
|
|
|
|
|
|
|
, enableDocs ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
dyalogHome = "$out/lib/dyalog";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
makeWrapperArgs = lib.optional dotnetSupport "--set DOTNET_ROOT ${dotnet-sdk_8}";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
licenseUrl = "https://www.dyalog.com/uploads/documents/Developer_Software_Licence.pdf";
|
|
|
|
|
|
|
|
licenseDisclaimer = ''
|
|
|
|
Dyalog is a licenced software. Dyalog licences do not include a licence to distribute Dyalog with your work.
|
|
|
|
For non-commercial purposes, a Basic Licence is granted when you accept the conditions and download a free copy of Dyalog.
|
|
|
|
|
|
|
|
More details about the license can be found here: ${licenseUrl}
|
|
|
|
|
|
|
|
If you agree to these terms, you can either override this package:
|
|
|
|
`dyalog.override { acceptLicense = true; }`
|
|
|
|
|
|
|
|
or you can set the following nixpkgs config option:
|
|
|
|
`config.dyalog.acceptLicense = true;`
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "dyalog";
|
2024-09-26 11:04:55 +00:00
|
|
|
version = "19.0.50027";
|
2023-10-09 19:29:22 +00:00
|
|
|
shortVersion = lib.versions.majorMinor finalAttrs.version;
|
|
|
|
|
|
|
|
src =
|
|
|
|
assert !acceptLicense -> throw licenseDisclaimer;
|
|
|
|
fetchurl {
|
|
|
|
url = "https://download.dyalog.com/download.php?file=${finalAttrs.shortVersion}/linux_64_${finalAttrs.version}_unicode.x86_64.deb";
|
2024-09-26 11:04:55 +00:00
|
|
|
hash = "sha256-3uB102Hr0dmqAZj2ezLhsAdBotY24PWJfE7g5wSmKMA=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" ] ++ lib.optional enableDocs "doc";
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
sourceRoot=$sourceRoot/opt/mdyalog/${finalAttrs.shortVersion}/64/unicode
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [ ./dyalogscript.patch ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
dpkg
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.cc.cc.lib # Used by Conga and .NET Bridge
|
|
|
|
ncurses5 # Used by the dyalog binary to correctly display in the terminal
|
2023-10-09 19:29:22 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals htmlRendererSupport [
|
|
|
|
alsa-lib
|
2024-04-21 15:54:59 +00:00
|
|
|
gtk3
|
|
|
|
libdrm
|
|
|
|
libGL
|
|
|
|
mesa
|
2023-10-09 19:29:22 +00:00
|
|
|
nss
|
|
|
|
]
|
2024-04-21 15:54:59 +00:00
|
|
|
++ lib.optional sqaplSupport unixODBC;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
# See which files are not really important: `https://github.com/Dyalog/DyalogDocker/blob/master/rmfiles.sh`
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p ${dyalogHome}
|
2024-04-21 15:54:59 +00:00
|
|
|
cp -r aplfmt aplkeys apltrans Experimental fonts Library PublicCACerts SALT StartupSession ${dyalogHome}
|
|
|
|
cp aplkeys.sh default.dse dyalog dyalogc dyalog.rt dyalog.dcfg.template dyalog.ver.dcfg.template languagebar.json mapl StartupSession.aplf ${dyalogHome}
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
mkdir ${dyalogHome}/lib
|
2024-04-21 15:54:59 +00:00
|
|
|
cp lib/{conga35_64.so,dyalog64.so,libconga35ssl64.so} ${dyalogHome}/lib
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
# Only keep the most useful workspaces
|
|
|
|
mkdir ${dyalogHome}/ws
|
|
|
|
cp ws/{conga,dfns,isolate,loaddata,salt,sharpplot,util}.dws ${dyalogHome}/ws
|
|
|
|
''
|
|
|
|
+ lib.optionalString dotnetSupport ''
|
2024-04-21 15:54:59 +00:00
|
|
|
cp libnethost.so Dyalog.Net.Bridge.* Lokad.ILPack.dll ${dyalogHome}
|
2023-10-09 19:29:22 +00:00
|
|
|
''
|
|
|
|
+ lib.optionalString htmlRendererSupport ''
|
2024-04-21 15:54:59 +00:00
|
|
|
cp -r locales ${dyalogHome}
|
|
|
|
cp libcef.so libEGL.so libGLESv2.so libvk_swiftshader.so libvulkan.so.1 ${dyalogHome}
|
|
|
|
cp chrome-sandbox icudtl.dat snapshot_blob.bin v8_context_snapshot.bin vk_swiftshader_icd.json *.pak ${dyalogHome}
|
2023-10-09 19:29:22 +00:00
|
|
|
cp lib/htmlrenderer.so ${dyalogHome}/lib
|
|
|
|
''
|
|
|
|
+ lib.optionalString sqaplSupport ''
|
2024-04-21 15:54:59 +00:00
|
|
|
cp lib/cxdya65u64u.so ${dyalogHome}/lib
|
2023-10-09 19:29:22 +00:00
|
|
|
cp ws/sqapl.dws ${dyalogHome}/ws
|
|
|
|
cp odbc.ini.sample sqapl.err sqapl.ini ${dyalogHome}
|
|
|
|
''
|
|
|
|
+ lib.optionalString zeroFootprintRideSupport ''
|
|
|
|
cp -r RIDEapp ${dyalogHome}
|
|
|
|
''
|
|
|
|
+ lib.optionalString enableDocs ''
|
|
|
|
mkdir -p $doc/share/doc/dyalog
|
|
|
|
cp -r help/* $doc/share/doc/dyalog
|
|
|
|
ln -s $doc/share/doc/dyalog ${dyalogHome}/help
|
|
|
|
''
|
|
|
|
+ ''
|
2024-04-21 15:54:59 +00:00
|
|
|
install -Dm644 dyalog.svg -t $out/share/icons/hicolor/scalable/apps
|
|
|
|
install -Dm644 dyalog.desktop -t $out/share/applications
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
for exec in "dyalog" "mapl"; do
|
|
|
|
makeWrapper ${dyalogHome}/$exec $out/bin/$exec ${toString makeWrapperArgs}
|
|
|
|
done
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
install -Dm755 scriptbin/dyalogscript $out/bin/dyalogscript
|
|
|
|
substituteInPlace $out/bin/dyalogscript \
|
|
|
|
--subst-var-by installdir ${dyalogHome} \
|
|
|
|
--subst-var-by scriptdir $out/bin
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# Register some undeclared runtime dependencies to be patched in by autoPatchelfHook
|
2024-09-19 14:19:46 +00:00
|
|
|
# Note: dyalog.rt is used internally to run child APL processes in
|
2024-04-21 15:54:59 +00:00
|
|
|
preFixup = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
for exec in "dyalog" "dyalog.rt"; do
|
|
|
|
patchelf ${dyalogHome}/$exec --add-needed libncurses.so
|
|
|
|
done
|
2024-04-21 15:54:59 +00:00
|
|
|
''
|
|
|
|
+ lib.optionalString htmlRendererSupport ''
|
|
|
|
patchelf ${dyalogHome}/libcef.so --add-needed libudev.so --add-needed libGL.so
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
changelog = "https://dyalog.com/dyalog/dyalog-versions/${lib.replaceStrings [ "." ] [ "" ] finalAttrs.shortVersion}.htm";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Dyalog APL interpreter";
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://www.dyalog.com";
|
|
|
|
license = {
|
|
|
|
fullName = "Dyalog License";
|
|
|
|
url = licenseUrl;
|
|
|
|
free = false;
|
|
|
|
};
|
|
|
|
mainProgram = "dyalog";
|
|
|
|
maintainers = with lib.maintainers; [ tomasajt markus1189 ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
|
|
};
|
|
|
|
})
|