[packages/libLC3plus] - up to 1.4.1, adjusted .pc file for pipewire compatibility, bcond to choose fixed/floating point

qboosh qboosh at pld-linux.org
Sat Mar 23 10:03:29 CET 2024


commit e3061abbca5bff0bc7b2a7fa6bea92d45e27b660
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Mar 23 08:52:31 2024 +0100

    - up to 1.4.1, adjusted .pc file for pipewire compatibility, bcond to choose fixed/floating point

 CMakeLists.txt.in | 186 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 LC3plus.pc.in     |  12 ++++
 libLC3plus.spec   |  40 +++++++-----
 3 files changed, 223 insertions(+), 15 deletions(-)
---
diff --git a/libLC3plus.spec b/libLC3plus.spec
index ea8fbf6..569c8df 100644
--- a/libLC3plus.spec
+++ b/libLC3plus.spec
@@ -1,22 +1,34 @@
+#
+# Conditional build:
+%bcond_with	fixed	# fixed point implementation
+
 Summary:	Fraunhofer LC3plus Codec library
 Summary(pl.UTF-8):	Biblioteka kodeka Fraunhofer LC3plus
 Name:		libLC3plus
-Version:	1.3.6
+Version:	1.4.1
 %define	gitref	887a9e1b3dd5e51462bc60b0400152eab51337ec
 Release:	1
-# build system from BlueKitchen is BSD-licensed
-License:	ETSI IPR + BSD
+License:	ETSI IPR
 Group:		Libraries
-NoSource0:	https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.03.01_60/ts_103634v010301p0.zip
-# NoSource0-md5:	3a3bc7c3ef7dcaede82caa73cd641b61
-Source1:	https://github.com/bluekitchen/libLC3plus/archive/%{gitref}/%{name}-%{gitref}.tar.gz
-# Source1-md5:	ec70471250a579d418b728a76ff685c3
+# search for newer releases at etsi.org
+# also (unofficially?) mirrored at https://github.com/arkq/LC3plus/tags with nice versioning
+Source0:	https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.04.01_60/ts_103634v010401p0.zip
+# NoSource0-md5:	9baaf65d7cf4f6cddfba278a7b8b85f2
+# inspired by https://github.com/bluekitchen/libLC3plus and https://github.com/Quackdoc/libLC3plus
+Source1:	CMakeLists.txt.in
+Source2:	LC3plus.pc.in
 Patch0:		%{name}-dirs.patch
 NoSource:	0
 URL:		https://www.iis.fraunhofer.de/en/ff/amm/communication/lc3.html
 BuildRequires:	cmake >= 3.8
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%if %{with fixed_point}
+%define		srcdir	src/fixed_point
+%else
+%define		srcdir	src/floating_point
+%endif
+
 %description
 LC3plus (Low Complexity Communication Codec Plus) codec library.
 
@@ -40,15 +52,13 @@ Pliki nagłówkowe biblioteki LC3plus.
 
 %{__mv} LC3plus_ETSI_src_* LC3plus_src
 
-%{__tar} xf %{SOURCE1} -C LC3plus_src/src/fixed_point --strip-components=1
-%patch0 -p1
+%{__sed} -e 's, at VERSION@,%{version},' %{SOURCE1} >LC3plus_src/%{srcdir}/CMakeLists.txt
+cp -p %{SOURCE2} LC3plus_src/%{srcdir}
 
 %build
-install -d build
-cd build
-%cmake ../LC3plus_src/src/fixed_point
+%cmake -B build -S LC3plus_src/%{srcdir}
 
-%{__make}
+%{__make} -C build
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -64,11 +74,11 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc LC3plus_src/Readme.txt LC3plus_src/src/fixed_point/{LICENSE,README.md}
+%doc LC3plus_src/Readme.txt
 %attr(755,root,root) %{_libdir}/libLC3plus.so.*.*.*
 
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libLC3plus.so
 %{_includedir}/LC3plus
-%{_pkgconfigdir}/LC3plus.pc
+%{_pkgconfigdir}/lc3plus.pc
diff --git a/CMakeLists.txt.in b/CMakeLists.txt.in
new file mode 100644
index 0000000..daaf354
--- /dev/null
+++ b/CMakeLists.txt.in
@@ -0,0 +1,186 @@
+cmake_minimum_required(VERSION 3.13)
+
+project(lc3plus
+	VERSION @VERSION@
+	DESCRIPTION "LC3plus library"
+	HOMEPAGE_URL "https://www.iis.fraunhofer.de/en/ff/amm/communication/lc3.html"
+	LANGUAGES C)
+
+add_definitions(-DWMOPS=0 -DDONT_COUNT_MEM)
+
+option(FIXED_POINT ON)
+
+if (FIXED_POINT)
+add_library(LC3plus
+    adjust_global_gain_fx.c
+    al_fec.c
+    apply_global_gain_fx.c
+    ari_codec.c
+    attack_detector_fx.c
+    basop_mpy.c
+    basop_util.c
+    constants.c
+    cutoff_bandwidth.c
+    dct2_fx.c
+    dct4_fx.c
+    dec_entropy.c
+    dec_lc3.c
+    detect_cutoff_warped_fx.c
+    enc_entropy.c
+    enc_lc3.c
+    estimate_global_gain_fx.c
+    fft.c
+    imdct_fx.c
+    lc3.c
+    levinson_fx.c
+    ltpf_coder_fx.c
+    ltpf_decoder_fx.c
+    mdct_fx.c
+    mdct_shaping_fx.c
+    near_nyquist_detector_fx.c
+    noise_factor_fx.c
+    noise_filling_fx.c
+    olpa_fx.c
+    pc_apply_fx.c
+    pc_classify_fx.c
+    pc_main_fx.c
+    pc_update_fx.c
+    per_band_energy_fx.c
+    plc_apply_fx.c
+    plc_classify_fx.c
+    plc_damping_scrambling_fx.c
+    plc_lpc_scaling_fx.c
+    plc_main_fx.c
+    plc_noise_substitution_fx.c
+    plc_phecu_f0_refine_first_fx.c
+    plc_phecu_fec_hq_fx.c
+    plc_phecu_lf_peak_analysis_fx.c
+    plc_phecu_peak_locator_fx.c
+    plc_phecu_setf0hz_fx.c
+    plc_phecu_tools_fx.c
+    plc_tdac_fx.c
+    plc_tdc_inverse_odft_fx.c
+    plc_tdc_lagwin_fx.c
+    plc_tdc_main_fx.c
+    plc_tdc_pre_emphasis_fx.c
+    plc_update_aft_imdct_fx.c
+    plc_update_fx.c
+    plc_xcorr_fx.c
+    pvq_dec_fx.c
+    pvq_enc_fx.c
+    pvq_index_fx.c
+    quantize_spec_fx.c
+    reorder_bitstream_fx.c
+    resamp12k8_fx.c
+    residual_coding_fx.c
+    residual_decoding_fx.c
+    rom_basop_util.c
+    scale_signal24_fx.c
+    setup_dec_lc3.c
+    setup_enc_lc3.c
+    sns_compute_scf_fx.c
+    sns_interpolate_scf_fx.c
+    sns_quantize_scf_fx.c
+    tns_coder_fx.c
+    tns_decoder_fx.c
+    basic_op/basop32.c
+    basic_op/control.c
+    basic_op/count.c
+    basic_op/dynmem.c
+    basic_op/enh1632.c
+    basic_op/enh40.c
+    basic_op/enhUL32.c
+)
+
+include_directories(basic_op)
+else ()
+add_library(LC3plus
+    adjust_global_gain.c
+    al_fec_fl.c
+    apply_global_gain.c
+    ari_codec.c
+    attack_detector.c
+    CMakeLists.txt
+    codec_exe.c
+    constants.c
+    cutoff_bandwidth.c
+    dct4.c
+    dec_entropy.c
+    dec_lc3_fl.c
+    detect_cutoff_warped.c
+    enc_entropy.c
+    enc_lc3_fl.c
+    estimate_global_gain.c
+    fft.c
+    imdct.c
+    lc3.c
+    LC3plus.pc.in
+    ltpf_coder.c
+    ltpf_decoder.c
+    makefile
+    mdct.c
+    mdct_shaping.c
+    near_nyquist_detector.c
+    noise_factor.c
+    noise_filling.c
+    olpa.c
+    pc_apply.c
+    pc_classify.c
+    pc_main.c
+    pc_update.c
+    per_band_energy.c
+    plc_classify.c
+    plc_compute_stab_fac.c
+    plc_damping_scrambling.c
+    plc_main.c
+    plc_noise_substitution0.c
+    plc_noise_substitution.c
+    plc_phecu_f0_refine_first.c
+    plc_phecu_fec_hq.c
+    plc_phecu_hq_ecu.c
+    plc_phecu_lf_peak_analysis.c
+    plc_phecu_rec_frame.c
+    plc_phecu_setf0hz.c
+    plc_phecu_spec_ana.c
+    plc_phecu_subst_spec.c
+    plc_phecu_tba_per_band_gain.c
+    plc_phecu_tba_spect_Xavg.c
+    plc_phecu_tba_trans_dect_gains.c
+    plc_phecu_trans_burst_ana_sub.c
+    plc_tdc.c
+    plc_tdc_tdac.c
+    plc_update.c
+    quantize_spec.c
+    reorder_bitstream.c
+    resamp12k8.c
+    residual_coding.c
+    residual_decoding.c
+    setup_com_lc3.c
+    setup_dec_lc3.c
+    setup_enc_lc3.c
+    sns_compute_scf.c
+    sns_interpolate_scf.c
+    sns_quantize_scf.c
+    tns_coder.c
+    tns_decoder.c
+)
+
+include_directories(fft)
+endif ()
+
+SET(CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Wall -W -Wextra -Wno-long-long")
+SET(CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration")
+
+set_target_properties(LC3plus PROPERTIES VERSION ${PROJECT_VERSION})
+set_target_properties(LC3plus PROPERTIES PUBLIC_HEADER lc3.h)
+target_link_libraries(LC3plus m)
+
+include(GNUInstallDirs)
+
+install(TARGETS LC3plus
+	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+	PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/LC3plus)
+
+configure_file(LC3plus.pc.in lc3plus.pc @ONLY)
+
+install(FILES ${CMAKE_BINARY_DIR}/lc3plus.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
diff --git a/LC3plus.pc.in b/LC3plus.pc.in
new file mode 100644
index 0000000..65564b2
--- /dev/null
+++ b/LC3plus.pc.in
@@ -0,0 +1,12 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+
+Name: @PROJECT_NAME@
+Description: @PROJECT_DESCRIPTION@
+Version: @PROJECT_VERSION@
+
+Requires:
+Libs: -L${libdir} -lLC3plus
+Cflags: -I${includedir} -DENABLE_HR_MODE
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libLC3plus.git/commitdiff/e3061abbca5bff0bc7b2a7fa6bea92d45e27b660



More information about the pld-cvs-commit mailing list