i think this works
This commit is contained in:
parent
c3e57757e2
commit
4ea6801df2
|
@ -73,6 +73,7 @@
|
||||||
|
|
||||||
darwinPkgs = nixpkgs.lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
darwinPkgs = nixpkgs.lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
||||||
Foundation
|
Foundation
|
||||||
|
MediaPlayer
|
||||||
]);
|
]);
|
||||||
in
|
in
|
||||||
with pkgs; {
|
with pkgs; {
|
||||||
|
|
29
meson.build
29
meson.build
|
@ -79,13 +79,34 @@ endforeach
|
||||||
|
|
||||||
deps = []
|
deps = []
|
||||||
|
|
||||||
deps += dependency('fmt')
|
fmt = dependency('fmt', required: false)
|
||||||
deps += dependency('libcurl')
|
libcurl = dependency('libcurl', required: false)
|
||||||
deps += dependency('tomlplusplus')
|
tomlpp = dependency('tomlplusplus', required: false)
|
||||||
deps += dependency('yyjson')
|
yyjson = dependency('yyjson', required: false)
|
||||||
|
|
||||||
|
if not fmt.found()
|
||||||
|
fmt = cpp.find_library('fmt', required: true)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if not libcurl.found()
|
||||||
|
libcurl = cpp.find_library('curl', required: true)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if not tomlpp.found()
|
||||||
|
tomlpp = cpp.find_library('tomlplusplus', required: true)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if not yyjson.found()
|
||||||
|
yyjson = cpp.find_library('yyjson', required: true)
|
||||||
|
endif
|
||||||
|
|
||||||
|
foreach dep : [fmt, libcurl, tomlpp, yyjson]
|
||||||
|
deps += dep
|
||||||
|
endforeach
|
||||||
|
|
||||||
if host_machine.system() == 'darwin'
|
if host_machine.system() == 'darwin'
|
||||||
deps += dependency('Foundation')
|
deps += dependency('Foundation')
|
||||||
|
deps += dependency('MediaPlayer')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if host_machine.system() == 'linux'
|
if host_machine.system() == 'linux'
|
||||||
|
|
|
@ -130,7 +130,7 @@ WeatherOutput Weather::getWeatherInfo() const {
|
||||||
"weather?q={}&appid={}&units={}",
|
"weather?q={}&appid={}&units={}",
|
||||||
location, apiKey, units);
|
location, apiKey, units);
|
||||||
|
|
||||||
result = MakeApiRequest(apiUrl);
|
result = MakeApiRequest(apiUrl).value();
|
||||||
} else {
|
} else {
|
||||||
const auto [lat, lon] = get<Coords>(loc);
|
const auto [lat, lon] = get<Coords>(loc);
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ WeatherOutput Weather::getWeatherInfo() const {
|
||||||
"weather?lat={:.3f}&lon={:.3f}&appid={}&units={}",
|
"weather?lat={:.3f}&lon={:.3f}&appid={}&units={}",
|
||||||
lat, lon, apiKey, units);
|
lat, lon, apiKey, units);
|
||||||
|
|
||||||
result = MakeApiRequest(apiUrl);
|
result = MakeApiRequest(apiUrl).value();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the cache with the new data
|
// Update the cache with the new data
|
||||||
|
|
Loading…
Reference in a new issue