emacsPackages.cask: improve patch substitution

- use --replace-fail to fail fast
- use shell variable melpaVersion to avoid a string interperation
- use shell variable ename to be consistent with other code and to
  avoid hardcoding
This commit is contained in:
Lin Jian
2025-10-01 02:49:57 +08:00
parent 6d7351801c
commit be406552d6
@@ -74,10 +74,10 @@ melpaBuild (
shut-up
];
# use melpaVersion so that it works for unstable releases too
postPatch = ''
lispdir=$out/share/emacs/site-lisp/elpa/cask-${finalAttrs.melpaVersion} \
substituteAllInPlace bin/cask
# use melpaVersion so that it works for unstable releases too
substituteInPlace bin/cask \
--replace-fail @lispdir@ $out/share/emacs/site-lisp/elpa/$ename-$melpaVersion
'';
postInstall = ''