jgaa/restc-cpp

Flatpak

bunglesss opened this issue · 4 comments

Hi,

I was hoping to use this in a project, it looks very good. I'm using Gnome Builder, which uses Flatpak to build and distribute projects.

I managed to work out how to use Boost, but I'm struggling with restc-cpp. I did this ...

    {
        "name": "restc-cpp",
    "buildsystem": "cmake",
        "sources": [
            {
                "type": "url",
                "url": "https://github.com/jgaa/restc-cpp.git"
            }
        ]
    },

Which seems to work. But then in the meson.build file, I think I need to tell my program to use what it's compiled within Flatpak. I'm trying this kind of thing ...

restc-cpp_inc = include_directories('??)
restc-cpp_lib = static_library(...)
restc-cpp_dep = declare_dependency(link_with : restc-cpp_lib,
include_directories : restc-cpp_inc)

The thing is, I don't think restc-cpp has a pkg-config file, which would make the above easier?

Any help with this would be great.

jgaa commented

I have no experience with gnome builder or flatpak, so 'm afraid I can't help you with that.

Wondered if you might know about a pkg-config file being distributed with this. Not sure whether cmake uses that, but seemed like a big thing with autotools and maybe other build systems to make it easier to pull in libraries ...

Hmm ... this looks promising ...

https://mesonbuild.com/Dependencies.html#cmake

This kind of works for the Flatpak part ...

    {
        "name": "restc-cpp",
    "buildsystem": "cmake",
    "config-opts": [
	"-DRESTC_CPP_WITH_UNIT_TESTS=OFF"
	],
        "sources": [
            {
                "type": "git",
                "url": "https://github.com/jgaa/restc-cpp.git"
            }
        ]
    },

It blows up thought because it seems it's trying to download to further dependencies internally? Is there any way around that?

I can then seemingly do this in the Meson bit ...

cmake_dep = dependency('rest-cpp', method : 'cmake')

Very new to all this stuff, Cmake, Meson and Flatpak. I'll get to write some C++ eventually :)