Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add raptor2 compatibility for lrdf #194

Closed
schivmeister opened this issue Aug 11, 2014 · 3 comments
Closed

add raptor2 compatibility for lrdf #194

schivmeister opened this issue Aug 11, 2014 · 3 comments

Comments

@schivmeister
Copy link

Hello fellow drummers

Hydrogen will fail to build with lrdf if raptor2 is installed:

/usr/include/lrdf.h:8:20: fatal error: raptor.h: No such file or directory

This is obviously because the includes are in a different path for raptor2, and although cmake (by way of pkg-config, whether or not LRDF is ON) populates the relevant env vars, they are not used:

[hydrogen-0.9.6]$ grep -Ri 'raptor2'
CMakeCache.txt:LRDF_CFLAGS:INTERNAL=-I/usr/include/raptor2
CMakeCache.txt:LRDF_INCLUDE_DIRS:INTERNAL=/usr/include/raptor2
CMakeCache.txt:LRDF_STATIC_CFLAGS:INTERNAL=-I/usr/include/raptor2
CMakeCache.txt:LRDF_STATIC_INCLUDE_DIRS:INTERNAL=/usr/include/raptor2
CMakeCache.txt:LRDF_STATIC_LDFLAGS:INTERNAL=-llrdf;-lraptor2;-lcrypto
CMakeCache.txt:LRDF_STATIC_LIBRARIES:INTERNAL=lrdf;raptor2;crypto

This is actually an old issue and I have propagated fixes to some other upstream projects since 2011, but I never got around to reporting to hydrogen.

Now that the buildsystem changed to cmake, my old patch no longer works. The fix is buildsystem-dependent, so here I propose a simple cmake-friendly modification:

--- hydrogen-0.9.6.orig/CMakeLists.txt
+++ hydrogen-0.9.6/CMakeLists.txt
@@ -193,6 +193,9 @@
 FIND_HELPER(PULSEAUDIO pulseaudio pulse/pulseaudio.h pulse)
 FIND_HELPER(LASH lash-1.0 lash/lash.h lash)
 FIND_HELPER(LRDF lrdf lrdf.h lrdf)
+IF(LRDF_FOUND)
+    include_directories(${LRDF_INCLUDE_DIRS})
+ENDIF(LRDF_FOUND)
 FIND_HELPER(RUBBERBAND rubberband RubberBandStretcher.h rubberband)
 FIND_HELPER(CPPUNIT cppunit cppunit/TestCase.h cppunit)
 # CHECK FOR Qt4

That should be it -- keep up the good work, guys!

@mauser
Copy link
Member

mauser commented Aug 14, 2014

Hi Ray!

I'm trying to reproduce the situation on my Ubuntu, but i couldn't make it happen.. Here liblrdf0-dev depends on libraptor1-dev, which provides /usr/include/raptor.h. So it is guaranteed that the file is there. What is the situation on your system?

@schivmeister
Copy link
Author

This is simply for compatibility with systems that have lrdf + raptor2 (as per issue title). In this case lrdf.h includes raptor.h, which does not exist on the system. What exists on the system is raptor2, which includes both versions of the header in its own directory (/usr/include/raptor2). Pkg-config picks this up nicely, but with cmake you have to tell it what information to use for the found dependency (lrdf.h).

@mauser
Copy link
Member

mauser commented Aug 26, 2014

Thanks Ray, this is now in the repository.

@mauser mauser closed this as completed Aug 26, 2014
vladimir-kirillovskiy added a commit to vladimir-kirillovskiy/hydrogen that referenced this issue Jun 11, 2017
mauser pushed a commit that referenced this issue Jul 4, 2017
* Possible fix for missing raptor.h #496

* this line was added for #194 but it seems like it's not needed

* fixed spelling error

* added checkboxes for view menu's options

* remove unneeded header I added by mistake

* removed fix for #496 to match with main branch of the main repository

* revert last commit

* workaround for my wrong branch managment

* added checkboxes for view menu's options

* remove unneeded header I added by mistake

* workaround for my wrong branch managment

* commit CMakeList as in the main branch

* converted spaces to tabs
mauser pushed a commit that referenced this issue Jul 4, 2017
* Possible fix for missing raptor.h #496

* this line was added for #194 but it seems like it's not needed

* fixed spelling error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants