summaryrefslogtreecommitdiff
path: root/libre/linux-libre/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'libre/linux-libre/PKGBUILD')
-rw-r--r--libre/linux-libre/PKGBUILD88
1 files changed, 55 insertions, 33 deletions
diff --git a/libre/linux-libre/PKGBUILD b/libre/linux-libre/PKGBUILD
index 8d6820446..5bd7209d0 100644
--- a/libre/linux-libre/PKGBUILD
+++ b/libre/linux-libre/PKGBUILD
@@ -12,7 +12,7 @@
pkgbase=linux-libre # Build stock kernel
#pkgbase=linux-libre-custom # Build kernel with a different name
_srcbasever=4.18-gnu
-_srcver=4.18.3-gnu
+_srcver=4.18.4-gnu
_archrel=arch1
_replacesarchkernel=('linux%') # '%' gets replaced with _kernelname
@@ -27,7 +27,7 @@ rcnrel=armv7-x5
arch=(i686 x86_64 armv7h)
url="https://linux-libre.fsfla.org/"
license=(GPL2)
-makedepends=(xmlto kmod inetutils bc libelf)
+makedepends=(xmlto kmod inetutils bc libelf python-sphinx graphviz)
options=('!strip')
source=(
"https://linux-libre.fsfla.org/pub/linux-libre/releases/${_srcbasever}/linux-libre-${_srcbasever}.tar.xz"{,.sign}
@@ -108,7 +108,7 @@ _replacesarchkernel=("${_replacesarchkernel[@]/\%/${_kernelname}}")
_replacesoldkernels=("${_replacesoldkernels[@]/\%/${_kernelname}}")
_replacesoldmodules=("${_replacesoldmodules[@]/\%/${_kernelname}}")
-case "${CARCH}" in
+case "$CARCH" in
i686|x86_64) KARCH=x86;;
armv7h) KARCH=arm;;
esac
@@ -126,7 +126,7 @@ prepare() {
patch -p1 -i ../patch-${_srcver%-*}-${_archrel}.patch
fi
- if [ "${CARCH}" = "armv7h" ]; then
+ if [ "$CARCH" = "armv7h" ]; then
# RCN patch (CM3 firmware deblobbed and AUFS/WireGuard removed)
# Note: For stability reasons, AUFS has been removed in the RCN patch.
# We are supporting AUFS in linux-libre-pck through PCK patch.
@@ -169,7 +169,7 @@ prepare() {
echo "$_kernelname" > localversion.20-pkgname
msg2 "Setting config..."
- cp ../config.${CARCH} .config
+ cp ../config.$CARCH .config
make olddefconfig
make -s kernelrelease > ../version
@@ -178,10 +178,10 @@ prepare() {
build() {
cd $_srcname
- if [ "${CARCH}" = "armv7h" ]; then
- make ${MAKEFLAGS} zImage modules dtbs
- elif [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then
- make bzImage modules
+ if [ "$CARCH" = "armv7h" ]; then
+ make $MAKEFLAGS zImage modules dtbs htmldocs
+ elif [ "$CARCH" = "x86_64" ] || [ "$CARCH" = "i686" ]; then
+ make bzImage modules htmldocs
fi
}
@@ -201,10 +201,10 @@ _package() {
cd $_srcname
msg2 "Installing boot image..."
- if [ "${CARCH}" = "armv7h" ]; then
- make INSTALL_DTBS_PATH="${pkgdir}/boot/dtbs/${pkgbase}" dtbs_install
- cp arch/$KARCH/boot/zImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
- elif [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then
+ if [ "$CARCH" = "armv7h" ]; then
+ make INSTALL_DTBS_PATH="$pkgdir/boot/dtbs/$pkgbase" dtbs_install
+ cp arch/$KARCH/boot/zImage "$pkgdir/boot/vmlinuz-$pkgbase"
+ elif [ "$CARCH" = "x86_64" ] || [ "$CARCH" = "i686" ]; then
install -Dm644 "$(make -s image_name)" "$pkgdir/boot/vmlinuz-$pkgbase"
fi
@@ -225,18 +225,18 @@ _package() {
msg2 "Installing hooks..."
# sed expression for following substitutions
- if [ "${CARCH}" = "armv7h" ]; then
- local _subst="
- s|/boot/vmlinuz-%PKGBASE%|$_kernver|g
+ if [ "$CARCH" = "armv7h" ]; then
+ local subst="
+ s|/boot/vmlinuz-%PKGBASE%|$kernver|g
s|%PKGBASE%|$pkgbase|g
- s|%KERNVER%|$_kernver|g
- s|%EXTRAMODULES%|$_extramodules|g
+ s|%KERNVER%|$kernver|g
+ s|%EXTRAMODULES%|$extramodules|g
"
- elif [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then
- local _subst="
+ else
+ local subst="
s|%PKGBASE%|$pkgbase|g
- s|%KERNVER%|$_kernver|g
- s|%EXTRAMODULES%|$_extramodules|g
+ s|%KERNVER%|$kernver|g
+ s|%EXTRAMODULES%|$extramodules|g
"
fi
@@ -273,13 +273,15 @@ _package-headers() {
cp -t "$builddir" -a scripts
# add objtool for external module building and enabled VALIDATION_STACK option
- install -Dt "$builddir/tools/objtool" tools/objtool/objtool
+ if [[ -e tools/objtool/objtool ]]; then
+ install -Dt "$builddir/tools/objtool" tools/objtool/objtool
+ fi
# add xfs and shmem for aufs building
mkdir -p "$builddir"/{fs/xfs,mm}
- if [[ ${CARCH} = i686 ]]; then
- install -t "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile_32.cpu
+ if [[ $CARCH = i686 ]]; then
+ install -t "$builddir/arch/$KARCH" -m644 arch/$KARCH/Makefile_32.cpu
fi
# ???
@@ -315,21 +317,21 @@ _package-headers() {
msg2 "Removing documentation..."
rm -r "$builddir/Documentation"
- # parabola changes
+ # Parabola changes
#
- # since we don't want to diverge too much from arch's pkgbuild, we'll
+ # since we don't want to diverge too much from Arch's PKGBUILD, we'll
# start marking our changes as such
- if [ "${CARCH}" = "armv7h" ]; then
+ if [ "$CARCH" = "armv7h" ]; then
for i in dove exynos omap2; do
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-${i}"
- cp -a arch/${KARCH}/mach-${i}/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-${i}/"
+ mkdir -p "$pkgdir/usr/lib/modules/$kernver/build/arch/$KARCH/mach-$i"
+ cp -a arch/$KARCH/mach-$i/include "$pkgdir/usr/lib/modules/$kernver/build/arch/$KARCH/mach-$i/"
done
for i in omap orion samsung versatile; do
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/plat-${i}"
- cp -a arch/${KARCH}/plat-${i}/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/plat-${i}/"
+ mkdir -p "$pkgdir/usr/lib/modules/$kernver/build/arch/$KARCH/plat-$i"
+ cp -a arch/$KARCH/plat-$i/include "$pkgdir/usr/lib/modules/$kernver/build/arch/$KARCH/plat-$i/"
done
fi
- # end of parabola changes
+ # end of Parabola changes
msg2 "Removing broken symlinks..."
find -L "$builddir" -type l -printf 'Removing %P\n' -delete
@@ -352,6 +354,10 @@ _package-headers() {
esac
done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
+ msg2 "Adding symlink..."
+ mkdir -p "$pkgdir/usr/src"
+ ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase-$pkgver"
+
msg2 "Fixing permissions..."
chmod -Rc u=rwX,go=rX "$pkgdir"
}
@@ -370,6 +376,22 @@ _package-docs() {
mkdir -p "$builddir"
cp -t "$builddir" -a Documentation
+ msg2 "Removing doctrees..."
+ rm -r "$builddir/Documentation/output/.doctrees"
+
+ msg2 "Moving HTML docs..."
+ local src dst
+ while read -rd '' src; do
+ dst="$builddir/Documentation/${src#$builddir/Documentation/output/}"
+ mkdir -p "${dst%/*}"
+ mv "$src" "$dst"
+ rmdir -p --ignore-fail-on-non-empty "${src%/*}"
+ done < <(find "$builddir/Documentation/output" -type f -print0)
+
+ msg2 "Adding symlink..."
+ mkdir -p "$pkgdir/usr/share/doc"
+ ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"
+
msg2 "Fixing permissions..."
chmod -Rc u=rwX,go=rX "$pkgdir"
}