On Tuesday 12 February 2019 18:11:52 Andrej Shadura wrote:
> * Package name    : libldac
>   Version         : 2.0.2
>   Upstream Author : Sony Corporation
> * URL             : https://android.googlesource.com/platform/external/libldac
>                     https://github.com/EHfive/ldacBT
> * License         : Apache 2.0
>   Programming Lang: C
>   Description     : A lossy audio codec for Bluetooth connections
> 
> LDAC is an audio coding technology developed by Sony.
> It enables the transmission of High-Resolution Audio content,
> even over a Bluetooth connection.
> 
> This library comes AOSP, having been released by Sony.

Hello! I tried to prepare Debian packaging for this library. Diff for
debian files is attached. There are two problems which I do not know how
to easily fix:

1) Upstream is stored only in git repository, there are no release tarballs

2) Upstream uses Android build system (Android.bp) which Debian does not
   support and moreover this library (in Android.bp) has specified that
   is built only for ARM architecture.

In attached debian files I fixed second problem by building library
directly in debian/rules file. It is just one 'gcc' call (or better
$(CC) call with passing all flags) so I think it does not make sense to
emulate Android.bp or create a new build system when it is such simple.
And library can be compiled also on x86, it is plain C so there is no
reason to not support non-ARM architectures. Android probably limited it
for ARM as Android in majority runs only on ARM... But I do not know
what to do with first problem.

-- 
Pali Rohár
pali.ro...@gmail.com
diff -Nurp debian/control debian/control
--- debian/control	1970-01-01 01:00:00.000000000 +0100
+++ debian/control	2020-05-08 11:08:45.542150125 +0200
@@ -0,0 +1,31 @@
+Source: libldac
+Maintainer: Name <email>
+Section: libs
+Priority: optional
+Build-Depends: debhelper-compat (= 12)
+Standards-Version: 4.5.0
+Homepage: https://android.googlesource.com/platform/external/libldac
+Rules-Requires-Root: no
+
+Package: libldac2
+Architecture: any
+Multi-Arch: same
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Sony LDAC audio codec, shared libraries
+ LDAC is an audio coding technology developed by Sony that enables the
+ transmission of High Resolution (Hi-Res) Audio content even over a
+ Bluetooth connection.
+ .
+ This package contains the shared libraries.
+
+Package: libldac-dev
+Architecture: any
+Multi-Arch: same
+Section: libdevel
+Depends: libldac2 (= ${binary:Version}), ${misc:Depends}
+Description: Sony LDAC audio codec, development headers
+ LDAC is an audio coding technology developed by Sony that enables the
+ transmission of High Resolution (Hi-Res) Audio content even over a
+ Bluetooth connection.
+ .
+ This package contains the development headers.
diff -Nurp debian/copyright debian/copyright
--- debian/copyright	1970-01-01 01:00:00.000000000 +0100
+++ debian/copyright	2020-05-08 11:08:45.542150125 +0200
@@ -0,0 +1,29 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: libldac
+Upstream-Contact: jeffbai...@google.com, rtenn...@google.com
+Copyright: 2003-2017, Sony Corporation
+Source: https://android.googlesource.com/platform/external/libldac
+License: Apache-2.0
+
+Files: *
+Copyright: 2003-2017, Sony Corporation
+License: Apache-2.0
+
+Files: debian/*
+License: Apache-2.0
+
+License: Apache-2.0
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ .
+ https://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ .
+ On Debian systems, the complete text of the Apache version 2.0 license
+ can be found in "/usr/share/common-licenses/Apache-2.0".
diff -Nurp debian/changelog debian/changelog
--- debian/changelog	1970-01-01 01:00:00.000000000 +0100
+++ debian/changelog	2020-05-08 11:08:45.542150125 +0200
@@ -0,0 +1,5 @@
+libldac (2.0.2-1) unstable; urgency=low
+
+  * Initial release (Closes: #922154)
+
+ -- Name <email>  Fri, 08 May 2020 11:04:14 +0200
diff -Nurp debian/libldac-dev.install debian/libldac-dev.install
--- debian/libldac-dev.install	1970-01-01 01:00:00.000000000 +0100
+++ debian/libldac-dev.install	2020-05-08 11:08:45.542150125 +0200
@@ -0,0 +1,2 @@
+usr/include/*
+usr/lib/*/lib*.so
diff -Nurp debian/libldac2.install debian/libldac2.install
--- debian/libldac2.install	1970-01-01 01:00:00.000000000 +0100
+++ debian/libldac2.install	2020-05-08 11:08:45.542150125 +0200
@@ -0,0 +1 @@
+usr/lib/*/lib*.so.*
diff -Nurp debian/libldac2.symbols debian/libldac2.symbols
--- debian/libldac2.symbols	1970-01-01 01:00:00.000000000 +0100
+++ debian/libldac2.symbols	2020-05-08 11:08:45.542150125 +0200
@@ -0,0 +1,50 @@
+libldacBT_enc.so.2 libldac2 #MINVER#
+* Build-Depends-Package: libldac-dev
+ ldacBT_alter_eqmid_priority@Base 2.0.2
+ ldacBT_close_handle@Base 2.0.2
+ ldacBT_encode@Base 2.0.2
+ ldacBT_free_handle@Base 2.0.2
+ ldacBT_get_bitrate@Base 2.0.2
+ ldacBT_get_eqmid@Base 2.0.2
+ ldacBT_get_error_code@Base 2.0.2
+ ldacBT_get_handle@Base 2.0.2
+ ldacBT_get_sampling_freq@Base 2.0.2
+ ldacBT_get_version@Base 2.0.2
+ ldacBT_init_handle_encode@Base 2.0.2
+ ldacBT_set_eqmid@Base 2.0.2
+ ldaclib_clear_error_code@Base 2.0.2
+ ldaclib_clear_internal_error_code@Base 2.0.2
+ ldaclib_encode@Base 2.0.2
+ ldaclib_flush_encode@Base 2.0.2
+ ldaclib_free_encode@Base 2.0.2
+ ldaclib_free_handle@Base 2.0.2
+ ldaclib_get_branch_version@Base 2.0.2
+ ldaclib_get_config_info@Base 2.0.2
+ ldaclib_get_encode_frame_length@Base 2.0.2
+ ldaclib_get_encode_setting@Base 2.0.2
+ ldaclib_get_error_code@Base 2.0.2
+ ldaclib_get_frame_samples@Base 2.0.2
+ ldaclib_get_handle@Base 2.0.2
+ ldaclib_get_channel@Base 2.0.2
+ ldaclib_get_channel_config_index@Base 2.0.2
+ ldaclib_get_internal_error_code@Base 2.0.2
+ ldaclib_get_major_version@Base 2.0.2
+ ldaclib_get_minor_version@Base 2.0.2
+ ldaclib_get_nlnn@Base 2.0.2
+ ldaclib_get_sampling_rate@Base 2.0.2
+ ldaclib_get_sampling_rate_index@Base 2.0.2
+ ldaclib_get_version@Base 2.0.2
+ ldaclib_check_nlnn_shift@Base 2.0.2
+ ldaclib_init_encode@Base 2.0.2
+ ldaclib_set_config_info@Base 2.0.2
+ ldaclib_set_encode_frame_length@Base 2.0.2
+ ldaclib_set_encode_info@Base 2.0.2
+ ldaclib_set_frame_header@Base 2.0.2
+
+libldacBT_abr.so.2 libldac2 #MINVER#
+* Build-Depends-Package: libldac-dev
+ ldac_ABR_free_handle@Base 2.0.2
+ ldac_ABR_get_handle@Base 2.0.2
+ ldac_ABR_Init@Base 2.0.2
+ ldac_ABR_Proc@Base 2.0.2
+ ldac_ABR_set_thresholds@Base 2.0.2
diff -Nurp debian/rules debian/rules
--- debian/rules	1970-01-01 01:00:00.000000000 +0100
+++ debian/rules	2020-05-08 11:08:45.542150125 +0200
@@ -0,0 +1,24 @@
+#!/usr/bin/make -f
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+%:
+	dh $@
+
+override_dh_auto_clean:
+	rm -f libldacBT_enc.so.2.0.2 libldacBT_abr.so.2.0.2
+
+override_dh_auto_build:
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -lm -Iinc -shared -fPIC -Wl,-soname,libldacBT_enc.so.2 -o libldacBT_enc.so.2.0.2 src/ldaclib.c src/ldacBT.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Iinc -Iabr/inc -shared -fPIC -Wl,-soname,libldacBT_abr.so.2 -o libldacBT_abr.so.2.0.2 abr/src/ldacBT_abr.c libldacBT_enc.so.2.0.2
+
+override_dh_auto_install:
+	mkdir -p debian/tmp/usr/include debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
+	cp -a inc/ldacBT.h src/ldaclib.h src/proto_ldac.h abr/inc/ldacBT_abr.h debian/tmp/usr/include/
+	cp -a libldacBT_enc.so.2.0.2 libldacBT_abr.so.2.0.2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
+	ln -sf libldacBT_enc.so.2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libldacBT_enc.so
+	ln -sf libldacBT_enc.so.2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libldacBT_enc.so.2.0
+	ln -sf libldacBT_enc.so.2.0.2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libldacBT_enc.so.2
+	ln -sf libldacBT_abr.so.2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libldacBT_abr.so
+	ln -sf libldacBT_abr.so.2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libldacBT_abr.so.2.0
+	ln -sf libldacBT_abr.so.2.0.2 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libldacBT_abr.so.2
diff -Nurp debian/source/format debian/source/format
--- debian/source/format	1970-01-01 01:00:00.000000000 +0100
+++ debian/source/format	2020-05-08 11:08:43.070121651 +0200
@@ -0,0 +1 @@
+3.0 (quilt)
diff -Nurp debian/upstream/metadata debian/upstream/metadata
--- debian/upstream/metadata	1970-01-01 01:00:00.000000000 +0100
+++ debian/upstream/metadata	2020-05-08 11:08:43.070121651 +0200
@@ -0,0 +1,2 @@
+Repository: https://android.googlesource.com/platform/external/libldac
+Repository-Browse: https://android.googlesource.com/platform/external/libldac

Reply via email to