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
22 # Set 'version' and 'release' for supported architectures
36 # Define a category for the output of the package name
39 # Use a custom package name
40 pkgname=linux-libre-headers
42 tarname=${program}-${version}-${_gnu_suffix}.tar.lz
45 fetch=http://linux-libre.fsfla.org/pub/linux-libre/releases/${version}-${_gnu_suffix}/$tarname
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
57 # Limit parallel jobs for the compiler
61 srcdir=linux-${version}
65 unpack "${tardir}/$tarname"
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/"
86 find "${destdir}/usr/include" -name '.*' -exec rm -rf {} +
87 rm -f "${destdir}/usr/include/Makefile"