I love github and open source but when you have to install a library that isn’t in your os’s repository, oh boy.

In my current project, I need freetype. It compiles with make and make install. Now it’s in my usr/lib/freetype2 and usr/include/freetype2 directory. The only problem is that the source files expect it to be in usr/lib and usr/include. The only fix is to manually change every include until it matches. You can get creative with find and replace but there is no 1 command fix and no matter what it’s always a lot of work and consumes a lot of time.

While I could sit down and actually do that, I’m just going to have to do the same thing every time I want to compile it on a different distro or on a different system. I’d rather put the files in my source directory so it’ll just compile every time so I only have to do this once.

I’m reasonably sure this isn’t what you’re supposed to do but I’ve shoehorned the last several libraries I needed into my project this way. A shitty hack that I only have to do once is better than a shitty hack I have to do a lot of times.

Is there a better way? It would have been so much easier to make everything have a top level h file but they split it into a lib and src directory which makes everything a huge pain in the ass when it doesn’t work.

  • hedgehog@ttrpg.network
    link
    fedilink
    arrow-up
    2
    ·
    2 months ago

    Can you configure freetype to go straight into /usr/local/lib and /usr/local/include instead, with no freetype/

    Or create a symlink?

    • PhilipTheBucket@ponder.cat
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 months ago

      That is what GNU Stow does, with a lot of package-management-like helper commands which make it all organized and convenient.

    • PenisDuckCuck9001@lemmynsfw.comOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      2 months ago

      Actually that worked for this one. Thanks.

      Edit: never mind. I don’t know why it wasn’t giving me errors as first but it started not compiling again. False alarm.