Files
BMLFS/build-scripts/userland-rpi.build

72 lines
2.2 KiB
Bash

#! /bin/bash
# Userland for Raspberry Pi
# Source: https://github.com/raspberrypi/userland/archive/master.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: cmake
# Recommended: NONE
# Optional: NONE
case $(uname -m) in
aarch64) export EXTRA_CONFIG=" -DARM64=on"
;;
esac
export LDFLAGS=" -Wl,--no-as-needed"
for f in $(find $PWD -type f -name CMakeLists.txt); do
sed -i 's,-Werror,,g' $f
done
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_RPATH=/opt/vc/lib $EXTRA_CONFIG ..
read -p "Press Enter to compile" &&
make -j2 &&
unset LDFLAGS EXTRA_CONFIG
read -p "Press Enter to install" &&
# if not using a package manager:
# make install
# if using pkgtools from Slackware, then:
sudo -S make DESTDIR=$BUILD install &&
read -p "Press Enter to create pakage description." &&
cd $BUILD && sudo mkdir -v install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
userland-rpi: userland-rpi (Raspberry Pi GPU userland libraries and utilities)
userland-rpi:
userland-rpi: ARM side libraries and utilities for interfacing to Raspberry Pi GPU.
userland-rpi:
userland-rpi: These typically are installed in /opt/vc/lib and includes source for
userland-rpi: the ARM side code to interface to: EGL, mmal, GLESv2, vcos,
userland-rpi: openmaxil, vchiq_arm, bcm_host, WFC, OpenVG.
userland-rpi:
userland-rpi: Homepage: https://github.com/raspberrypi/userland
userland-rpi:
userland-rpi:
EOF
cat > /tmp/doinst.sh << "EOF"
echo "/opt/vc/lib" >> /etc/ld-musl-$(uname -m).path
EOF
sudo -S mv /tmp/slack-desc install/ &&
sudo -S mv /tmp/doinst.sh install/ &&
read -p "Enter to build and install package" &&
sudo makepkg -l y -c n $PKGS/userland-rpi-2020.9.11-$(uname -m)-mlfs.txz &&
sudo rm -rf $BUILD/*