Hello Timothy, Timothy Sample <samp...@ngyro.com> skribis:
> The basic idea would be to add a field (or use a property) to the > package record. Let’s call it “graft-hook”. It would be Scheme code > that gets run after grafting takes place, giving us a chance to patch > special things like checksums. The hook would be passed the list of > files that were been modified during grafting. Then, in the Racket > package for example, I could write a graft-hook that updates the SHA-1 > hash of each of the modified source files. > > Since grafting is done at the derivation level, the hook code would have > to be propagated down from the package level. I haven’t looked at all > the details yet, because maybe this is a bad idea and I shouldn’t waste > my time! :) My first impression is that it is not too tricky. > > Are these problems too specialized to deserve a general mechanism like > this? Let me know what you think! I agree that this would be the right thing to do! (I’d really like to do it for GDB as discussed in <https://bugs.gnu.org/19973>.) Package properties would be the right way to make it extensible, but there are complications (notably we’d need to use gexps, but build systems don’t use gexps yet.) So as a first step, would like to try and implement the checksum update for Racket directly in (guix build grafts)? The implementation would need to be clearly separate from the generic grafting code (like profile hooks in (guix profiles)) such that we can easily add similar hooks and move them to a separate file later. WDYT? Thanks, Ludo’.