mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-02-02 22:07:13 +08:00
👷 add simple menu
fix deps detection
This commit is contained in:
parent
ae8737ccdb
commit
f7da6dd6e2
@ -40,3 +40,7 @@ else()
|
|||||||
message(STATUS "No colored compiler diagnostic set for '${CMAKE_CXX_COMPILER_ID}' compiler.")
|
message(STATUS "No colored compiler diagnostic set for '${CMAKE_CXX_COMPILER_ID}' compiler.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Enables STL container checker if not building a release.
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
add_definitions(-D_GLIBCXX_ASSERTIONS)
|
||||||
|
endif()
|
||||||
|
20
meson.build
20
meson.build
@ -8,11 +8,23 @@ project('cachyos-installer', 'cpp',
|
|||||||
'werror=true',
|
'werror=true',
|
||||||
'b_ndebug=if-release'])
|
'b_ndebug=if-release'])
|
||||||
|
|
||||||
|
is_debug_build = get_option('buildtype').startswith('debug')
|
||||||
cc = meson.get_compiler('cpp')
|
cc = meson.get_compiler('cpp')
|
||||||
|
if cc.get_id() == 'clang'
|
||||||
|
specific_cc_flags = [
|
||||||
|
'-nostdlib++',
|
||||||
|
'-nodefaultlibs',
|
||||||
|
]
|
||||||
|
specific_link_flags = [
|
||||||
|
'-fuse-ld=lld',
|
||||||
|
]
|
||||||
|
add_global_arguments(cc.get_supported_arguments(specific_cc_flags), language : 'cpp')
|
||||||
|
add_global_link_arguments(cc.get_supported_link_arguments(specific_link_flags), language : 'cpp')
|
||||||
|
endif
|
||||||
|
|
||||||
# Common dependencies
|
# Common dependencies
|
||||||
fmt = dependency('fmt', version : ['>=8.0.0'], fallback : ['fmt', 'fmt_dep'])
|
fmt = dependency('fmt', version : ['>=8.0.0'], fallback : ['fmt', 'fmt_dep'])
|
||||||
ftxui = dependency('ftxui', version : ['>=0.11.1'], modules : ['ftxui::screen', 'ftxui::dom', 'ftxui::component'], fallback : ['ftxui', 'ftxui_dep'])
|
ftxui = dependency('ftxui', modules : ['ftxui::screen', 'ftxui::dom', 'ftxui::component'], fallback : ['ftxui', 'ftxui_dep'])
|
||||||
nlohmann_json = dependency('nlohmann_json', version : ['>=3.10.4'], fallback : ['nlohmann_json', 'nlohmann_json_dep'])
|
nlohmann_json = dependency('nlohmann_json', version : ['>=3.10.4'], fallback : ['nlohmann_json', 'nlohmann_json_dep'])
|
||||||
|
|
||||||
src_files = files(
|
src_files = files(
|
||||||
@ -48,7 +60,11 @@ if cc.get_id() == 'gcc'
|
|||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('buildtype') != 'debug'
|
if is_debug_build
|
||||||
|
possible_cc_flags += [
|
||||||
|
'-D_GLIBCXX_ASSERTIONS',
|
||||||
|
]
|
||||||
|
else
|
||||||
if cc.get_id() == 'gcc'
|
if cc.get_id() == 'gcc'
|
||||||
possible_cc_flags += [
|
possible_cc_flags += [
|
||||||
'-flto',
|
'-flto',
|
||||||
|
49
src/main.cpp
49
src/main.cpp
@ -4,6 +4,15 @@
|
|||||||
#include <regex>
|
#include <regex>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include <ftxui/component/captured_mouse.hpp>
|
||||||
|
#include <ftxui/component/component.hpp>
|
||||||
|
#include <ftxui/component/component_options.hpp>
|
||||||
|
#include <ftxui/component/screen_interactive.hpp>
|
||||||
|
#include <ftxui/dom/elements.hpp>
|
||||||
|
#include <ftxui/screen/screen.hpp>
|
||||||
|
|
||||||
|
using namespace ftxui;
|
||||||
|
|
||||||
static constexpr int32_t SLEEP_TIMEOUT = 15;
|
static constexpr int32_t SLEEP_TIMEOUT = 15;
|
||||||
|
|
||||||
void show_iwctl() {
|
void show_iwctl() {
|
||||||
@ -52,4 +61,44 @@ int main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto screen = ScreenInteractive::Fullscreen();
|
||||||
|
|
||||||
|
auto button_ok = Button("Ok", screen.ExitLoopClosure());
|
||||||
|
auto button_quit = Button("Quit", screen.ExitLoopClosure());
|
||||||
|
|
||||||
|
auto component = Container::Horizontal({
|
||||||
|
button_ok,
|
||||||
|
button_quit,
|
||||||
|
});
|
||||||
|
|
||||||
|
auto dialog = vbox({
|
||||||
|
text("TODO!!"),
|
||||||
|
separator(),
|
||||||
|
hbox({
|
||||||
|
button_ok->Render(),
|
||||||
|
button_quit->Render(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
// -------- Center Menu --------------
|
||||||
|
/* clang-format off */
|
||||||
|
auto center_dialog = hbox({
|
||||||
|
filler(),
|
||||||
|
border(dialog),
|
||||||
|
filler(),
|
||||||
|
}) | vcenter;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
|
auto renderer = Renderer(component, [&] {
|
||||||
|
return vbox({
|
||||||
|
text("New CLI Installer") | bold,
|
||||||
|
filler(),
|
||||||
|
// -------- Center Menu --------------
|
||||||
|
center_dialog | hcenter,
|
||||||
|
filler(),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
screen.Loop(renderer);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[wrap-git]
|
[wrap-git]
|
||||||
url = https://github.com/fmtlib/fmt.git
|
url = https://github.com/fmtlib/fmt.git
|
||||||
revision = 491ba2dda5a04c2438abb6bd90219de773793ec0
|
revision = c472a2781852778cc3f06521a3384a2c5c5822d5
|
||||||
|
|
||||||
patch_directory = fmt
|
patch_directory = fmt
|
||||||
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
project('fmt', 'cpp',
|
project('fmt', 'cpp',
|
||||||
version : '8.0.1',
|
version : '8.0.1',
|
||||||
license : 'BSD',
|
license : 'BSD',
|
||||||
default_options : ['cpp_std=c++14']
|
default_options : [
|
||||||
|
'cpp_std=c++14',
|
||||||
|
'default_library=static',
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
fmt_private_cpp_args = [ ]
|
fmt_private_cpp_args = [ ]
|
||||||
|
@ -65,7 +65,8 @@ ftxui_dom_lib = static_library('ftxui_dom',
|
|||||||
'src/ftxui/dom/util.cpp',
|
'src/ftxui/dom/util.cpp',
|
||||||
'src/ftxui/dom/vbox.cpp'
|
'src/ftxui/dom/vbox.cpp'
|
||||||
],
|
],
|
||||||
include_directories : [ftxui_inc, ftxui_priv_inc]
|
include_directories : [ftxui_inc, ftxui_priv_inc],
|
||||||
|
link_with : [ftxui_screen_lib]
|
||||||
)
|
)
|
||||||
|
|
||||||
ftxui_component_lib = static_library('ftxui_component',
|
ftxui_component_lib = static_library('ftxui_component',
|
||||||
@ -97,7 +98,9 @@ ftxui_component_lib = static_library('ftxui_component',
|
|||||||
'src/ftxui/component/terminal_input_parser.hpp',
|
'src/ftxui/component/terminal_input_parser.hpp',
|
||||||
'src/ftxui/component/toggle.cpp'
|
'src/ftxui/component/toggle.cpp'
|
||||||
],
|
],
|
||||||
include_directories : [ftxui_inc, ftxui_priv_inc]
|
include_directories : [ftxui_inc, ftxui_priv_inc],
|
||||||
|
link_with : [ftxui_dom_lib],
|
||||||
|
dependencies : [thread_dep]
|
||||||
)
|
)
|
||||||
|
|
||||||
ftxui_dep = declare_dependency(
|
ftxui_dep = declare_dependency(
|
||||||
|
Loading…
Reference in New Issue
Block a user