diff options
author | Jaco Kroon <jaco@uls.co.za> | 2021-01-08 14:02:40 +0200 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2021-01-22 08:35:22 +0200 |
commit | c3b3b4a73fe525c228f3b60727f59ffc0b7ca1aa (patch) | |
tree | 64dfbce61c46bf8f80472deace68f71080c3a35b /net-misc/dahdi/dahdi-3.1.0-r3.ebuild | |
parent | sys-kernel/gentoo-kernel-bin: bump to 5.10.9 for arm64 (diff) | |
download | gentoo-c3b3b4a73fe525c228f3b60727f59ffc0b7ca1aa.tar.gz gentoo-c3b3b4a73fe525c228f3b60727f59ffc0b7ca1aa.tar.bz2 gentoo-c3b3b4a73fe525c228f3b60727f59ffc0b7ca1aa.zip |
net-misc/dahdi: version bump to fix compiler problems.
1. clang/LLVM
2. Kernel header changes (5.9 onwards)
Three additional patches added to the patch set (two of which from
dahdi-linux/next, and one just submitted):
09-dahdi-3.1.0-r3-remove-32bit-userspace-on-64bit-support.patch
10-dahdi-3.1.0-r3-ioctl-kernel-5.9.patch
11-dahdi-3.1.0-r3-clang.patch
09 is a dependency for 10, which is required since kernel version 5.9.
The former seems to affect 32-bit userspace on 64-bit kernels only,
and according to upstream there are no tests for this.
10 fixes the compile issues for kernels 5.9 onwards (which dropped ioctl
from proc_ops structures.
11 imports clang fixes as per https://issues.asterisk.org/jira/browse/DAHLIN-385
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Closes: https://bugs.gentoo.org/748240
Closes: https://bugs.gentoo.org/740818
Closes: https://github.com/gentoo/gentoo/pull/18990
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'net-misc/dahdi/dahdi-3.1.0-r3.ebuild')
-rw-r--r-- | net-misc/dahdi/dahdi-3.1.0-r3.ebuild | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/net-misc/dahdi/dahdi-3.1.0-r3.ebuild b/net-misc/dahdi/dahdi-3.1.0-r3.ebuild new file mode 100644 index 000000000000..6a86455478f1 --- /dev/null +++ b/net-misc/dahdi/dahdi-3.1.0-r3.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic linux-mod linux-info toolchain-funcs + +MY_P="${P/dahdi/dahdi-linux}" +JNET=1.0.14 +GENTOO=3.1.0-r3 +S="${WORKDIR}/${MY_P}" + +JNET_DRIVERS="cwain qozap ztgsm" + +DESCRIPTION="Kernel modules for Digium compatible hardware (formerly known as Zaptel)" +HOMEPAGE="https://www.asterisk.org" +SRC_URI="https://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/${MY_P}.tar.gz + https://www.junghanns.net/downloads/jnet-dahdi-drivers-${JNET}.tar.gz + https://downloads.uls.co.za/gentoo/dahdi/gentoo-dahdi-patchset-${GENTOO}.tar.bz2 + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fwload-vpmadt032-1.25.0.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-a4a-a0017.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-a4b-d001e.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-a8a-1d0017.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-a8b-1f001e.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-hx8-2.06.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-oct6114-032-1.05.01.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-oct6114-064-1.05.01.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-oct6114-128-1.05.01.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-oct6114-256-1.05.01.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-tc400m-MR6.12.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-te133-7a001e.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-te134-780017.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-te435-13001e.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-te436-10017.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-te820-1.76.tar.gz + https://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fw-vpmoct032-1.12.0.tar.gz +" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" +IUSE="flash oslec" + +PATCHES=( "${WORKDIR}/dahdi-patchset" ) + +CONFIG_CHECK="MODULES PCI ~CRC_CCITT" + +pkg_pretend() { + use oslec && CONFIG_CHECK+=" ECHO" + check_extra_config +} + +src_unpack() { + unpack ${A} + # Copy the firmware tarballs over, the makefile will try and download them otherwise + for file in ${A} ; do + [[ "${file}" = dahdi-fw* ]] || continue + cp "${DISTDIR}"/${file} "${MY_P}"/drivers/dahdi/firmware/ || + die "Error copying ${file} to ${S}/${MY_P}/drivers/dahdi/firmware/" + done + # But without the .bin's it'll still fall over and die, so copy those too. + mv *.bin "${MY_P}"/drivers/dahdi/firmware/ || + die "Error moving firmware files into the right folders." + + for drv in ${JNET_DRIVERS}; do + ln "${WORKDIR}/jnet-dahdi-drivers-${JNET}/${drv}/${drv}.c" "${MY_P}/drivers/dahdi/" || + die "Error linking ${drv}.c from jnet to DAHDI." + ln "${WORKDIR}/jnet-dahdi-drivers-${JNET}/${drv}/${drv}.h" "${MY_P}/drivers/dahdi/" || + die "Error linking ${drv}.h from jnet to DAHDI." + done +} + +src_prepare() { + if use flash; then + sed -i -e "s:/\* #define FXSFLASH \*/:#define FXSFLASH:" include/dahdi/dahdi_config.h || + die "Failed to define FXSFLASH" + sed -i -e "s:/\* #define SHORT_FLASH_TIME \*/:#define SHORT_FLASH_TIME:" \ + include/dahdi/dahdi_config.h || die "Failed to define SHORT_FLASH_TIME" + fi + if use oslec; then + sed -i -e 's:^#include .*oslec[.]h:#include "/usr/src/linux/drivers/misc/echo/oslec.h:' \ + drivers/dahdi/dahdi_echocan_oslec.c || die "Failed to prepare oslec source files." + fi + default +} + +src_compile() { + unset ARCH + emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" KSRC="${KV_OUT_DIR}" \ + DAHDI_MODULES_EXTRA="${JNET_DRIVERS// /.o }.o$(usex oslec " dahdi_echocan_oslec.o" "")" \ + LDFLAGS="$(raw-ldflags)" all +} + +src_install() { + einfo "Installing kernel module" + emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" KSRC="${KV_OUT_DIR}" DESTDIR="${D}" \ + DAHDI_MODULES_EXTRA="${JNET_DRIVERS// /.o }.o$(usex oslec " dahdi_echocan_oslec.o" "")" \ + LDFLAGS="$(raw-ldflags)" install + + # Remove the blank "version" files (these files are all empty, and root owned). + find "${ED}/lib/firmware" -name ".*" -delete || die "Error removing empty firmware version files" + + # If the kernel sources have a System.map, and there a suitable depmod + # available (seemingly when we're not cross-compiling), then the kernel + # sources depmod kicks in. Remove the files caused by that. + find "${ED}/lib/modules" -name "modules.*" -delete || die "Error deleting bogus modules.* files" +} |