1

I want to build SDL2 from source so I can use a newer version, that prefers dlopen instead of linking to libraries like the package that comes from ubuntu package manager, but also because I want to build it in an older version of Ubuntu so it has better glibc compatibility.

Problem is I also want to produce one artifact that is a debian package of my project, but I need to also have SDL2 built as a debian package that is installed on system to produce the correct rules when packaging my project.

I unpacked the source from SDL2 (2.0.12), used ./configure and make to build the sources. I then used dpkg-buildpackage -us -uc to build the debian package for SDL2. The problem is the resulting package fails to install complaining of an unmet dependency of libudev, which IS already installed in my system. Is there something I am missing when building a debian package from sdl2 souces?

4
  • You have to start with sudo apt-get build-dep libsdl2-2.0-0 to get build-dependencies of current version. Then install newer one with checkinstall.
    – N0rbert
    Dec 20, 2020 at 15:09
  • It almost worked but I got a BS error mkdir -p -- /usr/local/lib/cmake/SDL2 mkdir: cannot create directory '/usr/local/lib/cmake': No such file or directory , like... mkdirp never fails wth
    – eri0o
    Dec 20, 2020 at 16:36
  • Try to run sudo mkdir -p /usr/local/lib/cmake manually.
    – N0rbert
    Dec 20, 2020 at 17:15
  • Hey, it worked! If you make an answer I will accept it. The greatest magic is I never even heard of checkinstall and it works beautifully.
    – eri0o
    Dec 20, 2020 at 22:40

1 Answer 1

1

You have to start with sudo apt-get build-dep libsdl2-2.0-0 to get build-dependencies of current version. Then install newer one with checkinstall.

To fix the error during compilation use sudo mkdir -p /usr/local/lib/cmake .

1
  • Note: Build dependencies installed. I built libSDL2.so from source using SDL2-2.0.22.tar.gz and noticed one has the option of selecting Wayland shared and/or X11 shared. ccmake allowed both options to be YES that generated errors, Wayland shared on its own generated errors, and X11 shared on its own was successful.
    – Sildeag
    Jul 4 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.