Add xz / lzma, required by RPM.
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 11 Aug 2016 14:52:48 +0000 (15:52 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 11 Aug 2016 14:52:48 +0000 (15:52 +0100)
.gitignore
Makefile

index 40cde53..03a3b17 100644 (file)
@@ -47,4 +47,5 @@ stamp-*
 /sed-4.2/
 /tar-1.29/
 /util-linux-2.28/
+/xz-5.2.2/
 /zlib-1.2.8/
index cd42938..d4e345e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -82,6 +82,7 @@ PATCH_VERSION      = 2.7.5
 HOSTNAME_VERSION   = 3.15
 GETTEXT_VERSION    = 0.19
 LUA_VERSION        = 5.3.3
+XZ_VERSION         = 5.2.2
 
 all: stage1 stage2 stage3 stage4
 
@@ -311,6 +312,7 @@ stage3: stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \
        stage3-chroot/usr/bin/gettext \
        stage3-chroot/usr/bin/lua \
        stage3-chroot/usr/bin/rpm \
+       stage3-chroot/usr/bin/xz \
        stage3-chroot/init \
        stage3-disk.img
 
@@ -910,6 +912,24 @@ lua-$(LUA_VERSION).tar.gz:
        wget -O $@-t https://www.lua.org/ftp/lua-$(LUA_VERSION).tar.gz
        mv $@-t $@
 
+# Cross-compile xz.
+stage3-chroot/usr/bin/xz: xz-$(XZ_VERSION).tar.gz
+       rm -rf xz-$(XZ_VERSION)
+       tar -zxf $^
+       cd xz-$(XZ_VERSION) && \
+       PATH=$(ROOT)/fixed-gcc:$$PATH \
+       ./configure \
+           --host=riscv64-unknown-linux-gnu \
+           --prefix=/usr --libdir=/usr/lib64
+       cd xz-$(XZ_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make
+       cd xz-$(XZ_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot
+       rm -f stage3-chroot/usr/lib64/*.la
+
+xz-$(XZ_VERSION).tar.gz:
+       rm -f $@ $@-t
+       wget -O $@-t http://tukaani.org/xz/xz-$(XZ_VERSION).tar.gz
+       mv $@-t $@
+
 # Cross-compile RPM / rpmbuild.
 # We build this from a git commit, with a few hacks to the configure
 # script.