Skip to content

mkEkaPackage: init - #171

Open
jonringer wants to merge 3 commits into
masterfrom
mkekapkgs
Open

mkEkaPackage: init#171
jonringer wants to merge 3 commits into
masterfrom
mkekapkgs

Conversation

@jonringer

Copy link
Copy Markdown
Collaborator

See how this "feels" with partial application.

Comment thread pkgs/diffutils/default.nix
# "pr" need not be on the PATH as a run-time dep, so we need to tell
# configure where it is. Covers the cross and native case alike.
lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr"
lib.optional (coreutils != null) "PR_PROGRAM=${finalAttrs.commands.coreutils}/bin/pr"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that you can use the correct splice of package, I have the finalAttrs resolve the commands and libraries attrs, which then makes them available to be referenced like in this fashion.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referencing it through the fix point, then also makes this honor when people do something like .overrideAttrs { coreutils = <something else>; }

Implement scope-based dependency declaration per EEP 0041. Dependencies
are declared as functions receiving the correct package scope, replacing
callPackage-injected arguments and spliced packages. The CC compiler is
decoupled from stdenv, making it a per-package attribute.

Convert all 20 packages in the stdenv closure: acl, attr, bash, bzip2,
coreutils, diffutils, ed, file, findutils, gawk, grep, gzip, make,
patch, patchelf, pcre2, sed, tar, xz, zlib.
Make finalAttrs.commands, finalAttrs.libraries, etc. return the resolved
attrset (with scopes applied) instead of the raw function. This enables
the EEP 0041 pattern of referencing dependencies in build phases:

  checkPhase = ''
    ${lib.getBin finalAttrs.commands.cmake}/bin/ctest
  '';

The raw function form is still available via prev in overrideAttrs, so
composition continues to work:

  pkg.overrideAttrs (prev: {
    commands = scope: prev.commands scope // { extra = scope.extra; };
  })
Add .agents/skills/mkekapackage/SKILL.md covering scope-based dependency
declaration, the cc attribute, and migration from mkDerivation. Reference
it from AGENTS.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant