1 |
|
# Copyright 1999-2025 Gentoo Authors
|
|
1 |
# Copyright 2019-2025 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
MODULES_INITRAMFS_IUSE=+initramfs
|
7 |
|
inherit autotools flag-o-matic linux-mod-r1 multiprocessing
|
8 |
|
|
9 |
|
DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
|
10 |
|
HOMEPAGE="https://github.com/openzfs/zfs"
|
11 |
|
|
12 |
|
MODULES_KERNEL_MAX=6.7
|
13 |
|
MODULES_KERNEL_MIN=3.10
|
14 |
|
|
15 |
|
if [[ ${PV} == 9999 ]] ; then
|
16 |
|
EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
|
17 |
|
inherit git-r3
|
18 |
|
unset MODULES_KERNEL_MAX
|
19 |
|
else
|
20 |
|
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/openzfs.asc
|
21 |
|
inherit verify-sig
|
22 |
|
|
23 |
|
MY_PV=${PV/_rc/-rc}
|
24 |
|
SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz"
|
25 |
|
SRC_URI+=" verify-sig? ( https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc )"
|
26 |
|
S="${WORKDIR}/zfs-${PV%_rc?}"
|
27 |
|
|
28 |
|
ZFS_KERNEL_COMPAT="${MODULES_KERNEL_MAX}"
|
29 |
|
# Increments minor eg 5.14 -> 5.15, and still supports override.
|
30 |
|
ZFS_KERNEL_DEP="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
31 |
|
ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))"
|
32 |
|
|
33 |
|
if [[ ${PV} != *_rc* ]] ; then
|
34 |
|
KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc"
|
35 |
|
fi
|
36 |
|
fi
|
37 |
|
|
38 |
|
LICENSE="CDDL MIT debug? ( GPL-2+ )"
|
39 |
|
SLOT="0/${PVR}"
|
40 |
|
IUSE="custom-cflags debug +rootfs"
|
41 |
|
RESTRICT="test"
|
42 |
|
|
|
6 |
PYTHON_COMPAT=( python3_{10..13} )
|
|
7 |
DISTUTILS_USE_PEP517=hatchling
|
|
8 |
inherit distutils-r1
|
|
9 |
|
|
10 |
DESCRIPTION="tmux session manager. built on libtmux"
|
|
11 |
HOMEPAGE="https://tmuxp.git-pull.com"
|
|
12 |
SRC_URI="https://github.com/tmux-python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
13 |
|
|
14 |
LICENSE="MIT"
|
|
15 |
SLOT="0"
|
|
16 |
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
|
|
17 |
|
|
18 |
RDEPEND="
|
|
19 |
>=app-misc/tmux-3.0a
|
|
20 |
=dev-python/libtmux-0.40.1*[${PYTHON_USEDEP}]
|
|
21 |
>=dev-python/colorama-0.3.9[${PYTHON_USEDEP}]
|
|
22 |
>=dev-python/pyyaml-6.0[${PYTHON_USEDEP}]
|
|
23 |
"
|
43 |
24 |
BDEPEND="
|
44 |
|
dev-lang/perl
|
45 |
|
app-alternatives/awk
|
|
25 |
test? (
|
|
26 |
>=dev-python/pytest-6.2.5[${PYTHON_USEDEP}]
|
|
27 |
>=dev-python/pytest-mock-3.14.0[${PYTHON_USEDEP}]
|
|
28 |
>=dev-python/pytest-rerunfailures-4.2[${PYTHON_USEDEP}]
|
|
29 |
!dev-python/flaky
|
|
30 |
)
|
46 |
31 |
"
|
47 |
32 |
|
48 |
|
if [[ ${PV} != 9999 ]] ; then
|
49 |
|
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
|
50 |
|
|
51 |
|
IUSE+=" +dist-kernel-cap"
|
52 |
|
RDEPEND="
|
53 |
|
dist-kernel-cap? ( dist-kernel? (
|
54 |
|
<virtual/dist-kernel-${ZFS_KERNEL_DEP}
|
55 |
|
) )
|
56 |
|
"
|
57 |
|
fi
|
58 |
|
|
59 |
|
# Used to suggest matching USE, but without suggesting to disable
|
60 |
|
PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
|
61 |
|
|
62 |
|
PATCHES=(
|
63 |
|
"${FILESDIR}"/${PN}-2.1.11-gentoo.patch
|
|
33 |
EPYTEST_DESELECT=(
|
|
34 |
# test doesn't get along with sandbox
|
|
35 |
"tests/cli/test_load.py::test_load_zsh_autotitle_warning"
|
64 |
36 |
)
|
65 |
37 |
|
66 |
|
pkg_pretend() {
|
67 |
|
use rootfs || return 0
|
68 |
|
}
|
69 |
|
|
70 |
|
pkg_setup() {
|
71 |
|
local CONFIG_CHECK="
|
72 |
|
EFI_PARTITION
|
73 |
|
ZLIB_DEFLATE
|
74 |
|
ZLIB_INFLATE
|
75 |
|
!DEBUG_LOCK_ALLOC
|
76 |
|
!PAX_KERNEXEC_PLUGIN_METHOD_OR
|
77 |
|
"
|
78 |
|
use debug && CONFIG_CHECK+="
|
79 |
|
DEBUG_INFO
|
80 |
|
FRAME_POINTER
|
81 |
|
!DEBUG_INFO_REDUCED
|
82 |
|
"
|
83 |
|
use rootfs && CONFIG_CHECK+="
|
84 |
|
BLK_DEV_INITRD
|
85 |
|
DEVTMPFS
|
86 |
|
"
|
87 |
|
|
88 |
|
kernel_is -lt 5 && CONFIG_CHECK+=" IOSCHED_NOOP"
|
89 |
|
|
90 |
|
if [[ ${PV} != 9999 ]] ; then
|
91 |
|
local kv_major_max kv_minor_max zcompat
|
92 |
|
zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
93 |
|
kv_major_max="${zcompat%%.*}"
|
94 |
|
zcompat="${zcompat#*.}"
|
95 |
|
kv_minor_max="${zcompat%%.*}"
|
96 |
|
kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \
|
97 |
|
"Linux ${kv_major_max}.${kv_minor_max} is the latest supported version"
|
98 |
|
fi
|
99 |
|
|
100 |
|
linux-mod-r1_pkg_setup
|
101 |
|
}
|
102 |
|
|
103 |
|
src_prepare() {
|
104 |
|
default
|
105 |
|
|
106 |
|
# Run unconditionally (bug #792627)
|
107 |
|
eautoreconf
|
108 |
|
|
109 |
|
if [[ ${PV} != 9999 ]] ; then
|
110 |
|
# Set module revision number
|
111 |
|
sed -Ei "s/(Release:.*)1/\1${PR}-gentoo/" META || die
|
112 |
|
fi
|
113 |
|
}
|
114 |
|
|
115 |
|
src_configure() {
|
116 |
|
use custom-cflags || strip-flags
|
117 |
|
filter-ldflags -Wl,*
|
118 |
|
|
119 |
|
local myconf=(
|
120 |
|
--bindir="${EPREFIX}"/bin
|
121 |
|
--sbindir="${EPREFIX}"/sbin
|
122 |
|
--with-config=kernel
|
123 |
|
--with-linux="${KV_DIR}"
|
124 |
|
--with-linux-obj="${KV_OUT_DIR}"
|
125 |
|
$(use_enable debug)
|
126 |
|
|
127 |
|
# See gentoo.patch
|
128 |
|
GENTOO_MAKEARGS_EVAL="${MODULES_MAKEARGS[*]@Q}"
|
129 |
|
TEST_JOBS="$(makeopts_jobs)"
|
130 |
|
)
|
131 |
|
|
132 |
|
econf "${myconf[@]}"
|
133 |
|
}
|
|
38 |
EPYTEST_IGNORE=(
|
|
39 |
# not actually tests, but throws off test collection
|
|
40 |
"tests/fixtures/"
|
|
41 |
)
|
134 |
42 |
|
135 |
|
src_compile() {
|
136 |
|
emake "${MODULES_MAKEARGS[@]}"
|
137 |
|
}
|
|
43 |
distutils_enable_tests pytest
|
138 |
44 |
|
139 |
|
src_install() {
|
140 |
|
emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install
|
141 |
|
modules_post_process
|
|
45 |
python_prepare_all() {
|
|
46 |
sed -r -e 's:libtmux = "~[0-9.]+":libtmux = "~0.30":' \
|
|
47 |
-i pyproject.toml || die
|
142 |
48 |
|
143 |
|
dodoc AUTHORS COPYRIGHT META README.md
|
|
49 |
distutils-r1_python_prepare_all
|
144 |
50 |
}
|
145 |
51 |
|
146 |
|
pkg_postinst() {
|
147 |
|
linux-mod-r1_pkg_postinst
|
148 |
|
|
149 |
|
if use x86 || use arm ; then
|
150 |
|
ewarn "32-bit kernels will likely require increasing vmalloc to"
|
151 |
|
ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
|
152 |
|
fi
|
153 |
|
|
154 |
|
if has_version sys-boot/grub ; then
|
155 |
|
ewarn "This version of OpenZFS includes support for new feature flags"
|
156 |
|
ewarn "that are incompatible with previous versions. GRUB2 support for"
|
157 |
|
ewarn "/boot with the new feature flags is not yet available."
|
158 |
|
ewarn "Do *NOT* upgrade root pools to use the new feature flags."
|
159 |
|
ewarn "Any new pools will be created with the new feature flags by default"
|
160 |
|
ewarn "and will not be compatible with older versions of OpenZFS. To"
|
161 |
|
ewarn "create a new pool that is backward compatible wih GRUB2, use "
|
162 |
|
ewarn
|
163 |
|
ewarn "zpool create -o compatibility=grub2 ..."
|
164 |
|
ewarn
|
165 |
|
ewarn "Refer to /usr/share/zfs/compatibility.d/grub2 for list of features."
|
166 |
|
fi
|
|
52 |
python_test() {
|
|
53 |
SHELL="/bin/bash" epytest tests
|
167 |
54 |
}
|