|
29 | 29 | };
|
30 | 30 |
|
31 | 31 | outputs = { self, nixpkgs, flake-utils, cl-nix-lite, ... }: let
|
32 |
| - git-hly = { sbcl, pkgs, lib }: let |
33 |
| - pkgs' = pkgs.extend cl-nix-lite.overlays.default; |
| 32 | + git-hly = { pkgs, lib }: let |
| 33 | + inherit (pkgs) ecl; |
| 34 | + pkgs' = pkgs.appendOverlays [ |
| 35 | + cl-nix-lite.overlays.default |
| 36 | + (pfinal: pprev: { |
| 37 | + lispPackagesLite = pprev.lispPackagesLiteFor ecl; |
| 38 | + }) |
| 39 | + ]; |
34 | 40 | inherit (pkgs') lispPackagesLite;
|
35 | 41 | in with lispPackagesLite; lispDerivation {
|
36 | 42 | lispSystem = "git-hly";
|
|
45 | 51 | trivia
|
46 | 52 | lispPackagesLite."trivia.ppcre"
|
47 | 53 | ];
|
| 54 | + lispBuildPhase = '' |
| 55 | + ;; ECL is not a fan of ASDFv3's auto update magic |
| 56 | + (load "${asdf}/build/asdf.lisp") |
| 57 | + (let ((sys "git-hly")) |
| 58 | + (asdf:load-system sys) |
| 59 | + (asdf:make-build sys |
| 60 | + :type :program |
| 61 | + :move-here #P"./bin/" |
| 62 | + :epilogue-code `(progn |
| 63 | + (,(read-from-string |
| 64 | + (asdf::component-entry-point |
| 65 | + (asdf:find-system sys)))) |
| 66 | + (quit)))) |
| 67 | + ''; |
48 | 68 | # Override this to to disable the per-child command symlinking
|
49 | 69 | symlinkCommands = true;
|
50 | 70 | # I’m not sure if this is genius or awful? If I have to ask, it’s
|
51 | 71 | # probably awful.
|
52 |
| - postBuild = '' |
| 72 | + postBuild = let |
| 73 | + namePrinter = pkgs.writeText "print-names.lisp" '' |
| 74 | + (setf *compile-verbose* NIL) |
| 75 | + (setf *load-verbose* NIL) |
| 76 | + (load "${asdf}/build/asdf.lisp") |
| 77 | + (asdf:load-system "git-hly") |
| 78 | + (format T "~{~(~A~)~%~}" (git-hly/src/cmd::cmd-names)) |
| 79 | + ''; |
| 80 | + in '' |
53 | 81 | # Ideally, I should be able to access overridden args in the derivation itself
|
54 | 82 | # by passing a callback to lispDerivation, just like stdenv.mkDerivation...
|
55 | 83 | if [[ $symlinkCommands == "1" ]]; then
|
56 |
| -${sbcl}/bin/sbcl --script <<EOF | while read cmd ; do (cd bin && ln -s git-hly git-$cmd) ; done |
57 |
| -(require :asdf) |
58 |
| -(asdf:load-system "git-hly") |
59 |
| -(format T "~{~(~A~)~^~%~}~%" (git-hly/src/cmd::cmd-names)) |
60 |
| -EOF |
| 84 | + ${lib.getExe ecl} --shell ${namePrinter} | while read cmd ; do |
| 85 | + ln -s git-hly bin/git-$cmd |
| 86 | + done |
61 | 87 | fi
|
62 | 88 | '';
|
63 | 89 | installPhase = "mkdir -p $out; cp -r bin $out/";
|
|
69 | 95 | in flake-utils.lib.eachDefaultSystem (system:
|
70 | 96 | with rec {
|
71 | 97 | pkgs = nixpkgs.legacyPackages.${system};
|
72 |
| - sbclNoRefs = pkgs.sbcl.overrideAttrs { |
73 |
| - bootstrapLisp = pkgs.lib.getExe pkgs.sbcl; |
74 |
| - purgeNixReferences = true; |
75 |
| - coreCompression = false; |
76 |
| - doCheck = false; |
77 |
| - }; |
78 | 98 | };
|
79 | 99 | {
|
80 | 100 | packages = {
|
81 | 101 | default = pkgs.callPackage git-hly { };
|
82 |
| - norefs = (pkgs.extend (self: super: { |
83 |
| - sbcl = sbclNoRefs; |
84 |
| - })).callPackage git-hly {}; |
85 | 102 | };
|
86 | 103 | });
|
87 | 104 | }
|
0 commit comments