push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,157 @@
{
lib,
stdenv,
autoPatchelfHook,
requireFile,
alsa-lib,
dbus,
fontconfig,
freetype,
gcc,
glib,
installShellFiles,
libssh2,
ncurses,
opencv4,
openssl,
unixODBC,
xkeyboard_config,
xorg,
zlib,
libxml2,
libuuid,
lang ? "en",
libGL,
libGLU,
wrapQtAppsHook,
}:
let
l10n = import ./l10ns.nix {
lib = lib;
inherit requireFile lang;
};
dirName = "WolframEngine";
in
stdenv.mkDerivation rec {
inherit (l10n) version name src;
nativeBuildInputs = [
autoPatchelfHook
installShellFiles
wrapQtAppsHook
];
dontWrapQtApps = true;
buildInputs = [
alsa-lib
dbus
fontconfig
freetype
gcc.cc
gcc.libc
glib
libssh2
ncurses
opencv4
openssl
(lib.getLib stdenv.cc.cc)
unixODBC
xkeyboard_config
libxml2
libuuid
zlib
libGL
libGLU
]
++ (with xorg; [
libX11
libXext
libXtst
libXi
libXmu
libXrender
libxcb
libXcursor
libXfixes
libXrandr
libICE
libSM
]);
# some bundled libs are found through LD_LIBRARY_PATH
autoPatchelfIgnoreMissingDeps = true;
ldpath =
lib.makeLibraryPath buildInputs
+ lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") (
":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs
);
unpackPhase = ''
# find offset from file
offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
dd if="$src" ibs=$offset skip=1 | tar -xf -
cd Unix
'';
installPhase = ''
cd Installer
sed -i -e 's/^PATH=/# PATH=/' -e 's/=`id -[ug]`/=0/' MathInstaller
# Installer wants to write default config in HOME
export HOME=$(mktemp -d)
# Fix the installation script
patchShebangs MathInstaller
substituteInPlace MathInstaller \
--replace-fail '`hostname`' "" \
--replace-fail "chgrp" "# chgrp" \
--replace-fail "chown" ": # chown"
# Install the desktop items
export XDG_DATA_HOME="$out/share"
./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/${dirName} -silent
# Fix library paths
cd $out/libexec/${dirName}/Executables
for path in MathKernel math mcc wolfram; do
makeWrapper $out/libexec/${dirName}/Executables/$path $out/bin/$path --set LD_LIBRARY_PATH "${zlib}/lib:${lib.getLib stdenv.cc.cc}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}"
done
for path in WolframKernel wolframscript; do
makeWrapper $out/libexec/${dirName}/SystemFiles/Kernel/Binaries/Linux-x86-64/$path $out/bin/$path --set LD_LIBRARY_PATH "${zlib}/lib:${lib.getLib stdenv.cc.cc}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}"
done
wrapQtApp "$out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer" \
--set LD_LIBRARY_PATH "${zlib}/lib:${lib.getLib stdenv.cc.cc}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}" \
--set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb"
if ! isELF "$out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer"; then
substituteInPlace $out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer \
--replace-fail "TopDirectory=" "TopDirectory=$out/libexec/${dirName} #";
fi
for path in WolframPlayer wolframplayer; do
makeWrapper $out/libexec/${dirName}/Executables/$path $out/bin/$path
done
# Install man pages
installManPage $out/libexec/${dirName}/SystemFiles/SystemDocumentation/Unix/*
'';
# This is primarily an IO bound build; there's little benefit to building remotely.
preferLocalBuild = true;
# Stripping causes the program to core dump.
dontStrip = true;
meta = with lib; {
description = "Wolfram Engine computational software system";
homepage = "https://www.wolfram.com/engine/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ fbeffa ];
platforms = [ "x86_64-linux" ];
};
}

View File

@@ -0,0 +1,88 @@
{
lib,
requireFile,
lang,
majorVersion ? null,
}:
let
allVersions =
lib.flip map
# N.B. Versions in this list should be ordered from newest to oldest.
[
{
version = "14.1.0";
lang = "en";
language = "English";
sha256 = "1kxdvm3i7nn3ws784y972h2br1n0y82kkkjvz7c5llssv6d3pgj8";
installer = "WolframEngine_14.1.0_LIN.sh";
}
{
version = "13.3.0";
lang = "en";
language = "English";
sha256 = "96106ac8ed6d0e221a68d846117615c14025320f927e5e0ed95b1965eda68e31";
installer = "WolframEngine_13.3.0_LINUX.sh";
}
{
version = "13.2.0";
lang = "en";
language = "English";
sha256 = "1xvg1n64iq52jxnk9y551m5iwkkz6cxzwyw28h8d0kq36aaiky24";
installer = "WolframEngine_13.2.0_LINUX.sh";
}
{
version = "13.1.0";
lang = "en";
language = "English";
sha256 = "1659kyp38a8xknic95pynx9fsgn96i8jn9lnk89pc8n6vydw1460";
installer = "WolframEngine_13.1.0_LINUX.sh";
}
{
version = "13.0.1";
lang = "en";
language = "English";
sha256 = "1rrxi7d51m02407k719fq829jzanh550wr810i22n3irhk8axqga";
installer = "WolframEngine_13.0.1_LINUX.sh";
}
{
version = "13.0.0";
lang = "en";
language = "English";
sha256 = "10cpwllz9plxz22iqdh6xgkxqphl9s9nq8ax16pafjll6j9kqy1q";
installer = "WolframEngine_13.0.0_LINUX.sh";
}
]
(
{
version,
lang,
language,
sha256,
installer,
}:
{
inherit version lang;
name = "wolfram-engine-${version}" + lib.optionalString (lang != "en") "-${lang}";
src = requireFile {
name = installer;
message = ''
This nix expression requires that ${installer} is
already part of the store. Download the file from
https://www.wolfram.com/engine/ and add it to the nix store
with nix-store --add-fixed sha256 <FILE>.
'';
inherit sha256;
};
}
);
minVersion =
if majorVersion == null then
lib.elemAt (builtins.splitVersion (lib.elemAt allVersions 0).version) 0
else
majorVersion;
maxVersion = toString (1 + builtins.fromJSON minVersion);
in
lib.findFirst (
l: (l.lang == lang && l.version >= minVersion && l.version < maxVersion)
) (throw "Version ${minVersion} in language ${lang} not supported") allVersions