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
kicad: link through /lib and /share from kicad.base #88923
Conversation
|
||
in | ||
stdenv.mkDerivation rec { | ||
|
||
passthru.libraries = callPackages ./libraries.nix versionConfig.libVersion; | ||
# a link to this exists as python3.pkgs.[kicad|kicad-unstable] | ||
passthru.py = python.pkgs.toPythonModule base; |
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.
please keep the toPythonModule
only in python-packages.nix
.
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 makes it so kicad-small.py
works
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.
Python modules need to be inside python-packages.nix
, not outside of it.
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.
a link to the module exists there
independently defining it there would result in not only duplicating the same snippet at least 4 times
but risk breaking stuff if a pname changes (for example you couldn't do an ad-hoc (kicad.override {pname ="kicad-testing"; change=otherStuff;};).py
)
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.
removing the kicad.py
attribute would fix those concerns i suppose
but that would feel like a very scattered implementation?
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.
can you tell me if there's anything added by toPythonModule
?
kicad.base
== kicad.src
== kicad.py
== python3.pkgs.kicad
i think with the bindings exposed directly (by linking /lib
(and /share
?))
having kicad.py
doesn't make much sense
and python.pkgs.kicad
makes sense as an end-point for kicad.base
to avoid pulling in the kicad libraries if you just want the bindings
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.
resolved with the new commit? (will be squashed before undrafting)
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.
lookup the definition of toPythonModule
. It adds a passthru
that sets relevant attributes for it to be usable by python.buildEnv
/python.withPackages
.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/make-a-derivation-for-a-kicad-plugin/7317/14 |
Before making further changes I suggest introducing tests for the kicad bindings, so one can see what functions and what does not. |
Will linking through /share also fix the missing desktop icons associated with the Kicad applications, or would we also need to add |
pass through a kicad.py and link to it with python.pkgs.kicad to allow access to the bindings without pulling in the 3d models etc linking /lib and /share should allow the same while keep kicad usable it also exposes .desktop files and mime info
Would it be possible to make a subset of this PR that links |
@eduardosm did you (or anyone else with a desktop environment) manage to try this PR and confirm linking through |
I can confirm that this PR fixes #106295 |
I marked this as stale due to inactivity. → More info |
Motivation for this change
https://discourse.nixos.org/t/7317
and #40835
Things done
add a
kicad.py
attribute which istoPythonModule kicad.base
(this yields the same askicad.base
, does it add context?)python.pkgs.kicad
to point to that, addpython.pkgs.kicad-unstable
link through to
kicad.base
's/lib
link through to
kicad.base
's/share
.desktop
files,MIME
infobump
kicad-unstable
to the latest versionTested using sandboxing (nix.useSandbox on NixOS, or option
sandbox
innix.conf
on non-NixOS linux)Built on platform(s)
Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
Tested compilation of all pkgs that depend on this change using
nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
Tested execution of all binary files (usually in
./result/bin/
)Determined the impact on package closure size (by running
nix path-info -S
before and after)Ensured that relevant documentation is up to date
Fits CONTRIBUTING.md.