[packages/hpklinux] - updated to 4.20.36; no more autotools, just plain makefiles needing patching - added opt patch, re
qboosh
qboosh at pld-linux.org
Fri Mar 18 22:12:41 CET 2022
commit ec6a9b9fea748ee6f1f8bd820484fd82095d13c1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Mar 18 22:14:39 2022 +0100
- updated to 4.20.36; no more autotools, just plain makefiles needing patching
- added opt patch, removed outdated x32 patch
- added python modules
hpklinux-opt.patch | 54 +++++++++++++++++++++++
hpklinux.spec | 126 ++++++++++++++++++++++++++++++++++++++++++++---------
x32.patch | 27 ------------
3 files changed, 160 insertions(+), 47 deletions(-)
---
diff --git a/hpklinux.spec b/hpklinux.spec
index 0907cad..e48d15d 100644
--- a/hpklinux.spec
+++ b/hpklinux.spec
@@ -1,18 +1,34 @@
+#
+# Conditional build:
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
Summary: Linux HPI driver for AudioScience audio adapters
Summary(pl.UTF-8): Linuksowy sterownik HPI do kart dźwiękowych AudioScience
Name: hpklinux
-Version: 4.18.03
+Version: 4.20.36
+%define subver g76c09bc
Release: 1
License: GPL v2
Group: Applications/Sound
#Source0Download: http://www.audioscience.com/internet/download/linux_drivers.htm
-Source0: http://audioscience.com/internet/download/drivers/released/v4/18/03/%{name}-%{version}-1.tar.bz2
-# Source0-md5: 41b1c7223c6300493f3f71be57c39133
-Patch0: x32.patch
+Source0: http://www.audioscience.com/internet/download/drivers/released/v4/20/36/%{name}_%{version}-%{subver}.tar.gz
+# Source0-md5: e99c79747f1e5505f930b159e16abc24
+Patch0: %{name}-opt.patch
URL: http://www.audioscience.com/internet/download/linux_drivers.htm
BuildRequires: autoconf >= 2.50
BuildRequires: automake
BuildRequires: libtool >= 2:1.5
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with python2}
+BuildRequires: python-modules >= 1:2.7
+BuildRequires: python-setuptools
+%endif
+%if %{with python3}
+BuildRequires: python3-modules >= 1:3.4
+BuildRequires: python3-setuptools
+%endif
Requires: %{name}-libs = %{version}-%{release}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -61,27 +77,81 @@ Static HPI library.
%description static -l pl.UTF-8
Statyczna biblioteka HPI.
+%package -n python-hpi
+Summary: Python Linux HPI library
+Summary(pl.UTF-8): Biblioteka Linux HPI dla Pythona
+Group: Libraries/Python
+Requires: %{name}-libs = %{version}-%{release}
+
+%description -n python-hpi
+Python Linux HPI library.
+
+%description -n python-hpi -l pl.UTF-8
+Biblioteka Linux HPI dla Pythona.
+
+%package -n python3-hpi
+Summary: Python Linux HPI library
+Summary(pl.UTF-8): Biblioteka Linux HPI dla Pythona
+Group: Libraries/Python
+Requires: %{name}-libs = %{version}-%{release}
+
+%description -n python3-hpi
+Python Linux HPI library.
+
+%description -n python3-hpi -l pl.UTF-8
+Biblioteka Linux HPI dla Pythona.
+
%prep
-%setup -q -n %{name}-%{version}-1
+%setup -q -n %{name}_%{version}-%{subver}
%patch0 -p1
%build
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-%{__automake}
-%configure \
- --disable-kernel-compile \
- --disable-silent-rules \
- --with-firmware=/lib/firmware
-%{__make}
+CFLAGS="%{rpmcflags} %{rpmcppflags}" \
+%{__make} -C hpi-lib \
+ CC="%{__cc}"
+
+CFLAGS="%{rpmcflags} %{rpmcppflags}" \
+%{__make} -C hpi-cli-apps \
+ CC="%{__cc}"
+
+cd asi-python
+
+%if %{with python2}
+%py_build
+%endif
+
+%if %{with python3}
+%py3_build
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%{__make} -C hpi-lib install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ include-install-dir=%{_includedir}/asihpi \
+ lib-install-dir=%{_libdir}
+
+%{__make} -C hpi-cli-apps install \
DESTDIR=$RPM_BUILD_ROOT \
- INSTALLFIRMWAREPATH=$RPM_BUILD_ROOT/lib/firmware/asihpi
+ bin-install-dir=%{_bindir}
+
+%{__make} -C hpi-drv/firmware \
+ bin-install-base-path=$RPM_BUILD_ROOT/lib/firmware
+
+cd asi-python
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+# package only py3 variant
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/*.py
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -91,7 +161,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README.hpi drvnotes.txt
+%doc README.md
%attr(755,root,root) %{_bindir}/asi_firmware_updater
%attr(755,root,root) %{_bindir}/asihpi*
/lib/firmware/asihpi
@@ -110,9 +180,6 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_libdir}/libhpi.so
%attr(755,root,root) %{_libdir}/libhpimux.so
%attr(755,root,root) %{_libdir}/libhpiudp.so
-%{_libdir}/libhpi.la
-%{_libdir}/libhpimux.la
-%{_libdir}/libhpiudp.la
%{_includedir}/asihpi
%files static
@@ -120,3 +187,22 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libhpi.a
%{_libdir}/libhpimux.a
%{_libdir}/libhpiudp.a
+
+%if %{with python2}
+%files -n python-hpi
+%defattr(644,root,root,755)
+%{py_sitescriptdir}/audioscience
+%{py_sitescriptdir}/hpi-2.0-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-hpi
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/dab_data.py
+%attr(755,root,root) %{_bindir}/dabtest.py
+%attr(755,root,root) %{_bindir}/hpicontrol.py
+%attr(755,root,root) %{_bindir}/hpimixer.py
+%attr(755,root,root) %{_bindir}/hpisave.py
+%{py3_sitescriptdir}/audioscience
+%{py3_sitescriptdir}/hpi-2.0-py*.egg-info
+%endif
diff --git a/hpklinux-opt.patch b/hpklinux-opt.patch
new file mode 100644
index 0000000..c4c11da
--- /dev/null
+++ b/hpklinux-opt.patch
@@ -0,0 +1,54 @@
+--- hpklinux_4.20.36-g76c09bc/hpi-cli-apps/Makefile.orig 2021-10-19 20:33:01.000000000 +0200
++++ hpklinux_4.20.36-g76c09bc/hpi-cli-apps/Makefile 2022-03-18 21:47:57.802049088 +0100
+@@ -33,14 +33,16 @@ AR = $(CROSS_COMPILE)ar
+ LD = $(CROSS_COMPILE)ld
+
+ #WARNFULL_CFLAGS = -Wextra -pedantic -std=gnu99 -Wconversion
+-CFLAGS = -pipe -g -O2 -Wall -DHPI_OS_LINUX -DHPI_BUILD_EXCLUDE_ALL_DEPRECATED \
++CFLAGS += -pipe -Wall -DHPI_OS_LINUX -DHPI_BUILD_EXCLUDE_ALL_DEPRECATED \
+ $(WARNFULL_CFLAGS)
+
+ # Find out if this is a 64-bit build
+-ar_gcc_arch=$(shell $(CC) -dumpmachine | awk -F- '{ print $$1 }')
+-ifeq ($(ar_gcc_arch),x86_64)
++ar_gcc_machine=$(shell $(CC) -dumpmachine)
++ifneq ($(patsubst %gnux32,,$(ar_gcc_machine)),)
++ifeq ($(patsubst x86_64%,,$(ar_gcc_machine)),)
+ CFLAGS += -D HPI_BUILD_64BIT
+ endif
++endif
+
+ bins = asihpitest asihpiassert asihpitune asihpirec asihpiplay \
+ asi_firmware_updater asihpibl asihpirds asihpi_si4688
+--- hpklinux_4.20.36-g76c09bc/hpi-lib/Makefile.orig 2022-03-18 21:49:00.505042730 +0100
++++ hpklinux_4.20.36-g76c09bc/hpi-lib/Makefile 2022-03-18 21:49:05.541682110 +0100
+@@ -37,7 +37,7 @@ LIB_VER_INC = 0
+ lib-version-suffix = $(LIB_VER_MAJOR).$(LIB_VER_MINOR).$(LIB_VER_INC)
+
+ #WARNFULL_CFLAGS = -Wextra -pedantic -std=gnu99 -Wconversion
+-CFLAGS += -ggdb -fPIC -pipe -Wall $(WARNFULL_CFLAGS) \
++CFLAGS += -fPIC -pipe -Wall $(WARNFULL_CFLAGS) \
+ -DHPI_BUILD_DEBUG \
+ -DHPI_BUILD_INCLUDE_INTERNAL \
+ -DHPI_BUILD_EXCLUDE_ALL_DEPRECATED \
+@@ -51,13 +51,17 @@ dynamic-libs = libhpi.so libhpiudp.so li
+ libs = $(static-libs) $(dynamic-libs)
+
+ # Find out if this is a 64-bit build
+-ar_gcc_arch=$(shell $(CC) -dumpmachine | awk -F- '{ print $$1 }')
+-ifeq ($(ar_gcc_arch),x86_64)
++ar_gcc_machine=$(shell $(CC) -dumpmachine)
++ifeq ($(patsubst %gnux32,,$(ar_gcc_machine)),)
++ lib-install-dir-candidates = $(install-prefix)/libx32
++else
++ifeq ($(patsubst x86_64%,,$(ar_gcc_machine)),)
+ CFLAGS += -D HPI_BUILD_64BIT
+- lib-install-dir-candidates = $(install-prefix)/lib64 $(install-prefix)/lib
++ lib-install-dir-candidates = $(install-prefix)/lib64
+ else
+ lib-install-dir-candidates = $(install-prefix)/lib
+ endif
++endif
+
+ #### Detect library destination directory
+ # Use ldconfig to get a list of directories searched for dynamic libraries
diff --git a/x32.patch b/x32.patch
deleted file mode 100644
index dcc7259..0000000
--- a/x32.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- hpklinux-4.14.07/configure.ac~
-+++ hpklinux-4.14.07/configure.ac
-@@ -751,6 +751,7 @@ dnl $ar_gcc_distro = Target Distribution (suse, slackware, etc)
-
-
- AC_MSG_CHECKING(target architecture)
-+ar_gcc_machine=`$CC -dumpmachine`
- ar_gcc_arch=`$CC -dumpmachine | $AWK -F- "{ print \\$[1] }"`
- ar_gcc_distro=`$CC -dumpmachine | $AWK -F- "{ print \\$[2] }"`
- AC_MSG_RESULT("distro:$ar_gcc_distro arch:$ar_gcc_arch")
-@@ -758,8 +759,16 @@ AC_MSG_RESULT("distro:$ar_gcc_distro arch:$ar_gcc_arch")
- AC_SUBST(VENDOR,$ar_gcc_distro)
- AC_SUBST(ARCH,$ar_gcc_arch)
- if test "$ar_gcc_arch" = "x86_64" ; then
-+ case "$ar_gcc_machine" in
-+ *-gnux32)
-+ AC_SUBST(HPI_64BIT)
-+ AC_SUBST(LIB_PATH,libx32)
-+ ;;
-+ *)
- AC_SUBST(HPI_64BIT,"-D HPI_BUILD_64BIT")
- AC_SUBST(LIB_PATH,lib64)
-+ ;;
-+ esac
- else
- AC_SUBST(HPI_64BIT)
- AC_SUBST(LIB_PATH,lib)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/hpklinux.git/commitdiff/ec6a9b9fea748ee6f1f8bd820484fd82095d13c1
More information about the pld-cvs-commit
mailing list