all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help needed with newmoon
@ 2019-03-06 20:04 swedebugia
  2019-03-06 20:59 ` Leo Famulari
  2019-03-07  7:07 ` ng0
  0 siblings, 2 replies; 3+ messages in thread
From: swedebugia @ 2019-03-06 20:04 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 4356 bytes --]

Hi

My pet project for today was working on getting newmoon to build. I
failed :/

I got the definition from ng0 and have improved a few things and updated
it to the newest version.

I investigated the 3 errors below:
1. sqlite3 needs to be compiled with SQLITE_ENABLE_FTS3 (this results in
a lot of builds, patch attached)
2. our libvpx does not provide vpx_mem/vpx_mem.h even though it is in
the source of libvpx it is not installed it seems.
3. the pulseaudio-error I do not understand: <built-in>: fatal error:
when writing output to : Broken pipe ??

Here are the errors with context:

 0:19.11 checking for vpx >= 1.5.0... yes
 0:19.11 checking MOZ_LIBVPX_CFLAGS...
 0:19.11 checking MOZ_LIBVPX_LIBS...
-L/gnu/store/7s6z2ybw86k7r97cwzrix9hngs729lrk-libvpx-1.8.0/lib -lvpx -lm
 0:19.17 checking for vpx/vpx_decoder.h... yes
 0:19.38 checking for vpx_codec_dec_init_ver in -lvpx... yes
 0:19.42 checking for vpx_mem/vpx_mem.h... no
 0:19.44 checking for libpulse... yes
 0:19.45 checking MOZ_PULSEAUDIO_CFLAGS... -D_REENTRANT
 0:19.45 checking MOZ_PULSEAUDIO_LIBS...
-L/gnu/store/hd3x89yknm4k6k4gw16jy5xk7idq1sxf-pulseaudio-12.2/lib -lpulse
 0:19.47 <built-in>: fatal error: when writing output to : Broken pipe
 0:19.47 compilation terminated.
 0:19.48 /tmp/guix-build-newmoon-28.4.0.drv-0/source/old-configure: line
14935: test: : integer expression expected
 0:19.50 checking for wget... no
 0:19.52 checking for sqlite3 >= 3.26.0... yes
 0:19.52 checking SQLITE_CFLAGS...
 0:19.52 checking SQLITE_LIBS...
-L/gnu/store/kg104rhqzvmnpqxk91ayvwxzsrncr0f4-sqlite-3.26.0/lib -lsqlite3
 0:19.67 checking for SQLITE_SECURE_DELETE support in system SQLite... yes
 0:19.78 checking for SQLITE_THREADSAFE support in system SQLite... yes
 0:19.90 checking for SQLITE_ENABLE_FTS3 support in system SQLite... no
 0:19.90 configure: error: System SQLite library is not compiled with
SQLITE_ENABLE_FTS3.
 0:19.93 DEBUG: <truncated - see config.log for full output>
 0:19.94 DEBUG: configure:15039: checking for wget
 0:19.94 DEBUG: configure:15362: checking for sqlite3 >= 3.26.0
 0:19.94 DEBUG: configure:15369: checking SQLITE_CFLAGS
 0:19.94 DEBUG: configure:15374: checking SQLITE_LIBS
 0:19.94 DEBUG: configure:15405: checking for SQLITE_SECURE_DELETE
support in system SQLite
 0:19.94 DEBUG: configure:15428:
/gnu/store/n2p1zs14y89lwkg9da68y12pc10c6sw9-gcc-5.5.0/bin/gcc -std=gnu99
-o conftest  -fno-strict-aliasing -fno-math-errno -msse2 -mfpmath=sse
-pthread   -lpthread  -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id
conftest.c -ldl
-L/gnu/store/kg104rhqzvmnpqxk91ayvwxzsrncr0f4-sqlite-3.26.0/lib
-lsqlite3 1>&5
 0:19.94 DEBUG: configure:15451: checking for SQLITE_THREADSAFE support
in system SQLite
 0:19.94 DEBUG: configure:15474:
/gnu/store/n2p1zs14y89lwkg9da68y12pc10c6sw9-gcc-5.5.0/bin/gcc -std=gnu99
-o conftest  -fno-strict-aliasing -fno-math-errno -msse2 -mfpmath=sse
-pthread   -lpthread  -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id
conftest.c -ldl
-L/gnu/store/kg104rhqzvmnpqxk91ayvwxzsrncr0f4-sqlite-3.26.0/lib
-lsqlite3 1>&5
 0:19.94 DEBUG: configure:15497: checking for SQLITE_ENABLE_FTS3 support
in system SQLite
 0:19.94 DEBUG: configure:15520:
/gnu/store/n2p1zs14y89lwkg9da68y12pc10c6sw9-gcc-5.5.0/bin/gcc -std=gnu99
-o conftest  -fno-strict-aliasing -fno-math-errno -msse2 -mfpmath=sse
-pthread   -lpthread  -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id
conftest.c -ldl
-L/gnu/store/kg104rhqzvmnpqxk91ayvwxzsrncr0f4-sqlite-3.26.0/lib
-lsqlite3 1>&5
 0:19.94 DEBUG: configure: failed program was:
 0:19.94 DEBUG: #line 15511 "configure"
 0:19.94 DEBUG: #include "confdefs.h"
 0:19.94 DEBUG:
 0:19.94 DEBUG:             #include "sqlite3.h"
 0:19.94 DEBUG:
 0:19.94 DEBUG:             int main(int argc, char **argv){
 0:19.94 DEBUG:               return
!sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
 0:19.94 DEBUG:             }
 0:19.94 DEBUG: configure: error: System SQLite library is not compiled
with SQLITE_ENABLE_FTS3.
 0:19.94 ERROR: old-configure failed
 0:19.98 *** Fix above errors and then restart with\
 0:19.98
"/gnu/store/7j3941iannrngdvgbclyxid12vds5w9i-make-4.2.1/bin/make -f
client.mk build"
 0:19.98 make[1]: *** [client.mk:378: configure] Error 1
make: *** [GNUmakefile:9: build] Error 2


-- 
Cheers Swedebugia

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-WIP-gnu-Add-New-Moon.patch --]
[-- Type: text/x-patch; name="0001-WIP-gnu-Add-New-Moon.patch", Size: 21152 bytes --]

From 89c0629198b10264c07de88f2f678af5292d4fbf Mon Sep 17 00:00:00 2001
From: swedebugia <swedebugia@riseup.net>
Date: Sat, 23 Feb 2019 05:34:45 +0100
Subject: [PATCH 1/2] WIP gnu: Add New Moon.

---
 gnu/packages/web-browsers.scm | 400 +++++++++++++++++++++++++++++++++-
 1 file changed, 395 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/web-browsers.scm b/gnu/packages/web-browsers.scm
index a19a0dc7c..105fe2839 100644
--- a/gnu/packages/web-browsers.scm
+++ b/gnu/packages/web-browsers.scm
@@ -4,10 +4,12 @@
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2017, 2018 Nils Gillmann <ng0@ng0.is>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018 Timo Eisenmann <eisenmann@fn.de>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2019 Pierre Neidhardt <swedebugia@riseup.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,30 +30,52 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (gnu packages)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cups)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages fltk)
   #:use-module (gnu packages fontutils)
-  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages gnuzilla)
+  #:use-module (gnu packages gstreamer)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages icu4c)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages kerberos)
+  #:use-module (gnu packages libcanberra)
   #:use-module (gnu packages libevent)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages libidn)
+  #:use-module (gnu packages libreoffice)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages lisp)
   #:use-module (gnu packages lua)
-  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages m4)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
-  #:use-module (gnu packages python-web)
+;  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
-  #:use-module (gnu packages image)
+  #:use-module (gnu packages shells)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages webkit)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
-  #:use-module (gnu packages gcc)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
@@ -473,3 +497,369 @@ features for productive professionals.")
        ("unix-opts" ,sbcl-unix-opts)
        ("trivial-clipboard" ,sbcl-trivial-clipboard)))
     (synopsis "Infinitely extensible web-browser (with Lisp development files)")))
+
+(define-public newmoon
+  (package
+    (name "newmoon")
+    (version "28.4.0")
+    (source
+     (origin
+       ;; Only generated github tarball available.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/MoonchildProductions/UXP")
+             (commit (string-append "PM" version "_Release"))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0wnn15y7qpmz1b31rrmdlf3w4qz6f6qqrl8f1lgafx8czqgg9lwx"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(
+       ;; ("gst-plugins-base" ,gst-plugins-base)
+       ;; ("gstreamer" ,gstreamer)
+       ;; ("mozjs" ,mozjs)
+       ;; ("nss" ,nss)
+       ;; ("openssl" ,openssl)
+       ("alsa-lib" ,alsa-lib)
+       ("bzip2" ,bzip2)
+       ("cairo" ,cairo)
+       ("cups" ,cups)
+       ("dbus" ,dbus)
+       ("dbus-glib" ,dbus-glib)
+       ("ffmpeg" ,ffmpeg)
+       ("freetype" ,freetype)
+       ("glib" ,glib)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+-2" ,gtk+-2)
+       ("hunspell" ,hunspell)
+       ("inetutils" ,inetutils) ; Native-input?
+       ("libcanberra" ,libcanberra)
+       ("libevent" ,libevent)
+       ("libffi" ,libffi)
+       ("libgnome" ,libgnome)
+       ("libidl" ,libidl)
+       ("libjpeg-turbo" ,libjpeg-turbo)
+       ("libnotify" ,libnotify)
+       ("libpng-apng" ,libpng-apng)
+       ("libvpx" ,libvpx)
+       ("libwebp" ,libwebp)
+       ("libx11" ,libx11)
+       ("libxcomposite" ,libxcomposite)
+       ("libxext" ,libxext)
+       ("libxft" ,libxft)
+       ("libxi" ,libxi)
+       ("libxrender" ,libxrender)
+       ("libxscrnsaver" ,libxscrnsaver)
+       ("libxt" ,libxt)
+       ("libxt" ,libxt)
+       ("mesa" ,mesa)
+       ("mit-krb5" ,mit-krb5)
+       ("nspr" ,nspr)
+       ("pixman" ,pixman)
+       ("pulseaudio" ,pulseaudio)
+       ("python-2" ,python-2)
+       ("python-ply" ,python-ply)
+       ("sqlite" ,sqlite-3.26.0)
+       ("startup-notification" ,startup-notification)
+       ("tcsh" ,tcsh)
+       ("unzip" ,unzip)
+       ("xextproto" ,xextproto)
+       ("yasm" ,yasm)
+       ("zip" ,zip)))
+    (native-inputs
+     `(("autoconf-2.13" ,autoconf-2.13)
+       ("fontconfig" ,fontconfig)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("m4" ,m4)
+       ("which" ,which)
+       ("bash" ,bash)))
+    (arguments
+     `(#:modules ((ice-9 ftw)
+                  (ice-9 rdelim)
+                  (ice-9 match)
+                  ,@%gnu-build-system-modules)
+       ;; #:validate-runpath? #f
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           ;; According to <https://forum.palemoon.org/viewtopic.php?f=19&t=4166>
+           ;; the only way to set configure options is in the .mozconfig file
+           ;; (or the file set by variable MOZCONFIG).  If you try to use
+           ;; our configure-flags, the configuration will break in unexpected
+           ;; ways.  This includes breaking the mach build system detection
+           ;; of --host, --build, and --arch, and carrying flags recursively
+           ;; on to parts used later in the build system.
+           ;; The palemoon.org link describes an MS Windows build, but at
+           ;; least for Gentoo it is done comparable:
+           ;; <https://data.gpo.zugaina.org/palemoon/>.
+           (lambda* (#:key outputs configure-flags #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bash (which "bash"))
+                    (abs-srcdir (getcwd))
+                    (srcdir (string-append "../" (basename abs-srcdir)))
+                    (flags `(,(string-append "--prefix=" out)
+                             ,@configure-flags))
+                    (mozconfig (string-append (getcwd) "/.mozconfig")))
+               (setenv "SHELL" bash)
+               (setenv "AUTOCONF"
+                       (string-append (assoc-ref %build-inputs
+                                                 "autoconf-2.13")
+                                      "/bin/autoconf"))
+               (setenv "BUILD_OBJ_DIR" (string-append (getcwd) "/o"))
+               (setenv "CONFIG_SHELL" bash)
+               (setenv "QA_CONFIGURE_OPTIONS" ".*")
+               (setenv "MOZBUILD_STATE_PATH"
+                       (string-append (getcwd) "/mach_state"))
+               (setenv "MOZCONFIG"
+                       (string-append (getcwd) "/.mozconfig"))
+               (setenv "MOZ_NOSPAM" "1")
+               (mkdir-p (string-append (getcwd) "/builddir"))
+               (with-output-to-file mozconfig
+                 (lambda ()
+                   ;; These procedures help us create the .mozbuild-file
+                   (define (enable option)
+                     (string-append "ac_add_options --enable-" option "\n"))
+                   (define (disable option)
+                     (string-append "ac_add_options --disable-" option "\n"))
+                   (define (var env)
+                     (string-append "mk_add_options " env "\n"))
+                   (define (with option)
+                     (string-append "ac_add_options --with-" option "\n"))
+                   ;; The full list of options can be obtained by running:
+                   ;;  $ ./configure --help
+                   (display
+                    (string-append
+                     ;; Todo: dbus, safe-browsing, 
+                     (enable "application=palemoon")
+                     (enable "chrome-format=omni")
+                     (enable "content-sandbox")
+                     (enable "default-toolkit=\"cairo-gtk2\"")
+                     (enable "devtools")
+                     (enable "export-js")
+                     (enable "ffmpeg")
+                     (enable "jemalloc")
+                     (enable "pulseaudio")
+                     (enable "sandbox")
+                     (enable "skia")
+                     (enable "startup-notification")
+                     (enable "strip")
+                     (enable "system-cairo")
+                     (enable "system-ffi")
+                     (enable "system-hunspell")
+                     (enable "system-pixman")
+                     (enable "system-sqlite") ;Needs >= sqlite-3.26.0
+
+                     (disable "accessibility") ;There is no such option?
+                     (disable "alsa")
+                     ;;(disable "codesighs")
+                     (disable "debug-symbols")
+                     (disable "debug")
+                     (disable "gamepad")
+                     (disable "install-strip")
+                     (disable "necko-wifi")
+                     (disable "official-branding") ; Trademarks apply for official branding
+                     (disable "optimize")
+                     (disable "parental-controls") ;Yes? No?
+                     (disable "tests") ; TODO fix tests
+                     (disable "updater")
+                     (disable "valgrind")
+
+                     (with "pthreads")
+                     (with "system-bz2")
+                     (with "system-icu")
+                     (with "system-jpeg")
+                     (with "system-libevent")
+                     (with "system-libvpx")
+                     (with "system-nspr")
+                     (with "system-png")
+                     (with "system-zlib")
+
+                     (var "AUTOCONF=\"autoconf\"")
+                     (var (string-append "MOZ_OBJDIR=" (getenv "BUILD_OBJ_DIR"))) ;new
+                     (var "PYTHON=\"python2\"")
+                     "ac_add_options --prefix=" out "\n"
+
+                     ;;"ac_add_options --disable-installer\n" ; no such option.
+                     ;;"ac_add_options --disable-logging\n"
+                     ;;"ac_add_options --disable-websms-backend\n"
+                     ;;"ac_add_options --with-intl-api\n"
+                     ;;"ac_add_options --with-system-ply\n"
+                     ;;"ac_add_options --with-system-webp\n"
+		     ))))
+               (display "mach configure, this is expected to \"crash\"\n")
+               (zero? (system* "./mach" "configure"))
+               (display "mach, and another round.\n")
+               (zero? (system* "./mach")))
+             #t))
+         (add-after 'patch-source-shebangs 'setenvs
+           (lambda _
+             (substitute* (list "build/autoconf/config.guess"
+                                "client.mk"
+                                "js/src/configure.in"
+                                "intl/icu/source/configure")
+               (("/bin/sh") (which "sh")))
+             #t))
+         (add-before 'build 'patch-clientmk
+           (lambda _
+             (substitute* "client.mk"
+               (("/bin/sh") (which "sh")))
+             #t))
+         (replace 'build
+           (lambda _
+             (chdir "build")
+             (display "mach build, the real build now\n")
+             (system* "../mach" "build")
+             #t))
+         (add-after
+             'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
+           (lambda _
+             ;; libxul.so dynamically opens libraries, so here we explicitly
+             ;; link them into libxul.so instead.
+             ;;
+             ;; TODO: It might be preferable to patch in absolute file names in
+             ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
+             ;; work.  More investigation is needed.
+             (substitute* "toolkit/library/moz.build"
+               (("^# This needs to be last")
+                "OS_LIBS += [
+    'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
+    'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0', 'png' ]\n\n"))
+             #t))
+         (add-after 'unpack 'privacy-patch-branding
+           (lambda _
+             (substitute* "application/palemoon/branding/unofficial/pref/palemoon-branding.js"
+               (("http://www.palemoon.org/unofficial.shtml")
+                "https://gnu.org/s/guix"))
+             (substitute* "application/palemoon/branding/shared/pref/preferences.inc"
+               (("http://www.palemoon.org/firstrun.shtml")
+                "https://gnu.org"))
+             (substitute* "application/palemoon/branding/shared/locales/browserconfig.properties"
+               (("http://start.palemoon.org/")
+                "https://gnu.org/s/guix"))
+             #t))
+         (replace 'install
+           (lambda* (#:key name outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (lib (string-append out "/lib"))
+                    (palemoon (string-append
+                               out "/lib/palemoon/palemoon"))
+                    ;; Use one objectdirectory for all architectures.
+                    (objdir "o")
+                    ;; (prefsfile (string-append objdir "/dist/bin/browser"
+                    ;;                           "/defaults/profile"
+                    ;;                           "/prefs.js"))
+                    (tarfile (string-append objdir "/dist/palemoon-"
+                                            ,version ".linux-x86_64"
+                                            ".tar.bz2")))
+               ;; We skip this for now.
+               ;;                (substitute* prefsfile
+               ;;                  (("# Mozilla User Preferences")
+               ;;                   "# Mozilla User Preferences\n
+               ;; pref(\"app.update.enabled\", false);\n
+               ;; pref(\"browser.backspace_action\", 0);\n
+               ;; pref(\"browser.ctrlTab.previews\", false);\n
+               ;; pref(\"intl.locale.matchOS\", true);\n
+               ;; pref(\"general.useragent.locale\", \"chrome://global/locale/intl.properties\");\n
+               ;; pref(\"browser.display.use_system_colors\", true);"))
+               ;; Create the package, unpack it, manually install
+               ;; the files from there to not miss anything.
+               (zero? (system* "../mach" "package"))
+               (display (getcwd))
+               (chdir (string-append "../" objdir "/dist"))
+               (zero? (system* "tar" "xjpf"
+                               "palemoon-" ,version ".linux-x86_64.tar.bz2"))
+               (mkdir-p (string-append out "/lib/palemoon"))
+               (copy-recursively "palemoon"
+                                 (string-append out "/lib/palemoon"))
+               (mkdir-p bin)
+               (symlink (string-append out "/lib/palemoon/palemoon")
+                        (string-append bin "/newmoon"))
+               ;; Avoid duplicate binaries.
+               ;; https://bugzilla.mozilla.org/show_bug.cgi?id=658850 for
+               (delete-file (string-append out "/lib/palemoon/palemoon-bin")))))
+         ;; swap check and install phases and set paths to installed binaries
+         (add-before 'check 'set-path-for-check
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
+             #t))
+         (add-after 'install 'check
+           ;;(assoc-ref %standard-phases 'check))
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin/newmoon")))
+               (invoke bin "--version"))))
+         (delete 'check)
+         (delete 'bootstrap)
+         ;; (replace 'check
+         ;;   (lambda* (#:key outputs #:allow-other-keys)
+         ;;     (let* ((out (assoc-ref outputs "out"))
+         ;;            (bin (string-append out "/bin/newmoon")))
+         ;;       (invoke bin "--version"))))
+         (add-after 'install 'install-icons
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (display (getcwd))
+               (with-directory-excursion "../../browser/branding/unofficial"
+                 (for-each
+                  (lambda (file)
+                    (let* ((size (string-filter char-numeric? file))
+                           (icons (string-append out "/share/icons/hicolor/"
+                                                 size "x" size "/apps")))
+                      (mkdir-p icons)
+                      (copy-file file (string-append icons "/newmoon.png"))))
+                  '("default16.png" "default32.png" "default48.png"
+                    "mozicon128.png"))))))
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (apps (string-append out "/share/applications")))
+               (display (getcwd))
+               (with-directory-excursion "../../browser/branding/official"
+                 (substitute* "palemoon.desktop"
+                   (("Pale Moon")
+                    "New Moon")
+                   (("Exec=palemoon -new-tab https://start.palemoon.org")
+                    "Exec=newmoon -new-tab https://gnu.org/s/guix")
+                   (("Exec=palemoon -new-window")
+                    "Exec=newmoon -new-window")
+                   (("Exec=palemoon -private-window")
+                    "Exec=newmoon -private-window")
+                   (("palemoon")
+                    "newmoon"))
+                 (install-file "palemoon.desktop"
+                               (string-append apps
+                                              "/newmoon.desktop")))))))))
+
+    (home-page "https://www.palemoon.org/")
+    (synopsis "Web Browser compiled from Pale Moon sources")
+    (description
+     "New Moon is a web browser compiled from Pale Moon sourcecode.  New Moon
+is an independent browser derived from Firefox.
+
+Among its features are:
+@itemize
+@item It's fast (much codebloat has been removed since the fork from Firefox).
+@item The developers adhere to defence-in-depth, increasing the security
+step-by-step.
+@item Builds upon the Unified XUL Platform 
+@item Comes with the Goanna layout engine (forked from Gecko). 
+@item Uses the pre-Australis Firefox user interface Continues add-on support
+for XUL, XPCOM, and NPAPI plugins.
+@item Supports extensions and themes exclusive to Pale Moon, such as Adblock
+Latitude.
+@item Defaults to DuckDuckGo as the search engine.
+@item Uses the IP-API service instead of Google's for geolocation. 
+@item Fully customizable user interface.
+@item Newmoon is not a full featured (bloated) media player or recorder but
+does support the HTML5 video standard.
+@end itemize\n")
+    (properties '((upstream-name . "Pale-Moon")))
+    ;; The exception clause of the Palemoon license states that
+    ;; New Moon builds can be redistributed freely.
+    (license (list license:mpl2.0 ;and others, see toolkit/content/license.html
+                   license:gpl2+
+                   license:lgpl2.1))))
-- 
2.19.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.3: 0002-gnu-sqlite-Add-build-flag-SQLITE_ENABLE_FTS3.patch --]
[-- Type: text/x-patch; name="0002-gnu-sqlite-Add-build-flag-SQLITE_ENABLE_FTS3.patch", Size: 1080 bytes --]

From 9296960b3d24e0ae00894ba8c7547b7c3cb77ad1 Mon Sep 17 00:00:00 2001
From: swedebugia <swedebugia@riseup.net>
Date: Wed, 6 Mar 2019 20:56:27 +0100
Subject: [PATCH 2/2] gnu: sqlite: Add build flag: SQLITE_ENABLE_FTS3

* gnu/packages/sqlite.scm (sqlite)[arguments]: Add it.
---
 gnu/packages/sqlite.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index 05d7ce6b9..7bacbfe2e 100644
--- a/gnu/packages/sqlite.scm
+++ b/gnu/packages/sqlite.scm
@@ -73,7 +73,8 @@
       ;; to use the system SQLite unless these options are enabled.
       (list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
                            "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
-                           "-DSQLITE_ENABLE_DBSTAT_VTAB"))))
+                           "-DSQLITE_ENABLE_DBSTAT_VTAB "
+                           "-DSQLITE_ENABLE_FTS3")))) ; Needed for newmoon
    (home-page "https://www.sqlite.org/")
    (synopsis "The SQLite database management system")
    (description
-- 
2.19.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.4: palemoon.scm --]
[-- Type: text/x-scheme; name="palemoon.scm", Size: 37268 bytes --]

;;; ports - package definitions for infotropique OS/core
;;; Copyright (C) 2017, 2018 Nils Gillmann <gillmann@infotropique.org>
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation, either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;; Part of this module were originally based on the gnu/packages/gnuzilla.scm file
;; from GNU Guix which is covered by the GPL3 license. Consult the file for the
;; list of contributors.

(define-module (ports www palemoon palemoon)
  #:use-module ((srfi srfi-1) #:hide (zip))
  #:use-module (gnu packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages base)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gstreamer)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gnuzilla)
  #:use-module (gnu packages libcanberra)
  #:use-module (gnu packages cups)
  #:use-module (gnu packages kerberos)
  #:use-module (gnu packages m4)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages libreoffice)  ;for hunspell
  #:use-module (gnu packages image)
  #:use-module (gnu packages libffi)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages python)
  #:use-module (gnu packages shells)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages assembly)
  #:use-module (gnu packages icu4c)
  #:use-module (gnu packages video)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages bash))

(define-public newmoon
  (package
    (name "newmoon")
    (version "28.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/MoonchildProductions/"
                           "UXP/archive/" version "_Release.tar.gz"))
       ;; https://github.com/MoonchildProductions/UXP/archive/PM28.0.1_Release.tar.gz
       (file-name (string-append name "-" version ".tar.gz"))
       (sha256
        (base32
         "0xfkbxa8618zb379m3aaycmbz0lj1s5f2mlwgykp8d5qyvd35bdj"))))
    (build-system gnu-build-system)
    (inputs
     `(("alsa-lib" ,alsa-lib)
       ("mit-krb5" ,mit-krb5)
       ("bzip2" ,bzip2)
       ("cairo" ,cairo)
       ("cups" ,cups)
       ("libgnome" ,libgnome)
       ("libcanberra" ,libcanberra)
       ("dbus-glib" ,dbus-glib)
       ("dbus" ,dbus)
       ("glib" ,glib)
       ("gstreamer" ,gstreamer)
       ("gst-plugins-base" ,gst-plugins-base)
       ("gtk+-2" ,gtk+-2)
       ("gobject-introspection" ,gobject-introspection)
       ("freetype" ,freetype)
       ("hunspell" ,hunspell)
       ("libxt" ,libxt)
       ("libffi" ,libffi)
       ("libvpx" ,libvpx)
       ("libxt" ,libxt)
       ("libxcomposite" ,libxcomposite)
       ("libidl" ,libidl)
       ("libwebp" ,libwebp)
       ("libpng-apng" ,libpng-apng)
       ("libjpeg-turbo" ,libjpeg-turbo)
       ("libxscrnsaver" ,libxscrnsaver)
       ("libx11" ,libx11)
       ("libxext" ,libxext)
       ("libxft" ,libxft)
       ("libxi" ,libxi)
       ("libxrender" ,libxrender)
       ("xextproto" ,xextproto)
       ("libevent" ,libevent)
       ("libnotify" ,libnotify)
       ("mesa" ,mesa)
       ;; ("mozjs" ,mozjs)
       ("nspr" ,nspr)
       ;; ("nss" ,nss)
       ;; ("openssl" ,openssl)
       ("python-2" ,python-2)
       ("python-ply" ,python-ply)
       ("pixman" ,pixman)
       ("pulseaudio" ,pulseaudio)
       ("startup-notification" ,startup-notification)
       ("sqlite" ,sqlite)
       ("tcsh" ,tcsh)
       ("unzip" ,unzip)
       ("yasm" ,yasm)
       ("zip" ,zip)
       ("zlib" ,zlib)
       ("inetutils" ,inetutils))) ; Native-input?
    (native-inputs
     `(("autoconf-2.13" ,autoconf-2.13)
       ("fontconfig" ,fontconfig)
       ("perl" ,perl)
       ("pkg-config" ,pkg-config)
       ("m4" ,m4)
       ("which" ,which)
       ("bash" ,bash)))
    (arguments
     `(#:modules ((ice-9 ftw)
                  (ice-9 rdelim)
                  (ice-9 match)
                  ,@%gnu-build-system-modules)
       ;; #:validate-runpath? #f
       #:phases
       (modify-phases %standard-phases
         (replace 'configure
           ;; According to <https://forum.palemoon.org/viewtopic.php?f=19&t=4166>
           ;; the only way to set configure options is in the .mozconfig file
           ;; (or the file set by variable MOZCONFIG).  If you try to use
           ;; our configure-flags, the configuration will break in unexpected
           ;; ways.  This includes breaking the mach build system detection
           ;; of --host, --build, and --arch, and carrying flags recursively
           ;; on to parts used later in the build system.
           ;; The palemoon.org link describes an MS Windows build, but at
           ;; least for Gentoo it is done comparable:
           ;; <https://data.gpo.zugaina.org/palemoon/>.
           (lambda* (#:key outputs configure-flags #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bash (which "bash"))
                    (abs-srcdir (getcwd))
                    (srcdir (string-append "../" (basename abs-srcdir)))
                    (flags `(,(string-append "--prefix=" out)
                             ,@configure-flags))
                    (mozconfig (string-append (getcwd) "/.mozconfig")))
               (setenv "SHELL" bash)
               (setenv "AUTOCONF"
                       (string-append (assoc-ref %build-inputs
                                                 "autoconf-2.13")
                                      "/bin/autoconf"))
               (setenv "BUILD_OBJ_DIR" (string-append (getcwd) "/o"))
               (setenv "CONFIG_SHELL" bash)
               (setenv "QA_CONFIGURE_OPTIONS" ".*")
               (setenv "MOZBUILD_STATE_PATH"
                       (string-append (getcwd) "/mach_state"))
               (setenv "MOZCONFIG"
                       (string-append (getcwd) "/.mozconfig"))
               (setenv "MOZ_NOSPAM" "1")
               (mkdir-p (string-append (getcwd) "/builddir"))
               (with-output-to-file mozconfig
                 (lambda ()
                   (display
                    (string-append
                     "ac_add_options --enable-application=browser\n"
                     "mk_add_options MOZ_OBJDIR=" (getenv "BUILD_OBJ_DIR") "\n" ;new
                     "ac_add_options --prefix=" out "\n"
                     "ac_add_options --disable-debug\n"
                     "ac_add_options --disable-debug-symbols\n"
                     "ac_add_options --disable-accessibility\n" ;There is no such option?
                     "ac_add_options --disable-updater\n"
                     "ac_add_options --disable-installer\n"
                     "ac_add_options --disable-parental-controls\n" ;Yes? No?
                     "ac_add_options --disable-install-strip"
                     "ac_add_options --disable-tests\n"
                     "ac_add_options --with-system-ply\n"
                     "ac_add_options --with-system-libevent\n"
                     "ac_add_options --with-system-zlib\n"
                     "ac_add_options --with-system-bz2\n"
                     "ac_add_options --with-system-webp\n"
                     "ac_add_options --with-system-libvpx\n"
                     "ac_add_options --enable-system-hunspell\n"
                     "ac_add_options --enable-system-ffi\n"
                     "ac_add_options --enable-system-sqlite\n" ;Needs >= sqlite-3.21.0
                     "ac_add_options --enable-system-cairo\n"
                     "ac_add_options --enable-system-pixman\n"
                     "ac_add_options --enable-shared-js\n"
                     "ac_add_options --disable-valgrind\n"
                     "ac_add_options --with-pthreads\n"
                     "ac_add_options --disable-optimize\n"
                     "ac_add_options --enable-gstreamer\n"
                     "ac_add_options --enable-default-toolkit=\"cairo-gtk2\"\n"
                     "ac_add_options --disable-alsa\n"
                     "ac_add_options --enable-strip\n"
                     "ac_add_options --disable-codesighs\n"
                     "ac_add_options --disable-gamepad\n"
                     "ac_add_options --disable-logging\n"
                     "ac_add_options --disable-websms-backend\n"
                     "ac_add_options --enable-chrome-format=omni\n"
                     "ac_add_options --enable-startup-notification\n"
                     "ac_add_options --enable-shared-js\n"
                     "ac_add_options --enable-devtools\n"
                     ;; XXX!
                     "ac_add_options --with-system-png\n"
                     "ac_add_options --enable-pulseaudio\n"
                     "ac_add_options --disable-necko-wifi\n"
                     "ac_add_options --with-system-jpeg\n"
                     "ac_add_options --disable-official-branding\n" ; Trademarks apply for official branding
                     "mk_add_options PYTHON=\"python2\"\n"
                     "mk_add_options AUTOCONF=\"autoconf\"\n"
                     "ac_add_options --with-system-nspr\n"
                     "ac_add_options --enable-sandbox\n"
                     "ac_add_options --enable-content-sandbox\n"
                     "ac_add_options --enable-skia\n"
                     "ac_add_options --enable-jemalloc\n"
                     "ac_add_options --with-system-icu\n"
                     "ac_add_options --with-intl-api\n"))))
               (display "mach configure, this is expected to \"crash\"")
               (zero? (system* "./mach" "configure"))
               (display "mach, and another round.")
               (zero? (system* "./mach")))))
         (add-after 'patch-source-shebangs 'setenvs
           (lambda _
             (substitute* (list "build/autoconf/config.guess"
                                "client.mk"
                                "js/src/configure.in"
                                "intl/icu/source/configure")
               (("/bin/sh") (which "sh")))
             #t))
         (add-before 'build 'patch-clientmk
           (lambda _
             (substitute* "client.mk"
               (("/bin/sh") (which "sh")))
             #t))
         (replace 'build
           (lambda _
             (chdir "build")
             (display "mach build, the real build now")
             (system* "../mach" "build")
             #t))
         (add-after
             'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
           (lambda _
             ;; libxul.so dynamically opens libraries, so here we explicitly
             ;; link them into libxul.so instead.
             ;;
             ;; TODO: It might be preferable to patch in absolute file names in
             ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
             ;; work.  More investigation is needed.
             (substitute* "toolkit/library/moz.build"
               (("^# This needs to be last")
                "OS_LIBS += [
    'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
    'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0', 'png' ]\n\n"))
             #t))
         (add-after 'unpack 'privacy-patch-branding
           (lambda _
             (substitute* "browser/branding/unofficial/pref/palemoon-branding.js"
               (("http://www.palemoon.org/unofficial.shtml")
                "https://gnu.org/s/guix"))
             (substitute* "browser/branding/shared/pref/preferences.inc"
               (("http://www.palemoon.org/firstrun.shtml")
                "https://gnu.org"))
             (substitute* "browser/branding/shared/locales/browserconfig.properties"
               (("http://start.palemoon.org/")
                "https://gnu.org/s/guix"))
             #t))
         (replace 'install
           (lambda* (#:key name outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin"))
                    (lib (string-append out "/lib"))
                    (palemoon (string-append
                               out "/lib/palemoon/palemoon"))
                    ;; Use one objectdirectory for all architectures.
                    (objdir "o")
                    ;; (prefsfile (string-append objdir "/dist/bin/browser"
                    ;;                           "/defaults/profile"
                    ;;                           "/prefs.js"))
                    (tarfile (string-append objdir "/dist/palemoon-"
                                            ,version ".linux-x86_64"
                                            ".tar.bz2")))
               ;; We skip this for now.
               ;;                (substitute* prefsfile
               ;;                  (("# Mozilla User Preferences")
               ;;                   "# Mozilla User Preferences\n
               ;; pref(\"app.update.enabled\", false);\n
               ;; pref(\"browser.backspace_action\", 0);\n
               ;; pref(\"browser.ctrlTab.previews\", false);\n
               ;; pref(\"intl.locale.matchOS\", true);\n
               ;; pref(\"general.useragent.locale\", \"chrome://global/locale/intl.properties\");\n
               ;; pref(\"browser.display.use_system_colors\", true);"))
               ;; Create the package, unpack it, manually install
               ;; the files from there to not miss anything.
               (zero? (system* "../mach" "package"))
               (display (getcwd))
               (chdir (string-append "../" objdir "/dist"))
               (zero? (system* "tar" "xjpf"
                               "palemoon-" ,version ".linux-x86_64.tar.bz2"))
               (mkdir-p (string-append out "/lib/palemoon"))
               (copy-recursively "palemoon"
                                 (string-append out "/lib/palemoon"))
               (mkdir-p bin)
               (symlink (string-append out "/lib/palemoon/palemoon")
                        (string-append bin "/newmoon"))
               ;; Avoid duplicate binaries.
               ;; https://bugzilla.mozilla.org/show_bug.cgi?id=658850 for
               (delete-file (string-append out "/lib/palemoon/palemoon-bin")))))
         ;; swap check and install phases and set paths to installed binaries
         (add-before 'check 'set-path-for-check
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
             #t))
         (add-after 'install 'check
           ;;(assoc-ref %standard-phases 'check))
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin/newmoon")))
               (invoke bin "--version"))))
         (delete 'check)
         (delete 'bootstrap)
         ;; (replace 'check
         ;;   (lambda* (#:key outputs #:allow-other-keys)
         ;;     (let* ((out (assoc-ref outputs "out"))
         ;;            (bin (string-append out "/bin/newmoon")))
         ;;       (invoke bin "--version"))))
         (add-after 'install 'install-icons
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out")))
               (display (getcwd))
               (with-directory-excursion "../../browser/branding/unofficial"
                 (for-each
                  (lambda (file)
                    (let* ((size (string-filter char-numeric? file))
                           (icons (string-append out "/share/icons/hicolor/"
                                                 size "x" size "/apps")))
                      (mkdir-p icons)
                      (copy-file file (string-append icons "/newmoon.png"))))
                  '("default16.png" "default32.png" "default48.png"
                    "mozicon128.png"))))))
         (add-after 'install 'install-desktop-file
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (apps (string-append out "/share/applications")))
               (display (getcwd))
               (with-directory-excursion "../../browser/branding/official"
                 (substitute* "palemoon.desktop"
                   (("Pale Moon")
                    "New Moon")
                   (("Exec=palemoon -new-tab https://start.palemoon.org")
                    "Exec=newmoon -new-tab https://gnu.org/s/guix")
                   (("Exec=palemoon -new-window")
                    "Exec=newmoon -new-window")
                   (("Exec=palemoon -private-window")
                    "Exec=newmoon -private-window")
                   (("palemoon")
                    "newmoon"))
                 (install-file "palemoon.desktop"
                               (string-append apps
                                              "/newmoon.desktop")))))))))

    (home-page "https://www.palemoon.org/")
    (synopsis "Web Browser compiled from Pale Moon sources")
    (description
     "New Moon is a web browser compiled from Pale Moon sourcecode.  New Moon
is an independent browser derived from Firefox.  Among its features are:
Replaces the Gecko layout engine with the Goanna fork Uses the pre-Australis
Firefox user interface Continues add-on support for XUL, XPCOM, and NPAPI
plugins[9] Supports extensions and themes exclusive to Pale Moon, such as
Adblock Latitude[ Defaults to a customizable start page in cooperation with
start.me Defaults to DuckDuckGo as the search engine instead of Google or
Yahoo!  Uses the IP-API service instead of Google's for geolocation Fully
customizable user interface

NOTE: Please note that in this work-in-progress version it points to the start
page which promotes some services and needs cookies, and has some other
issues.  IMPORTANT: This version is based on the old Pale Moon codebase which
is in maintenance mode, but continues to receive security patches and
updates.")
    (properties '((upstream-name . "Pale-Moon")))
    ;; The exception clause of the Palemoon license states that
    ;; New Moon builds can be redistributed freely.
    (license (list license:mpl2.0 ;and others, see toolkit/content/license.html
                   license:gpl2+
                   license:lgpl2.1))))

(define-public newmoon
  (package
    (name "newmoon")
    (version "27.9.4")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/MoonchildProductions/"
                           "Pale-Moon/archive/" version "_Release.tar.gz"))
       (file-name (string-append name "-" version ".tar.gz"))
       (sha256
        (base32
         "0xfkbxa8618zb379m3aaycmbz0lj1s5f2mlwgykp8d5qyvd35bdj"))))
    (build-system gnu-build-system)
    (inputs
     `(("alsa-lib" ,alsa-lib)
       ("mit-krb5" ,mit-krb5)
       ("bzip2" ,bzip2)
       ("cairo" ,cairo)
       ("cups" ,cups)
       ("libgnome" ,libgnome)
       ("libcanberra" ,libcanberra)
       ("dbus-glib" ,dbus-glib)
       ("dbus" ,dbus)
       ("glib" ,glib)
       ("gstreamer" ,gstreamer)
       ("gst-plugins-base" ,gst-plugins-base)
       ("gtk+-2" ,gtk+-2)
       ("gobject-introspection" ,gobject-introspection)
       ("freetype" ,freetype)
       ("hunspell" ,hunspell)
       ("libxt" ,libxt)
       ("libffi" ,libffi)
       ("libvpx" ,libvpx)
       ("libxt" ,libxt)
       ("libxcomposite" ,libxcomposite)
       ("libidl" ,libidl)
       ("libwebp" ,libwebp)
       ("libpng-apng" ,libpng-apng)
       ("libjpeg-turbo" ,libjpeg-turbo)
       ("libxscrnsaver" ,libxscrnsaver)
       ("libx11" ,libx11)
       ("libxext" ,libxext)
       ("libxft" ,libxft)
       ("libxi" ,libxi)
       ("libxrender" ,libxrender)
       ("xextproto" ,xextproto)
       ("libevent" ,libevent)
       ("libnotify" ,libnotify)
       ("mesa" ,mesa)
       ;; ("mozjs" ,mozjs)
       ("nspr" ,nspr)
       ;; ("nss" ,nss)
       ;; ("openssl" ,openssl)
       ("python-2" ,python-2)
       ("python-ply" ,python-ply)
       ("pixman" ,pixman)
       ("pulseaudio" ,pulseaudio)
       ("startup-notification" ,startup-notification)
       ("sqlite" ,sqlite)
       ("tcsh" ,tcsh)
       ("unzip" ,unzip)
       ("yasm" ,yasm)
       ("zip" ,zip)
       ("zlib" ,zlib)
       ("inetutils" ,inetutils))) ; Native-input?
    (native-inputs
     `(("autoconf-2.13" ,autoconf-2.13)
       ("fontconfig" ,fontconfig)
       ("perl" ,perl)
       ("pkg-config" ,pkg-config)
       ("m4" ,m4)
       ("which" ,which)
       ("bash" ,bash)))
    ;; Only processors with SSE2 are supported.
    (supported-systems '("x86_64-linux" "i686-linux"))
    (arguments
     `(#:modules ((ice-9 ftw)
                  (ice-9 rdelim)
                  (ice-9 match)
                  ,@%gnu-build-system-modules)
       ;; We encounter runpath issues, looks harmless in practice.
       ;; But nevertheless: FIXME!!!!!!
       #:validate-runpath? #f
       #:phases
       (modify-phases %standard-phases
         (replace 'configure
           ;; According to <https://forum.palemoon.org/viewtopic.php?f=19&t=4166>
           ;; the only way to set configure options is in the .mozconfig file
           ;; (or the file set by variable MOZCONFIG).  If you try to use
           ;; our configure-flags, the configuration will break in unexpected
           ;; ways.  This includes breaking the mach build system detection
           ;; of --host, --build, and --arch, and carrying flags recursively
           ;; on to parts used later in the build system.
           ;; The palemoon.org link describes an MS Windows build, but at
           ;; least for Gentoo it is done comparable:
           ;; <https://data.gpo.zugaina.org/palemoon/>.
           (lambda* (#:key outputs configure-flags #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bash (which "bash"))
                    (abs-srcdir (getcwd))
                    (srcdir (string-append "../" (basename abs-srcdir)))
                    (flags `(,(string-append "--prefix=" out)
                             ,@configure-flags))
                    (mozconfig (string-append (getcwd) "/.mozconfig")))
               (setenv "SHELL" bash)
               (setenv "AUTOCONF"
                       (string-append (assoc-ref %build-inputs
                                                 "autoconf-2.13")
                                      "/bin/autoconf"))
               (setenv "BUILD_OBJ_DIR" (string-append (getcwd) "/o"))
               (setenv "CONFIG_SHELL" bash)
               (setenv "QA_CONFIGURE_OPTIONS" ".*")
               (setenv "MOZBUILD_STATE_PATH"
                       (string-append (getcwd) "/mach_state"))
               (setenv "MOZCONFIG"
                       (string-append (getcwd) "/.mozconfig"))
               (setenv "MOZ_NOSPAM" "1")
               (mkdir-p (string-append (getcwd) "/builddir"))
               (with-output-to-file mozconfig
                 (lambda ()
                   (display
                    (string-append
                     "ac_add_options --enable-application=browser\n"
                     "mk_add_options MOZ_OBJDIR=" (getenv "BUILD_OBJ_DIR") "\n" ;new
                     "ac_add_options --prefix=" out "\n"
                     "ac_add_options --disable-debug\n"
                     "ac_add_options --disable-debug-symbols\n"
                     "ac_add_options --disable-accessibility\n" ;There is no such option?
                     "ac_add_options --disable-updater\n"
                     "ac_add_options --disable-installer\n"
                     "ac_add_options --disable-parental-controls\n" ;Yes? No?
                     "ac_add_options --disable-install-strip"
                     "ac_add_options --disable-tests\n"
                     "ac_add_options --with-system-ply\n"
                     "ac_add_options --with-system-libevent\n"
                     "ac_add_options --with-system-zlib\n"
                     "ac_add_options --with-system-bz2\n"
                     "ac_add_options --with-system-webp\n"
                     "ac_add_options --with-system-libvpx\n"
                     "ac_add_options --enable-system-hunspell\n"
                     "ac_add_options --enable-system-ffi\n"
                     "ac_add_options --enable-system-sqlite\n" ;Needs >= sqlite-3.21.0
                     "ac_add_options --enable-system-cairo\n"
                     "ac_add_options --enable-system-pixman\n"
                     "ac_add_options --enable-shared-js\n"
                     "ac_add_options --disable-valgrind\n"
                     "ac_add_options --with-pthreads\n"
                     "ac_add_options --disable-optimize\n"
                     "ac_add_options --enable-gstreamer\n"
                     "ac_add_options --enable-default-toolkit=\"cairo-gtk2\"\n"
                     "ac_add_options --disable-alsa\n"
                     "ac_add_options --enable-strip\n"
                     "ac_add_options --disable-codesighs\n"
                     "ac_add_options --disable-gamepad\n"
                     "ac_add_options --disable-logging\n"
                     "ac_add_options --disable-websms-backend\n"
                     "ac_add_options --enable-chrome-format=omni\n"
                     "ac_add_options --enable-startup-notification\n"
                     "ac_add_options --enable-shared-js\n"
                     "ac_add_options --enable-devtools\n"
                     ;; XXX!
                     "ac_add_options --with-system-png\n"
                     "ac_add_options --enable-pulseaudio\n"
                     "ac_add_options --disable-necko-wifi\n"
                     "ac_add_options --with-system-jpeg\n"
                     "ac_add_options --disable-official-branding\n" ; Trademarks apply for official branding
                     "mk_add_options PYTHON=\"python2\"\n"
                     "mk_add_options AUTOCONF=\"autoconf\"\n"
                     "ac_add_options --with-system-nspr\n"
                     "ac_add_options --enable-sandbox\n"
                     "ac_add_options --enable-content-sandbox\n"
                     "ac_add_options --enable-skia\n"
                     "ac_add_options --enable-jemalloc\n"
                     "ac_add_options --with-system-icu\n"
                     "ac_add_options --with-intl-api\n"))))
               (display "mach configure, this is expected to \"crash\"")
               (zero? (system* "./mach" "configure"))
               (display "mach, and another round.")
               (zero? (system* "./mach")))))
         (add-after 'patch-source-shebangs 'setenvs
           (lambda _
             (substitute* (list "build/autoconf/config.guess"
                                "client.mk"
                                "js/src/configure.in"
                                "intl/icu/source/configure")
               (("/bin/sh") (which "sh")))
             #t))
         (add-before 'build 'patch-clientmk
           (lambda _
             (substitute* "client.mk"
               (("/bin/sh") (which "sh")))
             #t))
         (replace 'build
           (lambda _
             (chdir "build")
             (display "mach build, the real build now")
             (system* "../mach" "build")
             #t))
         (add-after
             'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
           (lambda _
             ;; libxul.so dynamically opens libraries, so here we explicitly
             ;; link them into libxul.so instead.
             ;;
             ;; TODO: It might be preferable to patch in absolute file names in
             ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
             ;; work.  More investigation is needed.
             (substitute* "toolkit/library/moz.build"
               (("^# This needs to be last")
                "OS_LIBS += [
    'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
    'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0', 'png' ]\n\n"))
             #t))
         (add-after 'unpack 'privacy-patch-branding
           (lambda _
             (substitute* "browser/branding/unofficial/pref/palemoon-branding.js"
               (("http://www.palemoon.org/unofficial.shtml")
                "https://gnu.org/s/guix"))
             (substitute* "browser/branding/shared/pref/preferences.inc"
               (("http://www.palemoon.org/firstrun.shtml")
                "https://gnu.org"))
             (substitute* "browser/branding/shared/locales/browserconfig.properties"
               (("http://start.palemoon.org/")
                "https://gnu.org/s/guix"))
             #t))
         (add-after 'unpack 'add-vendor-options
           (lambda _
             (substitute* "browser/branding/unofficial/pref/palemoon-branding.js"
               (("pref(\"app.update.url\", \"\")")
                "pref(\"app.update.url\", \"\");\n
                pref(\"browser.backspace_action\", 0);\n
                pref(\"browser.ctrlTab.previews\", false);\n
                pref(\"intl.locale.matchOS\", true);\n
                pref(\"extensions.blocklist.enabled\", false);\n
                pref(\"geo.enabled\", false);\n
                pref(\"services.sync.prefs.sync.security.OCSP.enabled\", false);\n
                pref(\"security.OCSP.GET.enabled\", false);\n
                pref(\"security.OCSP.require\", false);\n
                pref(\"general.useragent.locale\", \"chrome://global/locale/intl.properties\");\n
                pref(\"browser.display.use_system_colors\", true);"))
             #t))
         (replace 'install
           (lambda* (#:key name outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin"))
                    (lib (string-append out "/lib"))
                    (palemoon (string-append
                               out "/lib/palemoon/palemoon"))
                    ;; Use one objectdirectory for all architectures.
                    (objdir "o")
                    ;; (prefsfile (string-append objdir "/dist/bin/browser"
                    ;;                            "/defaults/preferences/"
                    ;;                            "/palemoon-branding.js"))
                    (tarfile (string-append objdir "/dist/palemoon-"
                                            ,version ".linux-x86_64"
                                            ".tar.bz2")))
               ;; Create the package, unpack it, manually install
               ;; the files from there to not miss anything.
               (zero? (system* "../mach" "package"))
               (display (getcwd))
               (chdir (string-append "../" objdir "/dist"))
               (zero? (system* "tar" "xjpf"
                               "palemoon-" ,version ".linux-x86_64.tar.bz2"))
               (mkdir-p (string-append out "/lib/palemoon"))
               (copy-recursively "palemoon"
                                 (string-append out "/lib/palemoon"))
               (mkdir-p bin)
               (symlink (string-append out "/lib/palemoon/palemoon")
                        (string-append bin "/newmoon"))
               ;; Avoid duplicate binaries.
               ;; https://bugzilla.mozilla.org/show_bug.cgi?id=658850 for
               (delete-file (string-append out "/lib/palemoon/palemoon-bin")))))
         ;; swap check and install phases and set paths to installed binaries
         (add-before 'check 'set-path-for-check
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
             #t))
         (add-after 'install 'check
           ;;(assoc-ref %standard-phases 'check))
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin/newmoon")))
               (invoke bin "--version"))))
         (delete 'check)
         (delete 'bootstrap)
         ;; (replace 'check
         ;;   (lambda* (#:key outputs #:allow-other-keys)
         ;;     (let* ((out (assoc-ref outputs "out"))
         ;;            (bin (string-append out "/bin/newmoon")))
         ;;       (invoke bin "--version"))))
         (add-after 'install 'install-icons
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out")))
               (display (getcwd))
               (with-directory-excursion "../../browser/branding/unofficial"
                 (for-each
                  (lambda (file)
                    (let* ((size (string-filter char-numeric? file))
                           (icons (string-append out "/share/icons/hicolor/"
                                                 size "x" size "/apps")))
                      (mkdir-p icons)
                      (copy-file file (string-append icons "/newmoon.png"))))
                  '("default16.png" "default32.png" "default48.png"
                    "mozicon128.png"))))))
         (add-after 'install 'install-desktop-file
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (apps (string-append out "/share/applications")))
               (display (getcwd))
               (with-directory-excursion "../../browser/branding/official"
                 (substitute* "palemoon.desktop"
                   (("Pale Moon")
                    "New Moon")
                   (("Exec=palemoon -new-tab https://start.palemoon.org")
                    "Exec=newmoon -new-tab https://gnu.org/s/guix")
                   (("Exec=palemoon -new-window")
                    "Exec=newmoon -new-window")
                   (("Exec=palemoon -private-window")
                    "Exec=newmoon -private-window")
                   (("palemoon")
                    "newmoon"))
                 (install-file "palemoon.desktop"
                               (string-append apps
                                              "/newmoon.desktop")))))))))

    (home-page "https://www.palemoon.org/")
    (synopsis "Web Browser compiled from Pale Moon sources")
    (description
     "New Moon is a web browser compiled from Pale Moon sourcecode.  New Moon
is an independent browser derived from Firefox.  Among its features are:
Replaces the Gecko layout engine with the Goanna fork Uses the pre-Australis
Firefox user interface Continues add-on support for XUL, XPCOM, and NPAPI
plugins[9] Supports extensions and themes exclusive to Pale Moon, such as
Adblock Latitude[ Defaults to a customizable start page in cooperation with
start.me Defaults to DuckDuckGo as the search engine instead of Google or
Yahoo!  Uses the IP-API service instead of Google's for geolocation Fully
customizable user interface

NOTE: Please note that in this work-in-progress version it points to the start
page which promotes some services and needs cookies, and has some other
issues.  IMPORTANT: This version is based on the old Pale Moon codebase which
is in maintenance mode, but continues to receive security patches and
updates.")
    (properties '((upstream-name . "Pale-Moon")))
    ;; The exception clause of the Palemoon license states that
    ;; New Moon builds can be redistributed freely.
    (license (list license:mpl2.0 ;and others, see toolkit/content/license.html
                   license:gpl2+
                   license:lgpl2.1))))

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Help needed with newmoon
  2019-03-06 20:04 Help needed with newmoon swedebugia
@ 2019-03-06 20:59 ` Leo Famulari
  2019-03-07  7:07 ` ng0
  1 sibling, 0 replies; 3+ messages in thread
From: Leo Famulari @ 2019-03-06 20:59 UTC (permalink / raw)
  To: swedebugia; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

On Wed, Mar 06, 2019 at 09:04:17PM +0100, swedebugia wrote:
> 1. sqlite3 needs to be compiled with SQLITE_ENABLE_FTS3 (this results in
> a lot of builds, patch attached)

Check our Git history for previous work related to SQLITE_ENABLE_FTS3.
Maybe we should bring back that special package or maybe your package
can be patched like Clementine.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Help needed with newmoon
  2019-03-06 20:04 Help needed with newmoon swedebugia
  2019-03-06 20:59 ` Leo Famulari
@ 2019-03-07  7:07 ` ng0
  1 sibling, 0 replies; 3+ messages in thread
From: ng0 @ 2019-03-07  7:07 UTC (permalink / raw)
  To: swedebugia; +Cc: guix-devel

swedebugia transcribed 63K bytes:
> Hi
> 
> My pet project for today was working on getting newmoon to build. I
> failed :/
> 
> I got the definition from ng0 and have improved a few things and updated
> it to the newest version.
> 
> I investigated the 3 errors below:
> 1. sqlite3 needs to be compiled with SQLITE_ENABLE_FTS3 (this results in
> a lot of builds, patch attached)
> 2. our libvpx does not provide vpx_mem/vpx_mem.h even though it is in
> the source of libvpx it is not installed it seems.
> 3. the pulseaudio-error I do not understand: <built-in>: fatal error:
> when writing output to : Broken pipe ??

Oops. Sorry, I should have appended this. I had taken my sqlite3
variants for granted :/
 
> Here are the errors with context:
> 
>  0:19.11 checking for vpx >= 1.5.0... yes
>  0:19.11 checking MOZ_LIBVPX_CFLAGS...
>  0:19.11 checking MOZ_LIBVPX_LIBS...
> -L/gnu/store/7s6z2ybw86k7r97cwzrix9hngs729lrk-libvpx-1.8.0/lib -lvpx -lm
>  0:19.17 checking for vpx/vpx_decoder.h... yes
>  0:19.38 checking for vpx_codec_dec_init_ver in -lvpx... yes
>  0:19.42 checking for vpx_mem/vpx_mem.h... no
>  0:19.44 checking for libpulse... yes
>  0:19.45 checking MOZ_PULSEAUDIO_CFLAGS... -D_REENTRANT
>  0:19.45 checking MOZ_PULSEAUDIO_LIBS...
> -L/gnu/store/hd3x89yknm4k6k4gw16jy5xk7idq1sxf-pulseaudio-12.2/lib -lpulse
>  0:19.47 <built-in>: fatal error: when writing output to : Broken pipe
>  0:19.47 compilation terminated.
>  0:19.48 /tmp/guix-build-newmoon-28.4.0.drv-0/source/old-configure: line
> 14935: test: : integer expression expected
>  0:19.50 checking for wget... no
>  0:19.52 checking for sqlite3 >= 3.26.0... yes
>  0:19.52 checking SQLITE_CFLAGS...
>  0:19.52 checking SQLITE_LIBS...
> -L/gnu/store/kg104rhqzvmnpqxk91ayvwxzsrncr0f4-sqlite-3.26.0/lib -lsqlite3
>  0:19.67 checking for SQLITE_SECURE_DELETE support in system SQLite... yes
>  0:19.78 checking for SQLITE_THREADSAFE support in system SQLite... yes
>  0:19.90 checking for SQLITE_ENABLE_FTS3 support in system SQLite... no
>  0:19.90 configure: error: System SQLite library is not compiled with
> SQLITE_ENABLE_FTS3.
>  0:19.93 DEBUG: <truncated - see config.log for full output>
>  0:19.94 DEBUG: configure:15039: checking for wget
>  0:19.94 DEBUG: configure:15362: checking for sqlite3 >= 3.26.0
>  0:19.94 DEBUG: configure:15369: checking SQLITE_CFLAGS
>  0:19.94 DEBUG: configure:15374: checking SQLITE_LIBS
>  0:19.94 DEBUG: configure:15405: checking for SQLITE_SECURE_DELETE
> support in system SQLite
>  0:19.94 DEBUG: configure:15428:
> /gnu/store/n2p1zs14y89lwkg9da68y12pc10c6sw9-gcc-5.5.0/bin/gcc -std=gnu99
> -o conftest  -fno-strict-aliasing -fno-math-errno -msse2 -mfpmath=sse
> -pthread   -lpthread  -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id
> conftest.c -ldl
> -L/gnu/store/kg104rhqzvmnpqxk91ayvwxzsrncr0f4-sqlite-3.26.0/lib
> -lsqlite3 1>&5
>  0:19.94 DEBUG: configure:15451: checking for SQLITE_THREADSAFE support
> in system SQLite
>  0:19.94 DEBUG: configure:15474:
> /gnu/store/n2p1zs14y89lwkg9da68y12pc10c6sw9-gcc-5.5.0/bin/gcc -std=gnu99
> -o conftest  -fno-strict-aliasing -fno-math-errno -msse2 -mfpmath=sse
> -pthread   -lpthread  -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id
> conftest.c -ldl
> -L/gnu/store/kg104rhqzvmnpqxk91ayvwxzsrncr0f4-sqlite-3.26.0/lib
> -lsqlite3 1>&5
>  0:19.94 DEBUG: configure:15497: checking for SQLITE_ENABLE_FTS3 support
> in system SQLite
>  0:19.94 DEBUG: configure:15520:
> /gnu/store/n2p1zs14y89lwkg9da68y12pc10c6sw9-gcc-5.5.0/bin/gcc -std=gnu99
> -o conftest  -fno-strict-aliasing -fno-math-errno -msse2 -mfpmath=sse
> -pthread   -lpthread  -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id
> conftest.c -ldl
> -L/gnu/store/kg104rhqzvmnpqxk91ayvwxzsrncr0f4-sqlite-3.26.0/lib
> -lsqlite3 1>&5
>  0:19.94 DEBUG: configure: failed program was:
>  0:19.94 DEBUG: #line 15511 "configure"
>  0:19.94 DEBUG: #include "confdefs.h"
>  0:19.94 DEBUG:
>  0:19.94 DEBUG:             #include "sqlite3.h"
>  0:19.94 DEBUG:
>  0:19.94 DEBUG:             int main(int argc, char **argv){
>  0:19.94 DEBUG:               return
> !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
>  0:19.94 DEBUG:             }
>  0:19.94 DEBUG: configure: error: System SQLite library is not compiled
> with SQLITE_ENABLE_FTS3.
>  0:19.94 ERROR: old-configure failed
>  0:19.98 *** Fix above errors and then restart with\
>  0:19.98
> "/gnu/store/7j3941iannrngdvgbclyxid12vds5w9i-make-4.2.1/bin/make -f
> client.mk build"
>  0:19.98 make[1]: *** [client.mk:378: configure] Error 1
> make: *** [GNUmakefile:9: build] Error 2
> 
> 
> -- 
> Cheers Swedebugia

> From 89c0629198b10264c07de88f2f678af5292d4fbf Mon Sep 17 00:00:00 2001
> From: swedebugia <swedebugia@riseup.net>
> Date: Sat, 23 Feb 2019 05:34:45 +0100
> Subject: [PATCH 1/2] WIP gnu: Add New Moon.
> 
> ---
>  gnu/packages/web-browsers.scm | 400 +++++++++++++++++++++++++++++++++-
>  1 file changed, 395 insertions(+), 5 deletions(-)
> 
> diff --git a/gnu/packages/web-browsers.scm b/gnu/packages/web-browsers.scm
> index a19a0dc7c..105fe2839 100644
> --- a/gnu/packages/web-browsers.scm
> +++ b/gnu/packages/web-browsers.scm
> @@ -4,10 +4,12 @@
>  ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
>  ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
> +;;; Copyright © 2017, 2018 Nils Gillmann <ng0@ng0.is>
>  ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
>  ;;; Copyright © 2018 Timo Eisenmann <eisenmann@fn.de>
>  ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
> +;;; Copyright © 2019 Pierre Neidhardt <swedebugia@riseup.net>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -28,30 +30,52 @@
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix packages)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages admin)
> +  #:use-module (gnu packages assembly)
> +  #:use-module (gnu packages autotools)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages bash)
>    #:use-module (gnu packages compression)
> +  #:use-module (gnu packages cups)
> +  #:use-module (gnu packages databases)
>    #:use-module (gnu packages documentation)
>    #:use-module (gnu packages fltk)
>    #:use-module (gnu packages fontutils)
> -  #:use-module (gnu packages gtk)
> +  #:use-module (gnu packages gcc)
> +  #:use-module (gnu packages gl)
> +  #:use-module (gnu packages glib)
> +  #:use-module (gnu packages gnome)
>    #:use-module (gnu packages gnupg)
> +  #:use-module (gnu packages gnuzilla)
> +  #:use-module (gnu packages gstreamer)
> +  #:use-module (gnu packages gtk)
> +  #:use-module (gnu packages icu4c)
> +  #:use-module (gnu packages image)
> +  #:use-module (gnu packages kerberos)
> +  #:use-module (gnu packages libcanberra)
>    #:use-module (gnu packages libevent)
> +  #:use-module (gnu packages libffi)
>    #:use-module (gnu packages libidn)
> +  #:use-module (gnu packages libreoffice)
> +  #:use-module (gnu packages linux)
>    #:use-module (gnu packages lisp)
>    #:use-module (gnu packages lua)
> -  #:use-module (gnu packages gnome)
> +  #:use-module (gnu packages m4)
>    #:use-module (gnu packages ncurses)
>    #:use-module (gnu packages perl)
>    #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages pulseaudio)
>    #:use-module (gnu packages python)
> -  #:use-module (gnu packages python-web)
> +;  #:use-module (gnu packages python-web)
>    #:use-module (gnu packages python-xyz)
>    #:use-module (gnu packages qt)
> -  #:use-module (gnu packages image)
> +  #:use-module (gnu packages shells)
>    #:use-module (gnu packages sqlite)
>    #:use-module (gnu packages tls)
> +  #:use-module (gnu packages video)
>    #:use-module (gnu packages webkit)
> +  #:use-module (gnu packages xdisorg)
>    #:use-module (gnu packages xorg)
> -  #:use-module (gnu packages gcc)
>    #:use-module (guix download)
>    #:use-module (guix git-download)
>    #:use-module (guix build-system gnu)
> @@ -473,3 +497,369 @@ features for productive professionals.")
>         ("unix-opts" ,sbcl-unix-opts)
>         ("trivial-clipboard" ,sbcl-trivial-clipboard)))
>      (synopsis "Infinitely extensible web-browser (with Lisp development files)")))
> +
> +(define-public newmoon
> +  (package
> +    (name "newmoon")
> +    (version "28.4.0")
> +    (source
> +     (origin
> +       ;; Only generated github tarball available.
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/MoonchildProductions/UXP")
> +             (commit (string-append "PM" version "_Release"))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32
> +         "0wnn15y7qpmz1b31rrmdlf3w4qz6f6qqrl8f1lgafx8czqgg9lwx"))))
> +    (build-system gnu-build-system)
> +    (inputs
> +     `(
> +       ;; ("gst-plugins-base" ,gst-plugins-base)
> +       ;; ("gstreamer" ,gstreamer)
> +       ;; ("mozjs" ,mozjs)
> +       ;; ("nss" ,nss)
> +       ;; ("openssl" ,openssl)
> +       ("alsa-lib" ,alsa-lib)
> +       ("bzip2" ,bzip2)
> +       ("cairo" ,cairo)
> +       ("cups" ,cups)
> +       ("dbus" ,dbus)
> +       ("dbus-glib" ,dbus-glib)
> +       ("ffmpeg" ,ffmpeg)
> +       ("freetype" ,freetype)
> +       ("glib" ,glib)
> +       ("gobject-introspection" ,gobject-introspection)
> +       ("gtk+-2" ,gtk+-2)
> +       ("hunspell" ,hunspell)
> +       ("inetutils" ,inetutils) ; Native-input?
> +       ("libcanberra" ,libcanberra)
> +       ("libevent" ,libevent)
> +       ("libffi" ,libffi)
> +       ("libgnome" ,libgnome)
> +       ("libidl" ,libidl)
> +       ("libjpeg-turbo" ,libjpeg-turbo)
> +       ("libnotify" ,libnotify)
> +       ("libpng-apng" ,libpng-apng)
> +       ("libvpx" ,libvpx)
> +       ("libwebp" ,libwebp)
> +       ("libx11" ,libx11)
> +       ("libxcomposite" ,libxcomposite)
> +       ("libxext" ,libxext)
> +       ("libxft" ,libxft)
> +       ("libxi" ,libxi)
> +       ("libxrender" ,libxrender)
> +       ("libxscrnsaver" ,libxscrnsaver)
> +       ("libxt" ,libxt)
> +       ("libxt" ,libxt)
> +       ("mesa" ,mesa)
> +       ("mit-krb5" ,mit-krb5)
> +       ("nspr" ,nspr)
> +       ("pixman" ,pixman)
> +       ("pulseaudio" ,pulseaudio)
> +       ("python-2" ,python-2)
> +       ("python-ply" ,python-ply)
> +       ("sqlite" ,sqlite-3.26.0)
> +       ("startup-notification" ,startup-notification)
> +       ("tcsh" ,tcsh)
> +       ("unzip" ,unzip)
> +       ("xextproto" ,xextproto)
> +       ("yasm" ,yasm)
> +       ("zip" ,zip)))
> +    (native-inputs
> +     `(("autoconf-2.13" ,autoconf-2.13)
> +       ("fontconfig" ,fontconfig)
> +       ("perl" ,perl)
> +       ("pkg-config" ,pkg-config)
> +       ("m4" ,m4)
> +       ("which" ,which)
> +       ("bash" ,bash)))
> +    (arguments
> +     `(#:modules ((ice-9 ftw)
> +                  (ice-9 rdelim)
> +                  (ice-9 match)
> +                  ,@%gnu-build-system-modules)
> +       ;; #:validate-runpath? #f
> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'configure
> +           ;; According to <https://forum.palemoon.org/viewtopic.php?f=19&t=4166>
> +           ;; the only way to set configure options is in the .mozconfig file
> +           ;; (or the file set by variable MOZCONFIG).  If you try to use
> +           ;; our configure-flags, the configuration will break in unexpected
> +           ;; ways.  This includes breaking the mach build system detection
> +           ;; of --host, --build, and --arch, and carrying flags recursively
> +           ;; on to parts used later in the build system.
> +           ;; The palemoon.org link describes an MS Windows build, but at
> +           ;; least for Gentoo it is done comparable:
> +           ;; <https://data.gpo.zugaina.org/palemoon/>.
> +           (lambda* (#:key outputs configure-flags #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bash (which "bash"))
> +                    (abs-srcdir (getcwd))
> +                    (srcdir (string-append "../" (basename abs-srcdir)))
> +                    (flags `(,(string-append "--prefix=" out)
> +                             ,@configure-flags))
> +                    (mozconfig (string-append (getcwd) "/.mozconfig")))
> +               (setenv "SHELL" bash)
> +               (setenv "AUTOCONF"
> +                       (string-append (assoc-ref %build-inputs
> +                                                 "autoconf-2.13")
> +                                      "/bin/autoconf"))
> +               (setenv "BUILD_OBJ_DIR" (string-append (getcwd) "/o"))
> +               (setenv "CONFIG_SHELL" bash)
> +               (setenv "QA_CONFIGURE_OPTIONS" ".*")
> +               (setenv "MOZBUILD_STATE_PATH"
> +                       (string-append (getcwd) "/mach_state"))
> +               (setenv "MOZCONFIG"
> +                       (string-append (getcwd) "/.mozconfig"))
> +               (setenv "MOZ_NOSPAM" "1")
> +               (mkdir-p (string-append (getcwd) "/builddir"))
> +               (with-output-to-file mozconfig
> +                 (lambda ()
> +                   ;; These procedures help us create the .mozbuild-file
> +                   (define (enable option)
> +                     (string-append "ac_add_options --enable-" option "\n"))
> +                   (define (disable option)
> +                     (string-append "ac_add_options --disable-" option "\n"))
> +                   (define (var env)
> +                     (string-append "mk_add_options " env "\n"))
> +                   (define (with option)
> +                     (string-append "ac_add_options --with-" option "\n"))
> +                   ;; The full list of options can be obtained by running:
> +                   ;;  $ ./configure --help
> +                   (display
> +                    (string-append
> +                     ;; Todo: dbus, safe-browsing, 
> +                     (enable "application=palemoon")
> +                     (enable "chrome-format=omni")
> +                     (enable "content-sandbox")
> +                     (enable "default-toolkit=\"cairo-gtk2\"")
> +                     (enable "devtools")
> +                     (enable "export-js")
> +                     (enable "ffmpeg")
> +                     (enable "jemalloc")
> +                     (enable "pulseaudio")
> +                     (enable "sandbox")
> +                     (enable "skia")
> +                     (enable "startup-notification")
> +                     (enable "strip")
> +                     (enable "system-cairo")
> +                     (enable "system-ffi")
> +                     (enable "system-hunspell")
> +                     (enable "system-pixman")
> +                     (enable "system-sqlite") ;Needs >= sqlite-3.26.0
> +
> +                     (disable "accessibility") ;There is no such option?
> +                     (disable "alsa")
> +                     ;;(disable "codesighs")
> +                     (disable "debug-symbols")
> +                     (disable "debug")
> +                     (disable "gamepad")
> +                     (disable "install-strip")
> +                     (disable "necko-wifi")
> +                     (disable "official-branding") ; Trademarks apply for official branding
> +                     (disable "optimize")
> +                     (disable "parental-controls") ;Yes? No?
> +                     (disable "tests") ; TODO fix tests
> +                     (disable "updater")
> +                     (disable "valgrind")
> +
> +                     (with "pthreads")
> +                     (with "system-bz2")
> +                     (with "system-icu")
> +                     (with "system-jpeg")
> +                     (with "system-libevent")
> +                     (with "system-libvpx")
> +                     (with "system-nspr")
> +                     (with "system-png")
> +                     (with "system-zlib")
> +
> +                     (var "AUTOCONF=\"autoconf\"")
> +                     (var (string-append "MOZ_OBJDIR=" (getenv "BUILD_OBJ_DIR"))) ;new
> +                     (var "PYTHON=\"python2\"")
> +                     "ac_add_options --prefix=" out "\n"
> +
> +                     ;;"ac_add_options --disable-installer\n" ; no such option.
> +                     ;;"ac_add_options --disable-logging\n"
> +                     ;;"ac_add_options --disable-websms-backend\n"
> +                     ;;"ac_add_options --with-intl-api\n"
> +                     ;;"ac_add_options --with-system-ply\n"
> +                     ;;"ac_add_options --with-system-webp\n"
> +		     ))))
> +               (display "mach configure, this is expected to \"crash\"\n")
> +               (zero? (system* "./mach" "configure"))
> +               (display "mach, and another round.\n")
> +               (zero? (system* "./mach")))
> +             #t))
> +         (add-after 'patch-source-shebangs 'setenvs
> +           (lambda _
> +             (substitute* (list "build/autoconf/config.guess"
> +                                "client.mk"
> +                                "js/src/configure.in"
> +                                "intl/icu/source/configure")
> +               (("/bin/sh") (which "sh")))
> +             #t))
> +         (add-before 'build 'patch-clientmk
> +           (lambda _
> +             (substitute* "client.mk"
> +               (("/bin/sh") (which "sh")))
> +             #t))
> +         (replace 'build
> +           (lambda _
> +             (chdir "build")
> +             (display "mach build, the real build now\n")
> +             (system* "../mach" "build")
> +             #t))
> +         (add-after
> +             'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
> +           (lambda _
> +             ;; libxul.so dynamically opens libraries, so here we explicitly
> +             ;; link them into libxul.so instead.
> +             ;;
> +             ;; TODO: It might be preferable to patch in absolute file names in
> +             ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
> +             ;; work.  More investigation is needed.
> +             (substitute* "toolkit/library/moz.build"
> +               (("^# This needs to be last")
> +                "OS_LIBS += [
> +    'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
> +    'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0', 'png' ]\n\n"))
> +             #t))
> +         (add-after 'unpack 'privacy-patch-branding
> +           (lambda _
> +             (substitute* "application/palemoon/branding/unofficial/pref/palemoon-branding.js"
> +               (("http://www.palemoon.org/unofficial.shtml")
> +                "https://gnu.org/s/guix"))
> +             (substitute* "application/palemoon/branding/shared/pref/preferences.inc"
> +               (("http://www.palemoon.org/firstrun.shtml")
> +                "https://gnu.org"))
> +             (substitute* "application/palemoon/branding/shared/locales/browserconfig.properties"
> +               (("http://start.palemoon.org/")
> +                "https://gnu.org/s/guix"))
> +             #t))
> +         (replace 'install
> +           (lambda* (#:key name outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin"))
> +                    (lib (string-append out "/lib"))
> +                    (palemoon (string-append
> +                               out "/lib/palemoon/palemoon"))
> +                    ;; Use one objectdirectory for all architectures.
> +                    (objdir "o")
> +                    ;; (prefsfile (string-append objdir "/dist/bin/browser"
> +                    ;;                           "/defaults/profile"
> +                    ;;                           "/prefs.js"))
> +                    (tarfile (string-append objdir "/dist/palemoon-"
> +                                            ,version ".linux-x86_64"
> +                                            ".tar.bz2")))
> +               ;; We skip this for now.
> +               ;;                (substitute* prefsfile
> +               ;;                  (("# Mozilla User Preferences")
> +               ;;                   "# Mozilla User Preferences\n
> +               ;; pref(\"app.update.enabled\", false);\n
> +               ;; pref(\"browser.backspace_action\", 0);\n
> +               ;; pref(\"browser.ctrlTab.previews\", false);\n
> +               ;; pref(\"intl.locale.matchOS\", true);\n
> +               ;; pref(\"general.useragent.locale\", \"chrome://global/locale/intl.properties\");\n
> +               ;; pref(\"browser.display.use_system_colors\", true);"))
> +               ;; Create the package, unpack it, manually install
> +               ;; the files from there to not miss anything.
> +               (zero? (system* "../mach" "package"))
> +               (display (getcwd))
> +               (chdir (string-append "../" objdir "/dist"))
> +               (zero? (system* "tar" "xjpf"
> +                               "palemoon-" ,version ".linux-x86_64.tar.bz2"))
> +               (mkdir-p (string-append out "/lib/palemoon"))
> +               (copy-recursively "palemoon"
> +                                 (string-append out "/lib/palemoon"))
> +               (mkdir-p bin)
> +               (symlink (string-append out "/lib/palemoon/palemoon")
> +                        (string-append bin "/newmoon"))
> +               ;; Avoid duplicate binaries.
> +               ;; https://bugzilla.mozilla.org/show_bug.cgi?id=658850 for
> +               (delete-file (string-append out "/lib/palemoon/palemoon-bin")))))
> +         ;; swap check and install phases and set paths to installed binaries
> +         (add-before 'check 'set-path-for-check
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let ((out (assoc-ref outputs "out")))
> +               (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
> +             #t))
> +         (add-after 'install 'check
> +           ;;(assoc-ref %standard-phases 'check))
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin/newmoon")))
> +               (invoke bin "--version"))))
> +         (delete 'check)
> +         (delete 'bootstrap)
> +         ;; (replace 'check
> +         ;;   (lambda* (#:key outputs #:allow-other-keys)
> +         ;;     (let* ((out (assoc-ref outputs "out"))
> +         ;;            (bin (string-append out "/bin/newmoon")))
> +         ;;       (invoke bin "--version"))))
> +         (add-after 'install 'install-icons
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out")))
> +               (display (getcwd))
> +               (with-directory-excursion "../../browser/branding/unofficial"
> +                 (for-each
> +                  (lambda (file)
> +                    (let* ((size (string-filter char-numeric? file))
> +                           (icons (string-append out "/share/icons/hicolor/"
> +                                                 size "x" size "/apps")))
> +                      (mkdir-p icons)
> +                      (copy-file file (string-append icons "/newmoon.png"))))
> +                  '("default16.png" "default32.png" "default48.png"
> +                    "mozicon128.png"))))))
> +         (add-after 'install 'install-desktop-file
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (apps (string-append out "/share/applications")))
> +               (display (getcwd))
> +               (with-directory-excursion "../../browser/branding/official"
> +                 (substitute* "palemoon.desktop"
> +                   (("Pale Moon")
> +                    "New Moon")
> +                   (("Exec=palemoon -new-tab https://start.palemoon.org")
> +                    "Exec=newmoon -new-tab https://gnu.org/s/guix")
> +                   (("Exec=palemoon -new-window")
> +                    "Exec=newmoon -new-window")
> +                   (("Exec=palemoon -private-window")
> +                    "Exec=newmoon -private-window")
> +                   (("palemoon")
> +                    "newmoon"))
> +                 (install-file "palemoon.desktop"
> +                               (string-append apps
> +                                              "/newmoon.desktop")))))))))
> +
> +    (home-page "https://www.palemoon.org/")
> +    (synopsis "Web Browser compiled from Pale Moon sources")
> +    (description
> +     "New Moon is a web browser compiled from Pale Moon sourcecode.  New Moon
> +is an independent browser derived from Firefox.
> +
> +Among its features are:
> +@itemize
> +@item It's fast (much codebloat has been removed since the fork from Firefox).
> +@item The developers adhere to defence-in-depth, increasing the security
> +step-by-step.
> +@item Builds upon the Unified XUL Platform 
> +@item Comes with the Goanna layout engine (forked from Gecko). 
> +@item Uses the pre-Australis Firefox user interface Continues add-on support
> +for XUL, XPCOM, and NPAPI plugins.
> +@item Supports extensions and themes exclusive to Pale Moon, such as Adblock
> +Latitude.
> +@item Defaults to DuckDuckGo as the search engine.
> +@item Uses the IP-API service instead of Google's for geolocation. 
> +@item Fully customizable user interface.
> +@item Newmoon is not a full featured (bloated) media player or recorder but
> +does support the HTML5 video standard.
> +@end itemize\n")
> +    (properties '((upstream-name . "Pale-Moon")))
> +    ;; The exception clause of the Palemoon license states that
> +    ;; New Moon builds can be redistributed freely.
> +    (license (list license:mpl2.0 ;and others, see toolkit/content/license.html
> +                   license:gpl2+
> +                   license:lgpl2.1))))
> -- 
> 2.19.2
> 

> From 9296960b3d24e0ae00894ba8c7547b7c3cb77ad1 Mon Sep 17 00:00:00 2001
> From: swedebugia <swedebugia@riseup.net>
> Date: Wed, 6 Mar 2019 20:56:27 +0100
> Subject: [PATCH 2/2] gnu: sqlite: Add build flag: SQLITE_ENABLE_FTS3
> 
> * gnu/packages/sqlite.scm (sqlite)[arguments]: Add it.
> ---
>  gnu/packages/sqlite.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
> index 05d7ce6b9..7bacbfe2e 100644
> --- a/gnu/packages/sqlite.scm
> +++ b/gnu/packages/sqlite.scm
> @@ -73,7 +73,8 @@
>        ;; to use the system SQLite unless these options are enabled.
>        (list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
>                             "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
> -                           "-DSQLITE_ENABLE_DBSTAT_VTAB"))))
> +                           "-DSQLITE_ENABLE_DBSTAT_VTAB "
> +                           "-DSQLITE_ENABLE_FTS3")))) ; Needed for newmoon
>     (home-page "https://www.sqlite.org/")
>     (synopsis "The SQLite database management system")
>     (description
> -- 
> 2.19.2
> 

> ;;; ports - package definitions for infotropique OS/core
> ;;; Copyright (C) 2017, 2018 Nils Gillmann <gillmann@infotropique.org>
> ;;;
> ;;; This program is free software: you can redistribute it and/or modify
> ;;; it under the terms of the GNU General Public License as
> ;;; published by the Free Software Foundation, either version 3 of the
> ;;; License, or (at your option) any later version.
> ;;;
> ;;; This program is distributed in the hope that it will be useful,
> ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
> ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> ;;; GNU General Public License for more details.
> ;;;
> ;;; You should have received a copy of the GNU General Public License
> ;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
> 
> ;; Part of this module were originally based on the gnu/packages/gnuzilla.scm file
> ;; from GNU Guix which is covered by the GPL3 license. Consult the file for the
> ;; list of contributors.
> 
> (define-module (ports www palemoon palemoon)
>   #:use-module ((srfi srfi-1) #:hide (zip))
>   #:use-module (gnu packages)
>   #:use-module ((guix licenses) #:prefix license:)
>   #:use-module (guix packages)
>   #:use-module (guix download)
>   #:use-module (guix build-system gnu)
>   #:use-module (gnu packages autotools)
>   #:use-module (gnu packages admin)
>   #:use-module (gnu packages base)
>   #:use-module (gnu packages databases)
>   #:use-module (gnu packages glib)
>   #:use-module (gnu packages gstreamer)
>   #:use-module (gnu packages gtk)
>   #:use-module (gnu packages gnome)
>   #:use-module (gnu packages gnuzilla)
>   #:use-module (gnu packages libcanberra)
>   #:use-module (gnu packages cups)
>   #:use-module (gnu packages kerberos)
>   #:use-module (gnu packages m4)
>   #:use-module (gnu packages linux)
>   #:use-module (gnu packages perl)
>   #:use-module (gnu packages pkg-config)
>   #:use-module (gnu packages compression)
>   #:use-module (gnu packages fontutils)
>   #:use-module (gnu packages libevent)
>   #:use-module (gnu packages libreoffice)  ;for hunspell
>   #:use-module (gnu packages image)
>   #:use-module (gnu packages libffi)
>   #:use-module (gnu packages pulseaudio)
>   #:use-module (gnu packages python)
>   #:use-module (gnu packages shells)
>   #:use-module (gnu packages tls)
>   #:use-module (gnu packages xorg)
>   #:use-module (gnu packages gl)
>   #:use-module (gnu packages assembly)
>   #:use-module (gnu packages icu4c)
>   #:use-module (gnu packages video)
>   #:use-module (gnu packages xdisorg)
>   #:use-module (gnu packages xorg)
>   #:use-module (gnu packages bash))
> 
> (define-public newmoon
>   (package
>     (name "newmoon")
>     (version "28.0.1")
>     (source
>      (origin
>        (method url-fetch)
>        (uri (string-append "https://github.com/MoonchildProductions/"
>                            "UXP/archive/" version "_Release.tar.gz"))
>        ;; https://github.com/MoonchildProductions/UXP/archive/PM28.0.1_Release.tar.gz
>        (file-name (string-append name "-" version ".tar.gz"))
>        (sha256
>         (base32
>          "0xfkbxa8618zb379m3aaycmbz0lj1s5f2mlwgykp8d5qyvd35bdj"))))
>     (build-system gnu-build-system)
>     (inputs
>      `(("alsa-lib" ,alsa-lib)
>        ("mit-krb5" ,mit-krb5)
>        ("bzip2" ,bzip2)
>        ("cairo" ,cairo)
>        ("cups" ,cups)
>        ("libgnome" ,libgnome)
>        ("libcanberra" ,libcanberra)
>        ("dbus-glib" ,dbus-glib)
>        ("dbus" ,dbus)
>        ("glib" ,glib)
>        ("gstreamer" ,gstreamer)
>        ("gst-plugins-base" ,gst-plugins-base)
>        ("gtk+-2" ,gtk+-2)
>        ("gobject-introspection" ,gobject-introspection)
>        ("freetype" ,freetype)
>        ("hunspell" ,hunspell)
>        ("libxt" ,libxt)
>        ("libffi" ,libffi)
>        ("libvpx" ,libvpx)
>        ("libxt" ,libxt)
>        ("libxcomposite" ,libxcomposite)
>        ("libidl" ,libidl)
>        ("libwebp" ,libwebp)
>        ("libpng-apng" ,libpng-apng)
>        ("libjpeg-turbo" ,libjpeg-turbo)
>        ("libxscrnsaver" ,libxscrnsaver)
>        ("libx11" ,libx11)
>        ("libxext" ,libxext)
>        ("libxft" ,libxft)
>        ("libxi" ,libxi)
>        ("libxrender" ,libxrender)
>        ("xextproto" ,xextproto)
>        ("libevent" ,libevent)
>        ("libnotify" ,libnotify)
>        ("mesa" ,mesa)
>        ;; ("mozjs" ,mozjs)
>        ("nspr" ,nspr)
>        ;; ("nss" ,nss)
>        ;; ("openssl" ,openssl)
>        ("python-2" ,python-2)
>        ("python-ply" ,python-ply)
>        ("pixman" ,pixman)
>        ("pulseaudio" ,pulseaudio)
>        ("startup-notification" ,startup-notification)
>        ("sqlite" ,sqlite)
>        ("tcsh" ,tcsh)
>        ("unzip" ,unzip)
>        ("yasm" ,yasm)
>        ("zip" ,zip)
>        ("zlib" ,zlib)
>        ("inetutils" ,inetutils))) ; Native-input?
>     (native-inputs
>      `(("autoconf-2.13" ,autoconf-2.13)
>        ("fontconfig" ,fontconfig)
>        ("perl" ,perl)
>        ("pkg-config" ,pkg-config)
>        ("m4" ,m4)
>        ("which" ,which)
>        ("bash" ,bash)))
>     (arguments
>      `(#:modules ((ice-9 ftw)
>                   (ice-9 rdelim)
>                   (ice-9 match)
>                   ,@%gnu-build-system-modules)
>        ;; #:validate-runpath? #f
>        #:phases
>        (modify-phases %standard-phases
>          (replace 'configure
>            ;; According to <https://forum.palemoon.org/viewtopic.php?f=19&t=4166>
>            ;; the only way to set configure options is in the .mozconfig file
>            ;; (or the file set by variable MOZCONFIG).  If you try to use
>            ;; our configure-flags, the configuration will break in unexpected
>            ;; ways.  This includes breaking the mach build system detection
>            ;; of --host, --build, and --arch, and carrying flags recursively
>            ;; on to parts used later in the build system.
>            ;; The palemoon.org link describes an MS Windows build, but at
>            ;; least for Gentoo it is done comparable:
>            ;; <https://data.gpo.zugaina.org/palemoon/>.
>            (lambda* (#:key outputs configure-flags #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (bash (which "bash"))
>                     (abs-srcdir (getcwd))
>                     (srcdir (string-append "../" (basename abs-srcdir)))
>                     (flags `(,(string-append "--prefix=" out)
>                              ,@configure-flags))
>                     (mozconfig (string-append (getcwd) "/.mozconfig")))
>                (setenv "SHELL" bash)
>                (setenv "AUTOCONF"
>                        (string-append (assoc-ref %build-inputs
>                                                  "autoconf-2.13")
>                                       "/bin/autoconf"))
>                (setenv "BUILD_OBJ_DIR" (string-append (getcwd) "/o"))
>                (setenv "CONFIG_SHELL" bash)
>                (setenv "QA_CONFIGURE_OPTIONS" ".*")
>                (setenv "MOZBUILD_STATE_PATH"
>                        (string-append (getcwd) "/mach_state"))
>                (setenv "MOZCONFIG"
>                        (string-append (getcwd) "/.mozconfig"))
>                (setenv "MOZ_NOSPAM" "1")
>                (mkdir-p (string-append (getcwd) "/builddir"))
>                (with-output-to-file mozconfig
>                  (lambda ()
>                    (display
>                     (string-append
>                      "ac_add_options --enable-application=browser\n"
>                      "mk_add_options MOZ_OBJDIR=" (getenv "BUILD_OBJ_DIR") "\n" ;new
>                      "ac_add_options --prefix=" out "\n"
>                      "ac_add_options --disable-debug\n"
>                      "ac_add_options --disable-debug-symbols\n"
>                      "ac_add_options --disable-accessibility\n" ;There is no such option?
>                      "ac_add_options --disable-updater\n"
>                      "ac_add_options --disable-installer\n"
>                      "ac_add_options --disable-parental-controls\n" ;Yes? No?
>                      "ac_add_options --disable-install-strip"
>                      "ac_add_options --disable-tests\n"
>                      "ac_add_options --with-system-ply\n"
>                      "ac_add_options --with-system-libevent\n"
>                      "ac_add_options --with-system-zlib\n"
>                      "ac_add_options --with-system-bz2\n"
>                      "ac_add_options --with-system-webp\n"
>                      "ac_add_options --with-system-libvpx\n"
>                      "ac_add_options --enable-system-hunspell\n"
>                      "ac_add_options --enable-system-ffi\n"
>                      "ac_add_options --enable-system-sqlite\n" ;Needs >= sqlite-3.21.0
>                      "ac_add_options --enable-system-cairo\n"
>                      "ac_add_options --enable-system-pixman\n"
>                      "ac_add_options --enable-shared-js\n"
>                      "ac_add_options --disable-valgrind\n"
>                      "ac_add_options --with-pthreads\n"
>                      "ac_add_options --disable-optimize\n"
>                      "ac_add_options --enable-gstreamer\n"
>                      "ac_add_options --enable-default-toolkit=\"cairo-gtk2\"\n"
>                      "ac_add_options --disable-alsa\n"
>                      "ac_add_options --enable-strip\n"
>                      "ac_add_options --disable-codesighs\n"
>                      "ac_add_options --disable-gamepad\n"
>                      "ac_add_options --disable-logging\n"
>                      "ac_add_options --disable-websms-backend\n"
>                      "ac_add_options --enable-chrome-format=omni\n"
>                      "ac_add_options --enable-startup-notification\n"
>                      "ac_add_options --enable-shared-js\n"
>                      "ac_add_options --enable-devtools\n"
>                      ;; XXX!
>                      "ac_add_options --with-system-png\n"
>                      "ac_add_options --enable-pulseaudio\n"
>                      "ac_add_options --disable-necko-wifi\n"
>                      "ac_add_options --with-system-jpeg\n"
>                      "ac_add_options --disable-official-branding\n" ; Trademarks apply for official branding
>                      "mk_add_options PYTHON=\"python2\"\n"
>                      "mk_add_options AUTOCONF=\"autoconf\"\n"
>                      "ac_add_options --with-system-nspr\n"
>                      "ac_add_options --enable-sandbox\n"
>                      "ac_add_options --enable-content-sandbox\n"
>                      "ac_add_options --enable-skia\n"
>                      "ac_add_options --enable-jemalloc\n"
>                      "ac_add_options --with-system-icu\n"
>                      "ac_add_options --with-intl-api\n"))))
>                (display "mach configure, this is expected to \"crash\"")
>                (zero? (system* "./mach" "configure"))
>                (display "mach, and another round.")
>                (zero? (system* "./mach")))))
>          (add-after 'patch-source-shebangs 'setenvs
>            (lambda _
>              (substitute* (list "build/autoconf/config.guess"
>                                 "client.mk"
>                                 "js/src/configure.in"
>                                 "intl/icu/source/configure")
>                (("/bin/sh") (which "sh")))
>              #t))
>          (add-before 'build 'patch-clientmk
>            (lambda _
>              (substitute* "client.mk"
>                (("/bin/sh") (which "sh")))
>              #t))
>          (replace 'build
>            (lambda _
>              (chdir "build")
>              (display "mach build, the real build now")
>              (system* "../mach" "build")
>              #t))
>          (add-after
>              'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
>            (lambda _
>              ;; libxul.so dynamically opens libraries, so here we explicitly
>              ;; link them into libxul.so instead.
>              ;;
>              ;; TODO: It might be preferable to patch in absolute file names in
>              ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
>              ;; work.  More investigation is needed.
>              (substitute* "toolkit/library/moz.build"
>                (("^# This needs to be last")
>                 "OS_LIBS += [
>     'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
>     'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0', 'png' ]\n\n"))
>              #t))
>          (add-after 'unpack 'privacy-patch-branding
>            (lambda _
>              (substitute* "browser/branding/unofficial/pref/palemoon-branding.js"
>                (("http://www.palemoon.org/unofficial.shtml")
>                 "https://gnu.org/s/guix"))
>              (substitute* "browser/branding/shared/pref/preferences.inc"
>                (("http://www.palemoon.org/firstrun.shtml")
>                 "https://gnu.org"))
>              (substitute* "browser/branding/shared/locales/browserconfig.properties"
>                (("http://start.palemoon.org/")
>                 "https://gnu.org/s/guix"))
>              #t))
>          (replace 'install
>            (lambda* (#:key name outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (bin (string-append out "/bin"))
>                     (lib (string-append out "/lib"))
>                     (palemoon (string-append
>                                out "/lib/palemoon/palemoon"))
>                     ;; Use one objectdirectory for all architectures.
>                     (objdir "o")
>                     ;; (prefsfile (string-append objdir "/dist/bin/browser"
>                     ;;                           "/defaults/profile"
>                     ;;                           "/prefs.js"))
>                     (tarfile (string-append objdir "/dist/palemoon-"
>                                             ,version ".linux-x86_64"
>                                             ".tar.bz2")))
>                ;; We skip this for now.
>                ;;                (substitute* prefsfile
>                ;;                  (("# Mozilla User Preferences")
>                ;;                   "# Mozilla User Preferences\n
>                ;; pref(\"app.update.enabled\", false);\n
>                ;; pref(\"browser.backspace_action\", 0);\n
>                ;; pref(\"browser.ctrlTab.previews\", false);\n
>                ;; pref(\"intl.locale.matchOS\", true);\n
>                ;; pref(\"general.useragent.locale\", \"chrome://global/locale/intl.properties\");\n
>                ;; pref(\"browser.display.use_system_colors\", true);"))
>                ;; Create the package, unpack it, manually install
>                ;; the files from there to not miss anything.
>                (zero? (system* "../mach" "package"))
>                (display (getcwd))
>                (chdir (string-append "../" objdir "/dist"))
>                (zero? (system* "tar" "xjpf"
>                                "palemoon-" ,version ".linux-x86_64.tar.bz2"))
>                (mkdir-p (string-append out "/lib/palemoon"))
>                (copy-recursively "palemoon"
>                                  (string-append out "/lib/palemoon"))
>                (mkdir-p bin)
>                (symlink (string-append out "/lib/palemoon/palemoon")
>                         (string-append bin "/newmoon"))
>                ;; Avoid duplicate binaries.
>                ;; https://bugzilla.mozilla.org/show_bug.cgi?id=658850 for
>                (delete-file (string-append out "/lib/palemoon/palemoon-bin")))))
>          ;; swap check and install phases and set paths to installed binaries
>          (add-before 'check 'set-path-for-check
>            (lambda* (#:key outputs #:allow-other-keys)
>              (let ((out (assoc-ref outputs "out")))
>                (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
>              #t))
>          (add-after 'install 'check
>            ;;(assoc-ref %standard-phases 'check))
>            (lambda* (#:key outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (bin (string-append out "/bin/newmoon")))
>                (invoke bin "--version"))))
>          (delete 'check)
>          (delete 'bootstrap)
>          ;; (replace 'check
>          ;;   (lambda* (#:key outputs #:allow-other-keys)
>          ;;     (let* ((out (assoc-ref outputs "out"))
>          ;;            (bin (string-append out "/bin/newmoon")))
>          ;;       (invoke bin "--version"))))
>          (add-after 'install 'install-icons
>            (lambda* (#:key outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out")))
>                (display (getcwd))
>                (with-directory-excursion "../../browser/branding/unofficial"
>                  (for-each
>                   (lambda (file)
>                     (let* ((size (string-filter char-numeric? file))
>                            (icons (string-append out "/share/icons/hicolor/"
>                                                  size "x" size "/apps")))
>                       (mkdir-p icons)
>                       (copy-file file (string-append icons "/newmoon.png"))))
>                   '("default16.png" "default32.png" "default48.png"
>                     "mozicon128.png"))))))
>          (add-after 'install 'install-desktop-file
>            (lambda* (#:key outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (apps (string-append out "/share/applications")))
>                (display (getcwd))
>                (with-directory-excursion "../../browser/branding/official"
>                  (substitute* "palemoon.desktop"
>                    (("Pale Moon")
>                     "New Moon")
>                    (("Exec=palemoon -new-tab https://start.palemoon.org")
>                     "Exec=newmoon -new-tab https://gnu.org/s/guix")
>                    (("Exec=palemoon -new-window")
>                     "Exec=newmoon -new-window")
>                    (("Exec=palemoon -private-window")
>                     "Exec=newmoon -private-window")
>                    (("palemoon")
>                     "newmoon"))
>                  (install-file "palemoon.desktop"
>                                (string-append apps
>                                               "/newmoon.desktop")))))))))
> 
>     (home-page "https://www.palemoon.org/")
>     (synopsis "Web Browser compiled from Pale Moon sources")
>     (description
>      "New Moon is a web browser compiled from Pale Moon sourcecode.  New Moon
> is an independent browser derived from Firefox.  Among its features are:
> Replaces the Gecko layout engine with the Goanna fork Uses the pre-Australis
> Firefox user interface Continues add-on support for XUL, XPCOM, and NPAPI
> plugins[9] Supports extensions and themes exclusive to Pale Moon, such as
> Adblock Latitude[ Defaults to a customizable start page in cooperation with
> start.me Defaults to DuckDuckGo as the search engine instead of Google or
> Yahoo!  Uses the IP-API service instead of Google's for geolocation Fully
> customizable user interface
> 
> NOTE: Please note that in this work-in-progress version it points to the start
> page which promotes some services and needs cookies, and has some other
> issues.  IMPORTANT: This version is based on the old Pale Moon codebase which
> is in maintenance mode, but continues to receive security patches and
> updates.")
>     (properties '((upstream-name . "Pale-Moon")))
>     ;; The exception clause of the Palemoon license states that
>     ;; New Moon builds can be redistributed freely.
>     (license (list license:mpl2.0 ;and others, see toolkit/content/license.html
>                    license:gpl2+
>                    license:lgpl2.1))))
> 
> (define-public newmoon
>   (package
>     (name "newmoon")
>     (version "27.9.4")
>     (source
>      (origin
>        (method url-fetch)
>        (uri (string-append "https://github.com/MoonchildProductions/"
>                            "Pale-Moon/archive/" version "_Release.tar.gz"))
>        (file-name (string-append name "-" version ".tar.gz"))
>        (sha256
>         (base32
>          "0xfkbxa8618zb379m3aaycmbz0lj1s5f2mlwgykp8d5qyvd35bdj"))))
>     (build-system gnu-build-system)
>     (inputs
>      `(("alsa-lib" ,alsa-lib)
>        ("mit-krb5" ,mit-krb5)
>        ("bzip2" ,bzip2)
>        ("cairo" ,cairo)
>        ("cups" ,cups)
>        ("libgnome" ,libgnome)
>        ("libcanberra" ,libcanberra)
>        ("dbus-glib" ,dbus-glib)
>        ("dbus" ,dbus)
>        ("glib" ,glib)
>        ("gstreamer" ,gstreamer)
>        ("gst-plugins-base" ,gst-plugins-base)
>        ("gtk+-2" ,gtk+-2)
>        ("gobject-introspection" ,gobject-introspection)
>        ("freetype" ,freetype)
>        ("hunspell" ,hunspell)
>        ("libxt" ,libxt)
>        ("libffi" ,libffi)
>        ("libvpx" ,libvpx)
>        ("libxt" ,libxt)
>        ("libxcomposite" ,libxcomposite)
>        ("libidl" ,libidl)
>        ("libwebp" ,libwebp)
>        ("libpng-apng" ,libpng-apng)
>        ("libjpeg-turbo" ,libjpeg-turbo)
>        ("libxscrnsaver" ,libxscrnsaver)
>        ("libx11" ,libx11)
>        ("libxext" ,libxext)
>        ("libxft" ,libxft)
>        ("libxi" ,libxi)
>        ("libxrender" ,libxrender)
>        ("xextproto" ,xextproto)
>        ("libevent" ,libevent)
>        ("libnotify" ,libnotify)
>        ("mesa" ,mesa)
>        ;; ("mozjs" ,mozjs)
>        ("nspr" ,nspr)
>        ;; ("nss" ,nss)
>        ;; ("openssl" ,openssl)
>        ("python-2" ,python-2)
>        ("python-ply" ,python-ply)
>        ("pixman" ,pixman)
>        ("pulseaudio" ,pulseaudio)
>        ("startup-notification" ,startup-notification)
>        ("sqlite" ,sqlite)
>        ("tcsh" ,tcsh)
>        ("unzip" ,unzip)
>        ("yasm" ,yasm)
>        ("zip" ,zip)
>        ("zlib" ,zlib)
>        ("inetutils" ,inetutils))) ; Native-input?
>     (native-inputs
>      `(("autoconf-2.13" ,autoconf-2.13)
>        ("fontconfig" ,fontconfig)
>        ("perl" ,perl)
>        ("pkg-config" ,pkg-config)
>        ("m4" ,m4)
>        ("which" ,which)
>        ("bash" ,bash)))
>     ;; Only processors with SSE2 are supported.
>     (supported-systems '("x86_64-linux" "i686-linux"))
>     (arguments
>      `(#:modules ((ice-9 ftw)
>                   (ice-9 rdelim)
>                   (ice-9 match)
>                   ,@%gnu-build-system-modules)
>        ;; We encounter runpath issues, looks harmless in practice.
>        ;; But nevertheless: FIXME!!!!!!
>        #:validate-runpath? #f
>        #:phases
>        (modify-phases %standard-phases
>          (replace 'configure
>            ;; According to <https://forum.palemoon.org/viewtopic.php?f=19&t=4166>
>            ;; the only way to set configure options is in the .mozconfig file
>            ;; (or the file set by variable MOZCONFIG).  If you try to use
>            ;; our configure-flags, the configuration will break in unexpected
>            ;; ways.  This includes breaking the mach build system detection
>            ;; of --host, --build, and --arch, and carrying flags recursively
>            ;; on to parts used later in the build system.
>            ;; The palemoon.org link describes an MS Windows build, but at
>            ;; least for Gentoo it is done comparable:
>            ;; <https://data.gpo.zugaina.org/palemoon/>.
>            (lambda* (#:key outputs configure-flags #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (bash (which "bash"))
>                     (abs-srcdir (getcwd))
>                     (srcdir (string-append "../" (basename abs-srcdir)))
>                     (flags `(,(string-append "--prefix=" out)
>                              ,@configure-flags))
>                     (mozconfig (string-append (getcwd) "/.mozconfig")))
>                (setenv "SHELL" bash)
>                (setenv "AUTOCONF"
>                        (string-append (assoc-ref %build-inputs
>                                                  "autoconf-2.13")
>                                       "/bin/autoconf"))
>                (setenv "BUILD_OBJ_DIR" (string-append (getcwd) "/o"))
>                (setenv "CONFIG_SHELL" bash)
>                (setenv "QA_CONFIGURE_OPTIONS" ".*")
>                (setenv "MOZBUILD_STATE_PATH"
>                        (string-append (getcwd) "/mach_state"))
>                (setenv "MOZCONFIG"
>                        (string-append (getcwd) "/.mozconfig"))
>                (setenv "MOZ_NOSPAM" "1")
>                (mkdir-p (string-append (getcwd) "/builddir"))
>                (with-output-to-file mozconfig
>                  (lambda ()
>                    (display
>                     (string-append
>                      "ac_add_options --enable-application=browser\n"
>                      "mk_add_options MOZ_OBJDIR=" (getenv "BUILD_OBJ_DIR") "\n" ;new
>                      "ac_add_options --prefix=" out "\n"
>                      "ac_add_options --disable-debug\n"
>                      "ac_add_options --disable-debug-symbols\n"
>                      "ac_add_options --disable-accessibility\n" ;There is no such option?
>                      "ac_add_options --disable-updater\n"
>                      "ac_add_options --disable-installer\n"
>                      "ac_add_options --disable-parental-controls\n" ;Yes? No?
>                      "ac_add_options --disable-install-strip"
>                      "ac_add_options --disable-tests\n"
>                      "ac_add_options --with-system-ply\n"
>                      "ac_add_options --with-system-libevent\n"
>                      "ac_add_options --with-system-zlib\n"
>                      "ac_add_options --with-system-bz2\n"
>                      "ac_add_options --with-system-webp\n"
>                      "ac_add_options --with-system-libvpx\n"
>                      "ac_add_options --enable-system-hunspell\n"
>                      "ac_add_options --enable-system-ffi\n"
>                      "ac_add_options --enable-system-sqlite\n" ;Needs >= sqlite-3.21.0
>                      "ac_add_options --enable-system-cairo\n"
>                      "ac_add_options --enable-system-pixman\n"
>                      "ac_add_options --enable-shared-js\n"
>                      "ac_add_options --disable-valgrind\n"
>                      "ac_add_options --with-pthreads\n"
>                      "ac_add_options --disable-optimize\n"
>                      "ac_add_options --enable-gstreamer\n"
>                      "ac_add_options --enable-default-toolkit=\"cairo-gtk2\"\n"
>                      "ac_add_options --disable-alsa\n"
>                      "ac_add_options --enable-strip\n"
>                      "ac_add_options --disable-codesighs\n"
>                      "ac_add_options --disable-gamepad\n"
>                      "ac_add_options --disable-logging\n"
>                      "ac_add_options --disable-websms-backend\n"
>                      "ac_add_options --enable-chrome-format=omni\n"
>                      "ac_add_options --enable-startup-notification\n"
>                      "ac_add_options --enable-shared-js\n"
>                      "ac_add_options --enable-devtools\n"
>                      ;; XXX!
>                      "ac_add_options --with-system-png\n"
>                      "ac_add_options --enable-pulseaudio\n"
>                      "ac_add_options --disable-necko-wifi\n"
>                      "ac_add_options --with-system-jpeg\n"
>                      "ac_add_options --disable-official-branding\n" ; Trademarks apply for official branding
>                      "mk_add_options PYTHON=\"python2\"\n"
>                      "mk_add_options AUTOCONF=\"autoconf\"\n"
>                      "ac_add_options --with-system-nspr\n"
>                      "ac_add_options --enable-sandbox\n"
>                      "ac_add_options --enable-content-sandbox\n"
>                      "ac_add_options --enable-skia\n"
>                      "ac_add_options --enable-jemalloc\n"
>                      "ac_add_options --with-system-icu\n"
>                      "ac_add_options --with-intl-api\n"))))
>                (display "mach configure, this is expected to \"crash\"")
>                (zero? (system* "./mach" "configure"))
>                (display "mach, and another round.")
>                (zero? (system* "./mach")))))
>          (add-after 'patch-source-shebangs 'setenvs
>            (lambda _
>              (substitute* (list "build/autoconf/config.guess"
>                                 "client.mk"
>                                 "js/src/configure.in"
>                                 "intl/icu/source/configure")
>                (("/bin/sh") (which "sh")))
>              #t))
>          (add-before 'build 'patch-clientmk
>            (lambda _
>              (substitute* "client.mk"
>                (("/bin/sh") (which "sh")))
>              #t))
>          (replace 'build
>            (lambda _
>              (chdir "build")
>              (display "mach build, the real build now")
>              (system* "../mach" "build")
>              #t))
>          (add-after
>              'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
>            (lambda _
>              ;; libxul.so dynamically opens libraries, so here we explicitly
>              ;; link them into libxul.so instead.
>              ;;
>              ;; TODO: It might be preferable to patch in absolute file names in
>              ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
>              ;; work.  More investigation is needed.
>              (substitute* "toolkit/library/moz.build"
>                (("^# This needs to be last")
>                 "OS_LIBS += [
>     'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
>     'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0', 'png' ]\n\n"))
>              #t))
>          (add-after 'unpack 'privacy-patch-branding
>            (lambda _
>              (substitute* "browser/branding/unofficial/pref/palemoon-branding.js"
>                (("http://www.palemoon.org/unofficial.shtml")
>                 "https://gnu.org/s/guix"))
>              (substitute* "browser/branding/shared/pref/preferences.inc"
>                (("http://www.palemoon.org/firstrun.shtml")
>                 "https://gnu.org"))
>              (substitute* "browser/branding/shared/locales/browserconfig.properties"
>                (("http://start.palemoon.org/")
>                 "https://gnu.org/s/guix"))
>              #t))
>          (add-after 'unpack 'add-vendor-options
>            (lambda _
>              (substitute* "browser/branding/unofficial/pref/palemoon-branding.js"
>                (("pref(\"app.update.url\", \"\")")
>                 "pref(\"app.update.url\", \"\");\n
>                 pref(\"browser.backspace_action\", 0);\n
>                 pref(\"browser.ctrlTab.previews\", false);\n
>                 pref(\"intl.locale.matchOS\", true);\n
>                 pref(\"extensions.blocklist.enabled\", false);\n
>                 pref(\"geo.enabled\", false);\n
>                 pref(\"services.sync.prefs.sync.security.OCSP.enabled\", false);\n
>                 pref(\"security.OCSP.GET.enabled\", false);\n
>                 pref(\"security.OCSP.require\", false);\n
>                 pref(\"general.useragent.locale\", \"chrome://global/locale/intl.properties\");\n
>                 pref(\"browser.display.use_system_colors\", true);"))
>              #t))
>          (replace 'install
>            (lambda* (#:key name outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (bin (string-append out "/bin"))
>                     (lib (string-append out "/lib"))
>                     (palemoon (string-append
>                                out "/lib/palemoon/palemoon"))
>                     ;; Use one objectdirectory for all architectures.
>                     (objdir "o")
>                     ;; (prefsfile (string-append objdir "/dist/bin/browser"
>                     ;;                            "/defaults/preferences/"
>                     ;;                            "/palemoon-branding.js"))
>                     (tarfile (string-append objdir "/dist/palemoon-"
>                                             ,version ".linux-x86_64"
>                                             ".tar.bz2")))
>                ;; Create the package, unpack it, manually install
>                ;; the files from there to not miss anything.
>                (zero? (system* "../mach" "package"))
>                (display (getcwd))
>                (chdir (string-append "../" objdir "/dist"))
>                (zero? (system* "tar" "xjpf"
>                                "palemoon-" ,version ".linux-x86_64.tar.bz2"))
>                (mkdir-p (string-append out "/lib/palemoon"))
>                (copy-recursively "palemoon"
>                                  (string-append out "/lib/palemoon"))
>                (mkdir-p bin)
>                (symlink (string-append out "/lib/palemoon/palemoon")
>                         (string-append bin "/newmoon"))
>                ;; Avoid duplicate binaries.
>                ;; https://bugzilla.mozilla.org/show_bug.cgi?id=658850 for
>                (delete-file (string-append out "/lib/palemoon/palemoon-bin")))))
>          ;; swap check and install phases and set paths to installed binaries
>          (add-before 'check 'set-path-for-check
>            (lambda* (#:key outputs #:allow-other-keys)
>              (let ((out (assoc-ref outputs "out")))
>                (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))
>              #t))
>          (add-after 'install 'check
>            ;;(assoc-ref %standard-phases 'check))
>            (lambda* (#:key outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (bin (string-append out "/bin/newmoon")))
>                (invoke bin "--version"))))
>          (delete 'check)
>          (delete 'bootstrap)
>          ;; (replace 'check
>          ;;   (lambda* (#:key outputs #:allow-other-keys)
>          ;;     (let* ((out (assoc-ref outputs "out"))
>          ;;            (bin (string-append out "/bin/newmoon")))
>          ;;       (invoke bin "--version"))))
>          (add-after 'install 'install-icons
>            (lambda* (#:key outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out")))
>                (display (getcwd))
>                (with-directory-excursion "../../browser/branding/unofficial"
>                  (for-each
>                   (lambda (file)
>                     (let* ((size (string-filter char-numeric? file))
>                            (icons (string-append out "/share/icons/hicolor/"
>                                                  size "x" size "/apps")))
>                       (mkdir-p icons)
>                       (copy-file file (string-append icons "/newmoon.png"))))
>                   '("default16.png" "default32.png" "default48.png"
>                     "mozicon128.png"))))))
>          (add-after 'install 'install-desktop-file
>            (lambda* (#:key outputs #:allow-other-keys)
>              (let* ((out (assoc-ref outputs "out"))
>                     (apps (string-append out "/share/applications")))
>                (display (getcwd))
>                (with-directory-excursion "../../browser/branding/official"
>                  (substitute* "palemoon.desktop"
>                    (("Pale Moon")
>                     "New Moon")
>                    (("Exec=palemoon -new-tab https://start.palemoon.org")
>                     "Exec=newmoon -new-tab https://gnu.org/s/guix")
>                    (("Exec=palemoon -new-window")
>                     "Exec=newmoon -new-window")
>                    (("Exec=palemoon -private-window")
>                     "Exec=newmoon -private-window")
>                    (("palemoon")
>                     "newmoon"))
>                  (install-file "palemoon.desktop"
>                                (string-append apps
>                                               "/newmoon.desktop")))))))))
> 
>     (home-page "https://www.palemoon.org/")
>     (synopsis "Web Browser compiled from Pale Moon sources")
>     (description
>      "New Moon is a web browser compiled from Pale Moon sourcecode.  New Moon
> is an independent browser derived from Firefox.  Among its features are:
> Replaces the Gecko layout engine with the Goanna fork Uses the pre-Australis
> Firefox user interface Continues add-on support for XUL, XPCOM, and NPAPI
> plugins[9] Supports extensions and themes exclusive to Pale Moon, such as
> Adblock Latitude[ Defaults to a customizable start page in cooperation with
> start.me Defaults to DuckDuckGo as the search engine instead of Google or
> Yahoo!  Uses the IP-API service instead of Google's for geolocation Fully
> customizable user interface
> 
> NOTE: Please note that in this work-in-progress version it points to the start
> page which promotes some services and needs cookies, and has some other
> issues.  IMPORTANT: This version is based on the old Pale Moon codebase which
> is in maintenance mode, but continues to receive security patches and
> updates.")
>     (properties '((upstream-name . "Pale-Moon")))
>     ;; The exception clause of the Palemoon license states that
>     ;; New Moon builds can be redistributed freely.
>     (license (list license:mpl2.0 ;and others, see toolkit/content/license.html
>                    license:gpl2+
>                    license:lgpl2.1))))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-07  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 20:04 Help needed with newmoon swedebugia
2019-03-06 20:59 ` Leo Famulari
2019-03-07  7:07 ` ng0

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.