add ethkey & parity-evm todarwin pkg

+new ststus icons
mac/Parity Ethereum.xcodeproj/project.pbxproj
mac/Parity/AppDelegate.swift
mac/Parity/Assets.xcassets/statusIcon.imageset/Parity-1.png
mac/Parity/Assets.xcassets/statusIcon.imageset/Parity-2.png
mac/Parity/Assets.xcassets/statusIcon.imageset/Parity.png
mac/Parity/GetBSDProcessList.swift
mac/install-readme.txt
mac/uninstall-parity.sh
scripts/gitlab-build.sh
This commit is contained in:
Denis S. Soldatov aka General-Beck 2018-01-16 20:30:28 +03:00
parent 04b571b742
commit 2ac2fbdf89
9 changed files with 42 additions and 34 deletions

View File

@ -13,6 +13,8 @@
0ACF9AC71E30FAB600D5C935 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0ACF9AC51E30FAB600D5C935 /* MainMenu.xib */; };
0AE564F11E3CE42C00BD01F7 /* GetBSDProcessList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE564F01E3CE42C00BD01F7 /* GetBSDProcessList.swift */; };
0AED4DA01E3E22F800BF87C0 /* ethstore in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0AED4D9F1E3E22F800BF87C0 /* ethstore */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
84CF92B3200E559900AD6E78 /* parity-evm in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84CF92B2200E559900AD6E78 /* parity-evm */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
84CF92B6200E56AE00AD6E78 /* ethkey in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84CF92B5200E56AE00AD6E78 /* ethkey */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -22,6 +24,8 @@
dstPath = "";
dstSubfolderSpec = 6;
files = (
84CF92B6200E56AE00AD6E78 /* ethkey in CopyFiles */,
84CF92B3200E559900AD6E78 /* parity-evm in CopyFiles */,
0AED4DA01E3E22F800BF87C0 /* ethstore in CopyFiles */,
0A7A475D1E3D2CDD0093D1AB /* parity in CopyFiles */,
);
@ -38,6 +42,8 @@
0ACF9AC81E30FAB600D5C935 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0AE564F01E3CE42C00BD01F7 /* GetBSDProcessList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetBSDProcessList.swift; sourceTree = "<group>"; };
0AED4D9F1E3E22F800BF87C0 /* ethstore */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = ethstore; path = ../target/release/ethstore; sourceTree = "<group>"; };
84CF92B2200E559900AD6E78 /* parity-evm */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = "parity-evm"; path = "../target/release/parity-evm"; sourceTree = "<group>"; };
84CF92B5200E56AE00AD6E78 /* ethkey */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = ethkey; path = ../target/release/ethkey; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -54,6 +60,8 @@
0ACF9AB51E30FAB600D5C935 = {
isa = PBXGroup;
children = (
84CF92B5200E56AE00AD6E78 /* ethkey */,
84CF92B2200E559900AD6E78 /* parity-evm */,
0AED4D9F1E3E22F800BF87C0 /* ethstore */,
0A7A475C1E3D2CDD0093D1AB /* parity */,
0ACF9AC01E30FAB600D5C935 /* Parity Ethereum */,
@ -110,7 +118,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = "Parity Technologies";
TargetAttributes = {
0ACF9ABD1E30FAB600D5C935 = {
@ -192,6 +200,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -241,6 +250,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;

View File

@ -1,4 +1,4 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@ -22,12 +22,12 @@ import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var statusMenu: NSMenu!
@IBOutlet weak var startAtLogonMenuItem: NSMenuItem!
let statusItem = NSStatusBar.system().statusItem(withLength: NSVariableStatusItemLength)
var parityPid: Int32? = nil
var commandLine: [String] = []
let defaultDefaults = "{\"fat_db\":false,\"mode\":\"passive\",\"mode.alarm\":3600,\"mode.timeout\":300,\"pruning\":\"fast\",\"tracing\":false}"
func menuAppPath() -> String {
return Bundle.main.executablePath!
}
@ -40,20 +40,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
return NSRunningApplication.runningApplications(withBundleIdentifier: Bundle.main.bundleIdentifier!).count > 1
}
func isParityRunning() -> Bool {
if let pid = self.parityPid {
return kill(pid, 0) == 0
}
return false
}
func killParity() {
if let pid = self.parityPid {
kill(pid, SIGKILL)
}
}
func openUI() {
let parity = Process()
parity.launchPath = self.parityPath()
@ -61,29 +61,29 @@ class AppDelegate: NSObject, NSApplicationDelegate {
parity.arguments!.append("ui")
parity.launch()
}
func writeConfigFiles() {
let basePath = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first?
.appendingPathComponent(Bundle.main.bundleIdentifier!, isDirectory: true)
if FileManager.default.fileExists(atPath: basePath!.path) {
return
}
do {
let defaultsFileDir = basePath?.appendingPathComponent("chains").appendingPathComponent("ethereum")
let defaultsFile = defaultsFileDir?.appendingPathComponent("user_defaults")
try FileManager.default.createDirectory(atPath: (defaultsFileDir?.path)!, withIntermediateDirectories: true, attributes: nil)
if !FileManager.default.fileExists(atPath: defaultsFile!.path) {
try defaultDefaults.write(to: defaultsFile!, atomically: false, encoding: String.Encoding.utf8)
}
let configFile = basePath?.appendingPathComponent("config.toml")
}
catch {}
}
func autostartEnabled() -> Bool {
return itemReferencesInLoginItems().existingReference != nil
}
@ -123,7 +123,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
return (nil, nil)
}
func toggleLaunchAtStartup() {
let itemReferences = itemReferencesInLoginItems()
let shouldBeToggled = (itemReferences.existingReference == nil)
@ -155,7 +155,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func launchParity() {
self.commandLine = CommandLine.arguments.dropFirst().filter({ $0 != "ui"})
let processes = GetBSDProcessList()!
let parityProcess = processes.index(where: {
var name = $0.kp_proc.p_comm
@ -166,7 +166,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
return str == "parity"
})
if parityProcess == nil {
let parity = Process()
let p = self.parityPath()
@ -178,7 +178,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.parityPid = processes[parityProcess!].kp_proc.p_pid
}
}
func applicationDidFinishLaunching(_ aNotification: Notification) {
if self.isAlreadyRunning() {
openUI()
@ -188,12 +188,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.writeConfigFiles()
self.launchParity()
Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true, block: {_ in
Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true, block: {_ in
if !self.isParityRunning() {
NSApplication.shared().terminate(self)
}
})
let icon = NSImage(named: "statusIcon")
icon?.isTemplate = true // best for dark mode
statusItem.image = icon
@ -206,19 +206,18 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
return true
}
@IBAction func quitClicked(_ sender: NSMenuItem) {
self.killParity()
NSApplication.shared().terminate(self)
}
@IBAction func openClicked(_ sender: NSMenuItem) {
self.openUI()
}
@IBAction func startAtLogonClicked(_ sender: NSMenuItem) {
self.toggleLaunchAtStartup()
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,4 +1,4 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@ -21,21 +21,21 @@ import Foundation
import Darwin
public func GetBSDProcessList() -> ([kinfo_proc]?) {
var done = false
var result: [kinfo_proc]?
var err: Int32
repeat {
let name = [CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0];
let namePointer = name.withUnsafeBufferPointer { UnsafeMutablePointer<Int32>(mutating: $0.baseAddress) }
var length: Int = 0
err = sysctl(namePointer, u_int(name.count), nil, &length, nil, 0)
if err == -1 {
err = errno
}
if err == 0 {
let count = length / MemoryLayout<kinfo_proc>.stride
result = [kinfo_proc](repeating: kinfo_proc(), count: count)
@ -54,6 +54,6 @@ public func GetBSDProcessList() -> ([kinfo_proc]?) {
}
}
} while err == 0 && !done
return result
}

View File

@ -3,8 +3,6 @@ Parity Wallet
Welcome to Parity Wallet, your all-in-one Ethereum node and wallet.
WARNING: This installer is **EXPERIMENTAL**. Use it at your own risk.
If you continue, Parity will be installed as a user service. You will be able to use the Parity Wallet through your browser by using the menu bar icon, following the shortcut in the Launchpad or navigating to http://localhost:8080/ in your browser.
If you continue, Parity will be installed as a user service. You will be able to use the Parity Wallet through your browser by using the menu bar icon, following the shortcut in the Launchpad or navigating to http://localhost:8180/ in your browser.
Parity is distributed under the terms of the GPL.

View File

@ -9,5 +9,4 @@ fi
PLIST=~/Library/LaunchAgents/io.parity.ethereum.plist
su $SUDO_USER -c "launchctl stop io.parity.ethereum"
su $SUDO_USER -c "launchctl unload $PLIST"
rm -f /usr/local/libexec/parity /usr/local/libexec/uninstall-parity.sh /usr/local/bin/ethstore $PLIST
rm -f /usr/local/libexec/parity /usr/local/libexec/uninstall-parity.sh /usr/local/bin/ethstore /usr/local/bin/ethkey /usr/local/bin/parity-evm $PLIST

View File

@ -115,7 +115,9 @@ make_rpm () {
make_pkg () {
echo "make PKG"
cp target/$PLATFORM/release/parity target/release/parity
cp target/$PLATFORM/release/parity-evm target/release/parity-evm
cp target/$PLATFORM/release/ethstore target/release/ethstore
cp target/$PLATFORM/release/ethkey target/release/ethkey
cd mac
xcodebuild -configuration Release
cd ..