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

Compilation fails on cairo.h not found #85

Closed
ghost opened this issue Jul 7, 2021 · 17 comments
Closed

Compilation fails on cairo.h not found #85

ghost opened this issue Jul 7, 2021 · 17 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@ghost
Copy link

ghost commented Jul 7, 2021

Describe the bug

Cloned the repo and tried to compile it as mentioned on #78
Returns with file cairo.h not found. (I've installed the cairo package)

FAILED: source_subfolder/libs/core/CMakeFiles/core.dir/__/__/__/__/src/common/cairo.cpp.o 
/gnu/store/9jkrwb0b4nv3za898siggc002xy4vh55-profile/bin/c++  -DDLL_EXPORTS -DWXBUILDING -DWXMAKINGDLL_CORE -DWXUSINGDLL -DWX_PRECOMP -D_GLIBCXX_USE_CXX11_ABI=1 -D_LIB -D_UNICODE -D__WXGTK2__ -D__WXGTK__ -Dcore_EXPORTS -DwxUSE_BASE=0 -DwxUSE_GUI=1 -I/home/anon/.conan/data/libpng/1.6.37/_/_/package/61378f3db01d0a2424aa7ca62df88dcbfa0c279e/include -I/home/anon/.conan/data/libjpeg-turbo/2.0.5/_/_/package/10124878f77fe964cc9acc46bfaa384dae0053a1/include -Ilib/wx/include/gtk2-unicode-3.1 -I../source_subfolder/include -I/home/anon/.conan/data/expat/2.2.9/audacity/stable/package/46863e2dc48a06454dddba7dea457fd3976ba047/include -isystem /home/anon/.conan/data/zlib/1.2.11/_/_/package/46863e2dc48a06454dddba7dea457fd3976ba047/include -m64 -g  -fPIC   -pthread -std=gnu++14  -Winvalid-pch -include "/home/anon/.conan/data/wxwidgets/3.1.3.1-audacity/_/_/build/30cf406d6ca56e351d0981b27cd1fe83fcb3a119/build_subfolder/source_subfolder/libs/core/cotire/core_CXX_prefix.hxx" -MD -MT source_subfolder/libs/core/CMakeFiles/core.dir/__/__/__/__/src/common/cairo.cpp.o -MF source_subfolder/libs/core/CMakeFiles/core.dir/__/__/__/__/src/common/cairo.cpp.o.d -o source_subfolder/libs/core/CMakeFiles/core.dir/__/__/__/__/src/common/cairo.cpp.o -c ../source_subfolder/src/common/cairo.cpp
../source_subfolder/src/common/cairo.cpp:24:10: fatal error: cairo.h: No such file or directory
 #include <cairo.h>
          ^~~~~~~~~
compilation terminated.
[161/596] Building CXX object source_subfolder/libs/core/CMakeFiles/core.dir/__/__/__/__/src/common/bookctrl.cpp.o
[162/596] Building CXX object source_subfolder/libs/core/CMakeFiles/core.dir/__/__/__/__/src/common/checkboxcmn.cpp.o
[163/596] Building CXX object source_subfolder/libs/core/CMakeFiles/core.dir/__/__/__/__/src/common/btncmn.cpp.o
ninja: build stopped: subcommand failed.
wxwidgets/3.1.3.1-audacity: 
WARN: wxwidgets/3.1.3.1-audacity: requirement expat/2.2.9 overridden by your conanfile to expat/2.2.9@audacity/stable 
wxwidgets/3.1.3.1-audacity: WARN: Package binary is corrupted, removing: 30cf406d6ca56e351d0981b27cd1fe83fcb3a119
wxwidgets/3.1.3.1-audacity: WARN: Build folder is dirty, removing it: /home/anon/.conan/data/wxwidgets/3.1.3.1-audacity/_/_/build/30cf406d6ca56e351d0981b27cd1fe83fcb3a119
wxwidgets/3.1.3.1-audacity: ERROR: Package '30cf406d6ca56e351d0981b27cd1fe83fcb3a119' build failed
wxwidgets/3.1.3.1-audacity: WARN: Build folder /home/anon/.conan/data/wxwidgets/3.1.3.1-audacity/_/_/build/30cf406d6ca56e351d0981b27cd1fe83fcb3a119
ERROR: wxwidgets/3.1.3.1-audacity: Error in build() method, line 256
        cmake.build()
        ConanException: Error 1 while executing cmake --build '/home/anon/.conan/data/wxwidgets/3.1.3.1-audacity/_/_/build/30cf406d6ca56e351d0981b27cd1fe83fcb3a119/build_subfolder' '--' '-j4'
CMake Error at cmake-proxies/cmake-modules/conan.cmake:631 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  cmake-proxies/cmake-modules/SneedacityDependencies.cmake:233 (conan_cmake_install)
  cmake-proxies/cmake-modules/SneedacityDependencies.cmake:254 (_conan_install)
  CMakeLists.txt:480 (resolve_conan_dependencies)


-- Configuring incomplete, errors occurred!
See also "/tmp/sneed_build/CMakeFiles/CMakeOutput.log".
See also "/tmp/sneed_build/CMakeFiles/CMakeError.log".

To Reproduce

Steps to reproduce the behavior:

git clone https://github.com/Sneeds-Feed-and-Seed/sneedacity
mkdir sneed_build
cd sneed_build
cmake -G "Unix Makefiles" -Dsneedacity_use_ffmpeg=loaded ../sneedacity
  1. See error

Expected behavior

Package compiles successfully

Additional information:

  • OS: GNU GuixSD
  • Version: Sneedacity master
@sneedcat
Copy link
Contributor

sneedcat commented Jul 7, 2021

Looks like Guix has two cairo packages, cairo and cairo-xcb. Which one of those are you using?

Disclaimer

I'm not a Guix user.

@ghost
Copy link
Author

ghost commented Jul 7, 2021

Tried compiling with either of both the packages installed and I still see the same error.

@sneedcat
Copy link
Contributor

sneedcat commented Jul 7, 2021

Can someone on Nix try to compile this? This might be related to how Nix and Guix handle the filesystem.

@Ckath
Copy link
Contributor

Ckath commented Jul 7, 2021

it could be named differently or be in some subdir, is there a guix development audacity package to peek at?

@sneedcat
Copy link
Contributor

sneedcat commented Jul 7, 2021

@Ckath
Copy link
Contributor

Ckath commented Jul 7, 2021

so they mention some audacity-add-include.patch and audacity-build-with-system-portaudio.patch there, the former of which probably holds the key to this not working as is. if I can find where they are. weird things if from what I can understand of that audacity package it doesnt seem to dep cairo even.

@sneedcat
Copy link
Contributor

sneedcat commented Jul 7, 2021

so they mention some audacity-add-include.patch and audacity-build-with-system-portaudio.patch there, the former of which probably holds the key to this not working as is. if I can find where they are. weird things if from what I can understand of that audacity package it doesnt seem to dep cairo even.

https://guix.gnu.org/en/packages/audacity-2.4.2/

@Ckath
Copy link
Contributor

Ckath commented Jul 7, 2021

I'm not convinced anymore, the one that I thought would magically solve it is just:

Without <sys/time.h>, gettimeofday is undefined.

diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp
index 0187e3962..e15d55f4c 100644
--- a/src/AudioIO.cpp
+++ b/src/AudioIO.cpp
@@ -479,6 +479,8 @@ time warp info and AudioIOListener and whether the playback is looped.
 #include "../lib-src/portmidi/porttime/porttime.h"
 #include "../lib-src/header-substitutes/allegro.h"
 
+#include <sys/time.h>
+
    #define MIDI_SLEEP 10 /* milliseconds */
    // how long do we think the thread that fills MIDI buffers,
    // if it is separate from the portaudio thread,

the other one is portaudio specific

@Ckath
Copy link
Contributor

Ckath commented Jul 7, 2021

it is 2.4.2 though, what are the chances they broke it on guix in all those versions past 2.4.2?
I'll have a look at the 2.4.2 source and see if cairo is even there at that time.

one last thing you can try @Hey-RAM I also see some mentions of packages depping cairomm, which may or may not help compiling for now

@sneedcat
Copy link
Contributor

sneedcat commented Jul 7, 2021

I found this patch also on Gentoo's ebuild. I'm not sure if it applies to 3.0.x builds. All distros stopped updating Audacity from 2.6.x.

@Ckath
Copy link
Contributor

Ckath commented Jul 7, 2021

okay this doesnt help, both times the only place that #include <cairo.h> even gets mentioned is

lib-src/lv2/lv2/plugins/eg-sampler.lv2/sampler_ui.c:32:#include <cairo.h>
lib-src/lv2/lv2/plugins/eg-scope.lv2/examploscope_ui.c:26:#include <cairo.h>

exactly the same for latest sneedacity and audacity 2.4.2

which means theres no logical reason why that would compile fine while sneedacity builds trip on it

@sneedcat
Copy link
Contributor

sneedcat commented Jul 7, 2021

Looks like the problem is related to compiling wxWidgets. wxWidgets depends on GTK2 and probably uses Cairo surfaces. Maybe we should move wxWidgets to GTK3.

@Ckath
Copy link
Contributor

Ckath commented Jul 7, 2021

ah so its finally running into the wxWidgets packaging pain
in that case this issue really becomes #47, which might take a while to get to

@sneedcat
Copy link
Contributor

sneedcat commented Jul 7, 2021

Can you try to compile a simple C program like

#include <cairo.h>

int main() {}

with clang pkg-config --libs --cflags gtkmm-3.0 cairomm-1.0 -O3 main.c -o main
Maybe it's an environment issue

@ghost
Copy link
Author

ghost commented Jul 8, 2021

Yeah, so it might be a fault on my side, running the trivial program above fails with the same error. Any idea how to fix it?

Edit:
Using pkg-config properly compiles `#include <cairo.h> \n int main() {}`. Using the same configuration for sneedacity fails.

@ghost ghost changed the title Building package fails on GNU Guix Compilation fails on cairo.h not found Jul 8, 2021
@Ckath
Copy link
Contributor

Ckath commented Jul 8, 2021

not sure if anyone is familiar with guix on this project, I'm not at any rate. but assuming you tried the before mentioned cairomm package too, no clue. will have to bother some guix people somewhere to find out whats going on.

@mariaWitch mariaWitch added the bug Something isn't working label Jul 16, 2021
@ImGonnaChuck ImGonnaChuck added this to the Correct bugs milestone Mar 24, 2022
@ImGonnaChuck
Copy link
Contributor

Compiling on Guix is not supported.

@ImGonnaChuck ImGonnaChuck added the wontfix This will not be worked on label Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants