]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - grub/grub.nm
json-c: Update to version 0.17-20230812
[ipfire-3.x.git] / grub / grub.nm
index cd3974347ceb303eba38eaf0a0bd21adea54b848..263a36d56bad95249413406d4b4302f47e4a449b 100644 (file)
@@ -4,13 +4,12 @@
 ###############################################################################
 
 name       = grub
-version    = 2.00
-release    = 5.1
-sup_arches = x86_64 i686
+version    = 2.06
+release    = 2
 
 groups     = System/Boot
-url        = http://www.gnu.org/software/grub/
-license    = GPLv2+
+url        = https://www.gnu.org/software/grub/
+license    = GPLv3
 summary    = Grand Unified Boot Loader.
 
 description
@@ -20,57 +19,70 @@ description
        systems.
 end
 
-source_dl  = http://ftp.gnu.org/gnu/grub/ ftp://alpha.gnu.org/gnu/grub/
+source_dl  = https://ftp.gnu.org/gnu/grub/
 sources    = %{thisapp}.tar.xz
 
-# Unifont
-unifont = /usr/share/X11/fonts/misc/unifont.pcf.gz
-
 build
+       arches = aarch64 x86_64
+
        requires
                autoconf
-               autogen
                automake
                bison
                bzip2-devel
-               dejavu-fonts-sans-fonts
                flex
                freetype-devel
                gettext
+               gettext-devel
                libdevmapper-devel
                ncurses-devel
-               paxctl
+               python3
                zlib-devel
-               %{unifont}
+       end
+
+       # Don't leak our CFLAGS to boot code
+       export HOST_CFLAGS  = %{CFLAGS}
+       export HOST_LDFLAGS = %{LDFLAGS}
+
+       platforms = efi
+
+       if "%{DISTRO_PLATFORM}" == "x86"
+               platforms += pc
        end
 
        prepare_cmds
-               cp -vf %{unifont} unifont.pcf.gz
-               ./autogen.sh
+               PYTHON=%{python3} ./autogen.sh
+
+               for platform in %{platforms}; do
+                       cp -r %{DIR_APP} %{DIR_APP}-${platform}
+               done
        end
 
        # As the modules contain always 32 bit code, they
        # should be living in /usr/lib.
        libdir = %{prefix}/lib
 
-       configure_options += \
-               --target="i386" \
-               --with-platform=pc \
-               --program-transform-name=s,grub,grub, \
-               --disable-werror \
-               CFLAGS="$(echo %{CFLAGS} | sed \
-                       -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' \
-                       -e 's/-fstack-protector-strong//g' \
-                       -e 's/-fstack-protector-all//g' \
-                       -e 's/-fstack-protector//g' \
-                       -e 's/-fPIC//g' \
-                       -e 's/--param=ssp-buffer-size=4//g' \
-                       -e 's/-mregparm=3/-mregparm=4/g' \
-                       -e 's/-fexceptions//g' \
-                       -e 's/-m64//g' \
-                       -e 's/-fasynchronous-unwind-tables//g' )"
-
-       install_cmds
+       build
+               for platform in %{platforms}; do
+                       pushd %{DIR_APP}-${platform}
+                       ./configure \
+                               %{configure_options} \
+                               --with-platform=${platform} \
+                               --disable-werror \
+                               CFLAGS= LDFLAGS=
+
+                       make %{PARALLELISMFLAGS}
+                       popd
+               done
+       end
+
+       install
+               for platform in %{platforms}; do
+                       pushd %{DIR_APP}-${platform}
+                       make install DESTDIR=%{BUILDROOT}
+                       popd
+               done
+
                # Install empty configuration file.
                mkdir -pv %{BUILDROOT}/boot/grub
                touch %{BUILDROOT}/boot/grub/grub.cfg
@@ -93,30 +105,14 @@ build
                %{BUILDROOT}%{bindir}/grub-mkfont -o DejaVuSans-Bold-14.pf2 \
                        -s 14 %{datadir}/fonts/dejavu/DejaVuSans-Bold.ttf
                popd
-
-               # Disable hardening.
-               paxctl -mpes \
-                       %{BUILDROOT}%{sbindir}/grub-bios-setup \
-                       %{BUILDROOT}%{sbindir}/grub-probe
-
-               paxctl -mpex \
-                       %{BUILDROOT}%{bindir}/grub-script-check
-       end
-
-       debuginfo_strict_build_id = false
-end
-
-quality-agent
-       whitelist_nx
-               %{bindir}/*|%{sbindir}/*
        end
 end
 
 packages
        package %{name}
                requires
+                       efibootmgr
                        gettext
-                       os-prober
                        system-logos >= 2
                end