You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

packages.nix 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. { lib, callPackage, fetchurl, fetchFromGitHub, overrideCC, gccStdenv, gcc6 }:
  2. let
  3. common = opts: callPackage (import ./common.nix opts) {};
  4. # Needed on older branches since rustc: 1.32.0 -> 1.33.0
  5. missing-documentation-patch = fetchurl {
  6. name = "missing-documentation.patch";
  7. url = "https://aur.archlinux.org/cgit/aur.git/plain/deny_missing_docs.patch"
  8. + "?h=firefox-esr&id=03bdd01f9cf";
  9. sha256 = "1i33n3fgwc8d0v7j4qn7lbdax0an6swar12gay3q2nwrhg3ic4fb";
  10. };
  11. in
  12. rec {
  13. firefox = common rec {
  14. pname = "firefox";
  15. ffversion = "69.0.2";
  16. src = fetchurl {
  17. url = "mirror://mozilla/firefox/releases/${ffversion}/source/firefox-${ffversion}.source.tar.xz";
  18. sha512 = "2ag1syrvlkch7vl151hkq8abf86p9v6b6gmgcbh26b8wfva1p1ss1x09h4w50zmcc6jq4q5mcxgf1sd9zna552jl90k1y4rqvrrzwl6";
  19. };
  20. patches = [
  21. ./no-buildconfig-ffx65.patch
  22. ];
  23. meta = {
  24. description = "A web browser built from Firefox source tree";
  25. homepage = http://www.mozilla.com/en-US/firefox/;
  26. maintainers = with lib.maintainers; [ eelco andir ];
  27. platforms = lib.platforms.unix;
  28. badPlatforms = lib.platforms.darwin;
  29. license = lib.licenses.mpl20;
  30. };
  31. updateScript = callPackage ./update.nix {
  32. attrPath = "firefox-unwrapped";
  33. versionKey = "ffversion";
  34. };
  35. };
  36. # Do not remove. This is the last version of Firefox that supports
  37. # the old plugins. While this package is unsafe to use for browsing
  38. # the web, there are many old useful plugins targeting offline
  39. # activities (e.g. ebook readers, syncronous translation, etc) that
  40. # will probably never be ported to WebExtensions API.
  41. firefox-esr-52 = (common rec {
  42. pname = "firefox-esr";
  43. ffversion = "52.9.0esr";
  44. src = fetchurl {
  45. url = "mirror://mozilla/firefox/releases/${ffversion}/source/firefox-${ffversion}.source.tar.xz";
  46. sha512 = "bfca42668ca78a12a9fb56368f4aae5334b1f7a71966fbba4c32b9c5e6597aac79a6e340ac3966779d2d5563eb47c054ab33cc40bfb7306172138ccbd3adb2b9";
  47. };
  48. patches = [
  49. # this one is actually an omnipresent bug
  50. # https://bugzilla.mozilla.org/show_bug.cgi?id=1444519
  51. ./fix-pa-context-connect-retval.patch
  52. ];
  53. meta = firefox.meta // {
  54. description = "A web browser built from Firefox Extended Support Release source tree";
  55. knownVulnerabilities = [ "Support ended in August 2018." ];
  56. };
  57. }).override {
  58. stdenv = overrideCC gccStdenv gcc6; # gcc7 fails with "undefined reference to `__divmoddi4'"
  59. gtk3Support = false;
  60. };
  61. firefox-esr-60 = common rec {
  62. pname = "firefox-esr";
  63. ffversion = "60.9.0esr";
  64. src = fetchurl {
  65. url = "mirror://mozilla/firefox/releases/${ffversion}/source/firefox-${ffversion}.source.tar.xz";
  66. sha512 = "4baea5c9c4eff257834bbaee6d7786f69f7e6bacd24ca13c2705226f4a0d88315ab38c650b2c5e9c76b698f2debc7cea1e5a99cb4dc24e03c48a24df5143a3cf";
  67. };
  68. patches = [
  69. ./no-buildconfig-ffx65.patch
  70. # this one is actually an omnipresent bug
  71. # https://bugzilla.mozilla.org/show_bug.cgi?id=1444519
  72. ./fix-pa-context-connect-retval.patch
  73. missing-documentation-patch
  74. ];
  75. meta = firefox.meta // {
  76. description = "A web browser built from Firefox Extended Support Release source tree";
  77. };
  78. updateScript = callPackage ./update.nix {
  79. attrPath = "firefox-esr-60-unwrapped";
  80. versionSuffix = "esr";
  81. versionKey = "ffversion";
  82. };
  83. };
  84. firefox-esr-68 = common rec {
  85. pname = "firefox-esr";
  86. ffversion = "68.1.0esr";
  87. src = fetchurl {
  88. url = "mirror://mozilla/firefox/releases/${ffversion}/source/firefox-${ffversion}.source.tar.xz";
  89. sha512 = "0n8iy9xwf8wldkknq3y3nlm0cmb48baamvz4wmmbpfb2kfrxbsj3wnnd9ayk9zxhrsdq0na9gvkc374mv06nyqijrahd67wljv08fx5";
  90. };
  91. patches = [
  92. ./no-buildconfig-ffx65.patch
  93. ];
  94. meta = firefox.meta // {
  95. description = "A web browser built from Firefox Extended Support Release source tree";
  96. };
  97. updateScript = callPackage ./update.nix {
  98. attrPath = "firefox-esr-68-unwrapped";
  99. versionSuffix = "esr";
  100. versionKey = "ffversion";
  101. };
  102. };
  103. } // (let
  104. iccommon = args: common (args // {
  105. pname = "icecat";
  106. isIceCatLike = true;
  107. meta = (args.meta or {}) // {
  108. description = "The GNU version of the Firefox web browser";
  109. longDescription = ''
  110. GNUzilla is the GNU version of the Mozilla suite, and GNU
  111. IceCat is the GNU version of the Firefox web browser.
  112. Notable differences from mainline Firefox:
  113. - entirely free software, no non-free plugins, addons,
  114. artwork,
  115. - no telemetry, no "studies",
  116. - sane privacy and security defaults (for instance, unlike
  117. Firefox, IceCat does _zero_ network requests on startup by
  118. default, which means that with IceCat you won't need to
  119. unplug your Ethernet cable each time you want to create a
  120. new browser profile without announcing that action to a
  121. bunch of data-hungry corporations),
  122. - all essential privacy and security settings can be
  123. configured directly from the main screen,
  124. - optional first party isolation (like TorBrowser),
  125. - comes with HTTPS Everywhere (like TorBrowser), Tor Browser
  126. Button (like TorBrowser Bundle), LibreJS, and SpyBlock
  127. plugins out of the box.
  128. This package can be installed together with Firefox and
  129. TorBrowser, it will use distinct binary names and profile
  130. directories.
  131. '';
  132. homepage = "https://www.gnu.org/software/gnuzilla/";
  133. platforms = lib.platforms.unix;
  134. license = with lib.licenses; [ mpl20 gpl3Plus ];
  135. };
  136. });
  137. in {
  138. icecat = iccommon rec {
  139. ffversion = "60.3.0";
  140. icversion = "${ffversion}-gnu1";
  141. src = fetchurl {
  142. url = "mirror://gnu/gnuzilla/${ffversion}/icecat-${icversion}.tar.bz2";
  143. sha256 = "0icnl64nxcyf7dprpdpygxhabsvyhps8c3ixysj9bcdlj9q34ib1";
  144. };
  145. patches = [
  146. ./no-buildconfig.patch
  147. missing-documentation-patch
  148. ];
  149. };
  150. # Similarly to firefox-esr-52 above.
  151. icecat-52 = iccommon rec {
  152. ffversion = "52.6.0";
  153. icversion = "${ffversion}-gnu1";
  154. src = fetchurl {
  155. url = "mirror://gnu/gnuzilla/${ffversion}/icecat-${icversion}.tar.bz2";
  156. sha256 = "09fn54glqg1aa93hnz5zdcy07cps09dbni2b4200azh6nang630a";
  157. };
  158. patches = [
  159. # this one is actually an omnipresent bug
  160. # https://bugzilla.mozilla.org/show_bug.cgi?id=1444519
  161. ./fix-pa-context-connect-retval.patch
  162. ];
  163. meta.knownVulnerabilities = [ "Support ended in August 2018." ];
  164. };
  165. }) // (let
  166. tbcommon = args: common (args // {
  167. pname = "tor-browser";
  168. isTorBrowserLike = true;
  169. unpackPhase = ''
  170. # fetchFromGitHub produces ro sources, root dir gets a name that
  171. # is too long for shebangs. fixing
  172. cp -a $src tor-browser
  173. chmod -R +w tor-browser
  174. cd tor-browser
  175. # set times for xpi archives
  176. find . -exec touch -d'2010-01-01 00:00' {} \;
  177. '';
  178. meta = (args.meta or {}) // {
  179. description = "A web browser built from TorBrowser source tree";
  180. longDescription = ''
  181. This is a version of TorBrowser with bundle-related patches
  182. reverted.
  183. I.e. it's a variant of Firefox with less fingerprinting and
  184. some isolation features you can't get with any extensions.
  185. Or, alternatively, a variant of TorBrowser that works like any
  186. other UNIX program and doesn't expect you to run it from a
  187. bundle.
  188. It will use your default Firefox profile if you're not careful
  189. even! Be careful!
  190. It will clash with firefox binary if you install both. But it
  191. should not be a problem because you should run browsers in
  192. separate users/VMs anyway.
  193. Create new profile by starting it as
  194. $ firefox -ProfileManager
  195. and then configure it to use your tor instance.
  196. Or just use `tor-browser-bundle` package that packs this
  197. `tor-browser` back into a sanely-built bundle.
  198. '';
  199. homepage = "https://www.torproject.org/projects/torbrowser.html";
  200. platforms = lib.platforms.unix;
  201. license = with lib.licenses; [ mpl20 bsd3 ];
  202. };
  203. });
  204. in rec {
  205. tor-browser-7-5 = (tbcommon {
  206. ffversion = "52.9.0esr";
  207. tbversion = "7.5.6";
  208. # FIXME: fetchFromGitHub is not ideal, unpacked source is >900Mb
  209. src = fetchFromGitHub {
  210. owner = "SLNOS";
  211. repo = "tor-browser";
  212. # branch "tor-browser-52.9.0esr-7.5-2-slnos"
  213. rev = "95bb92d552876a1f4260edf68fda5faa3eb36ad8";
  214. sha256 = "1ykn3yg4s36g2cpzxbz7s995c33ij8kgyvghx38z4i8siaqxdddy";
  215. };
  216. }).override {
  217. gtk3Support = false;
  218. };
  219. tor-browser-8-5 = tbcommon rec {
  220. ffversion = "60.9.0esr";
  221. tbversion = "8.5.6";
  222. # FIXME: fetchFromGitHub is not ideal, unpacked source is >900Mb
  223. src = fetchFromGitHub {
  224. owner = "SLNOS";
  225. repo = "tor-browser";
  226. # branch "tor-browser-60.9.0esr-8.5-2-slnos"
  227. rev = "0489ae3158cd8c0e16c2e78b94083d8cbf0209dc";
  228. sha256 = "0y5s7d8pg8ak990dp8d801j9823igaibfhv9hsa79nib5yllifzs";
  229. };
  230. patches = [
  231. missing-documentation-patch
  232. ];
  233. };
  234. tor-browser = tor-browser-8-5;
  235. })