Loading without a path was broken by nixpkgs commit
e2d06c5695. Fortunately we don't want
libudev.so.0 in modelsim now anyway which was the reason for loading by
name only, so we move it back to being 64-bit only and load it by
absolute path.
stdenv.shell is a shell for building, runtimeShell is for running, so
the latter should be used in wrappers. (The distinction only matters
when cross-compiling.)
The former is deprecated. The latter is implemented with
buildFHSEnvBubblewrap. The reason this package was switched to
buildFHSEnvChroot in the first place[1] is fixed by passing `multiArch =
true` (which brings e.g. 32-bit dynamic loader /lib/ld-linux.so.2).
[1] Commit cae417d315 ("quartus-prime: use buildFHSEnvChroot")
* Upstream recommends it (adding $QUARTUS_ROOTDIR/bin to $PATH).
* It's cool that nixpkgs *can* do these tricks (only expose a subset of
programs), but in this case I don't think it's a good idea. For
example, before this change I was missing the `jtagconfig` program.
* This increases the number of programs in .../bin from 29 to 80.
(In preparation for adding lmutil.)
Quartus is a mix of 32- and 64-bit programs, and these "lsb" loaders are
required by some of the unwrapped binaries:
$ find /nix/store/HASH-quartus-prime-lite-unwrapped-20.1.1.720 -type f -executable | xargs -n1 patchelf --print-interpreter |& grep "ld-lsb" | sort -u
/lib64/ld-lsb-x86-64.so.3
/lib/ld-lsb.so.3
Upper case shell variables are generally for internal variables (SHELL,
BASH_VERSION) or environment variables (PAGER, EDITOR). Other variables
should be lower case.
Instead of maintaining both a list of executables to wrap and their
directory names, extract the directory names from the executables and
run mkdir as needed. Keep DRY.
Fixes a few issues, listed below.
Intel's website redesign broke the requireFile link, but fortunately
files can now be downloaded without a user account. The derivation
is modified to remove requireFile and download directly instead.
Issues with quoting command line arguments are corrected.
An issue causing crashes when running in containers is worked around
with LD_PRELOAD.
The meta.platforms attribute is corrected to the supported processors.
This allows customizing the install process for the unwrapped process,
as proposed in #123469, without introducing top-level support for
untested modifications.
The PR could then be straightforwardly implemented as an overlay, that
does:
quartus-prime-lite = super.quartus-prime-lite.override {
unwrapped = quartus-prime-lite.unwrapped.overrideAttrs (o: {
buildCommand = o.buildCommand + ''
rm -r $out/nios2eds/bin/gnu
find $out/modelsim_ase/altera/{verilog,vhdl}/* ! -name src ! -path '*twentynm*' -delete
'';
});
};
buildFHSUserEnv does not currently support multiple binaries, so doing
this manually with wrappers.
Pass through original quartus derivation for debugging/overriding