summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2021-11-22 20:24:41 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2021-11-22 20:24:41 -0300
commit17dc5d7faa81b7c3c735ded16a1b24892db93ffb (patch)
treec4a51c8b9832d8f86c43cb9a7acf67f9a4745b79
parent4041bc18302d1ee695abf606c33490ea2391fbe8 (diff)
downloadnixpkgs-17dc5d7faa81b7c3c735ded16a1b24892db93ffb.tar
nixpkgs-17dc5d7faa81b7c3c735ded16a1b24892db93ffb.tar.gz
nixpkgs-17dc5d7faa81b7c3c735ded16a1b24892db93ffb.tar.bz2
nixpkgs-17dc5d7faa81b7c3c735ded16a1b24892db93ffb.tar.lz
nixpkgs-17dc5d7faa81b7c3c735ded16a1b24892db93ffb.tar.xz
nixpkgs-17dc5d7faa81b7c3c735ded16a1b24892db93ffb.tar.zst
nixpkgs-17dc5d7faa81b7c3c735ded16a1b24892db93ffb.zip
palemoon: factor mozconfig in a new file
It makes easier to understand and customize the building.
-rw-r--r--pkgs/applications/networking/browsers/palemoon/default.nix52
-rw-r--r--pkgs/applications/networking/browsers/palemoon/mozconfig46
2 files changed, 54 insertions, 44 deletions
diff --git a/pkgs/applications/networking/browsers/palemoon/default.nix b/pkgs/applications/networking/browsers/palemoon/default.nix
index c41e40b6f83..8a257ee626f 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"}
-
-    # 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
-    '
+    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
+
+    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 00000000000..0eab96e5846
--- /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@