From 7a72f5e8651a3cd451ae20f5efe91d7bd17b6f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=A4ppeler?= Date: Mon, 28 Dec 2020 23:35:12 +0100 Subject: [PATCH] New Package: Direwolf --- srcpkgs/direwolf/patches/10-Fix-cross.patch | 13 ++++++++ srcpkgs/direwolf/patches/20-Fix-musl.patch | 37 +++++++++++++++++++++ srcpkgs/direwolf/template | 15 +++++++++ 3 files changed, 65 insertions(+) create mode 100644 srcpkgs/direwolf/patches/10-Fix-cross.patch create mode 100644 srcpkgs/direwolf/patches/20-Fix-musl.patch create mode 100644 srcpkgs/direwolf/template diff --git a/srcpkgs/direwolf/patches/10-Fix-cross.patch b/srcpkgs/direwolf/patches/10-Fix-cross.patch new file mode 100644 index 00000000000..fdf8d2f2db0 --- /dev/null +++ b/srcpkgs/direwolf/patches/10-Fix-cross.patch @@ -0,0 +1,13 @@ +Reason: Set RUN_NEON for cross compiling with arm architectures + +diff -ru CMakeLists.txt CMakeLists.txt +--- CMakeLists.txt 2020-10-28 01:45:30.000000000 +0100 ++++ d/CMakeLists.txt 2020-12-29 09:49:49.006446795 +0100 +@@ -8,6 +8,7 @@ + set(direwolf_VERSION_PATCH "0") + set(direwolf_VERSION_SUFFIX "") + ++set(RUN_NEON "advanced") + # options + option(FORCE_SSE "Compile with SSE instruction only" OFF) + option(FORCE_SSSE3 "Compile with SSSE3 instruction only" OFF) diff --git a/srcpkgs/direwolf/patches/20-Fix-musl.patch b/srcpkgs/direwolf/patches/20-Fix-musl.patch new file mode 100644 index 00000000000..4a6c2066912 --- /dev/null +++ b/srcpkgs/direwolf/patches/20-Fix-musl.patch @@ -0,0 +1,37 @@ +Reason: Fixes local declarations when using musl + +diff -ru conf/CMakeLists.txt conf/CMakeLists.txt +--- conf/CMakeLists.txt 2020-10-28 01:45:30.000000000 +0100 ++++ conf/CMakeLists.txt 2020-12-29 09:49:13.435238905 +0100 +@@ -26,7 +26,7 @@ + + # install udev rules for CM108 + if(LINUX) +- install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/) ++ install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /usr/lib/udev/rules.d/) + endif() + + install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR}) +diff -ru src/decode_aprs.c src/decode_aprs.c +--- src/decode_aprs.c 2020-10-28 01:45:30.000000000 +0100 ++++ src/decode_aprs.c 2020-12-29 09:53:24.021103609 +0100 +@@ -3930,7 +3930,7 @@ + * models before getting to the more generic APY. + */ + +-#if defined(__WIN32__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__) ++#if ! defined(__GLIBC__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__) + qsort (tocalls, num_tocalls, sizeof(struct tocalls_s), tocall_cmp); + #else + qsort (tocalls, num_tocalls, sizeof(struct tocalls_s), (__compar_fn_t)tocall_cmp); +diff -ru src/direwolf.h src/direwolf.h +--- src/direwolf.h 2020-10-28 01:45:30.000000000 +0100 ++++ src/direwolf.h 2020-12-29 09:50:44.182848501 +0100 +@@ -282,7 +282,7 @@ + char *strcasestr(const char *S, const char *FIND); + + +-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__) ++#if ! defined(__GLIBC__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__) + + // strlcpy and strlcat should be in string.h and the C library. diff --git a/srcpkgs/direwolf/template b/srcpkgs/direwolf/template new file mode 100644 index 00000000000..d1046766766 --- /dev/null +++ b/srcpkgs/direwolf/template @@ -0,0 +1,15 @@ +# Template file for 'direwolf' +pkgname=direwolf +version=1.6 +revision=1 +build_style=cmake +hostmakedepends="gcc make hamlib" +makedepends="alsa-lib-devel libudev-devel hamlib-devel" +depends="hamlib" +short_desc="Software AX.25/APRS TNC" +maintainer="David Käppeler " +license="GPL-3.0-or-later" +homepage="https://github.com/wb2osz/direwolf" +distfiles="https://github.com/wb2osz/direwolf/archive/${version}.tar.gz" +checksum=208b0563c9b339cbeb0e1feb52dc18ae38295c40c0009d6381fc4acb68fdf660 +python_version=3