2
1
Fork 0
mirror of https://git.savannah.gnu.org/git/gnuboot.git synced 2025-01-08 16:47:40 +01:00
gnuboot/resources/packages/i945-thinkpads-install-utilities/Makefile.am
Denis 'GNUtoo' Carikli 7df6d6169b
Build bucts and patched flashrom for I945 ThinkPads with Guix.
GNU Boot can be installed on some I945 ThinkPads without disassembling
them. To do that it requires both a patched flashrom and bucts.

This build them and also integrate Guix in GNU Boot as a dependency to
build them.

This will enable us to later on ship these utilities and then update
the installation instructions to use them somehow.

It also makes sure that we have proper authorship of the patch used
for flashrom and also unify the two flashrom patches not to require
two different flashrom binaries.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
2024-05-12 22:56:04 +02:00

95 lines
3 KiB
Makefile

# Copyright (C) 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.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 <https://www.gnu.org/licenses/>.
# This Makefile makes it easier to cache the builds than with shell
# scripts: The make program compares the timestamps of the source code
# and the binaries and if the source is more recent, rebuilds the
# binaries.
TOPDIR = .
DESTDIR ?= $(TOPDIR)/release
PACK_NAME = i945-thinkpads-install-utilities
GUIX_PACKAGE_NAMES ?= bucts flashrom-bucts
RELEASE_DIR = $(DESTDIR)/i945-thinkpads-install
# We enable caching by not making this configurable and so when the
# Makefile isn't updated, the Guix revision doesn't change, so we
# don't need to rebuild anything.
GUIX_REVISION = v1.4.0
GUIX_PACK_COMMAND = \
source resources/scripts/misc/guix.sh && \
source_guix_profile && \
guix time-machine \
--commit=$(GUIX_REVISION) -- \
pack \
-L $(TOPDIR)/resources/guix/ \
-L $(TOPDIR)/resources/guix/gnuboot/patches/ \
-RR \
--save-provenance \
--system=i686-linux \
--symlink=/usr/local/bin/bucts=bin/bucts \
--symlink=/usr/local/bin/flashrom-bucts=sbin/flashrom-bucts
.PHONY: $(PACK_NAME) $(PACK_NAME)-clean $(PACK_NAME)-distclean $(PACK_NAME)-download $(PACK_NAME)-module
$(PACK_NAME): \
$(RELEASE_DIR)/$(PACK_NAME)-deb-pack.deb \
$(RELEASE_DIR)/$(PACK_NAME)-tarball-pack.tar.gz \
$(RELEASE_DIR)/packages_src.tar \
$(RELEASE_DIR)/gnuboot_src.tar
# To better fit in the current package structure
$(PACK_NAME)-download: $(PACK_NAME)
$(PACK_NAME)-module: $(PACK_NAME)
# TODO: Make sure the tarball is reproducible
$(RELEASE_DIR)/gnuboot_src.tar: Makefile
install -d $(RELEASE_DIR)
git -C $(TOPDIR) archive HEAD > $@
# TODO: Use Guix to produce a source package to make it reproducible
$(RELEASE_DIR)/packages_src.tar: Makefile
install -d $(RELEASE_DIR)
tar cf $@ \
`source resources/scripts/misc/guix.sh && \
source_guix_profile && \
guix time-machine --commit=$(GUIX_REVISION) -- \
build \
-c $(GUIX_BUILD_CORES) \
-L $(TOPDIR)/resources/guix/ \
-L $(TOPDIR)/resources/guix/gnuboot/patches \
--sources=transitive \
$(GUIX_PACKAGE_NAMES) | sort -u`
$(RELEASE_DIR)/$(PACK_NAME)-deb-pack.deb: Makefile
install -d $(RELEASE_DIR)
install \
`$(GUIX_PACK_COMMAND) --format="deb" $(GUIX_PACKAGE_NAMES)` \
$@
$(RELEASE_DIR)/$(PACK_NAME)-tarball-pack.tar.gz: Makefile
install -d $(RELEASE_DIR)
install \
`$(GUIX_PACK_COMMAND) --format="tarball" $(GUIX_PACKAGE_NAMES)` \
$@
$(PACK_NAME)-clean:
rm -rf $(RELEASE_DIR)
$(PACK_NAME)-distclean: $(PACK_NAME)-clean