diff --git a/build.sh b/build.sh index d30b27f..887e9e4 100755 --- a/build.sh +++ b/build.sh @@ -62,6 +62,9 @@ COREUTILS_URL=https://mirror.ufs.ac.za/gnu/coreutils/coreutils-$COREUTILS_VERSIO DIFFUTILS_VERSION=3.12 DIFFUTILS_URL=https://mirror.ufs.ac.za/gnu/diffutils/diffutils-$DIFFUTILS_VERSION.tar.xz +FILE_VERSION=5.46 +FILE_URL=https://astron.com/pub/file/file-$FILE_VERSION.tar.gz + if [ ! -d "$SYSROOT" ]; then mkdir -p "$SYSROOT"/{etc,cross,sources,usr,dev,proc,sys,run} mkdir -p "$SYSROOT"/usr/{bin,sbin,lib,include} @@ -320,8 +323,33 @@ toolchain_diffutils() { cd "$SOURCES" && rm -rf diffutils-$DIFFUTILS_VERSION } +toolchain_file() { + fetch $FILE_URL - + cd "$SOURCES" && tar xf file-$FILE_VERSION.tar.gz && cd file-$FILE_VERSION + + mkdir -p build + + pushd build + ../configure \ + --disable-bzlib \ + --disable-libseccomp \ + --disable-xzlib \ + --disable-zlib + make + popd + + ./configure \ + --prefix=/usr \ + --host="$TARGET" \ + --build=$(./config.guess) + + make FILE_COMPILE="$(pwd)/build/src/file" && make DESTDIR="$SYSROOT" install + + rm "$SYSROOT"/usr/lib/libmagic.la + + cd "$SOURCES" && rm -rf file-$FILE_VERSION +} #bootstrap_binutils #bootstap_gcc @@ -332,4 +360,5 @@ toolchain_diffutils() { #toolchain_ncurses #toolchain_bash #toolchain_coreutils -toolchain_diffutils \ No newline at end of file +#toolchain_diffutils +toolchain_file \ No newline at end of file