1 pkgs: lib: buildPackages:
6 libExt = pkgs.stdenv.hostPlatform.extensions.sharedLibrary;
7 inherit (import ./lib-override-helper.nix pkgs lib)
9 addPackageRequiresIfOlder
10 ignoreCompilationError
11 ignoreCompilationErrorIfOlder
17 cl-lib = null; # builtin
18 cl-print = null; # builtin
20 advice = null; # builtin
22 # Compilation instructions for the Ada executables:
23 # https://www.nongnu.org/ada-mode/
24 ada-mode = super.ada-mode.overrideAttrs (
25 finalAttrs: previousAttrs: {
26 # actually unpack source of ada-mode and wisi
27 # which are both needed to compile the tools
35 sourceRoot = "ada-mode-${finalAttrs.version}";
37 nativeBuildInputs = previousAttrs.nativeBuildInputs or [ ] ++ [
39 buildPackages.gprbuild
40 buildPackages.dos2unix
44 buildInputs = previousAttrs.buildInputs or [ ] ++ [ pkgs.gnatPackages.gnatcoll-xref ];
48 ./build.sh -j$NIX_BUILD_CORES
53 previousAttrs.postInstall or ""
59 meta = previousAttrs.meta // {
60 maintainers = [ lib.maintainers.sternenseemann ];
65 # native-compiler-error-empty-byte in old versions
66 ada-ref-man = ignoreCompilationErrorIfOlder super.ada-ref-man "2020.1.0.20201129.190419";
68 # elisp error in old versions
69 ampc = ignoreCompilationErrorIfOlder super.ampc "0.2.0.20240220.181558";
71 auctex = mkHome super.auctex;
73 auctex-cont-latexmk = mkHome super.auctex-cont-latexmk;
75 auctex-label-numbers = mkHome super.auctex-label-numbers;
77 # missing optional dependencies https://codeberg.org/rahguzar/consult-hoogle/issues/4
78 consult-hoogle = addPackageRequiresIfOlder super.consult-hoogle [ self.consult ] "0.2.2";
80 # missing optional dependencies https://github.com/jacksonrayhamilton/context-coloring/issues/10
81 context-coloring = addPackageRequires super.context-coloring [ self.js2-mode ];
83 cpio-mode = ignoreCompilationError super.cpio-mode; # elisp error
85 # fixed in https://git.savannah.gnu.org/cgit/emacs/elpa.git/commit/?h=externals/dbus-codegen&id=cfc46758c6252a602eea3dbc179f8094ea2a1a85
86 dbus-codegen = ignoreCompilationErrorIfOlder super.dbus-codegen "0.1.0.20201127.221326"; # elisp error
88 ebdb = super.ebdb.overrideAttrs (
89 finalAttrs: previousAttrs:
91 applyOrgRoamMissingPatch = lib.versionOlder finalAttrs.version "0.8.22.0.20240205.070828";
94 dontUnpack = !applyOrgRoamMissingPatch;
96 if applyOrgRoamMissingPatch then
97 previousAttrs.patches or [ ]
100 name = "fix-comilation-error-about-missing-org-roam.patch";
101 url = "https://github.com/girzel/ebdb/commit/058f30a996eb9074feac8f94db4eb49e85ae08f1.patch";
102 hash = "sha256-UI72N3lCgro6bG75sWnbw9truREToQHEzZ1TeQAIMjo=";
106 previousAttrs.patches or null;
108 if applyOrgRoamMissingPatch then
109 previousAttrs.preBuild or ""
113 local content_directory=$ename-$version
114 src=$PWD/$content_directory.tar
115 tar --create --verbose --file=$src $content_directory
119 previousAttrs.preBuild or null;
123 eglot = super.eglot.overrideAttrs (
124 finalAttrs: previousAttrs: {
126 previousAttrs.postInstall or ""
127 # old versions do not include an info manual
128 + lib.optionalString (lib.versionAtLeast "1.17.0.20240829.5352" finalAttrs.version) ''
129 local info_file=eglot.info
130 pushd $out/share/emacs/site-lisp/elpa/eglot-*
131 # specify output info file to override the one defined in eglot.texi
132 makeinfo --output=$info_file eglot.texi
133 install-info $info_file dir
139 jinx = super.jinx.overrideAttrs (old: {
142 nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.pkg-config ];
144 buildInputs = old.buildInputs or [ ] ++ [ pkgs.enchant2 ];
150 NIX_CFLAGS_COMPILE="$($PKG_CONFIG --cflags enchant-2) $NIX_CFLAGS_COMPILE"
151 $CC -shared -o jinx-mod${libExt} jinx-mod.c -lenchant-2
155 old.postInstall or ""
158 outd=$out/share/emacs/site-lisp/elpa/jinx-*
159 install -m444 -t $outd jinx-mod${libExt}
160 rm $outd/jinx-mod.c $outd/emacs-module.h
164 maintainers = [ lib.maintainers.DamienCassou ];
168 notes-mode = (mkHome super.notes-mode).overrideAttrs (old: {
170 buildInputs = old.buildInputs or [ ] ++ [ pkgs.perl ];
171 nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.perl ];
176 patchShebangs --build mkconfig
178 local content_directory=$ename-$version
179 src=$PWD/$content_directory.tar
180 tar --create --verbose --file=$src $content_directory
187 patchShebangs --host --update $out/share/emacs/site-lisp/elpa/$ename-$version/mkconfig
191 plz = super.plz.overrideAttrs (old: {
197 substituteInPlace plz.el \
198 --replace-fail 'plz-curl-program "curl"' 'plz-curl-program "${lib.getExe pkgs.curl}"'
204 tar -cf "$ename-$version.tar" --transform "s,^,$ename-$version/," * .[!.]*
205 src="$ename-$version.tar"
209 # https://sourceware.org/bugzilla/show_bug.cgi?id=32185
210 poke = addPackageRequires super.poke [ self.poke-mode ];
212 pq = super.pq.overrideAttrs (old: {
213 buildInputs = old.buildInputs or [ ] ++ [ pkgs.postgresql ];
216 preview-auto = mkHome super.preview-auto;
218 preview-tailor = mkHome super.preview-tailor;
220 # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73325
221 psgml = ignoreCompilationError super.psgml; # elisp error
223 # native-ice https://github.com/mattiase/relint/issues/15
224 relint = ignoreCompilationError super.relint;
226 shen-mode = ignoreCompilationErrorIfOlder super.shen-mode "0.1.0.20221221.82050"; # elisp error
228 # native compilation for tests/seq-tests.el never ends
229 # delete tests/seq-tests.el to workaround this
230 seq = super.seq.overrideAttrs (old: {
236 local content_directory=$(echo seq-*)
237 rm --verbose $content_directory/tests/seq-tests.el
238 src=$PWD/$content_directory.tar
239 tar --create --verbose --file=$src $content_directory
243 # https://github.com/alphapapa/taxy.el/issues/3
244 taxy = super.taxy.overrideAttrs (old: {
250 local content_directory=$ename-$version
251 rm --verbose --recursive $content_directory/examples
252 src=$PWD/$content_directory.tar
253 tar --create --verbose --file=$src $content_directory
257 tex-parens = mkHomeIfOlder super.tex-parens "0.4.0.20240630.70456";
259 timerfunctions = ignoreCompilationErrorIfOlder super.timerfunctions "1.4.2.0.20201129.225252";
261 # kv is required in triples-test.el
262 # Alternatively, we can delete that file. But adding a dependency is easier.
263 triples = addPackageRequires super.triples [ self.kv ];
265 wisitoken-grammar-mode = ignoreCompilationError super.wisitoken-grammar-mode; # elisp error
267 xeft = super.xeft.overrideAttrs (old: {
269 buildInputs = old.buildInputs or [ ] ++ [ pkgs.xapian ];
273 $CXX -shared -o xapian-lite${libExt} xapian-lite.cc -lxapian
276 old.postInstall or ""
279 outd=$out/share/emacs/site-lisp/elpa/xeft-*
280 install -m444 -t $outd xapian-lite${libExt}
281 rm $outd/xapian-lite.cc $outd/emacs-module.h $outd/emacs-module-prelude.h $outd/demo.gif $outd/Makefile
285 # native-ice https://github.com/mattiase/xr/issues/9
286 xr = ignoreCompilationError super.xr;