gnu: icecat: Modernize package definition.
* gnu/packages/gnuzilla.scm (icecat)[inputs, native-inputs]: Use new style. [configure-flags, phases]: Use gexps.
This commit is contained in:
		
							parent
							
								
									a3605b59c6
								
							
						
					
					
						commit
						7aa0e310fa
					
				
					 1 changed files with 367 additions and 381 deletions
				
			
		| 
						 | 
				
			
			@ -904,93 +904,94 @@ in C/C++.")
 | 
			
		|||
    (source icecat-source)
 | 
			
		||||
    (build-system gnu-build-system)
 | 
			
		||||
    (inputs
 | 
			
		||||
     `(("alsa-lib" ,alsa-lib)
 | 
			
		||||
       ("bzip2" ,bzip2)
 | 
			
		||||
       ("cups" ,cups)
 | 
			
		||||
       ("dbus-glib" ,dbus-glib)
 | 
			
		||||
       ("gdk-pixbuf" ,gdk-pixbuf)
 | 
			
		||||
       ("glib" ,glib)
 | 
			
		||||
       ("gtk+" ,gtk+)
 | 
			
		||||
       ("gtk+-2" ,gtk+-2)
 | 
			
		||||
       ;; UNBUNDLE-ME! ("graphite2" ,graphite2)
 | 
			
		||||
       ("cairo" ,cairo)
 | 
			
		||||
       ("pango" ,pango)
 | 
			
		||||
       ("freetype" ,freetype)
 | 
			
		||||
       ("font-dejavu" ,font-dejavu)
 | 
			
		||||
       ;; UNBUNDLE-ME! ("harfbuzz" ,harfbuzz)
 | 
			
		||||
       ("libcanberra" ,libcanberra)
 | 
			
		||||
       ("libgnome" ,libgnome)
 | 
			
		||||
       ("libjpeg-turbo" ,libjpeg-turbo)
 | 
			
		||||
       ("libpng-apng" ,libpng-apng)
 | 
			
		||||
       ;; UNBUNDLE-ME! ("libogg" ,libogg)
 | 
			
		||||
       ;; UNBUNDLE-ME! ("libtheora" ,libtheora) ; wants theora-1.2, not yet released
 | 
			
		||||
       ;; UNBUNDLE-ME! ("libvorbis" ,libvorbis)
 | 
			
		||||
       ("libxft" ,libxft)
 | 
			
		||||
       ("libevent" ,libevent)
 | 
			
		||||
       ("libxinerama" ,libxinerama)
 | 
			
		||||
       ("libxscrnsaver" ,libxscrnsaver)
 | 
			
		||||
       ("libxcomposite" ,libxcomposite)
 | 
			
		||||
       ("libxt" ,libxt)
 | 
			
		||||
       ("libffi" ,libffi)
 | 
			
		||||
       ("ffmpeg" ,ffmpeg)
 | 
			
		||||
       ("libvpx" ,libvpx)
 | 
			
		||||
       ("icu4c" ,icu4c)
 | 
			
		||||
       ("pixman" ,pixman)
 | 
			
		||||
       ("pulseaudio" ,pulseaudio)
 | 
			
		||||
       ("mesa" ,mesa)
 | 
			
		||||
       ("pciutils" ,pciutils)
 | 
			
		||||
       ("mit-krb5" ,mit-krb5)
 | 
			
		||||
       ("hunspell" ,hunspell)
 | 
			
		||||
       ("libnotify" ,libnotify)
 | 
			
		||||
     (list alsa-lib
 | 
			
		||||
           bzip2
 | 
			
		||||
           cups
 | 
			
		||||
           dbus-glib
 | 
			
		||||
           gdk-pixbuf
 | 
			
		||||
           glib
 | 
			
		||||
           gtk+
 | 
			
		||||
           gtk+-2
 | 
			
		||||
           ;; UNBUNDLE-ME! graphite2
 | 
			
		||||
           cairo
 | 
			
		||||
           pango
 | 
			
		||||
           freetype
 | 
			
		||||
           font-dejavu
 | 
			
		||||
           ;; UNBUNDLE-ME! harfbuzz
 | 
			
		||||
           libcanberra
 | 
			
		||||
           libgnome
 | 
			
		||||
           libjpeg-turbo
 | 
			
		||||
           libpng-apng
 | 
			
		||||
           ;; UNBUNDLE-ME! libogg
 | 
			
		||||
           ;; UNBUNDLE-ME! libtheora ; wants theora-1.2, not yet released
 | 
			
		||||
           ;; UNBUNDLE-ME! libvorbis
 | 
			
		||||
           libxft
 | 
			
		||||
           libevent
 | 
			
		||||
           libxinerama
 | 
			
		||||
           libxscrnsaver
 | 
			
		||||
           libxcomposite
 | 
			
		||||
           libxt
 | 
			
		||||
           libffi
 | 
			
		||||
           ffmpeg
 | 
			
		||||
           libvpx
 | 
			
		||||
           icu4c
 | 
			
		||||
           pixman
 | 
			
		||||
           pulseaudio
 | 
			
		||||
           mesa
 | 
			
		||||
           pciutils
 | 
			
		||||
           mit-krb5
 | 
			
		||||
           hunspell
 | 
			
		||||
           libnotify
 | 
			
		||||
           ;; See <https://bugs.gnu.org/32833>
 | 
			
		||||
           ;;   and related comments in the 'remove-bundled-libraries' phase.
 | 
			
		||||
       ;; UNBUNDLE-ME! ("nspr" ,nspr)
 | 
			
		||||
       ;; UNBUNDLE-ME! ("nss" ,nss)
 | 
			
		||||
       ("shared-mime-info" ,shared-mime-info)
 | 
			
		||||
       ("sqlite" ,sqlite)
 | 
			
		||||
       ("eudev" ,eudev)
 | 
			
		||||
       ("unzip" ,unzip)
 | 
			
		||||
       ("zip" ,zip)
 | 
			
		||||
       ("zlib" ,zlib)))
 | 
			
		||||
           ;; UNBUNDLE-ME! nspr
 | 
			
		||||
           ;; UNBUNDLE-ME! nss
 | 
			
		||||
           shared-mime-info
 | 
			
		||||
           sqlite
 | 
			
		||||
           eudev
 | 
			
		||||
           unzip
 | 
			
		||||
           zip
 | 
			
		||||
           zlib))
 | 
			
		||||
    (native-inputs
 | 
			
		||||
     ;; The following patches are specific to the Guix packaging of IceCat,
 | 
			
		||||
     ;; and therefore we prefer to leave them out of 'source', which should be
 | 
			
		||||
     ;; a tarball suitable for compilation on any system that IceCat supports.
 | 
			
		||||
     ;; (Bug fixes and security fixes, however, should go in 'source').
 | 
			
		||||
     `(;; XXX TODO: Adapt these patches to IceCat 91.
 | 
			
		||||
     (list
 | 
			
		||||
      ;; XXX TODO: Adapt these patches to IceCat 91.
 | 
			
		||||
      ;; ("icecat-avoid-bundled-libraries.patch"
 | 
			
		||||
      ;;  ,(search-patch "icecat-avoid-bundled-libraries.patch"))
 | 
			
		||||
      ;; ("icecat-use-system-graphite2+harfbuzz.patch"
 | 
			
		||||
      ;;  ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
 | 
			
		||||
      ;; ("icecat-use-system-media-libs.patch"
 | 
			
		||||
      ;;  ,(search-patch "icecat-use-system-media-libs.patch"))
 | 
			
		||||
 | 
			
		||||
       ("patch" ,(canonical-package patch))
 | 
			
		||||
 | 
			
		||||
       ("rust" ,rust)
 | 
			
		||||
       ("cargo" ,rust "cargo")
 | 
			
		||||
       ("rust-cbindgen" ,rust-cbindgen-0.19)
 | 
			
		||||
       ("llvm" ,llvm-11)
 | 
			
		||||
       ("clang" ,clang-11)
 | 
			
		||||
       ("perl" ,perl)
 | 
			
		||||
       ("node" ,node)
 | 
			
		||||
       ("python" ,python-wrapper)
 | 
			
		||||
       ("yasm" ,yasm)
 | 
			
		||||
       ("nasm" ,nasm)  ; XXX FIXME: only needed on x86_64 and i686
 | 
			
		||||
       ("pkg-config" ,pkg-config)
 | 
			
		||||
       ("m4" ,m4)
 | 
			
		||||
       ("which" ,which)))
 | 
			
		||||
      rust
 | 
			
		||||
      `(,rust "cargo")
 | 
			
		||||
      rust-cbindgen-0.19
 | 
			
		||||
      llvm-11
 | 
			
		||||
      clang-11
 | 
			
		||||
      perl
 | 
			
		||||
      node
 | 
			
		||||
      python-wrapper
 | 
			
		||||
      yasm
 | 
			
		||||
      nasm                         ; XXX FIXME: only needed on x86_64 and i686
 | 
			
		||||
      pkg-config
 | 
			
		||||
      m4
 | 
			
		||||
      which))
 | 
			
		||||
    (arguments
 | 
			
		||||
     `(#:tests? #f  ;not worth the cost
 | 
			
		||||
     (list
 | 
			
		||||
      #:tests? #f                       ;not worth the cost
 | 
			
		||||
 | 
			
		||||
      ;; Some dynamic lib was determined at runtime, so rpath check may fail.
 | 
			
		||||
      #:validate-runpath? #f
 | 
			
		||||
 | 
			
		||||
       #:configure-flags `("--enable-application=browser"
 | 
			
		||||
      #:configure-flags
 | 
			
		||||
      #~(list
 | 
			
		||||
         "--enable-application=browser"
 | 
			
		||||
         "--with-distribution-id=org.gnu"
 | 
			
		||||
         "--enable-geckodriver"
 | 
			
		||||
                           ;; Do not require addons in the global app or
 | 
			
		||||
                           ;; system directories to be signed by Mozilla.
 | 
			
		||||
         ;; Do not require addons in the global app or system directories to
 | 
			
		||||
         ;; be signed by Mozilla.
 | 
			
		||||
         "--with-unsigned-addon-scopes=app,system"
 | 
			
		||||
         "--allow-addon-sideload"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1001,8 +1002,7 @@ in C/C++.")
 | 
			
		|||
         "--disable-crashreporter"
 | 
			
		||||
         "--disable-eme"
 | 
			
		||||
 | 
			
		||||
                           ;; Building with debugging symbols takes ~5GiB, so
 | 
			
		||||
                           ;; disable it.
 | 
			
		||||
         ;; Building with debugging symbols takes ~5GiB, so disable it.
 | 
			
		||||
         "--disable-debug"
 | 
			
		||||
         "--disable-debug-symbols"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1012,27 +1012,23 @@ in C/C++.")
 | 
			
		|||
         "--enable-strip"
 | 
			
		||||
         "--disable-elf-hack"
 | 
			
		||||
 | 
			
		||||
                           ;; Clang is needed to build Stylo, Mozilla's new
 | 
			
		||||
                           ;; CSS engine.  We must specify the clang paths
 | 
			
		||||
                           ;; manually, because otherwise the Mozilla build
 | 
			
		||||
                           ;; system looks in the directories returned by
 | 
			
		||||
                           ;; llvm-config --bindir and llvm-config --libdir,
 | 
			
		||||
                           ;; which return paths in the llvm package where
 | 
			
		||||
                           ;; clang is not found.
 | 
			
		||||
                           ,(string-append "--with-clang-path="
 | 
			
		||||
                                           (assoc-ref %build-inputs "clang")
 | 
			
		||||
                                           "/bin/clang")
 | 
			
		||||
                           ,(string-append "--with-libclang-path="
 | 
			
		||||
                                           (assoc-ref %build-inputs "clang")
 | 
			
		||||
                                           "/lib")
 | 
			
		||||
         ;; Clang is needed to build Stylo, Mozilla's new CSS engine.  We must
 | 
			
		||||
         ;; specify the clang paths manually, because otherwise the Mozilla
 | 
			
		||||
         ;; build system looks in the directories returned by llvm-config
 | 
			
		||||
         ;; --bindir and llvm-config --libdir, which return paths in the llvm
 | 
			
		||||
         ;; package where clang is not found.
 | 
			
		||||
         (string-append "--with-clang-path="
 | 
			
		||||
                        (search-input-file %build-inputs "bin/clang"))
 | 
			
		||||
         (string-append "--with-libclang-path="
 | 
			
		||||
                        (dirname (search-input-file %build-inputs
 | 
			
		||||
                                                    "lib/libclang.so")))
 | 
			
		||||
 | 
			
		||||
                           ;; Hack to work around missing
 | 
			
		||||
                           ;; "unofficial" branding in icecat.
 | 
			
		||||
         ;; Hack to work around missing "unofficial" branding in icecat.
 | 
			
		||||
         "--enable-official-branding"
 | 
			
		||||
 | 
			
		||||
         ;; Avoid bundled libraries.
 | 
			
		||||
                           "--with-system-jpeg"        ; must be libjpeg-turbo
 | 
			
		||||
                           "--with-system-png"         ; must be libpng-apng
 | 
			
		||||
         "--with-system-jpeg"           ;must be libjpeg-turbo
 | 
			
		||||
         "--with-system-png"            ;must be libpng-apng
 | 
			
		||||
         "--with-system-zlib"
 | 
			
		||||
         ;; UNBUNDLE-ME! "--with-system-bz2"
 | 
			
		||||
         ;; UNBUNDLE-ME! "--with-system-libevent"
 | 
			
		||||
| 
						 | 
				
			
			@ -1055,9 +1051,9 @@ in C/C++.")
 | 
			
		|||
         ;; UNBUNDLE-ME! "--enable-system-sqlite"
 | 
			
		||||
         )
 | 
			
		||||
 | 
			
		||||
       #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
 | 
			
		||||
      #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
 | 
			
		||||
 | 
			
		||||
       #:modules ((ice-9 ftw)
 | 
			
		||||
      #:modules `((ice-9 ftw)
 | 
			
		||||
                  (ice-9 match)
 | 
			
		||||
                  (srfi srfi-1)
 | 
			
		||||
                  (srfi srfi-26)
 | 
			
		||||
| 
						 | 
				
			
			@ -1067,12 +1063,10 @@ in C/C++.")
 | 
			
		|||
                  (guix build gremlin)
 | 
			
		||||
                  ,@%gnu-build-system-modules)
 | 
			
		||||
      #:phases
 | 
			
		||||
       (modify-phases %standard-phases
 | 
			
		||||
      #~(modify-phases %standard-phases
 | 
			
		||||
          (add-after 'unpack 'apply-guix-specific-patches
 | 
			
		||||
            (lambda* (#:key inputs native-inputs #:allow-other-keys)
 | 
			
		||||
             (let ((patch (string-append (assoc-ref (or native-inputs inputs)
 | 
			
		||||
                                                    "patch")
 | 
			
		||||
                                         "/bin/patch")))
 | 
			
		||||
              (let ((patch (search-input-file inputs "bin/patch")))
 | 
			
		||||
                (for-each (match-lambda
 | 
			
		||||
                            ((label . file)
 | 
			
		||||
                             (when (and (string-prefix? "icecat-" label)
 | 
			
		||||
| 
						 | 
				
			
			@ -1089,7 +1083,7 @@ in C/C++.")
 | 
			
		|||
              (for-each (lambda (file)
 | 
			
		||||
                          (format #t "deleting '~a'...~%" file)
 | 
			
		||||
                          (delete-file-recursively file))
 | 
			
		||||
                       '(;; FIXME: Removing the bundled icu breaks configure.
 | 
			
		||||
                        '( ;; FIXME: Removing the bundled icu breaks configure.
 | 
			
		||||
                          ;;   * The bundled icu headers are used in some places.
 | 
			
		||||
                          ;;   * The version number is taken from the bundled copy.
 | 
			
		||||
                          ;;"intl/icu"
 | 
			
		||||
| 
						 | 
				
			
			@ -1132,12 +1126,10 @@ in C/C++.")
 | 
			
		|||
                          ))))
 | 
			
		||||
          (add-after 'remove-bundled-libraries 'fix-ffmpeg-runtime-linker
 | 
			
		||||
            (lambda* (#:key inputs #:allow-other-keys)
 | 
			
		||||
             (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
 | 
			
		||||
                    (libavcodec (string-append ffmpeg "/lib/libavcodec.so")))
 | 
			
		||||
              ;; Arrange to load libavcodec.so by its absolute file name.
 | 
			
		||||
              (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
 | 
			
		||||
                (("libavcodec\\.so")
 | 
			
		||||
                  libavcodec)))))
 | 
			
		||||
                 (search-input-file inputs "lib/libavcodec.so")))))
 | 
			
		||||
          (add-after 'fix-ffmpeg-runtime-linker 'build-sandbox-whitelist
 | 
			
		||||
            (lambda* (#:key inputs #:allow-other-keys)
 | 
			
		||||
              (define (runpath-of lib)
 | 
			
		||||
| 
						 | 
				
			
			@ -1202,10 +1194,9 @@ in C/C++.")
 | 
			
		|||
            ;; configure does not work followed by both "SHELL=..." and
 | 
			
		||||
            ;; "CONFIG_SHELL=..."; set environment variables instead
 | 
			
		||||
            (lambda* (#:key outputs configure-flags #:allow-other-keys)
 | 
			
		||||
             (let* ((out (assoc-ref outputs "out"))
 | 
			
		||||
                    (bash (which "bash"))
 | 
			
		||||
              (let* ((bash (which "bash"))
 | 
			
		||||
                     (abs-srcdir (getcwd))
 | 
			
		||||
                    (flags `(,(string-append "--prefix=" out)
 | 
			
		||||
                     (flags `(,(string-append "--prefix=" #$output)
 | 
			
		||||
                              ,(string-append "--with-l10n-base="
 | 
			
		||||
                                              abs-srcdir "/l10n")
 | 
			
		||||
                              ,@configure-flags)))
 | 
			
		||||
| 
						 | 
				
			
			@ -1217,20 +1208,19 @@ in C/C++.")
 | 
			
		|||
                (setenv "CC" "clang")
 | 
			
		||||
                (setenv "CXX" "clang++")
 | 
			
		||||
                (setenv "LDFLAGS" (string-append "-Wl,-rpath="
 | 
			
		||||
                                                (assoc-ref outputs "out")
 | 
			
		||||
                                                "/lib/icecat"))
 | 
			
		||||
                                                 #$output "/lib/icecat"))
 | 
			
		||||
 | 
			
		||||
                (setenv "MACH_USE_SYSTEM_PYTHON" "1")
 | 
			
		||||
                (setenv "MOZ_NOSPAM" "1")
 | 
			
		||||
               (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp
 | 
			
		||||
                (setenv "MOZ_BUILD_DATE" #$%icecat-build-id) ; avoid timestamp
 | 
			
		||||
 | 
			
		||||
                (format #t "build directory: ~s~%" (getcwd))
 | 
			
		||||
                (format #t "configure flags: ~s~%" flags)
 | 
			
		||||
 | 
			
		||||
                (call-with-output-file "mozconfig"
 | 
			
		||||
                 (lambda (out)
 | 
			
		||||
                  (lambda (port)
 | 
			
		||||
                    (for-each (lambda (flag)
 | 
			
		||||
                               (format out "ac_add_options ~a\n" flag))
 | 
			
		||||
                                (format port "ac_add_options ~a\n" flag))
 | 
			
		||||
                              flags)))
 | 
			
		||||
 | 
			
		||||
                (invoke "./mach" "configure"))))
 | 
			
		||||
| 
						 | 
				
			
			@ -1264,16 +1254,14 @@ in C/C++.")
 | 
			
		|||
              ;; reason.  Use 'find-files' to avoid having to deal with the
 | 
			
		||||
              ;; system/architecture-specific file name.
 | 
			
		||||
              (install-file (first (find-files "." "geckodriver"))
 | 
			
		||||
                           (string-append (assoc-ref outputs "out") "/bin"))))
 | 
			
		||||
                            (string-append #$output "/bin"))))
 | 
			
		||||
          (add-after 'install 'wrap-program
 | 
			
		||||
           (lambda* (#:key inputs outputs #:allow-other-keys)
 | 
			
		||||
             (let* ((out (assoc-ref outputs "out"))
 | 
			
		||||
                    (lib (string-append out "/lib"))
 | 
			
		||||
                    (gtk (assoc-ref inputs "gtk+"))
 | 
			
		||||
            (lambda* (#:key inputs #:allow-other-keys)
 | 
			
		||||
              (let* ((lib (string-append #$output "/lib"))
 | 
			
		||||
                     (gtk #$(this-package-input "gtk+"))
 | 
			
		||||
                     (gtk-share (string-append gtk "/share"))
 | 
			
		||||
                    (ld-libs (map (lambda (label)
 | 
			
		||||
                                    (string-append (assoc-ref inputs label)
 | 
			
		||||
                                                   "/lib"))
 | 
			
		||||
                     (ld-libs '#$(map (lambda (label)
 | 
			
		||||
                                        (file-append (this-package-input label) "/lib"))
 | 
			
		||||
                                      '("libpng-apng"
 | 
			
		||||
                                        "libxscrnsaver"
 | 
			
		||||
                                        "mesa"
 | 
			
		||||
| 
						 | 
				
			
			@ -1291,32 +1279,30 @@ in C/C++.")
 | 
			
		|||
                  ;;   `("MOZ_ENABLE_WAYLAND" = ("1"))
 | 
			
		||||
                  `("LD_LIBRARY_PATH" prefix ,ld-libs)))))
 | 
			
		||||
          (add-after 'wrap-program 'install-desktop-entry
 | 
			
		||||
           (lambda* (#:key outputs #:allow-other-keys)
 | 
			
		||||
            (lambda _
 | 
			
		||||
              ;; Install the '.desktop' file.
 | 
			
		||||
              (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
 | 
			
		||||
                    (out          (assoc-ref outputs "out"))
 | 
			
		||||
                    (applications (string-append out "/share/applications")))
 | 
			
		||||
                     (applications (string-append #$output "/share/applications")))
 | 
			
		||||
                (substitute* desktop-file
 | 
			
		||||
                 (("^Exec=icecat")     (string-append "Exec=" out "/bin/icecat"))
 | 
			
		||||
                  (("^Exec=icecat")     (string-append "Exec=" #$output "/bin/icecat"))
 | 
			
		||||
                  (("IceCat")           "GNU IceCat")
 | 
			
		||||
                  (("Icon=.*")          "Icon=icecat\n")
 | 
			
		||||
                  (("NewWindow")        "new-window")
 | 
			
		||||
                  (("NewPrivateWindow") "new-private-window"))
 | 
			
		||||
                (install-file desktop-file applications))))
 | 
			
		||||
          (add-after 'install-desktop-entry 'install-icons
 | 
			
		||||
           (lambda* (#:key outputs #:allow-other-keys)
 | 
			
		||||
             (let ((out (assoc-ref outputs "out")))
 | 
			
		||||
            (lambda _
 | 
			
		||||
              (with-directory-excursion "browser/branding/official"
 | 
			
		||||
                (for-each
 | 
			
		||||
                 (lambda (file)
 | 
			
		||||
                   (let* ((size (string-filter char-numeric? file))
 | 
			
		||||
                           (icons (string-append out "/share/icons/hicolor/"
 | 
			
		||||
                          (icons (string-append #$output "/share/icons/hicolor/"
 | 
			
		||||
                                                size "x" size "/apps")))
 | 
			
		||||
                     (mkdir-p icons)
 | 
			
		||||
                     (copy-file file (string-append icons "/icecat.png"))))
 | 
			
		||||
                 '("default16.png" "default22.png" "default24.png"
 | 
			
		||||
                   "default32.png" "default48.png" "content/icon64.png"
 | 
			
		||||
                    "mozicon128.png" "default256.png")))))))))
 | 
			
		||||
                   "mozicon128.png" "default256.png"))))))))
 | 
			
		||||
    (home-page "https://www.gnu.org/software/gnuzilla/")
 | 
			
		||||
    (synopsis "Entirely free browser derived from Mozilla Firefox")
 | 
			
		||||
    (description
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue