Skip to content

Commit

Permalink
Merge pull request #21 from mysteriumnetwork/fix/multiarch-2
Browse files Browse the repository at this point in the history
Fix node native check & update
  • Loading branch information
Zensey authored Dec 22, 2022
2 parents 93f5db8 + 0dc22ff commit 10aa76d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
git clone https://github.com/mysteriumnetwork/myst-launcher
pushd myst-launcher
git fetch --all --tags
git checkout tags/1.0.36-mac
git checkout tags/1.0.40-mac
popd
popd
Expand Down
8 changes: 7 additions & 1 deletion gobridge/gobridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"os"

"github.com/mysteriumnetwork/myst-launcher/app"
"github.com/mysteriumnetwork/myst-launcher/controller"
"github.com/mysteriumnetwork/myst-launcher/model"
"github.com/mysteriumnetwork/myst-launcher/myst"
"github.com/mysteriumnetwork/myst-launcher/utils"
Expand Down Expand Up @@ -91,8 +92,8 @@ func GoStart() {
ap.SetModel(mod)
ap.SetUI(ui)

go controller.CheckLauncherUpdates(mod)
ap.StartAppController()

}

func sendState() {
Expand Down Expand Up @@ -193,5 +194,10 @@ func GoUpdateToMainnet() {
sendConfig()
}

//export GoTriggerLauncherUpdateOk
func GoTriggerLauncherUpdateOk(action C.int) {
mod.UIBus.Publish("launcher-update-ok", int(action))
}

// required by runtime
func main() {}
91 changes: 4 additions & 87 deletions gobridge/gobridge.h
Original file line number Diff line number Diff line change
@@ -1,91 +1,8 @@
/* Code generated by cmd/cgo; DO NOT EDIT. */

/* package command-line-arguments */


#line 1 "cgo-builtin-export-prolog"

#include <stddef.h> /* for ptrdiff_t below */

#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H

#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
#endif

#endif

/* Start of preamble from import "C" comments. */


#line 3 "gobridge.go"




#include "interface.h"

#line 1 "cgo-generated-wrapper"


/* End of preamble from import "C" comments. */


/* Start of boilerplate cgo prologue. */
#line 1 "cgo-gcc-export-header-prolog"

#ifndef GO_CGO_PROLOGUE_H
#define GO_CGO_PROLOGUE_H

typedef signed char GoInt8;
typedef unsigned char GoUint8;
typedef short GoInt16;
typedef unsigned short GoUint16;
typedef int GoInt32;
typedef unsigned int GoUint32;
typedef long long GoInt64;
typedef unsigned long long GoUint64;
typedef GoInt64 GoInt;
typedef GoUint64 GoUint;
typedef __SIZE_TYPE__ GoUintptr;
typedef float GoFloat32;
typedef double GoFloat64;
typedef float _Complex GoComplex64;
typedef double _Complex GoComplex128;

/*
static assertion to make sure the file is being used on architecture
at least with matching size of GoInt.
*/
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];

#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef _GoString_ GoString;
#endif
typedef void *GoMap;
typedef void *GoChan;
typedef struct { void *t; void *v; } GoInterface;
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;

#ifdef __arm64__
#include "gobridge_arm64.h"
#endif

/* End of boilerplate cgo prologue. */

#ifdef __cplusplus
extern "C" {
#endif

extern void GoInit(char* resPath, char* prodVer);
extern void GoStart();
extern void GoSetModalResult(int rc);
extern void GoDialogueComplete();
extern void GoOnAppExit();
extern void GoTriggerUpgrade();
extern void GoSetState(NSConfig* s);
extern void GoSetNetworkConfig(NSConfig* s);
extern void GoUpdateToMainnet();

#ifdef __cplusplus
}
#ifdef __amd64__
#include "gobridge_amd64.h"
#endif
4 changes: 2 additions & 2 deletions launcher.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@
"$(PROJECT_DIR)/gobridge",
"$(PROJECT_DIR)",
);
MARKETING_VERSION = 1.0.36;
MARKETING_VERSION = 1.0.40;
PRODUCT_BUNDLE_IDENTIFIER = com.mysterium.launcher;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -606,7 +606,7 @@
"$(PROJECT_DIR)/gobridge",
"$(PROJECT_DIR)",
);
MARKETING_VERSION = 1.0.36;
MARKETING_VERSION = 1.0.40;
PRODUCT_BUNDLE_IDENTIFIER = com.mysterium.launcher;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
9 changes: 7 additions & 2 deletions launcher/Model.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ - (void)notificationHandlerDialogue:(NSNotification *) notification
NSWindowController *modalWindowDelegate = [[UpdateLauncherModalDelegate alloc] init];
NSWindow *modalWindow = [modalWindowDelegate window];
NSModalResponse response = [NSApp runModalForWindow:modalWindow ];

GoDialogueComplete();

if (response == NSModalResponseCancel) {
GoTriggerLauncherUpdateOk(0);
}
if (response == NSModalResponseOK) {
GoTriggerLauncherUpdateOk(2);
}
}
}

Expand Down

0 comments on commit 10aa76d

Please sign in to comment.