anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / editors / emacs / sources.nix
blob521a3d83a0976ab18c185262229fd9097b0f5339
1 { lib
2 , fetchFromBitbucket
3 , fetchFromSavannah
4 }:
6 let
7   mkArgs = { pname, version, variant, patches ? _: [ ], rev, hash }: {
8     inherit pname version variant patches;
10     src = {
11       "mainline" = (fetchFromSavannah {
12         repo = "emacs";
13         inherit rev hash;
14       });
15       "macport" = (fetchFromBitbucket {
16         owner = "mituharu";
17         repo = "emacs-mac";
18         inherit rev hash;
19       });
20     }.${variant};
22     meta = {
23       homepage = {
24         "mainline" = "https://www.gnu.org/software/emacs/";
25         "macport" = "https://bitbucket.org/mituharu/emacs-mac/";
26       }.${variant};
27       description = "Extensible, customizable GNU text editor"
28                     + lib.optionalString (variant == "macport") " - macport variant";
29       longDescription = ''
30       GNU Emacs is an extensible, customizable text editor—and more. At its core
31       is an interpreter for Emacs Lisp, a dialect of the Lisp programming
32       language with extensions to support text editing.
34       The features of GNU Emacs include: content-sensitive editing modes,
35       including syntax coloring, for a wide variety of file types including
36       plain text, source code, and HTML; complete built-in documentation,
37       including a tutorial for new users; full Unicode support for nearly all
38       human languages and their scripts; highly customizable, using Emacs Lisp
39       code or a graphical interface; a large number of extensions that add other
40       functionality, including a project planner, mail and news reader, debugger
41       interface, calendar, and more. Many of these extensions are distributed
42       with GNU Emacs; others are available separately.
43     '' + lib.optionalString (variant == "macport") ''
45       This release is built from Mitsuharu Yamamoto's patched source code
46       tailored for macOS.
47     '';
48       changelog = {
49         "mainline" = "https://www.gnu.org/savannah-checkouts/gnu/emacs/news/NEWS.${version}";
50         "macport" = "https://bitbucket.org/mituharu/emacs-mac/raw/${rev}/NEWS-mac";
51       }.${variant};
52       license = lib.licenses.gpl3Plus;
53       maintainers = {
54         "mainline" = with lib.maintainers; [
55           AndersonTorres
56           adisbladis
57           jwiegley
58           lovek323
59           matthewbauer
60         ];
61         "macport" = with lib.maintainers; [ ];
62       }.${variant};
63       platforms = {
64         "mainline" = lib.platforms.all;
65         "macport" = lib.platforms.darwin;
66       }.${variant};
67       mainProgram = "emacs";
68     };
69   };
72   emacs28 = import ./make-emacs.nix (mkArgs {
73     pname = "emacs";
74     version = "28.2";
75     variant = "mainline";
76     rev = "28.2";
77     hash = "sha256-4oSLcUDR0MOEt53QOiZSVU8kPJ67GwugmBxdX3F15Ag=";
78     patches = fetchpatch: [
79       # CVE-2022-45939
80       (fetchpatch {
81         url = "https://git.savannah.gnu.org/cgit/emacs.git/patch/?id=d48bb4874bc6cd3e69c7a15fc3c91cc141025c51";
82         hash = "sha256-TiBQkexn/eb6+IqJNDqR/Rn7S7LVdHmL/21A5tGsyJs=";
83       })
85       # https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00611.html
86       (fetchpatch {
87         url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/10_all_org-macro-eval.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6";
88         hash = "sha256-OdGt4e9JGjWJPkfJhbYsmQQc6jart4BH5aIKPIbWKFs=";
89       })
90       (fetchpatch {
91         url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/11_all_untrusted-content.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6";
92         hash = "sha256-wa2bsnCt5yFx0+RAFZGBPI+OoKkbrfkkMer/KBEc/wA=";
93       })
94       (fetchpatch {
95         url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/12_all_org-remote-unsafe.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6";
96         hash = "sha256-b6WU1o3PfDV/6BTPfPNUFny6oERJCNsDrvflxX3Yvek=";
97       })
99       # security fix from Emacs 29.4
100       (fetchpatch {
101         url = "https://git.savannah.gnu.org/cgit/emacs.git/patch/?id=c645e1d8205f0f0663ec4a2d27575b238c646c7c";
102         hash = "sha256-G+gGQx5w3KuWMotR1n/sYYL8WyAABYW3fUPeffMMs38=";
103       })
104     ];
105   });
107   emacs29 = import ./make-emacs.nix (mkArgs {
108     pname = "emacs";
109     version = "29.4";
110     variant = "mainline";
111     rev = "29.4";
112     hash = "sha256-FCP6ySkN9mAdp2T09n6foS2OciqZXc/54guRZ0B4Z2s=";
113   });
115   emacs30 = import ./make-emacs.nix (mkArgs {
116     pname = "emacs";
117     version = "30.0.92";
118     variant = "mainline";
119     rev = "30.0.92";
120     hash = "sha256-V2TXLemSCIPTpg6RDChv4va7pHfVcqSMw/EWqvlRQ1o=";
121   });
123   emacs28-macport = import ./make-emacs.nix (mkArgs {
124     pname = "emacs-mac";
125     version = "28.2";
126     variant = "macport";
127     rev = "emacs-28.2-mac-9.1";
128     hash = "sha256-Ne2jQ2nVLNiQmnkkOXVc5AkLVkTpm8pFC7VNY2gQjPE=";
129     patches = fetchpatch: [
130       # CVE-2022-45939
131       (fetchpatch {
132         url = "https://git.savannah.gnu.org/cgit/emacs.git/patch/?id=d48bb4874bc6cd3e69c7a15fc3c91cc141025c51";
133         hash = "sha256-TiBQkexn/eb6+IqJNDqR/Rn7S7LVdHmL/21A5tGsyJs=";
134       })
136       # https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00611.html
137       (fetchpatch {
138         url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/10_all_org-macro-eval.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6";
139         hash = "sha256-OdGt4e9JGjWJPkfJhbYsmQQc6jart4BH5aIKPIbWKFs=";
140       })
141       (fetchpatch {
142         url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/11_all_untrusted-content.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6";
143         hash = "sha256-wa2bsnCt5yFx0+RAFZGBPI+OoKkbrfkkMer/KBEc/wA=";
144       })
145       (fetchpatch {
146         url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/12_all_org-remote-unsafe.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6";
147         hash = "sha256-b6WU1o3PfDV/6BTPfPNUFny6oERJCNsDrvflxX3Yvek=";
148       })
149     ];
150   });
152   emacs29-macport = import ./make-emacs.nix (mkArgs {
153     pname = "emacs-mac";
154     version = "29.1";
155     variant = "macport";
156     rev = "emacs-29.1-mac-10.0";
157     hash = "sha256-TE829qJdPjeOQ+kD0SfyO8d5YpJjBge/g+nScwj+XVU=";
158   });