projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 364 forks source link

Fix collisions with projectM <4 #699

Closed hartwork closed 1 year ago

hartwork commented 1 year ago

Hello! :wave:

This addresses the concerns about file collusion between projectM >=4 and projectM <4 in a way where projectM <4 and >=4 can be installed in parallel and Linux distros will remain friends with projectM — that would be nice.

This was discussed with @kblaschke at https://github.com/projectM-visualizer/frontend-libvisual-plug-in/issues/1#issuecomment-1421081449, some ideas are his, some ideas are mine and awaiting review.

This pull request affects three key things:

Looking forward to review and feedback.

Best, Sebastian

revmischa commented 1 year ago

Thinking about this more, I don't really understand the goal. Why would anyone want or need two different versions of projectM installed at a time? If I compile against a shared library then the version of that .so will be built into the binary

https://unix.stackexchange.com/questions/475/how-do-so-shared-object-numbers-work

kblaschke commented 1 year ago

Thinking about this more, I don't really understand the goal. Why would anyone want or need two different versions of projectM installed at a time? If I compile against a shared library then the version of that .so will be built into the binary

I asked the same question in the main discussion linked above. It's all about file name collisions, which is bad for Linux package managers. The .so file/symlink would be the same for all versions, same goes for include dirs/files and pkg-config.

There's a possibility of backporting V4 to an older Linux distro still having V3 and applications using both. A slight possibility would be newer distros also installing both versions, but IMO installing an old, broken library isn't really a good idea.

For future versions, this may come in handy though, see how libSDL struggled with it. They also put the major version into the library base name, to get around this exact issue. Qt is another example. Or the GTK libraries.

hartwork commented 1 year ago

"4.0" looks odd to me, why not just "4"? easier to type and less confusing when we release 4.1 etc

@revmischa good idea, adjusted and pushed.

hartwork commented 1 year ago

I believe, this is good to go by know. Please let me know what more to adjust or fix, if any. Thank you! :beers: