[packages/bonk] - new; c++ patch to add missing include and fix illegal conversions

qboosh qboosh at pld-linux.org
Sun Mar 12 07:43:11 CET 2023


commit e3a21def24e3d57214a9b3dae33d27044c7227ea
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 12 07:45:07 2023 +0100

    - new; c++ patch to add missing include and fix illegal conversions

 bonk-c++.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 bonk.spec      | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 107 insertions(+)
---
diff --git a/bonk.spec b/bonk.spec
new file mode 100644
index 0000000..afd18a3
--- /dev/null
+++ b/bonk.spec
@@ -0,0 +1,55 @@
+Summary:	Bonk lossy/lossless audio coder
+Summary(pl.UTF-8):	Stratny i bezstratny koder dźwięku Bonk
+Name:		bonk
+Version:	0.6
+Release:	1
+License:	GPL v2+
+Group:		Applications/Sound
+Source0:	https://logarithmic.net/pfh-files/bonk/%{name}-%{version}.tar.gz
+# Source0-md5:	e89bfb9c7e985b548e8effc3b059b888
+Patch0:		%{name}-c++.patch
+URL:		http://www.logarithmic.net/pfh/bonk
+BuildRequires:	libstdc++-devel
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Bonk is a high quality audio compression program. It can operate in
+either lossless or lossy mode. In lossless mode, the exact original
+WAV file can be recovered from the compressed file. In lossy mode,
+some information is discarded in the compressed file, yielding a much
+higher compression ratio. The information discarded is perceptually
+unimportant, and the result should be a *perceptually* lossless
+encoding.
+
+%description -l pl.UTF-8
+Bonk to program do kompresji dźwięku wysokiej jakości. Może działać w
+trybie stratnym i bezstratnym. W trybie bezstratnym z pliku
+skompresowanego można odtworzyć dokładnie oryginalny plik WAV. W
+trybie stratnym część informacji jest tracona, dzięki czemu osiąga
+dużo większy współczynnik kompresji. Tracone informacje są zmysłowo
+nieistotne, więc wynik powinien być zakodowany *dla słuchu*
+bezstratnie.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+%{__make} \
+	CXX="%{__cxx}" \
+	CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_bindir}
+
+%{__make} install \
+	PREFIX=$RPM_BUILD_ROOT%{_prefix}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README
+%attr(755,root,root) %{_bindir}/bonk
diff --git a/bonk-c++.patch b/bonk-c++.patch
new file mode 100644
index 0000000..31aa45c
--- /dev/null
+++ b/bonk-c++.patch
@@ -0,0 +1,52 @@
+--- bonk-0.6/bonk.cc.orig	2002-06-23 05:58:57.000000000 +0200
++++ bonk-0.6/bonk.cc	2023-03-12 07:40:12.512837219 +0100
+@@ -37,6 +37,7 @@ const char *version = "0.6";
+ #include <vector>
+ #include <string>
+ #include <algorithm>
++#include <cstring>
+ 
+ using namespace std;
+ 
+@@ -559,7 +560,7 @@ FILE *open_dsp(int rate,bool stereo) {
+   return fdopen(device,"wb"); 
+ }
+ 
+-bool has_parameter(int &argc,char **&argv,char *name,char *&value) {
++bool has_parameter(int &argc,char **&argv,const char *name,char *&value) {
+   for(int i=1;i<argc-1;i++) {
+     if (strcasecmp(argv[i],name) == 0) {
+       value = argv[i+1];
+@@ -573,7 +574,7 @@ bool has_parameter(int &argc,char **&arg
+   return false;
+ }
+ 
+-bool has_flag(int &argc,char **&argv,char *name) {
++bool has_flag(int &argc,char **&argv,const char *name) {
+   for(int i=1;i<argc;i++) {
+     if (strcasecmp(argv[i],name) == 0) {
+       for(int j=i;j<argc-1;j++)
+--- bonk-0.6/utility.h.orig	2002-06-23 05:59:12.000000000 +0200
++++ bonk-0.6/utility.h	2023-03-12 07:39:20.093121201 +0100
+@@ -54,8 +54,8 @@ uint16 read_uint16(FILE *f) {
+ // Throwable error structure:
+ 
+ struct error { 
+-  char *message; 
+-  error(char *_message) : message(_message) { } 
++  const char *message; 
++  error(const char *_message) : message(_message) { } 
+ };
+ 
+ // Number of bits required to store a value:
+--- bonk-0.6/wav.h.orig	2002-06-23 05:54:33.000000000 +0200
++++ bonk-0.6/wav.h	2023-03-12 07:39:58.349580615 +0100
+@@ -4,7 +4,7 @@
+ #include <stdio.h>
+ #include "utility.h"
+ 
+-bool read_pattern(FILE *file,char *pattern) {
++bool read_pattern(FILE *file,const char *pattern) {
+   while(*pattern) {
+     if (fgetc(file) != *pattern)
+       return false;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/bonk.git/commitdiff/e3a21def24e3d57214a9b3dae33d27044c7227ea



More information about the pld-cvs-commit mailing list