Commit Graph

32 Commits

Author SHA1 Message Date
Thomas Watson
cdc306ebe6 quartus-prime-lite: fix loading of libudev.so.0
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.
2023-11-19 23:29:08 +01:00
Bjørn Forsman
9008bc4eb6 quartus-prime-lite: expose all modelsim programs
Just because nixpkgs can split upstream packages and hide certain
programs doesn't mean we should. Upstream documents that users should
add the ModelSim bin/ path to $PATH:
https://www.intel.com/content/www/us/en/docs/programmable/683200/1-2-1-and-2-0-1/setting-up-the-environment.html

This answers the comment "Should we install all executables?" -- yes.
2023-11-15 22:30:42 +01:00
Bjørn Forsman
99476c1ec3 quartus-prime-lite: use runtimeShell in wrappers
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.)
2023-10-13 17:21:42 +02:00
Bjørn Forsman
215bb70952 quartus-prime-lite: test building encrypted device model
Prevent regressions.
2023-10-13 17:21:42 +02:00
Bjørn Forsman
4de69110fa quartus-prime-lite: modelsim: fix compiling encrypted device models
LD_PRELOADing libudev breaks compiling encrypted device models in
ModelSim, so only use LD_PRELOAD for non-ModelSim wrappers.

Before:

  $ "$(NIXPKGS_ALLOW_UNFREE=1 nix-build -A quartus-prime-lite)/bin/vlog" "$(NIXPKGS_ALLOW_UNFREE=1 nix-build -A quartus-prime-lite.unwrapped)/modelsim_ase/altera/verilog/src/arriav_atoms_ncrypt.v"
  [...]
  ** Error: /nix/store/szcr2q24izqvhz7ybalar43y5xdg172a-quartus-prime-lite-unwrapped-20.1.1.720/modelsim_ase/altera/verilog/src/arriav_atoms_ncrypt.v(38): (vlog-2163) Macro `<protected> is undefined.
  ** Error: /nix/store/szcr2q24izqvhz7ybalar43y5xdg172a-quartus-prime-lite-unwrapped-20.1.1.720/modelsim_ase/altera/verilog/src/arriav_atoms_ncrypt.v(38): (vlog-2163) Macro `<protected> is undefined.
  ** Error: (vlog-13069) /nix/store/szcr2q24izqvhz7ybalar43y5xdg172a-quartus-prime-lite-unwrapped-20.1.1.720/modelsim_ase/altera/verilog/src/arriav_atoms_ncrypt.v(38): syntax error in protected region.
  [...]
  Errors: 4, Warnings: 0

After:

  $ "$(NIXPKGS_ALLOW_UNFREE=1 nix-build -A quartus-prime-lite)/bin/vlog" "$(NIXPKGS_ALLOW_UNFREE=1 nix-build -A quartus-prime-lite.unwrapped)/modelsim_ase/altera/verilog/src/arriav_atoms_ncrypt.v"
  [...]
  Errors: 0, Warnings: 0
2023-10-13 17:21:42 +02:00
Bjørn Forsman
7fe9476618 quartus-prime-lite: move passthru towards end
Coding style.
2023-10-13 17:21:42 +02:00
Bjørn Forsman
04413f50b9 quartus-prime-lite: buildFHSEnvChroot -> buildFHSEnv
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")
2023-10-13 17:21:42 +02:00
Bjørn Forsman
169dc22b96 quartus-prime-lite: don't overwrite LD_PRELOAD
Instead, merge the user provided LD_PRELOAD environment variable with
the hardcoded libudev.so.1 entry. User provided libs are loaded first.
2023-10-13 17:21:42 +02:00
Bjørn Forsman
b201c54346 quartus-prime-lite: eliminate two unneeded execve syscalls
* Set LD_PRELOAD in the profile snippet to eliminate one execve() for `env`.
* Set runScript to "" to eliminate one execve() for bash.
2023-10-13 17:21:42 +02:00
Bjørn Forsman
e19a5b040c quartus-prime-lite: expose all of quartus/bin/*
* 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.
2023-10-13 17:21:42 +02:00
Bjørn Forsman
f7c180ee1e quartus-prime-lite: add vcom, vdel, vmap
These are useful for Modelsim scripting.
2023-10-13 17:21:42 +02:00
Bjørn Forsman
5428524354 quartus-prime-lite: add lmutil
It's tool to check the validity of licenses, and vsim suggests running
it when it has issues validating a license. (At least in Quartus
22.1.2.)
2023-10-13 17:21:42 +02:00
Bjørn Forsman
9069ffe15f quartus-prime-lite: add /lib/ld-lsb*.so.3 dynamic loaders to FHS env
(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
2023-10-13 17:21:42 +02:00
Bjørn Forsman
61893a949e quartus-prime-lite: list progs to wrap in sh instead of Nix
This opens up for using sh globbing (and possibly wrapping *all*
programs), something which is not possible when the program list is
coded in Nix.
2023-10-13 17:21:42 +02:00
Bjørn Forsman
b74de9ec5f quartus-prime-lite: lower case local shell variables
Upper case shell variables are generally for internal variables (SHELL,
BASH_VERSION) or environment variables (PAGER, EDITOR). Other variables
should be lower case.
2023-10-13 17:21:42 +02:00
Bjørn Forsman
83f590a588 quartus-prime-lite: run mkdir as needed
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.
2023-10-13 17:21:42 +02:00
Atemu
cae417d315 quartus-prime: use buildFHSEnvChroot
Does not work with bubblewrap for some reason
2023-04-16 10:15:15 +02:00
Atemu
7e689a7dd8 quartus-prime: use libxcrypt-legacy
Needs libxcrypt.so.1
2023-04-16 10:15:15 +02:00
Atemu
f63a12f296 tree-wide: buildFHSUserEnv -> buildFHSEnv 2023-04-16 10:15:13 +02:00
Matheus Vieira
8065069c54 quartus-prime-lite: add missing libcrypt.so.1 2023-01-05 18:52:38 -03:00
Thomas Watson
c73d086a49 quartus-prime-lite: cleanup
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.
2022-08-31 14:55:48 -05:00
Robert Scott
466c2e342a treewide/applications: add sourceType binaryNativeCode for many packages 2022-06-23 18:38:19 +01:00
K900
cb2cfba6f7 treewide: switch all desktop file generators to new API
Notably:
- remove explicit arguments that match the defaults
- convert everything to the right Nix types
2022-02-25 13:40:38 -08:00
João Capucho
87d9bb9544
quartus-prime: add missing libudev0 dependency 2022-02-10 00:10:29 +00:00
Kai Wohlfahrt
778c776ab6
quartus: formatting fixes from review
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-05-30 11:07:31 +01:00
Kai Wohlfahrt
b1c5fd83bb quartus: 20.1 -> 20.1.1 2021-05-29 23:15:05 +01:00
Kai Wohlfahrt
788c34d9b0 quartus: split out unwrapped package
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
      '';
    });
  };
2021-05-29 22:16:50 +01:00
Jonathan Ringer
a2cca0669e quartus-prime-lite: remove hydraPlatforms 2021-01-19 01:16:25 -08:00
Kai Wohlfahrt
35b8671313 quartus-prime-lite: 19.1 -> 20.1 2020-07-02 08:37:35 +02:00
Kai Wohlfahrt
088b7d4a7a quartus: Export sub-commands
buildFHSUserEnv does not currently support multiple binaries, so doing
this manually with wrappers.

Pass through original quartus derivation for debugging/overriding
2020-03-24 17:34:21 +00:00
Kai Wohlfahrt
f30f3bd2af quartus: support more devices 2020-03-23 16:38:14 +00:00
Kai Wohlfahrt
38e6c845dc quartus: init at 19.1.0.670
This requires a FHSUserEnv because the licensing executable checksums
itself (I think).

The override of libpng is a bit ugly, can this be cleaned up?
2020-01-15 21:15:39 +00:00