1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

audio/lpcnet: update 20210629 → 0.5

Uncouple circular build dependency with codec2, ctests reduced to a working set,
build system maintenance for different machines.

PR:	275098
This commit is contained in:
takefu 2023-11-14 18:39:27 -08:00 committed by Yuri Victorovich
parent 0b68738a55
commit a6361e08a0
4 changed files with 46 additions and 55 deletions

View File

@ -1,11 +1,10 @@
PORTNAME= lpcnet
PORTVERSION= 20210629
PORTREVISION= 1
DISTVERSIONPREFIX=v
DISTVERSION= 0.5
PORTEPOCH= 1
CATEGORIES= audio hamradio
MASTER_SITES= http://rowetel.com/downloads/deep/:main \
GH:sub
DISTFILES= lpcnet_191005_v1.0.tgz:main \
${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}:sub
MASTER_SITES= https://rowetel.com/downloads/deep/:ADD
DISTFILES= lpcnet_191005_v1.0.tgz:ADD
MAINTAINER= hamradio@FreeBSD.org
COMMENT= Neural Net speech coding
@ -13,17 +12,17 @@ WWW= https://freedv.org/
LICENSE= LGPL21
LIB_DEPENDS= libcodec2.so:audio/codec2
USES= cmake compiler:c++11-lib
CMAKE_ARGS+= -DMACHINE_CPU:STRING="${MACHINE_CPU}" \
-DWRKDIR:STRING=${WRKDIR}
USE_GITHUB= yes
GH_ACCOUNT= drowe67
GH_PROJECT= LPCNet
GH_TAGNAME= 0dc5935
.include <bsd.port.pre.mk>
.include <bsd.cpu.mk>
.include <bsd.port.post.mk>
CMAKE_ARGS= -DMACHINE_CPU:STRING="${MACHINE_CPU}" \
-DWRKDIR:STRING=${WRKDIR} \
-DWRKSRC:STRING=${WRKSRC}
post-extract:
@${EXTRACT_CMD} xf ${DISTDIR}/lpcnet_191005_v1.0.tgz -C${WRKSRC}/src
.include <bsd.port.mk>

View File

@ -1,7 +1,5 @@
TIMESTAMP = 1641483640
TIMESTAMP = 1699937082
SHA256 (lpcnet_191005_v1.0.tgz) = 509440924751fdd87ffaa5683ee3dddd937af5c833b9104ccce65d51614926c8
SIZE (lpcnet_191005_v1.0.tgz) = 18396516
SHA256 (lpcnet-20210629.tar.gz) = 31a687ac5e822c6c2cf75fe8e7371a5cd834d692635a802ec8fd33dc340d9cf2
SIZE (lpcnet-20210629.tar.gz) = 33016759
SHA256 (drowe67-LPCNet-20210629-0dc5935_GH0.tar.gz) = 31a687ac5e822c6c2cf75fe8e7371a5cd834d692635a802ec8fd33dc340d9cf2
SIZE (drowe67-LPCNet-20210629-0dc5935_GH0.tar.gz) = 33016759
SHA256 (drowe67-LPCNet-v0.5_GH0.tar.gz) = 8c01fb69fc5ef1e33b654d811161c3df3759878c7c61c5d66a149751bd680516
SIZE (drowe67-LPCNet-v0.5_GH0.tar.gz) = 5233217

View File

@ -1,59 +1,51 @@
--- CMakeLists.txt.orig 2021-06-29 09:04:36 UTC
--- CMakeLists.txt.orig 2023-05-05 19:42:19 UTC
+++ CMakeLists.txt
@@ -87,15 +87,32 @@ message(STATUS "Host system arch is: ${CMAKE_SYSTEM_PR
@@ -93,15 +93,27 @@ message(STATUS "Host system arch is: ${CMAKE_SYSTEM_PR
# Detection of available CPU optimizations
if(NOT DISABLE_CPU_OPTIMIZATION)
if(UNIX AND NOT APPLE)
- message(STATUS "Looking for available CPU optimizations on Linux/BSD system...")
- execute_process(COMMAND grep -c "avx2" /proc/cpuinfo
- OUTPUT_VARIABLE AVX2)
- OUTPUT_VARIABLE AVX2_PRESENT)
- execute_process(COMMAND grep -c "avx " /proc/cpuinfo
- OUTPUT_VARIABLE AVX)
- OUTPUT_VARIABLE AVX_PRESENT)
- execute_process(COMMAND grep -c "sse4_1 " /proc/cpuinfo
- OUTPUT_VARIABLE SSE)
- OUTPUT_VARIABLE SSE_PRESENT)
- execute_process(COMMAND grep -c "neon" /proc/cpuinfo
- OUTPUT_VARIABLE NEON)
- OUTPUT_VARIABLE NEON_PRESENT)
+ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+ message(STATUS "Looking for available CPU optimizations on FreeBSD system...")
+ message (STATUS "MACHINE_CPU = ${MACHINE_CPU}")
+ if (MACHINE_CPU MATCHES "avx")
+ set(AVX TRUE)
+ endif()
+ if (MACHINE_CPU MATCHES "avx2")
+ set(AVX2 TRUE)
+ endif()
+ if (MACHINE_CPU MATCHES "sse")
+ set(SSE TRUE)
+ endif()
+ if (MACHINE_CPU MATCHES "neon")
+ set(NEON TRUE)
+ endif()
+ execute_process(COMMAND grep -c "AVX," /var/run/dmesg.boot
+ OUTPUT_VARIABLE AVX_PRESENT)
+ execute_process(COMMAND grep -c "AVX2," /var/run/dmesg.boot
+ OUTPUT_VARIABLE AVX2_PRESENT)
+ execute_process(COMMAND grep -c "SSE," /var/run/dmesg.boot
+ OUTPUT_VARIABLE SSE_PRESENT)
+ execute_process(COMMAND grep -c "NEON," /var/run/dmesg.boot
+ OUTPUT_VARIABLE NEON_PRESENT)
+ else()
+ message(STATUS "Looking for available CPU optimizations on Linux system...")
+ execute_process(COMMAND grep -c "avx2" /proc/cpuinfo
+ OUTPUT_VARIABLE AVX2)
+ OUTPUT_VARIABLE AVX2_PRESENT)
+ execute_process(COMMAND grep -c "avx " /proc/cpuinfo
+ OUTPUT_VARIABLE AVX)
+ OUTPUT_VARIABLE AVX_PRESENT)
+ execute_process(COMMAND grep -c "sse4_1 " /proc/cpuinfo
+ OUTPUT_VARIABLE SSE)
+ OUTPUT_VARIABLE SSE_PRESENT)
+ execute_process(COMMAND grep -c "neon" /proc/cpuinfo
+ OUTPUT_VARIABLE NEON)
+ OUTPUT_VARIABLE NEON_PRESENT)
+ endif()
elseif(APPLE)
if(BUILD_OSX_UNIVERSAL)
# Presume AVX/AVX2 are enabled on the x86 side. The ARM side will auto-enable
@@ -140,36 +157,12 @@ if(${NEON} OR ${NEON} GREATER 0)
# Presume AVX and SSE are enabled on the x86 side. (AVX2 is not guaranteed depending
@@ -164,38 +176,8 @@ elseif(${NEON} AND (${NEON_PRESENT} OR ${NEON_PRESENT}
set(LPCNET_C_PROC_FLAGS -mfpu=neon -march=armv8-a -mtune=cortex-a53)
endif()
# grab latest NN model (or substitute your own)
-# grab latest NN model (or substitute your own)
-set(LPCNET_ROOT http://rowetel.com/downloads/deep/)
-set(LPCNET_FILE lpcnet_191005_v1.0.tgz)
-set(LPCNET_URL ${LPCNET_ROOT}${LPCNET_FILE})
+# retrieved by port
+#set(LPCNET_ROOT http://rowetel.com/downloads/deep/)
+#set(LPCNET_FILE lpcnet_191005_v1.0.tgz)
+#set(LPCNET_URL ${LPCNET_ROOT}${LPCNET_FILE})
-
-if(EXISTS ${CMAKE_BINARY_DIR}/${LPCNET_FILE})
- set(lpcnet_SOURCE_DIR ${CMAKE_BINARY_DIR}/src)
- file(MAKE_DIRECTORY ${lpcnet_SOURCE_DIR})
@ -80,7 +72,9 @@
- FetchContent_Populate(lpcnet)
- endif()
-endif()
+set(lpcnet_SOURCE_DIR ${WRKDIR})
-
+## grab latest NN model (or substitute your own)
+set(lpcnet_SOURCE_DIR ${WRKSRC}/src)
add_subdirectory(src)
# Find codec2
if(CODEC2_BUILD_DIR)
# Ctests ----------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
bin/lpcnet_dec
bin/lpcnet_enc
include/lpcnet/lpcnet_freedv.h
lib/cmake/lpcnetfreedv/lpcnetfreedv-config-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/lpcnetfreedv/lpcnetfreedv-config-release.cmake
lib/cmake/lpcnetfreedv/lpcnetfreedv-config.cmake
lib/liblpcnetfreedv.so
lib/liblpcnetfreedv.so.0.2
lib/liblpcnetfreedv.so.0.5