!1 添加源代码

Merge pull request !1 from sherlock2010/master
This commit is contained in:
openeuler-ci-bot 2019-12-21 18:25:58 +08:00 committed by Gitee
commit f0c3e7b858
5 changed files with 149 additions and 0 deletions

View File

@ -0,0 +1,52 @@
diff -up libgdither-0.6/Makefile.default libgdither-0.6/Makefile
--- libgdither-0.6/Makefile.default 2005-07-24 22:19:30.000000000 +0200
+++ libgdither-0.6/Makefile 2008-06-10 20:05:01.000000000 +0200
@@ -1,6 +1,6 @@
VERSION = 0.6
-PREFIX = /usr/local
-CFLAGS = -Wall -g -I. -O3 -funroll-loops -finline-limit=9999999 -ffast-math -malign-double -march=`uname -m` -fPIC
+PREFIX = /usr
+CFLAGS = $(INIT_CFLAGS) -I. -ffast-math -fPIC
TARDIR = libgdither-$(VERSION)
@@ -10,20 +10,22 @@ gdither.o: gdither.c gdither.h gdither_t
$(CC) $(CFLAGS) -c gdither.c
libgdither.so: gdither.o
- $(CC) -shared gdither.o -o libgdither.so
+ $(CC) -shared gdither.o -Wl,-soname,libgdither.so.1 -o libgdither.so.1.0
libgdither.pc: libgdither.pc.in Makefile
sed -e 's|@VERSION@|$(VERSION)|' -e 's|@PREFIX@|$(PREFIX)|' \
libgdither.pc.in > libgdither.pc
install: all
- install -d $(PREFIX)/lib/
- install libgdither.so $(PREFIX)/lib/
- install -d $(PREFIX)/include/
- install gdither.h $(PREFIX)/include/
- install gdither_types.h $(PREFIX)/include/
- install -d $(PREFIX)/lib/pkgconfig/
- install libgdither.pc $(PREFIX)/lib/pkgconfig/
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ install -pm 0755 libgdither.so* $(DESTDIR)$(LIBDIR)
+ ln -s libgdither.so.1.0 $(DESTDIR)$(LIBDIR)/libgdither.so.1
+ ln -s libgdither.so.1.0 $(DESTDIR)$(LIBDIR)/libgdither.so
+ mkdir -p $(DESTDIR)$(PREFIX)/include/libgdither
+ install -pm 0644 gdither.h $(DESTDIR)$(PREFIX)/include/libgdither
+ install -pm 0644 gdither_types.h $(DESTDIR)$(PREFIX)/include/libgdither
+ mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig/
+ install -pm 0644 libgdither.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
clean:
rm -f *.o *.so
diff -up libgdither-0.6/libgdither.pc.default libgdither-0.6/libgdither.pc
--- libgdither-0.6/libgdither.pc.default 2005-07-24 22:19:30.000000000 +0200
+++ libgdither-0.6/libgdither.pc 2008-06-10 20:04:09.000000000 +0200
@@ -6,4 +6,4 @@ Name: libgdither
Version: 0.6
Description: A library for applying dithering to PCM audio sources
Libs: -L${libdir} -lgdither -lm
-Cflags: -I${includedir}
+Cflags: -I${includedir}/libgdither

13
libgdither-0.6-gavl.patch Normal file
View File

@ -0,0 +1,13 @@
diff -ur libgdither-0.6/gdither.c libgdither/gdither.c
--- libgdither-0.6/gdither.c 2005-07-24 22:19:30.000000000 +0200
+++ libgdither/gdither.c 2008-04-20 13:43:33.000000000 +0200
@@ -342,7 +342,7 @@
for (i=0; (i + pos) < length && i < GDITHER_CONV_BLOCK; i++) {
conv[i] = x[pos + i];
}
- gdither_runf(s, channel, i, conv, ycast + s->channels * step);
+ gdither_runf(s, channel, i, conv, ycast + pos * step);
pos += i;
}
}

View File

@ -0,0 +1,11 @@
--- libgdither-0.6/Makefile 2018-04-10 18:23:46.000822954 +0200
+++ libgdither-0.6/Makefile 2018-04-10 18:25:25.783013273 +0200
@@ -10,7 +10,7 @@
$(CC) $(CFLAGS) -c gdither.c
libgdither.so: gdither.o
- $(CC) -shared gdither.o -Wl,-soname,libgdither.so.1 -o libgdither.so.1.0
+ $(CC) $(LDFLAGS) -shared gdither.o -Wl,-soname,libgdither.so.1 -o libgdither.so.1.0
libgdither.pc: libgdither.pc.in Makefile
sed -e 's|@VERSION@|$(VERSION)|' -e 's|@PREFIX@|$(PREFIX)|' \

BIN
libgdither-0.6.tar.gz Normal file

Binary file not shown.

73
libgdither.spec Normal file
View File

@ -0,0 +1,73 @@
Name: libgdither
Version: 0.6
Release: 19
Summary: A library for performing audio dithering on PCM samples
License: GPLv2+
URL: http://plugin.org.uk/libgdither/
Source0: http://plugin.org.uk/libgdither/libgdither-%{version}.tar.gz
BuildRequires: gcc-c++ fftw-devel >= 3.0.0
Patch0001: libgdither-0.6-default.patch
Patch0002: libgdither-0.6-gavl.patch
Patch0003: libgdither-0.6-ldflags.patch
%description
Libgdither is a GPL'd library library for performing audio dithering on PCM samples. The dithering
process should be carried out before reducing the bit width of PCM audio data (eg. float to 16 bit
int conversions) to preserve audio quality.
It can do conversions between any combination of:
in out (optionally interleaved)
-------------------------------------------------------------
normalised mono float 8bit unsigned ints
normalised mono double 16bit signed ints
32bit signed ints
normalised float
normalised double
At any bitdepth supported by the input and output formats.
%package devel
Summary: Development documents for %{name}
Requires: %{name} = %{version}-%{release}
%description devel
Head files,libraries and other development documents for %{name}.
%prep
%autosetup -p1
%build
export INIT_CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="%{build_ldflags}"
%make_build
%install
%make_install LIBDIR=%{_libdir}
find $RPM_BUILD_ROOT -name '*.la' | xargs rm -rf
sed -i -e 's|/usr/local|%{_prefix}|g' $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libgdither.pc
sed -i -e 's|%{_prefix}/lib|%{_libdir}|' $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libgdither.pc
%check
make test CFLAGS="%{optflags} -I%{_builddir}/%{?buildsubdir}" --std=c99 -Werror
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%license COPYING
%doc README
%{_libdir}/*.so.*
%files devel
%{_includedir}/%{name}
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%changelog
* Sat Dec 21 2019 zhouyihang <zhouyihang1@huawei.com> - 0.6-19
- Package init