diff --git a/meson.build b/meson.build index 080766e..31a7243 100644 --- a/meson.build +++ b/meson.build @@ -63,21 +63,22 @@ curl_dep = dependency( ], ) -xxd_prog = find_program('xxd', required: true) -xxd_generator = generator( - xxd_prog, +binh_prog = find_program('scripts/bin2header.py', required: true) +binh_generator = generator( + binh_prog, output: '@PLAINNAME@.c', - arguments: ['-n', '@EXTRA_ARGS@', '-i', '@INPUT@', '@OUTPUT@'], + arguments: ['-v', '@EXTRA_ARGS@', '-i', '@INPUT@', '-o', '@OUTPUT@'], ) # FIXME: the explicit 'B612_Regular_ttf' below would ideally be @PLAINNAME@.underscorify() above except substitution does not work there -font_b612_c = xxd_generator.process( +font_b612_c = binh_generator.process( 'src/fonts/polarsys-b612/fonts/ttf/B612-Regular.ttf', extra_args: 'B612_Regular_ttf', ) -font_mdi_c = xxd_generator.process( + +font_mdi_c = binh_generator.process( 'src/fonts/MaterialDesign-Webfont/fonts/materialdesignicons-webfont.ttf', extra_args: 'mdi_ttf', ) @@ -167,7 +168,6 @@ endif incdir = include_directories('./src/') -openssl_dep = dependency('openssl') zlib_dep = dependency('zlib') if get_option('front-ftxui').enabled() @@ -195,7 +195,6 @@ if get_option('front-ftxui').enabled() ftxui_screen_dep, ftxui_dom_dep, ftxui_component_dep, - openssl_dep, zlib_dep, libatomic, ], @@ -220,7 +219,6 @@ executable( json_dep, thread_dep, curl_dep, - openssl_dep, zlib_dep, libatomic, ], @@ -260,7 +258,6 @@ if get_option('front-lvgl').enabled() curl_dep, lvgl_dep, sdl2_dep, - openssl_dep, zlib_dep, libatomic, date_dep, diff --git a/openwrt-package/voorkant/Makefile b/openwrt-package/voorkant/Makefile new file mode 100644 index 0000000..622e3f8 --- /dev/null +++ b/openwrt-package/voorkant/Makefile @@ -0,0 +1,34 @@ +# FIXME: license text here + +include $(TOPDIR)/rules.mk + +PKG_NAME:=voorkant +PKG_RELEASE:=0_git + +PKG_LICENSE:=MIT + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/meson.mk + +define Package/voorkant + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libcurl +nlohmannjson +libatomic +libstdcpp + TITLE:=Non-web Home Assistant frontend +endef + +define Package/voorkant/description + FIXME +endef + +define Package/voorkant/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt-build/voorkant-lvgl $(1)/usr/bin/ +endef + +MESON_ARGS += \ + --prefer-static -Dlvgl-driver=fbdev -Dfront-ftxui=disabled + +TARGET_LDFLAGS += -latomic -static -lstdc++ -lgcc_eh + +$(eval $(call BuildPackage,voorkant)) diff --git a/openwrt-package/voorkant/src b/openwrt-package/voorkant/src new file mode 120000 index 0000000..c25bddb --- /dev/null +++ b/openwrt-package/voorkant/src @@ -0,0 +1 @@ +../.. \ No newline at end of file diff --git a/scripts/bin2header.py b/scripts/bin2header.py new file mode 100644 index 0000000..a130204 --- /dev/null +++ b/scripts/bin2header.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# taken and modified from https://github.com/user-none/Bin-Headers/blob/aaebde3891957b39e4cc4c7844e1ecdecabeaaa2/bin2header.py, with gratitude +# that repo is licensed under MIT + +import argparse +import sys + +def bin2header(data, var_name='var'): + out = [] + out.append('unsigned char {var_name}[] = {{'.format(var_name=var_name)) + l = [ data[i:i+12] for i in range(0, len(data), 12) ] + for i, x in enumerate(l): + line = ', '.join([ '0x{val:02x}'.format(val=c) for c in x ]) + out.append(' {line}{end_comma}'.format(line=line, end_comma=',' if i