summaryrefslogblamecommitdiff
path: root/system/easy-kernel/APKBUILD
blob: d98dc529fbb95bdae3fe183a9afb17a1c59ca316 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                  
                                                                        
                    

              
                                   


                                                         
                                       
                      
          
                                         
          

                                                        
                                                                  
                                                                      
                                                                              
                            
                    
                  
                     
                   
                      
                           

                        
         




                             
                                                                              
                      
                                                 






                                           
                       







                                            











                                                                                



                                                          

                                                                       

                                                  





                                                                      

 


                                                             
                                                           












                                                                                 

                                                             

 
       

                                                             
                                     
                                                                           

                                                                                                                                                               
                                                                                                                                                          
                                                                                                                                                      
                                                                                                                                              
                                                                                                                                            
                                                                                                                                               
                                                                                                                                             
                                                                                                                                                


                                                                                                                                                     
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
_pkgname=easy-kernel
pkgver=4.14.76
pkgrel=11
pkgname=$_pkgname-$pkgver-mc$pkgrel
pkgdesc="The Linux kernel, packaged for your convenience"
url="https://kernel.org/"
arch="all"
options="!check !dbg !strip !tracedeps"
license="GPL-2.0-only"
depends=""
makedepends="bc gzip lzop openssl-dev xz"
install=""
provides="easy-kernel=$pkgver-r$pkgrel"
subpackages="$_pkgname-modules-$pkgver-mc$pkgrel:modules
	$_pkgname-src-$pkgver-mc$pkgrel:src linux-headers:headers"
source="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.tar.xz
	https://distfiles.adelielinux.org/source/linux-4.14-mc$pkgrel.patch.xz
	ast-endianness.patch
	config-ppc64
	config-ppc
	config-x86_64
	config-pmmx
	config-aarch64
	futex-cmpxchg.patch
	kernel.h
	uapi-ether.patch
	"
builddir="$srcdir/linux-4.14"

prepare() {
	default_prepare
	cd "$srcdir"
	cat linux-4.14-mc$pkgrel.patch.xz | unxz -> linux-4.14-mc$pkgrel.patch
	cd "$builddir"
	patch -Np1 <../linux-4.14-mc$pkgrel.patch
	cd "$srcdir"
	cp config-$CARCH linux-4.14/.config
	cp -pr linux-4.14 linux-src
}

build() {
	cd "$builddir"
	make LDFLAGS=""
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir"/boot
	make INSTALL_PATH="$pkgdir"/boot \
		INSTALL_MOD_PATH="$pkgdir" \
		install modules_install

	if [ -f "$pkgdir"/boot/vmlinuz ]; then
		mv "$pkgdir"/boot/vmlinuz \
			"$pkgdir"/boot/vmlinuz-$pkgver-mc$pkgrel-easy
	fi
	if [ -f "$pkgdir"/boot/vmlinux ]; then
		mv "$pkgdir"/boot/vmlinux \
			"$pkgdir"/boot/vmlinux-$pkgver-mc$pkgrel-easy
	fi

	install -D "$builddir"/include/config/kernel.release \
		"$pkgdir"/usr/share/kernel/easy-$pkgver-mc$pkgrel/kernel.release
}

modules() {
	pkgdesc="Modules / device drivers for easy-kernel"
	provides="easy-kernel-modules=$pkgver-r$pkgrel"
	autodeps=0  # modules should not depend on src just for symlink
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/modules "$subpkgdir"/lib/
	rm "$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy/build
	rm "$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy/source
	ln -s "../../../usr/src/linux-$pkgver-mc$pkgrel" \
		"$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy/build
	ln -s "../../../usr/src/linux-$pkgver-mc$pkgrel" \
		"$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy/source
}

headers() {
	pkgdesc="System headers provided by the Linux kernel"
	cd "$builddir"
	patch -Np1 -i "$srcdir"/../revert-broken-uapi.patch

	mkdir -p "$subpkgdir"/usr
	make headers_install INSTALL_HDR_PATH="$subpkgdir/usr"

	find "$subpkgdir/usr" \( -name .install -o -name ..install.cmd \) -exec \
		rm -f {} \;

	# provided by libdrm
	rm -rf "$subpkgdir"/usr/include/drm

	# needed for spl, VMware on x86, etc
	install -D -m644 "$builddir"/include/generated/utsrelease.h \
		"$subpkgdir"/usr/include/linux/utsrelease.h

	cp "$srcdir"/kernel.h "$subpkgdir"/usr/include/linux/
}

src() {
	pkgdesc="Kernel source code used to build the kernel"
	provides="easy-kernel-src=$pkgver-r$pkgrel"
	mkdir -p "$subpkgdir"/usr/src
	mv "$srcdir"/linux-src "$subpkgdir"/usr/src/linux-$pkgver-mc$pkgrel
}
sha512sums="77e43a02d766c3d73b7e25c4aafb2e931d6b16e870510c22cef0cdb05c3acb7952b8908ebad12b10ef982c6efbe286364b1544586e715cf38390e483927904d8  linux-4.14.tar.xz
d8bfe29549e0a1a7e86d8ead682e93e704c8d0b4b454f8a75306aa7ef5d628cab3a65847e27502866ed5901aff189eb440d47d8e07c2c34ebb7d2d82b717a64b  linux-4.14-mc11.patch.xz
e41d9111219342ad13367902242444ecdd847a93575c3f9709d6c6a075bc650f4a15be9db1a8798435fc0a0b56d41705829bfe0d2c2d88f8d1c28931e27ef5be  ast-endianness.patch
3d3ee8f7c27ff20b9569ec4dadabd2c733102d1cf5fd3f6abfefaa4dc34e5161b793d82bce7c29f02aafe74791b345b516bf5b1503d36bf714ef2e70507a2bc3  config-ppc64
1112f6c3fcfd7fdc0ef4d5e85df5d3adea430a9c7b4c2b34508a215f7ba14c863ccd7a5e17f13ed46c518bafec30cfb3ced70c465137c14ef5fc998b6cbcca1f  config-ppc
438a66561200d570b3bf6ab0481d9725a9f482b1fcf852a90f99c6db5aa4ee02d2b67b57235bb7afc01515a79289407cbe111536340824d7a391ce1a658c9a76  config-x86_64
e8f7749877c5b2574e7e853b757477b8f99d757b43225d4f83d611c20215b8b2690cc85369608c2dc8f7d6a619136a2d7dde4648031e37d2ae4dcc5ba85652c8  config-pmmx
0174e758ea318171c8036426ed0ad22aaafbdbac755732a46397686ec8dd24e977447f6fc275d59eed43ea047fc8a36061b7ad0d5862d522222455a60c943027  config-aarch64
64486a4f53046a69f727cecd8c39400b50c2d2b15e3b5ca8c18b8249d25990f3a872ec064800ba3d190f9d25b4518899b9ea3675920f487108102856d6beb51e  futex-cmpxchg.patch
fdd94b9de7b374f1812dec0f9971c05f5e52177ca4a16c8071daa620c18265b38f656f528e7045a24f30af01f05e53e54546fb0a9e93773cf191866e87de505d  kernel.h
af093e91e8c8371629948e2e574f8764078564bc027ba5b2f87886f8827d9a63ba7a43717552fe7e3cc9212b2fd55b8633b12900c3d8cdc6c035d52b389c39e5  uapi-ether.patch"