git.iko.soy/typeable/nixpkgs
on master help sign in
tor-browser-bundle: factor out extensions
commit2651602c17c199fd70a7ef1b68f00b07fdef7fa9 authorJoachim Fasting <joachifm@fastmail.fm> dateWed 27 Sep 2017, 07:10 (9 years ago) parent47f0997
2 files changed+125−134
pkgs/applications/networking/browsers/tor-browser-bundle/default.nix+3−134 pkgs/applications/networking/browsers/tor-browser-bundle/extensions.nix+122
pkgs/applications/networking/browsers/tor-browser-bundle/default.nix+3−134
@@ -15,7 +15,6 @@
1515, noto-fonts-emoji
1616
1717# Extensions, common
18−, unzip
1918, zip
2019
2120# HTTPS Everywhere
@@ -36,139 +35,9 @@ let
3635 sha256 = "0j37mqldj33fnzghxifvy6v8vdwkcz0i4z81prww64md5s8qcsa9";
3736 };
3837
39− # Each extension drv produces an output comprising an unpacked .xpi
40− # named after the extension uuid, as it would appear under
41− # `firefox/extensions'.
42− firefoxExtensions = {
43− https-everywhere = stdenv.mkDerivation rec {
44− name = "https-everywhere-${version}";
45− version = "5.2.21";
46−
47− extid = "https-everywhere-eff@eff.org";
48−
49− src = fetchgit {
50− url = "https://git.torproject.org/https-everywhere.git";
51− rev = "refs/tags/${version}";
52− sha256 = "0z9madihh4b4z4blvfmh6w1hsv8afyi0x7b243nciq9r4w55xgfa";
53− };
54−
55− nativeBuildInputs = [
56− git
57− libxml2 # xmllint
58− python27
59− python27Packages.lxml
60− rsync
61− unzip
62− zip
63− ];
64−
65− unpackPhase = ''
66− cp -dR --no-preserve=mode "$src" src
67− cd src
68− '';
69−
70− # Beware: the build expects translations/ to be non-empty (which it
71− # will be with submodules initialized).
72− buildPhase = ''
73− $shell ./makexpi.sh ${version} --no-recurse
74− '';
75−
76− installPhase = ''
77− mkdir $out
78− unzip -d "$out/$extid" "pkg/https-everywhere-$version-eff.xpi"
79− '';
80−
81− meta = {
82− homepage = https://gitweb.torproject.org/https-everywhere.git/;
83− };
84− };
85−
86− noscript = stdenv.mkDerivation rec {
87− name = "noscript-${version}";
88− version = "5.0.10";
89−
90− extid = "{73a6fe31-595d-460b-a920-fcc0f8843232}";
91−
92− src = fetchurl {
93− url = "https://secure.informaction.com/download/releases/noscript-${version}.xpi";
94− sha256 = "18k5karbaj5mhd9cyjbqgik6044bw88rjalkh6anjanxbn503j6g";
95− };
96−
97− nativeBuildInputs = [ unzip ];
98−
99− unpackPhase = ":";
100−
101− installPhase = ''
102− mkdir $out
103− unzip -d "$out/$extid" "$src"
104− '';
105− };
106−
107− torbutton = stdenv.mkDerivation rec {
108− name = "torbutton-${version}";
109− version = "1.9.8.1";
110−
111− extid = "torbutton@torproject.org";
112−
113− src = fetchgit {
114− url = "https://git.torproject.org/torbutton.git";
115− rev = "refs/tags/${version}";
116− sha256 = "1amp0c9ky0a7fsa0bcbi6n6ginw7s2g3an4rj7kvc1lxmrcsm65l";
117− };
118−
119− nativeBuildInputs = [ unzip zip ];
120−
121− unpackPhase = ''
122− cp -dR --no-preserve=mode "$src" src
123− cd src
124− '';
125−
126− buildPhase = ''
127− $shell ./makexpi.sh
128− '';
129−
130− installPhase = ''
131− mkdir $out
132− unzip -d "$out/$extid" "pkg/torbutton-$version.xpi"
133− '';
134−
135− meta = {
136− homepage = https://gitweb.torproject.org/torbutton.git/;
137− };
138− };
139−
140− tor-launcher = stdenv.mkDerivation rec {
141− name = "tor-launcher-${version}";
142− version = "0.2.12.3";
143−
144− extid = "tor-launcher@torproject.org";
145−
146− src = fetchgit {
147− url = "https://git.torproject.org/tor-launcher.git";
148− rev = "refs/tags/${version}";
149− sha256 = "0126x48pjiy2zm4l8jzhk70w24hviaz560ffp4lb9x0ar615bc9q";
150− };
151−
152− nativeBuildInputs = [ unzip zip ];
153−
154− unpackPhase = ''
155− cp -dR --no-preserve=mode "$src" src
156− cd src
157− '';
158−
159− buildPhase = ''
160− make package
161− '';
162−
163− installPhase = ''
164− mkdir $out
165− unzip -d "$out/$extid" "pkg/tor-launcher-$version.xpi"
166− '';
167−
168− meta = {
169− homepage = https://gitweb.torproject.org/tor-launcher.git/;
170− };
171− };
38+ firefoxExtensions = import ./extensions.nix {
39+ inherit stdenv fetchurl fetchgit zip
40+ git libxml2 python27 python27Packages rsync;
17241 };
17342
17443 extensionsEnv = symlinkJoin {
pkgs/applications/networking/browsers/tor-browser-bundle/extensions.nixnew file+122
@@ -0,0 +1,122 @@
1+{ stdenv
2+, fetchgit
3+, fetchurl
4+
5+# common
6+, zip
7+
8+# HTTPS Everywhere
9+, git
10+, libxml2 # xmllint
11+, python27
12+, python27Packages
13+, rsync
14+}:
15+
16+{
17+ https-everywhere = stdenv.mkDerivation rec {
18+ name = "https-everywhere-${version}";
19+ version = "5.2.21";
20+
21+ extid = "https-everywhere-eff@eff.org";
22+
23+ src = fetchgit {
24+ url = "https://git.torproject.org/https-everywhere.git";
25+ rev = "refs/tags/${version}";
26+ sha256 = "0z9madihh4b4z4blvfmh6w1hsv8afyi0x7b243nciq9r4w55xgfa";
27+ };
28+
29+ nativeBuildInputs = [
30+ git
31+ libxml2 # xmllint
32+ python27
33+ python27Packages.lxml
34+ rsync
35+ zip
36+ ];
37+
38+ unpackPhase = ''
39+ cp -dR --no-preserve=mode "$src" src && cd src
40+ '';
41+
42+ buildPhase = ''
43+ $shell ./makexpi.sh ${version} --no-recurse
44+ '';
45+
46+ installPhase = ''
47+ install -m 444 -D pkg/https-everywhere-$version-eff.xpi "$out/$extid.xpi"
48+ '';
49+ };
50+
51+ noscript = stdenv.mkDerivation rec {
52+ name = "noscript-${version}";
53+ version = "5.0.10";
54+
55+ extid = "{73a6fe31-595d-460b-a920-fcc0f8843232}";
56+
57+ src = fetchurl {
58+ url = "https://secure.informaction.com/download/releases/noscript-${version}.xpi";
59+ sha256 = "18k5karbaj5mhd9cyjbqgik6044bw88rjalkh6anjanxbn503j6g";
60+ };
61+
62+ unpackPhase = ":";
63+
64+ installPhase = ''
65+ install -m 444 -D $src "$out/$extid.xpi"
66+ '';
67+ };
68+
69+ torbutton = stdenv.mkDerivation rec {
70+ name = "torbutton-${version}";
71+ version = "1.9.8.1";
72+
73+ extid = "torbutton@torproject.org";
74+
75+ src = fetchgit {
76+ url = "https://git.torproject.org/torbutton.git";
77+ rev = "refs/tags/${version}";
78+ sha256 = "1amp0c9ky0a7fsa0bcbi6n6ginw7s2g3an4rj7kvc1lxmrcsm65l";
79+ };
80+
81+ nativeBuildInputs = [ zip ];
82+
83+ unpackPhase = ''
84+ cp -dR --no-preserve=mode "$src" src && cd src
85+ '';
86+
87+ buildPhase = ''
88+ $shell ./makexpi.sh
89+ '';
90+
91+ installPhase = ''
92+ install -m 444 -D pkg/torbutton-$version.xpi "$out/$extid.xpi"
93+ '';
94+ };
95+
96+ tor-launcher = stdenv.mkDerivation rec {
97+ name = "tor-launcher-${version}";
98+ version = "0.2.12.3";
99+
100+ extid = "tor-launcher@torproject.org";
101+
102+ src = fetchgit {
103+ url = "https://git.torproject.org/tor-launcher.git";
104+ rev = "refs/tags/${version}";
105+ sha256 = "0126x48pjiy2zm4l8jzhk70w24hviaz560ffp4lb9x0ar615bc9q";
106+ };
107+
108+ nativeBuildInputs = [ zip ];
109+
110+ unpackPhase = ''
111+ cp -dR --no-preserve=mode "$src" src && cd src
112+ '';
113+
114+ buildPhase = ''
115+ make package
116+ '';
117+
118+ installPhase = ''
119+ install -m 444 -D pkg/tor-launcher-$version.xpi "$out/$extid.xpi"
120+ '';
121+ };
122+}