Comments (23)
@relrod iniparser version 3.1 and 4.0 has the exact same arguments, so i don't know if a version detection is actually possible in a configure script. Would it be a sufficient workaround to use a compilation option?
So if you run something like:
./configure --legacy-iniparser
Would make it build with iniparser version 3.1
from cava.
fwiw (@sedrubal you might be interested in this) for now I built this in a COPR:
https://copr.fedorainfracloud.org/coprs/codeblock/cava/
So: sudo dnf copr enable codeblock/cava && sudo dnf install cava
should work on F22-24.
from cava.
@PureTryOut looks like you are using your system wide instalation of iniparser (not the one budled in cava). It fails with too many arguments in this function:
cava.c:193:3: error: too many arguments to function ‘iniparser_getseckeys’
iniparser_getseckeys(ini, "eq", keys);
^
In file included from cava.c:52:0:
/usr/include/iniparser.h:142:9: note: declared here
char ** iniparser_getseckeys(dictionary * d, char * s);
In your version of iniparser the function iniparser_getseckeys
takes two argements. However both the bundled version and the one on github takes three.
I suggest trying to uppgrade your version of iniparser.
from cava.
I have the same issue on fedora:23
which ships version 3.1
(which is btw. the latest version on iniparser homepage ;) )
In version 4.0
they added the 3rd argument.
Can you somehow support version 3.1
, too? I think this would be good, as fedora usually provides the latest version of packages in comparison to other distros and as even they provide only version 3.1
, other distros won't be able to build cava with system's iniparser, too.
from cava.
Good idea @sedrubal, I think it can be done with the help of the config-script.
from cava.
Sorry I kinda forgot about this issue. Gentoo ships 3.1 as well, which explains the problem.
@sedrubal could you explain me how to edit ./configure so it'll use 3.1 properly?
from cava.
@PureTryOut as a workaround you can remove your installed version of iniparser. This will force cava to install the bundled version 4 of iniparser.
To create a permanent fix I will have to use the config script to detect the version. Then in the source I must create a separate code for version 3.1 that uses the old method of detecting number of keys. Just don't have the time right now.
from cava.
Cool, thanks @karlstav
from cava.
Sadly that does not seem to work. It just starts complaining that it can't find iniparser.h...
from cava.
@PureTryOut did you run ./configure
and make
again after you uninstalled iniparser?
from cava.
Woops, I'm stupid. I forgot ./configure
. It compiled and installed fine, but to run it I actually had to install iniparser again. It now runs fine though.
from cava.
@karlstav any update here? Wanting to possibly packaging this for Fedora (I saw the specfile in the readme, I was thinking of submitting it as an actual package though) and it would have to use the system iniparser
, but I'm hitting this same error.
from cava.
@relrod i started looking for a way to detect (in the config script) iniparser version or whether the function iniparser_getseckeys
takes two or three arguments. But I'm stuck... Maybe i should post an issue at the iniparser github page?
from cava.
@relrod the copr build works on fedora 24 with fedoras iniparser. Thanks so far ;)
from cava.
@karlstav Yep, that would work!
from cava.
@sedrubal Yeah, I patched it in the specfile, not ideal but it works for now :)
from cava.
created a separate branch for this iss83
, you can test it already, not sure if it works.
from cava.
also test if the equalizer actually works with this. (that is the only thing this problematic function (iniparser_getseckeys) is actually used for)
from cava.
cava.c:216:8: error: assignment to expression with array type
keys = iniparser_getseckeys(ini, "eq");
^
In the Fedora COPR package, I did this:
--- cava.c.orig 2016-06-15 17:05:34.548834878 -0400
+++ cava.c 2016-06-15 17:05:09.976739403 -0400
@@ -208,8 +208,8 @@
smcount = iniparser_getsecnkeys(ini, "eq");
if (smcount > 0) {
smooth = malloc(smcount*sizeof(*smooth));
- const char *keys[smcount];
- iniparser_getseckeys(ini, "eq", keys);
+ char *keys[smcount];
+ memcpy(keys, iniparser_getseckeys(ini, "eq"), smcount*sizeof(*smooth));
for (int sk = 0; sk < smcount; sk++) {
smooth[sk] = iniparser_getdouble(ini, keys[sk], 1);
}
...although I'm not 100% sure the last argument to memcpy
is correct. I'm not a C coder by trade ;)
from cava.
Try it now, I changed it to match the Fedora COPR package.
It looks strange to use memcpy, but it might be because there was a problem with memory leak in the iniparser_getseckeys
function. Which was why they added the third argument.
from cava.
@karlstav well in C, functions can't return arrays, so I think memcpy is the only way without passing the pointer directly to the function wanting to return an array (like they do in the new iniparser). But again I'm not a C coder by trade, so I could be off here.
That change did work and builds cleanly for me. :) But before you just match the COPR package -- you should probably double check the smcount*sizeof(*smooth)
parameter to memcpy
- That was a guess on my part, I'm not sure if it's right. If it is, then +1 on this patch, it works well for me.
from cava.
I'm not 100% on memory allocation myself, but I think this might be sufficient:
char **keys = iniparser_getseckeys(ini, "eq");
the function returns a pointer to statically allocated character string. So I don't think any memory allocation is necessary. I made the change so you can test it.
from cava.
Works fine for me! @karlstav thanks for this fix and for cava, it's awesome!
from cava.
Related Issues (20)
- Is it possible to remove the bar heads from idle Cava? HOT 2
- Release the app on Fdroid HOT 4
- Two squares (not umlaut) on top of each bar if starting over ssh HOT 4
- Very high sensivity HOT 2
- Segmentation fault HOT 2
- Keyboard controls are ignored when pausing PipeWire input HOT 6
- Erratic when waveform activated HOT 2
- Cava ignores the config file HOT 2
- Fails to build with iniparser 4.2 HOT 3
- Cava terminated with SIGSEGV at startup HOT 28
- missing <stdlib.h> in config.c
- Is it possible to integrate into a console-based music player? HOT 1
- Error: failure in opening stream (Invalid number of channels) HOT 1
- error while loading shared libraries: libiniparser.so HOT 11
- Linking fails on 10.6: `Undefined symbols: _glGenVertexArrays, _glReleaseShaderCompiler, _glBindVertexArray` HOT 5
- Cava causing crashes of pipewire HOT 1
- Gradient depends on the window size HOT 5
- Waves don't work properly in raw mode. HOT 18
- Error while loading shared libraries...
- Split view or something HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cava.