New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avrgcc: rename to avrgcc-unwrapped; add wrappers #48278
Conversation
The wrappers supply flags so that avr-gcc and avr-g++ can find necessary headers and libraries. Fixes NixOS#48205
version = stdenv.lib.strings.getVersion avrgcc-unwrapped.name; | ||
nativeBuildInputs = [ makeWrapper ]; | ||
buildInputs = [ avrgcc-unwrapped avrlibc ]; | ||
builder = writeText "builder.sh" '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified by using buildCommand
(see #48205 (comment))
pkgs/top-level/all-packages.nix
Outdated
@@ -7872,11 +7872,13 @@ with pkgs; | |||
|
|||
avrgcclibc = throw "avrgcclibs are now separate packages, install avrbinutils, avrgcc and avrlibc"; | |||
|
|||
avrbinutils = callPackage ../development/misc/avr/binutils {}; | |||
avrbinutils = callPackage ../development/misc/avr/binutils {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever multiple defs are aligned with extra spaces before the =
in all-packages.nix
, the defs are also formatted as a paragraph without extra newlines. So either remove the spaces or also remove the newlines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code I was replacing had this alignment, so I thought it'd be neighborly and preserve it. I've taken it out now as it didn't really help the aesthetics very much to begin with.
👎 from me on this. We want everyone to use the cc-wrapper for cross compilation. It should be possible to do something like:
That way we can cross compile the entire Nixpkgs. |
@matthewbauer, what would you recommend then for simple AVR use cases as described in #48205? |
source $stdenv/setup | ||
mkdir -p $out/bin $out/lib | ||
buildCommand = '' | ||
mkdir -p $out/bin $out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extra $out
is not needed. (But a bit of extra pedantry never hurts 😉)
I started out trying to do this with We can leave this hard-to-use until someone writes a ETA: I should expand a bit. |
That looks terrific @matthewbauer ! |
Thanks @acowley for your initial draft! |
The wrappers supply flags so that avr-gcc and avr-g++ can
find necessary headers and libraries.
Fixes #48205
Motivation for this change
As currently defined, it is not obvious how to use the
avgcc
compilers.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)