From 17dc5d7faa81b7c3c735ded16a1b24892db93ffb Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Mon, 22 Nov 2021 20:24:41 -0300 Subject: [PATCH] palemoon: factor mozconfig in a new file It makes easier to understand and customize the building. --- .../networking/browsers/palemoon/default.nix | 50 +++---------------- .../networking/browsers/palemoon/mozconfig | 46 +++++++++++++++++ 2 files changed, 53 insertions(+), 43 deletions(-) create mode 100644 pkgs/applications/networking/browsers/palemoon/mozconfig diff --git a/pkgs/applications/networking/browsers/palemoon/default.nix b/pkgs/applications/networking/browsers/palemoon/default.nix index c41e40b6f838..8a257ee626ff 100644 --- a/pkgs/applications/networking/browsers/palemoon/default.nix +++ b/pkgs/applications/networking/browsers/palemoon/default.nix @@ -112,50 +112,14 @@ stdenv.mkDerivation rec { export MOZCONFIG=$PWD/mozconfig export MOZ_NOSPAM=1 - # Keep this similar to the official .mozconfig file, - # only minor changes for portability are permitted with branding. - # https://developer.palemoon.org/build/linux/ - echo > $MOZCONFIG ' - # Clear this if not a 64bit build - _BUILD_64=${lib.optionalString stdenv.hostPlatform.is64bit "1"} + export build64=${lib.optionalString stdenv.hostPlatform.is64bit "1"} + export gtkversion=${if withGTK3 then "3" else "2"} + export xlibs=${lib.makeLibraryPath [ xorg.libX11 ]} + export prefix=$out + export mozmakeflags="-j${if enableParallelBuilding then "$NIX_BUILD_CORES" else "1"}" + export autoconf=${autoconf213}/bin/autoconf - # Set GTK Version - _GTK_VERSION=${if withGTK3 then "3" else "2"} - - # Standard build options for Pale Moon - ac_add_options --enable-application=palemoon - ac_add_options --enable-optimize="-O2 -w" - ac_add_options --enable-default-toolkit=cairo-gtk$_GTK_VERSION - ac_add_options --enable-jemalloc - ac_add_options --enable-strip - ac_add_options --enable-devtools - ac_add_options --enable-av1 - - ac_add_options --disable-eme - ac_add_options --disable-webrtc - ac_add_options --disable-gamepad - ac_add_options --disable-tests - ac_add_options --disable-debug - ac_add_options --disable-necko-wifi - ac_add_options --disable-updater - - ac_add_options --with-pthreads - - # Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding. - ac_add_options --enable-official-branding - export MOZILLA_OFFICIAL=1 - - ac_add_options --x-libraries=${lib.makeLibraryPath [ xorg.libX11 ]} - - # - # NixOS-specific adjustments - # - - ac_add_options --prefix=$out - - mk_add_options MOZ_MAKE_FLAGS="-j${if enableParallelBuilding then "$NIX_BUILD_CORES" else "1"}" - mk_add_options AUTOCONF=${autoconf213}/bin/autoconf - ' + substituteAll ${./mozconfig} $MOZCONFIG runHook postConfigure ''; diff --git a/pkgs/applications/networking/browsers/palemoon/mozconfig b/pkgs/applications/networking/browsers/palemoon/mozconfig new file mode 100644 index 000000000000..0eab96e58469 --- /dev/null +++ b/pkgs/applications/networking/browsers/palemoon/mozconfig @@ -0,0 +1,46 @@ +# -*- mode: sh; coding: utf-8-unix; fill-column: 80 -*- + +# Mozconfig template file for nixpkgs + +# Keep this similar to the official .mozconfig file, only minor changes for +# portability are permitted with branding. +# https://developer.palemoon.org/build/linux/ + +_BUILD_64=@build64@ + +# Set GTK Version +_GTK_VERSION=@gtkversion@ + +# Standard build options for Pale Moon +ac_add_options --enable-application=palemoon +ac_add_options --enable-optimize="-O2 -w" +ac_add_options --enable-default-toolkit=cairo-gtk$_GTK_VERSION +ac_add_options --enable-jemalloc +ac_add_options --enable-strip +ac_add_options --enable-devtools +ac_add_options --enable-av1 + +ac_add_options --disable-eme +ac_add_options --disable-webrtc +ac_add_options --disable-gamepad +ac_add_options --disable-tests +ac_add_options --disable-debug +ac_add_options --disable-necko-wifi +ac_add_options --disable-updater + +ac_add_options --with-pthreads + +# Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding. +ac_add_options --enable-official-branding +export MOZILLA_OFFICIAL=1 + +ac_add_options --x-libraries=@xlibs@ + +# +# NixOS-specific adjustments +# + +ac_add_options --prefix=@prefix@ + +mk_add_options MOZ_MAKE_FLAGS=@mozmakeflags@ +mk_add_options AUTOCONF=@autoconf@