Merge pull request #28999 from oxij/pkg/tor-reorg-update

firefoxPackages: tor-browser: reorganize and update
This commit is contained in:
Joachim F 2017-09-05 13:53:48 +00:00 committed by GitHub
commit 6ee01c0c87
2 changed files with 51 additions and 21 deletions

View File

@ -1,5 +1,5 @@
{ pname, version, updateScript ? null
, src, patches ? [], overrides ? {}, meta
, src, patches ? [], extraConfigureFlags ? [], extraMakeFlags ? [], overrides ? {}, meta
, isTorBrowserLike ? false }:
{ lib, stdenv, pkgconfig, pango, perl, python, zip, libIDL
@ -29,7 +29,6 @@
# Set to `privacySupport` or `false`.
, webrtcSupport ? !privacySupport
, loopSupport ? !privacySupport || !isTorBrowserLike
, geolocationSupport ? !privacySupport
, googleAPISupport ? geolocationSupport
, crashreporterSupport ? false
@ -44,11 +43,10 @@
# option. However, in Firefox's case, those binaries may not be
# distributed without permission from the Mozilla Foundation, see
# http://www.mozilla.org/foundation/trademarks/.
, enableOfficialBranding ? false
, enableOfficialBranding ? isTorBrowserLike
}:
assert stdenv.cc ? libc && stdenv.cc.libc != null;
assert !isTorBrowserLike -> loopSupport; # can't be disabled on firefox :(
let
flag = tf: x: [(if tf then "--enable-${x}" else "--disable-${x}")];
@ -147,8 +145,6 @@ stdenv.mkDerivation (rec {
++ flag ffmpegSupport "ffmpeg"
++ lib.optional (!ffmpegSupport) "--disable-gstreamer"
++ flag webrtcSupport "webrtc"
++ lib.optionals isTorBrowserLike
(flag loopSupport "loop")
++ flag geolocationSupport "mozril-geoloc"
++ lib.optional googleAPISupport "--with-google-api-keyfile=ga"
++ flag crashreporterSupport "crashreporter"
@ -159,7 +155,18 @@ stdenv.mkDerivation (rec {
else [ "--disable-debug" "--enable-release"
"--enable-optimize"
"--enable-strip" ])
++ lib.optional enableOfficialBranding "--enable-official-branding";
++ lib.optional enableOfficialBranding "--enable-official-branding"
++ extraConfigureFlags;
preBuild = lib.optionalString (enableOfficialBranding && isTorBrowserLike) ''
buildFlagsArray=("MOZ_APP_DISPLAYNAME=Tor Browser")
'';
makeFlags = lib.optionals enableOfficialBranding [
"MOZILLA_OFFICIAL=1"
"BUILD_OFFICIAL=1"
]
++ extraMakeFlags;
enableParallelBuilding = true;

View File

@ -45,19 +45,9 @@ rec {
};
} {};
tor-browser = common rec {
pname = "tor-browser";
version = "6.5.2";
isTorBrowserLike = true;
# FIXME: fetchFromGitHub is not ideal, unpacked source is >900Mb
src = fetchFromGitHub {
owner = "SLNOS";
repo = "tor-browser";
rev = "tor-browser-45.8.0esr-6.5-2";
sha256 = "0vbcp1qlxjlph0dqibylsyvb8iah3lnzdxc56hllpvbn51vrp39j";
};
} // (let
commonAttrs = {
overrides = {
unpackPhase = ''
# fetchFromGitHub produces ro sources, root dir gets a name that
@ -101,9 +91,42 @@ rec {
homepage = https://www.torproject.org/projects/torbrowser.html;
platforms = lib.platforms.linux;
};
} {
};
in rec {
tor-browser-6-5 = common (rec {
pname = "tor-browser";
version = "6.5.2";
isTorBrowserLike = true;
extraConfigureFlags = [ "--disable-loop" ];
# FIXME: fetchFromGitHub is not ideal, unpacked source is >900Mb
src = fetchFromGitHub {
owner = "SLNOS";
repo = "tor-browser";
rev = "tor-browser-45.8.0esr-6.5-2";
sha256 = "0vbcp1qlxjlph0dqibylsyvb8iah3lnzdxc56hllpvbn51vrp39j";
};
} // commonAttrs) {
stdenv = overrideCC stdenv gcc5;
ffmpegSupport = false;
};
}
tor-browser-7-0 = common (rec {
pname = "tor-browser";
version = "7.0.1";
isTorBrowserLike = true;
# FIXME: fetchFromGitHub is not ideal, unpacked source is >900Mb
src = fetchFromGitHub {
owner = "SLNOS";
repo = "tor-browser";
rev = "tor-browser-52.3.0esr-7.0-1-slnos";
sha256 = "0szbf8gjbl4dnrb4igy4mq5858i1y6ki4skhdw63iqqdd8w9v4yv";
};
} // commonAttrs) {};
tor-browser = tor-browser-7-0;
})