summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorBoohbah2019-11-27 04:20:56 +0000
committerBoohbah2019-11-27 04:20:56 +0000
commite7e35802193bf14e094a5c12e7748c600ce9ea80 (patch)
tree9658e108ae8343d5d4fe425522882d09f5e3d968 /PKGBUILD
parentfde74430223eed7726835078dd91a8ebb3448b1d (diff)
downloadaur-e7e35802193bf14e094a5c12e7748c600ce9ea80.tar.gz
New PKGBUILD based on current archlinux 5.4 version
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD356
1 files changed, 127 insertions, 229 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 770ec80c8c4..d0d9ae88a8e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,276 +1,174 @@
# Maintainer: Boohbah <boohbah at gmail.com>
-# Contributor: Tobias Powalowski <tpowa@archlinux.org>
-# Contributor: Thomas Baechler <thomas@archlinux.org>
-# Contributor: Jonathan Chan <jyc@fastmail.fm>
-# Contributor: misc <tastky@gmail.com>
-# Contributor: NextHendrix <cjones12 at sheffield.ac.uk>
-# Contributor: Shun Terabayashi <shunonymous at gmail.com>
-# Contributor: Brad McCormack <bradmccormack100 at gmail.com>
-# Contributor: Doug Johnson <dougvj at dougvj.net>
-# Contributor: Parker <parker.l.reed@gmail.com>
+# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
pkgbase=linux-git
-_srcname=linux
-pkgver=5.4.r3800.g2be7d348fe92
+pkgver=5.4.r4234.gc2da5bdc66a3
pkgrel=1
-arch=('i686' 'x86_64')
-url="http://www.kernel.org/"
-license=('GPL2')
-makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'libelf')
+pkgdesc='Linux git'
+url="https://www.kernel.org"
+arch=(x86_64)
+license=(GPL2)
+makedepends=(bc kmod libelf git)
options=('!strip')
-source=('git+https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux'
- # the main kernel config files
- 'config' 'config.x86_64'
- # standard config files for mkinitcpio ramdisk
- "${pkgbase}.preset")
+_srcname=linux
+source=(
+ 'git+https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux'
+ config # the main kernel config file
+)
sha256sums=('SKIP'
- 'becc0c98cff692dee9500f19d38882636caf4c58d5086c7725690a245532f5dc'
- 'f5c48fe919bd841fc87839c73f5021d859a4ba614ffc832fed790e64a0d58f58'
- '95fcfdfcb9d540d1a1428ce61e493ddf2c2a8ec96c8573deeadbb4ee407508c7')
+ 'edf3e3de13ff0ee40da422ba168c03a3f351229aabb01829853da3b08720ea78')
-_kernelname=${pkgbase#linux}
+export KBUILD_BUILD_HOST=archlinux
+export KBUILD_BUILD_USER=$pkgbase
+export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
pkgver() {
- cd "${_srcname}"
+ cd $_srcname
git describe --long | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g;s/\.rc/rc/'
}
prepare() {
- cd "${_srcname}"
-
- if [ "${CARCH}" = "x86_64" ]; then
- cat "${srcdir}/config.x86_64" > ./.config
- else
- cat "${srcdir}/config" > ./.config
- fi
-
- # set localversion to git commit
- sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-${pkgver##*.}\"|g" ./.config
- sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
-
- # don't run depmod on 'make install'. We'll do this ourselves in packaging
- sed -i '2iexit 0' scripts/depmod.sh
-
- # get kernel version
- make prepare
-
- # load configuration
- # Configure the kernel. Replace the line below with one of your choice.
- #make menuconfig # CLI menu for configuration
- #make nconfig # new CLI menu for configuration
- #make xconfig # X-based configuration
- #make oldconfig # using old config from previous kernel version
- make olddefconfig # old config from previous kernel, defaults for new options
- # ... or manually edit .config
-}
+ cd $_srcname
+
+ msg2 "Setting version..."
+ scripts/setlocalversion --save-scmversion
+ echo "-$pkgrel" > localversion.10-pkgrel
+ echo "${pkgbase#linux}" > localversion.20-pkgname
+
+ local src
+ for src in "${source[@]}"; do
+ src="${src%%::*}"
+ src="${src##*/}"
+ [[ $src = *.patch ]] || continue
+ msg2 "Applying patch $src..."
+ patch -Np1 < "../$src"
+ done
-build() {
- cd "${_srcname}"
+ msg2 "Setting config..."
+ cp ../config .config
+ make olddefconfig
- make ${MAKEFLAGS} LOCALVERSION= bzImage modules
+ make -s kernelrelease > version
+ msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
}
-_package() {
- pkgdesc="The Linux kernel and modules (git version)"
- depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
- optdepends=('crda: to set the correct wireless channels of your country')
- provides=('linux')
- backup=("etc/mkinitcpio.d/${pkgbase}.preset")
- install=linux.install
-
- cd "${_srcname}"
-
- KARCH=x86
-
- # get kernel version
- _kernver="$(make LOCALVERSION= kernelrelease)"
- _basekernel=${_kernver%%-*}
- _basekernel=${_basekernel%.*}
-
- mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
- make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
- cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
-
- # set correct depmod command for install
- cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
- true && install=${install}.pkg
- sed \
- -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
- -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
- -i "${startdir}/${install}"
-
- # install mkinitcpio preset file for kernel
- install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
- sed \
- -e "1s|'linux.*'|'${pkgbase}'|" \
- -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
- -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
- -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
- -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
-
- # remove build and source links
- rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
- # remove the firmware
- rm -rf "${pkgdir}/lib/firmware"
- # make room for external modules
- ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
- # add real version for building modules and running depmod from post_install/upgrade
- mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
- echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
-
- # Now we call depmod...
- depmod -b "${pkgdir}" -F System.map "${_kernver}"
-
- # move module tree /lib -> /usr/lib
- mkdir -p "${pkgdir}/usr"
- mv "${pkgdir}/lib" "${pkgdir}/usr/"
-
- # add vmlinux
- install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
-
- # add System.map
- install -D -m644 System.map "${pkgdir}/boot/System.map-${_kernver}"
+build() {
+ cd $_srcname
+ make bzImage modules
}
-_package-headers() {
- pkgdesc="Header files and scripts for building modules for Linux kernel (git version)"
- provides=('linux-headers')
-
- install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
+_package() {
+ pkgdesc="The $pkgdesc kernel and modules"
+ depends=(coreutils kmod initramfs)
+ optdepends=('crda: to set the correct wireless channels of your country'
+ 'linux-firmware: firmware images needed for some devices')
- cd "${_srcname}"
- install -D -m644 Makefile \
- "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
- install -D -m644 kernel/Makefile \
- "${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
- install -D -m644 .config \
- "${pkgdir}/usr/lib/modules/${_kernver}/build/.config"
+ cd $_srcname
+ local kernver="$(<version)"
+ local modulesdir="$pkgdir/usr/lib/modules/$kernver"
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
+ msg2 "Installing boot image..."
+ # systemd expects to find the kernel here to allow hibernation
+ # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
+ install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
- for i in acpi asm-generic clocksource config crypto drm dt-bindings \
- generated keys kvm linux math-emu media misc net pcmcia ras rdma \
- scsi soc sound target trace uapi vdso video xen; do
- cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
- done
+ # Used by mkinitcpio to name the kernel
+ echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
- # copy arch includes for external modules
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
- cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"
+ msg2 "Installing modules..."
+ make INSTALL_MOD_PATH="$pkgdir/usr" modules_install
- # copy files necessary for later builds, like nvidia and vmware
- cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
- cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"
-
- # fix permissions on scripts dir
- chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"
+ # remove build and source links
+ rm "$modulesdir"/{source,build}
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
+ msg2 "Fixing permissions..."
+ chmod -Rc u=rwX,go=rX "$pkgdir"
+}
- cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
+_package-headers() {
+ pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel"
- if [ "${CARCH}" = "i686" ]; then
- cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
- fi
+ cd $_srcname
+ local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
- cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
+ msg2 "Installing build files..."
+ install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
+ localversion.* version vmlinux
+ install -Dt "$builddir/kernel" -m644 kernel/Makefile
+ install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
+ cp -t "$builddir" -a scripts
- # add dm headers
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
- cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
+ # add objtool for external module building and enabled VALIDATION_STACK option
+ install -Dt "$builddir/tools/objtool" tools/objtool/objtool
- # add inotify.h
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
- cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"
+ # add xfs and shmem for aufs building
+ mkdir -p "$builddir"/{fs/xfs,mm}
- # add wireless headers
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
- cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
+ msg2 "Installing headers..."
+ cp -t "$builddir" -a include
+ cp -t "$builddir/arch/x86" -a arch/x86/include
+ install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
- # add dvb headers for external modules
- # http://bugs.archlinux.org/task/11194
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
- cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
+ install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
+ install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
- # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
- # in reference to:
# http://bugs.archlinux.org/task/13146
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
- cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
- cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
+ install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
- # add dvb headers
- # in reference to:
# http://bugs.archlinux.org/task/20402
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
- cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
- cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
- cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"
-
- # add xfs and shmem for aufs building
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
- # removed in 3.17 series
- # cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"
-
- # copy in Kconfig files
- for i in $(find . -name "Kconfig*"); do
- mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
- cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
+ install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
+ install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
+ install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h
+
+ msg2 "Installing KConfig files..."
+ find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
+
+ msg2 "Removing unneeded architectures..."
+ local arch
+ for arch in "$builddir"/arch/*/; do
+ [[ $arch = */x86/ ]] && continue
+ echo "Removing $(basename "$arch")"
+ rm -r "$arch"
done
- # Fix file conflict with -doc package
- rm "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild"/Kconfig.*-*
-
- # Add objtool for CONFIG_STACK_VALIDATION
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/tools"
- cp -a tools/objtool "${pkgdir}/usr/lib/modules/${_kernver}/build/tools"
-
- chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
- find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
-
- # strip scripts directory
- find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
- case "$(file -bi "${binary}")" in
- *application/x-sharedlib*) # Libraries (.so)
- /usr/bin/strip ${STRIP_SHARED} "${binary}";;
- *application/x-archive*) # Libraries (.a)
- /usr/bin/strip ${STRIP_STATIC} "${binary}";;
- *application/x-executable*) # Binaries
- /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
+ msg2 "Removing documentation..."
+ rm -r "$builddir/Documentation"
+
+ msg2 "Removing broken symlinks..."
+ find -L "$builddir" -type l -printf 'Removing %P\n' -delete
+
+ msg2 "Removing loose objects..."
+ find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
+
+ msg2 "Stripping build tools..."
+ local file
+ while read -rd '' file; do
+ case "$(file -bi "$file")" in
+ application/x-sharedlib\;*) # Libraries (.so)
+ strip -v $STRIP_SHARED "$file" ;;
+ application/x-archive\;*) # Libraries (.a)
+ strip -v $STRIP_STATIC "$file" ;;
+ application/x-executable\;*) # Binaries
+ strip -v $STRIP_BINARIES "$file" ;;
+ application/x-pie-executable\;*) # Relocatable binaries
+ strip -v $STRIP_SHARED "$file" ;;
esac
- done
-
- # remove unneeded architectures
- rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
-}
-
-_package-docs() {
- pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel (git version)"
- provides=('linux-docs')
-
- cd "${_srcname}"
+ done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
- cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
- find "${pkgdir}" -type f -exec chmod 444 {} \;
- find "${pkgdir}" -type d -exec chmod 755 {} \;
+ msg2 "Adding symlink..."
+ mkdir -p "$pkgdir/usr/src"
+ ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
- # remove files already in linux package
- rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
- rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/Kconfig"
+ msg2 "Fixing permissions..."
+ chmod -Rc u=rwX,go=rX "$pkgdir"
}
-pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
-for _p in ${pkgname[@]}; do
- eval "package_${_p}() {
- $(declare -f "_package${_p#${pkgbase}}")
- _package${_p#${pkgbase}}
+pkgname=("$pkgbase" "$pkgbase-headers")
+for _p in "${pkgname[@]}"; do
+ eval "package_$_p() {
+ $(declare -f "_package${_p#$pkgbase}")
+ _package${_p#$pkgbase}
}"
done