chemoelectric

A first test of make-toolchain-environment

Aug 29th, 2025 (edited)
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. {
  2. pkgs ? import <nixpkgs> { },
  3. ...
  4. }:
  5.  
  6. with pkgs;
  7. mkShell {
  8. buildInputs = [
  9. gcc15
  10. coreutils
  11. gawk
  12. gnumake
  13. binutils
  14. ];
  15.  
  16. shellHook = ''
  17.  
  18. # TODO: This could be done with an overlay
  19. # filesystem and so not disrupt a thing.
  20.  
  21. w='-' # '+' for noisy, '-' for quiet.
  22. syms=symlinks$w
  23. libs=libraries$w
  24.  
  25. pkgs="${glibc} ${glibc.dev}"
  26.  
  27. rm -R -f POSIX
  28.  
  29. mkdir -p POSIX/include
  30. for p in $pkgs; do
  31. for dir in include; do
  32. $HOME/.local/bin/mte $syms $p/$dir POSIX/$dir
  33. done
  34. done
  35.  
  36. mkdir -p POSIX/lib
  37. for p in $pkgs; do
  38. for dir in lib; do
  39. $HOME/.local/bin/mte $libs $p/$dir POSIX/$dir
  40. done
  41. done
  42.  
  43. export PATH="${gcc15}/bin:$PATH"
  44. export CC=${gcc15}/bin/gcc
  45. export CPPFLAGS=-idirafter`pwd`/POSIX/include
  46. export LDFLAGS=-L`pwd`/POSIX/lib
  47. '';
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment