wow
This commit is contained in:
commit
7467b40e30
7 changed files with 393 additions and 0 deletions
215
pkgs/waterfox-bin/default.nix
Normal file
215
pkgs/waterfox-bin/default.nix
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
/**
|
||||
* @name waterfox-bin
|
||||
* @author joyfulcat
|
||||
* @source https://github.com/joyfulcat/nixpkgs/blob/e1916bfd30fde149d32b41f8f6bdad32bd2e70ce/pkgs/by-name/wa/waterfox/package.nix
|
||||
*/
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
wrapGAppsHook3,
|
||||
alsa-lib,
|
||||
at-spi2-atk,
|
||||
at-spi2-core,
|
||||
atk,
|
||||
cairo,
|
||||
cups,
|
||||
dbus-glib,
|
||||
libnotify,
|
||||
libdrm,
|
||||
libxkbcommon,
|
||||
mesa,
|
||||
nspr,
|
||||
nss,
|
||||
pango,
|
||||
systemd,
|
||||
libpulseaudio,
|
||||
gdk-pixbuf,
|
||||
gtk3,
|
||||
makeDesktopItem,
|
||||
unzip,
|
||||
libX11,
|
||||
libXScrnSaver,
|
||||
libXcomposite,
|
||||
libXcursor,
|
||||
libXdamage,
|
||||
libXext,
|
||||
libXfixes,
|
||||
libXi,
|
||||
libXrandr,
|
||||
libXrender,
|
||||
libXtst,
|
||||
libxcb,
|
||||
writeText,
|
||||
patchelf,
|
||||
makeWrapper,
|
||||
libGL,
|
||||
ffmpeg,
|
||||
glib,
|
||||
pciutils,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "6.6.9";
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = "waterfox";
|
||||
exec = "waterfox %U";
|
||||
icon = "waterfox";
|
||||
desktopName = "Waterfox";
|
||||
genericName = "Web Browser";
|
||||
categories = [
|
||||
"Network"
|
||||
"WebBrowser"
|
||||
];
|
||||
mimeTypes = [
|
||||
"text/html"
|
||||
"text/xml"
|
||||
"application/xhtml+xml"
|
||||
"application/vnd.mozilla.xul+xml"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
"x-scheme-handler/ftp"
|
||||
];
|
||||
};
|
||||
|
||||
prefsFile = writeText "waterfox-prefs.js" ''
|
||||
// Disable automatic updates and notifications
|
||||
pref("app.update.auto", false);
|
||||
pref("app.update.enabled", false);
|
||||
pref("browser.crashReports.unsubmittedCheck.enabled", false);
|
||||
'';
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "waterfox";
|
||||
version = version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://cdn1.waterfox.net/waterfox/releases/${finalAttrs.version}/Linux_x86_64/waterfox-${finalAttrs.version}.tar.bz2";
|
||||
hash = "sha256-rm0scyOkBLKXPtH3tTx4yBwX/swNGGZlWeQ00zDJQAw=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
wrapGAppsHook3
|
||||
unzip
|
||||
patchelf
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
alsa-lib
|
||||
at-spi2-atk
|
||||
at-spi2-core
|
||||
atk
|
||||
cairo
|
||||
cups
|
||||
dbus-glib
|
||||
libnotify
|
||||
libdrm
|
||||
libxkbcommon
|
||||
mesa
|
||||
nspr
|
||||
nss
|
||||
pango
|
||||
systemd
|
||||
libpulseaudio
|
||||
gdk-pixbuf
|
||||
gtk3
|
||||
libX11
|
||||
libXScrnSaver
|
||||
libXcomposite
|
||||
libXcursor
|
||||
libXdamage
|
||||
libXext
|
||||
libXfixes
|
||||
libXi
|
||||
libXrandr
|
||||
libXrender
|
||||
libXtst
|
||||
libxcb
|
||||
stdenv.cc.cc.lib
|
||||
libGL
|
||||
ffmpeg
|
||||
glib
|
||||
pciutils
|
||||
];
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,opt,share/applications}
|
||||
cp -r . $out/opt/waterfox
|
||||
|
||||
makeWrapper $out/opt/waterfox/waterfox-bin $out/bin/waterfox \
|
||||
--set GTK_IM_MODULE gtk-im-context-simple \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}"
|
||||
|
||||
cp ${desktopItem}/share/applications/* $out/share/applications/
|
||||
|
||||
mkdir -p $out/share/icons/hicolor/256x256/apps
|
||||
cp $out/opt/waterfox/browser/chrome/icons/default/default256.png \
|
||||
$out/share/icons/hicolor/256x256/apps/waterfox.png
|
||||
|
||||
mkdir -p $out/opt/waterfox/browser/defaults/preferences
|
||||
cp ${prefsFile} $out/opt/waterfox/browser/defaults/preferences/nix-prefs.js
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
find $out/opt/waterfox -type f -name "*.so" -exec sh -c '
|
||||
if patchelf --print-interpreter "{}" >/dev/null 2>&1; then
|
||||
patchelf \
|
||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "${lib.makeLibraryPath finalAttrs.buildInputs}:$out/opt/waterfox" \
|
||||
"{}"
|
||||
fi
|
||||
' \;
|
||||
|
||||
patchelf \
|
||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "${lib.makeLibraryPath finalAttrs.buildInputs}:$out/opt/waterfox" \
|
||||
$out/opt/waterfox/waterfox-bin
|
||||
|
||||
patchelf \
|
||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "${lib.makeLibraryPath finalAttrs.buildInputs}:$out/opt/waterfox" \
|
||||
$out/opt/waterfox/glxtest
|
||||
|
||||
patchelf \
|
||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "${lib.makeLibraryPath finalAttrs.buildInputs}:$out/opt/waterfox" \
|
||||
$out/opt/waterfox/vaapitest
|
||||
|
||||
cp -L ${nspr}/lib/libnspr4.so $out/opt/waterfox/
|
||||
cp -L ${nspr}/lib/libplc4.so $out/opt/waterfox/
|
||||
cp -L ${nspr}/lib/libplds4.so $out/opt/waterfox/
|
||||
|
||||
for lib in ${nss}/lib/lib{nss3,nssutil3,smime3,ssl3}.so; do
|
||||
if [ ! -e $out/opt/waterfox/$(basename $lib) ]; then
|
||||
cp -L $lib $out/opt/waterfox/
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
gappsWrapperArgs+=(
|
||||
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:$out/share"
|
||||
)
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Privacy-focused, multi-platform web browser";
|
||||
homepage = "https://www.waterfox.net/";
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
license = lib.licenses.mpl20;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with lib.maintainers; [
|
||||
joyfulcat
|
||||
];
|
||||
};
|
||||
})
|
||||
90
pkgs/waterfox/default.nix
Normal file
90
pkgs/waterfox/default.nix
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/**
|
||||
* @name waterfox
|
||||
* @author paring
|
||||
* @source https://git.pari.ng/paring/nix-packages/src/commit/2a2a6be44cc2ffc6b51a609732e506ed9964a1bb/pkg/waterfox
|
||||
*/
|
||||
{
|
||||
apple-sdk_15,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
nixosTests,
|
||||
nix-update-script,
|
||||
sccache,
|
||||
stdenv,
|
||||
buildMozillaMach,
|
||||
}:
|
||||
let
|
||||
waterfox = buildMozillaMach rec {
|
||||
pname = "waterfox";
|
||||
version = "6.6.9";
|
||||
applicationName = "Waterfox";
|
||||
binaryName = "waterfox";
|
||||
branding = "waterfox/browser/branding";
|
||||
src = fetchFromGitHub {
|
||||
owner = "BrowserWorks";
|
||||
repo = "Waterfox";
|
||||
tag = version;
|
||||
hash = "sha256-mrbXjztb4+qUnXEB/WrXN0x6AiBjz7yPqLwTuqeQfUg=";
|
||||
fetchSubmodules = true;
|
||||
preFetch = ''
|
||||
export GIT_CONFIG_COUNT=1
|
||||
export GIT_CONFIG_KEY_0=url.https://github.com/.insteadOf
|
||||
export GIT_CONFIG_VALUE_0=git@github.com:
|
||||
''; # We can't clone with SSH here
|
||||
};
|
||||
|
||||
extraBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
apple-sdk_15 # Browser requires sdk 15+ to work on darwin
|
||||
];
|
||||
|
||||
extraConfigureFlags = [
|
||||
"--with-app-basename=${applicationName}"
|
||||
];
|
||||
|
||||
extraPatches = [
|
||||
./remove-missing-icons.patch
|
||||
]; # Some of the icons are missing and cause the build to crash. Removing them fixes the issue
|
||||
|
||||
extraPostPatch = ''
|
||||
rm .mozconfig .mozconfig-*
|
||||
|
||||
echo 'export CCACHE_CPP2=yes' >> .mozconfig
|
||||
echo 'export RUSTC_WRAPPER=sccache' >> .mozconfig
|
||||
echo 'ac_add_options --with-ccache=sccache' >> .mozconfig
|
||||
''; # buildMozillaMach will take care of the build arguments
|
||||
|
||||
meta = {
|
||||
broken = stdenv.buildPlatform.is32bit;
|
||||
# since Firefox 60, build on 32-bit platforms fails with "out of memory".
|
||||
# not in `badPlatforms` because cross-compilation on 64-bit machine might work.
|
||||
changelog = "https://github.com/BrowserWorks/waterfox/releases/tag/${version}";
|
||||
description = "A privacy-focused Firefox Fork";
|
||||
homepage = "https://www.waterfox.com";
|
||||
license = lib.licenses.mpl20;
|
||||
mainProgram = "waterfox";
|
||||
# maintainers = with lib.maintainers; [
|
||||
# aurelivia
|
||||
# ethancedwards8 # Darwin
|
||||
# hythera
|
||||
# ];
|
||||
maxSilent = 14400; # 4h, double the default of 7200s (c.f. #129212, #129115)
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
tests = { inherit (nixosTests) waterfox; };
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
in
|
||||
waterfox.overrideAttrs (prev: {
|
||||
nativeBuildInputs = (prev.nativeBuildInputs or [ ]) ++ [
|
||||
sccache
|
||||
];
|
||||
|
||||
preConfigure = (prev.preConfigure or "") + ''
|
||||
export SCCACHE_DIR=/var/cache/sccache/waterfox
|
||||
export SCCACHE_IDLE_TIMEOUT=0
|
||||
export SCCACHE_CACHE_SIZE=64G
|
||||
export SCCACHE_ERROR_LOG=/var/cache/sccache/waterfox.log
|
||||
|
||||
sccache -s
|
||||
'';
|
||||
})
|
||||
18
pkgs/waterfox/remove-missing-icons.patch
Normal file
18
pkgs/waterfox/remove-missing-icons.patch
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
|
||||
index 64d9993530c3..8f107b65c5be 100644
|
||||
--- a/browser/installer/package-manifest.in
|
||||
+++ b/browser/installer/package-manifest.in
|
||||
@@ -222,13 +222,10 @@
|
||||
@RESPATH@/chrome/toolkit.manifest
|
||||
#ifdef MOZ_GTK
|
||||
@RESPATH@/browser/chrome/icons/default/default16.png
|
||||
-@RESPATH@/browser/chrome/icons/default/default22.png
|
||||
-@RESPATH@/browser/chrome/icons/default/default24.png
|
||||
@RESPATH@/browser/chrome/icons/default/default32.png
|
||||
@RESPATH@/browser/chrome/icons/default/default48.png
|
||||
@RESPATH@/browser/chrome/icons/default/default64.png
|
||||
@RESPATH@/browser/chrome/icons/default/default128.png
|
||||
-@RESPATH@/browser/chrome/icons/default/default256.png
|
||||
#endif
|
||||
|
||||
; [DevTools Startup Files]
|
||||
Loading…
Add table
Add a link
Reference in a new issue