MB_MSXHUB_API ?= https://msxhub.com/api
$(call mb_make_call,mb_doc_variable_deep,MB_MSXHUB_API,"Resource identifier for msxhub package rest api.")
MB_MSXHUB_CACHE ?= $(MB_OS_CACHE)/msxbuild/msxhub
$(call mb_make_call,mb_doc_variable_deep,MB_MSXHUB_CACHE,"Cache storage location.")
define _mb_msxhub_file_fetch
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_os_echo_command,$(MB_I18N_MSXHUB_FILE_FETCH) $(subst $(MB_MSXHUB_API)/,,$(1)))
$(MB_ᕽᕽᕽ )$(if $(wildcard $(dir $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)))),,$(call mb_make_call,mb_os_dir_create,$(dir $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)))))
$(MB_ᕽᕽᕽ )$(if $(wildcard $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1))),,wget -O $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)) $(1))
endef
# NOTE: with HDD import/export we get duplicate files after openMSX run, so force to lowercase.
define mb_msxhub_file
$(MB_ᕽᕽᕽ )$(if $(wildcard $(MB_MSXHUB_CACHE)/$(2)),,$(call mb_make_call,_mb_msxhub_file_fetch,$(MB_MSXHUB_API)/$(2)))
$(MB_ᕽᕽᕽ )$(if $(wildcard $(1)/$(call mb_make_call,mb_make_lowercase,$(notdir $(2)))),,$(call mb_make_call,mb_os_file_copy,$(MB_MSXHUB_CACHE)/$(2),$(1)/$(call mb_make_call,mb_make_lowercase,$(notdir $(2)))))
endef
$(call mb_make_call,mb_doc_function_deep,mb_msxhub_file,"Installs msxsub packages from slug into dir.","
")
#
# Operating System (minimal)
#
define mb_msxhub_get_msxdos1_boot
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS1/1.03-2/get/MSXDOS1/MSXDOS.SYS)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS1/1.03-2/get/MSXDOS1/COMMAND.COM)
endef
$(call mb_make_call,mb_doc_function_deep,mb_msxhub_get_msxdos1_boot,"Installs msxdos1 boot files into dir.","")
define mb_msxhub_get_msxdos2_boot
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
endef
$(call mb_make_call,mb_doc_function_deep,mb_msxhub_get_msxdos2_boot,"Installs msxdos2 boot files into dir.","")
define mb_msxhub_get_nextor_boot
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/NEXTOR.SYS)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/COMMAND2.COM)
endef
$(call mb_make_call,mb_doc_function_deep,mb_msxhub_get_nextor_boot,"Installs nextor boot files into dir.","")
#
# Native OS utils
#
define mb_msxhub_get_msxdos2_utils
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/UTILS/CHKDSK.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/UTILS/DISKCOPY.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/UTILS/FIXDISK.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/UTILS/UNDEL.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/UTILS/XCOPY.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/UTILS/XDIR.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2/2.20-1/get/MSXDOS2/UTILS/KMODE.COM)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_msxdos2_utils,"Installs msxdos2 util files into dir.","")
define mb_msxhub_get_nextor_utils
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/DELALL.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/DEVINFO.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/DRIVERS.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/DRVINFO.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/FASTOUT.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/LOCK.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/MAPDRV.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/EMUFILE.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/RALLOC.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/Z80MODE.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/NSYSVER.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/NEXBOOT.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),NEXTOR/2.1.0-1/get/NEXTOR/CONCLUS.COM)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_nextor_utils,"Installs nextor util files into dir.","")
#
# Compilers
#
define mb_msxhub_get_macro80
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/CREF80.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/L80.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/LIB80.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MACRO80/2.0-1/get/MACRO80/M80.COM)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_macro80,"Installs macro80 package into dir.","")
define mb_msxhub_get_z80asmuk
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/BINTOASM.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/DUMP.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOCOM.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/PRL.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/PRNTOSYM.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/RSX.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/ZSM.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/ZSMPP.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),Z80ASMUK/3.4-1/get/Z80ASMUK/HEXTOBIN.COM)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_z80asmuk,"Installs z80asmuk package into dir.","")
define mb_msxhub_get_wbass2
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),WBASS2/2.0-1/get/WBASS2/zoekram.bin)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),WBASS2/2.0-1/get/WBASS2/wbass2.bin)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),WBASS2/2.0-1/get/WBASS2/wbass2.bas)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_wbass2,"Installs wbass2 package into dir.","")
define mb_msxhub_get_konpass
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),KONPASS/1.3.0-1/get/KONPASS/KONPASS.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),KONPASS/1.3.0-1/get/KONPASS/KONPASS.DAT)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_konpass,"Installs konpass package into dir.","")
#
# Compressors
#
define mb_msxhub_get_pmarc
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMARC.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMCAT.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMEXE2.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMEXT.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMSET.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),PMARC/2.0-1/get/PMARC/PMSFX2.COM)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_pmarc,"Installs pmarc package into dir.","")
define mb_msxhub_get_lhpack
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),LHPACK/1.00-1/get/LHPACK/lhpack.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_lhpack,"Installs lhpack package into dir.","")
define mb_msxhub_get_lhext
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),LHEXT/1.34-2/get/LHEXT/lhext.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_lhext,"Installs lhext package into dir.","")
define mb_msxhub_get_gunzip
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),GUNZIP/1.1-1/get/GUNZIP/gunzip.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_gunzip,"Installs gunzip package into dir.","")
define mb_msxhub_get_tunzip
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),TUNZIP/0.91-1/get/TUNZIP/tunzip.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_tunzip,"Installs tunzip package into dir.","")
define mb_msxhub_get_popcom
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),POPCOM/1.00-2/get/POPCOM/popcom.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_popcom,"Installs popcom package into dir.","")
#
# Tools
#
define mb_msxhub_get_make
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MAKE/2.00-1/get/MAKE/MAKE.COM)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_make,"Installs make package into dir.","")
define mb_msxhub_get_adir
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),ADIR/1.3-1/get/ADIR/adir.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_adir,"Installs adir package into dir.","")
define mb_msxhub_get_turbo
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),TURBO/2.1-1/get/TURBO/turbo.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_turbo,"Installs turbo package into dir.","")
define mb_msxhub_get_baskom
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),BASKOM/1.0-1/get/BASKOM/baskom.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_baskom,"Installs baskom package into dir.","")
define mb_msxhub_get_binldr
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),BINLDR/1.0.2-1/get/BINLDR/BINLDR.COM)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_binldr,"Installs binldr package into dir.","")
define mb_msxhub_get_dmphex
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),DMPHEX/1.00-1/get/DMPHEX/dmphex.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_dmphex,"Installs dmphex package into dir.","")
define mb_msxhub_get_zd
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),ZD/3.30-1/get/ZD/zd.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_zd,"Installs zd package into dir.","")
define mb_msxhub_get_msxdos2t
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/ADDAUX.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/BEEP.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/BIO.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/BODY.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/BSAVE.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/CAL.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/CALC.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/DUMP.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/EXPAND.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/GREP.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/HEAD.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/KEY.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/LIST.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/LS.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/MENU.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/MORE.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/PATCH.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/SLEEP.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/TAIL.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/TR.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/UNIQ.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/VIEW.COM)
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),MSXDOS2T/1.0-1/get/MSXDOS2T/WC.COM)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_msxdos2t,"Installs msxdos2t package into dir.","")
#
# Graphics editors
#
define mb_msxhub_get_gfxage
$(MB_ᕽᕽᕽ )$(call mb_make_call,mb_msxhub_file,$(1),GFXAGE/0.99-1/get/GFXAGE/gfxage.com)
endef
$(call mb_make_call,mb_doc_function,mb_msxhub_get_gfxage,"Installs gfxage package into dir.","")