Upgrade of linux-libre (6.1.20), Xorg, added ncompress (required by libXpm)
[dragora.git] / recipes / kernel / headers / recipe
blobbb38e9fee629a535af4a12f4ad8c3f58ae365a08
1 # Build recipe for GNU Linux-libre headers.
3 # Copyright (c) 2015-2023 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
18 set -e
20 program=linux-libre
22 # Set 'version' and 'release' for supported architectures
23 case "$(uname -m)" in
24 i?86)
25     version=4.14.305
26     release=1
27     _gnu_suffix="gnu1"
28     ;;
30     version=6.1.20
31     release=1
32     _gnu_suffix="gnu"
33     ;;
34 esac
36 # Define a category for the output of the package name
37 pkgcategory=kernel
39 # Use a custom package name
40 pkgname=linux-libre-headers
42 tarname=${program}-${version}-${_gnu_suffix}.tar.lz
44 # Remote source(s)
45 fetch=http://linux-libre.fsfla.org/pub/linux-libre/releases/${version}-${_gnu_suffix}/$tarname
47 description="
48 The GNU Linux-libre headers (${arch}).
50 This package contains the Linux headers provided by the GNU Linux-libre
51 project to expose the kernel's API.
54 homepage=https://www.gnu.org/software/linux-libre
55 license="GPLv2 only"
57 # Limit parallel jobs for the compiler
58 jobs=1
60 # To match 'srcdir'
61 srcdir=linux-${version}
63 build()
65     unpack "${tardir}/$tarname"
66     unset -v _gnu_suffix
68     cd "$srcdir"
70     patch -p1 < "${worktree}/patches/linux-headers/revert-broken-uapi.patch"
71     patch -p1 < "${worktree}/patches/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch"
73     # Set sane permissions
74     chmod -R u+w,go-w,a+rX-s .
76     make -j${jobs} mrproper
77     make -j${jobs} headers || make -j${jobs} headers_check
79     # Holy molly... the 'headers_install' target cannot be used
80     # because it requires rsync(1), which is not available early.
82     mkdir -p "${destdir}/usr/include"
83     cp -Rp usr/include/* "${destdir}/usr/include/"
85     # Remove cruft
86     find "${destdir}/usr/include" -name '.*' -exec rm -rf {} +
87     rm -f "${destdir}/usr/include/Makefile"