Merge pull request #187653 from tpwrules/fix-quartus

This commit is contained in:
Sandro 2022-09-04 00:56:37 +02:00 committed by GitHub
commit 2597a22c25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

View file

@ -25,7 +25,6 @@ in buildFHSUserEnv rec {
# qsys requirements
xorg.libXtst
xorg.libXi
libudev0-shim
];
multiPkgs = pkgs: with pkgs; let
# This seems ugly - can we override `libpng = libpng12` for all `pkgs`?
@ -44,6 +43,7 @@ in buildFHSUserEnv rec {
xorg.libX11
xorg.libXext
xorg.libXrender
libudev0-shim
];
passthru = { inherit unwrapped; };
@ -71,7 +71,7 @@ in buildFHSUserEnv rec {
EXECUTABLES="${lib.concatStringsSep " " (quartusExecutables ++ qsysExecutables ++ modelsimExecutables)}"
for executable in $EXECUTABLES; do
echo "#!${stdenv.shell}" >> $out/$executable
echo "$WRAPPER ${unwrapped}/$executable \$@" >> $out/$executable
echo "$WRAPPER ${unwrapped}/$executable \"\$@\"" >> $out/$executable
done
cd $out
@ -80,7 +80,12 @@ in buildFHSUserEnv rec {
ln --symbolic --relative --target-directory ./bin $EXECUTABLES
'';
# LD_PRELOAD fixes issues in the licensing system that cause memory corruption and crashes when
# starting most operations in many containerized environments, including WSL2, Docker, and LXC
# (a similiar fix involving LD_PRELOADing tcmalloc did not solve the issue in my situation)
# we use the name so that quartus can load the 64 bit verson and modelsim can load the 32 bit version
# https://community.intel.com/t5/Intel-FPGA-Software-Installation/Running-Quartus-Prime-Standard-on-WSL-crashes-in-libudev-so/m-p/1189032
runScript = writeScript "${name}-wrapper" ''
exec $@
exec env LD_PRELOAD=libudev.so.0 "$@"
'';
}

View file

@ -1,4 +1,4 @@
{ stdenv, lib, unstick, requireFile
{ stdenv, lib, unstick, fetchurl
, supportedDevices ? [ "Arria II" "Cyclone V" "Cyclone IV" "Cyclone 10 LP" "MAX II/V" "MAX 10 FPGA" ]
}:
@ -34,18 +34,18 @@ let
};
version = "20.1.1.720";
homepage = "https://fpgasoftware.intel.com";
require = {name, sha256}: requireFile {
download = {name, sha256}: fetchurl {
inherit name sha256;
url = "${homepage}/${lib.versions.majorMinor version}/?edition=lite&platform=linux";
# e.g. "20.1.1.720" -> "20.1std.1/720"
url = "https://downloads.intel.com/akdlm/software/acdsinst/${lib.versions.majorMinor version}std.${lib.versions.patch version}/${lib.elemAt (lib.splitVersion version) 3}/ib_installers/${name}";
};
in stdenv.mkDerivation rec {
inherit version;
pname = "quartus-prime-lite-unwrapped";
src = map require ([{
src = map download ([{
name = "QuartusLiteSetup-${version}-linux.run";
sha256 = "0mjp1rg312dipr7q95pb4nf4b8fwvxgflnd1vafi3g9cshbb1c3k";
} {
@ -87,12 +87,11 @@ in stdenv.mkDerivation rec {
'';
meta = with lib; {
inherit homepage;
homepage = "https://fpgasoftware.intel.com";
description = "FPGA design and simulation software";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = platforms.linux;
hydraPlatforms = [ ]; # requireFile srcs cannot be fetched by hydra, ignore
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ kwohlfahrt ];
};
}