From 35842b8ac7a1d47a9851e4011ad1e6cf374008e2 Mon Sep 17 00:00:00 2001 From: Craig Everett Date: Fri, 8 Aug 2025 13:00:00 +0900 Subject: [PATCH] Add Mac arch detection (relatively naive) --- ebin/gajumine.app | 2 +- src/gajumine.erl | 2 +- src/gmc_con.erl | 11 ++++++++--- src/gmc_conf.erl | 28 ++++++++++++++-------------- src/gmc_gui.erl | 2 +- src/gmc_sup.erl | 2 +- zomp.meta | 4 ++-- 7 files changed, 28 insertions(+), 23 deletions(-) diff --git a/ebin/gajumine.app b/ebin/gajumine.app index 542445d..150e54b 100644 --- a/ebin/gajumine.app +++ b/ebin/gajumine.app @@ -3,6 +3,6 @@ {registered,[]}, {included_applications,[]}, {applications,[stdlib,kernel]}, - {vsn,"0.2.5"}, + {vsn,"0.2.6"}, {modules,[gajumine,gmc_con,gmc_conf,gmc_gui,gmc_sup]}, {mod,{gajumine,[]}}]}. diff --git a/src/gajumine.erl b/src/gajumine.erl index 2fb18f7..6b7c976 100644 --- a/src/gajumine.erl +++ b/src/gajumine.erl @@ -3,7 +3,7 @@ %%% @end -module(gajumine). --vsn("0.2.5"). +-vsn("0.2.6"). -behavior(application). -author("Craig Everett "). -copyright("QPQ AG "). diff --git a/src/gmc_con.erl b/src/gmc_con.erl index b541501..48b04ed 100644 --- a/src/gmc_con.erl +++ b/src/gmc_con.erl @@ -3,7 +3,7 @@ %%% @end -module(gmc_con). --vsn("0.2.5"). +-vsn("0.2.6"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). @@ -270,8 +270,13 @@ platform_dir() -> {unix, linux} -> "linux_x86_64"; {unix, darwin} -> - % TODO: Check M2 vs x86 - "mac_m2"; + case erlang:system_info(system_architecture) of + "aarch64-" ++ _ -> + "mac_m2"; + Other -> + ok = log(info, "system_architecture: ~p", [Other]), + "mac_x86_64" + end; {win32, nt} -> "win_x86_64" end, diff --git a/src/gmc_conf.erl b/src/gmc_conf.erl index 2db179f..3417b57 100644 --- a/src/gmc_conf.erl +++ b/src/gmc_conf.erl @@ -3,7 +3,7 @@ %%% @end -module(gmc_conf). --vsn("0.2.5"). +-vsn("0.2.6"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). @@ -18,15 +18,15 @@ -record(s, - {wx = none :: none | wx:wx_object(), - frame = none :: none | wx:wx_object(), - lang = en :: en | jp, - j = none :: none | fun(), - net = none :: none | wx:wx_object(), - acc = none :: none | wx:wx_object(), - keys = none :: none | wx:wx_object(), - cores = none :: none | wx:wx_object(), - memory = none :: none | wx:wx_object()}). + {wx = none :: none | wx:wx_object(), + frame = none :: none | wx:wx_object(), + lang = en :: en | jp, + j = none :: none | fun(), + net = none :: none | wx:wx_object(), + acc = none :: none | wx:wx_object(), + keys = none :: none | wx:wx_object(), + cores = 2 :: pos_integer(), + memory = 3550722201 :: pos_integer()}). @@ -213,16 +213,16 @@ done(State = #s{net = Network, acc = AccTx, keys = KeysTx, cores = CoresTx, memo buh_bye(State). cores("") -> - none; + 2; cores(CoreS) -> try list_to_integer(CoreS) catch - _:_ -> none + _:_ -> 2 end. bytes("") -> - none; + 3550722201; bytes(GigsS) -> try list_to_integer(GigsS) * gig() @@ -231,7 +231,7 @@ bytes(GigsS) -> try trunc(list_to_float(GigsS) * gig()) catch - _:_ -> none + _:_ -> 3550722201 end end. diff --git a/src/gmc_gui.erl b/src/gmc_gui.erl index 3f0c540..b819fec 100644 --- a/src/gmc_gui.erl +++ b/src/gmc_gui.erl @@ -3,7 +3,7 @@ %%% @end -module(gmc_gui). --vsn("0.2.5"). +-vsn("0.2.6"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). diff --git a/src/gmc_sup.erl b/src/gmc_sup.erl index 7142d63..eebfd02 100644 --- a/src/gmc_sup.erl +++ b/src/gmc_sup.erl @@ -12,7 +12,7 @@ %%% @end -module(gmc_sup). --vsn("0.2.5"). +-vsn("0.2.6"). -behaviour(supervisor). -author("Craig Everett "). -copyright("QPQ AG "). diff --git a/zomp.meta b/zomp.meta index 15479e9..cadf99b 100644 --- a/zomp.meta +++ b/zomp.meta @@ -2,9 +2,9 @@ {type,gui}. {modules,[]}. {prefix,"gmc"}. -{author,"Craig Everett"}. {desc,"Mining client for the Gajumaru Root"}. -{package_id,{"qpq","gajumine",{0,2,5}}}. +{author,"Craig Everett"}. +{package_id,{"qpq","gajumine",{0,2,6}}}. {deps,[{"uwiger","gmhive_client",{0,4,4}}, {"uwiger","gmcuckoo",{1,2,3}}, {"qpq","cuckoo_cpu",{0,3,0}},