Skip to content

Commit

Permalink
Updated to 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EmeraldLoc committed Jun 9, 2022
1 parent 2329eeb commit eeb3b2e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 25 deletions.
8 changes: 4 additions & 4 deletions sm_osx.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 21;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"sm_osx/Preview Content\"";
DEVELOPMENT_TEAM = 25RK3JMVLT;
ENABLE_HARDENED_RUNTIME = NO;
Expand All @@ -359,7 +359,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.1.9;
MARKETING_VERSION = 1.2.1;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.CubingStudios.sm-osx";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -377,7 +377,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 21;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"sm_osx/Preview Content\"";
DEVELOPMENT_TEAM = 25RK3JMVLT;
ENABLE_HARDENED_RUNTIME = NO;
Expand All @@ -391,7 +391,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.1.9;
MARKETING_VERSION = 1.2.1;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.CubingStudios.sm-osx";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
8 changes: 5 additions & 3 deletions sm_osx/CompilationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ struct CompilationView: View {

Spacer()

TextEditor(text: $totalLog)
.disabled(true)
TextEditor(text: .constant(totalLog))

Spacer()

Expand All @@ -51,6 +50,9 @@ struct CompilationView: View {
}

}.onAppear {

print("Exec Path: \(execPath)\n Repo Path: \(repo)")

task.executableURL = URL(fileURLWithPath: "/bin/zsh")
task.arguments = ["-cl", "cd ~/SM64Repos && rm -rf \(execPath) && cd ~/; \(compileCommands)"]

Expand Down Expand Up @@ -178,7 +180,7 @@ struct CompilationView: View {

compilesSucess = false

height = 150
height = 550

try? shell.shell("cd ~/SM64Repos && rm -rf \(execPath)", false)
try? shell.shell("cd ~/SM64Repos && rm -rf \(repo)", false)
Expand Down
35 changes: 24 additions & 11 deletions sm_osx/LauncherView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct LauncherView: View {
@FetchRequest(sortDescriptors:[SortDescriptor(\.title)]) var launcherRepos: FetchedResults<LauncherRepos>
@State var existingRepo = URL(string: "")
@State var repoTitle = ""
@State var currentVersion = "v1.2.0\n"
@State var currentVersion = "v1.2.1\n"
@State var updateAlert = false
@State var latestVersion = ""
@State var repoArgs = ""
Expand All @@ -31,6 +31,7 @@ struct LauncherView: View {
@State var romURL = URL(string: "")
@State var crashIndex = 0
@State var logIndex = 0
@State var homebrewText = ""
let sm64: UTType = .init(filenameExtension: "f3dex2e") ?? UTType.unixExecutable
let rom: UTType = .init(filenameExtension: "z64") ?? UTType.unixExecutable

Expand Down Expand Up @@ -281,12 +282,10 @@ struct LauncherView: View {

romURL = showOpenPanelForRom()

romURL? = URL(fileURLWithPath: romURL?.path.replacingOccurrences(of: " ", with: "\\ ") ?? "")
romURL? = URL(fileURLWithPath: romURL?.path.replacingOccurrences(of: " ", with: #"\ "#
, options: .literal, range: nil) ?? "")

print(romURL?.path ?? "")
print(romURL?.pathExtension ?? "")

print(try? shell.shell("cp \(romURL?.path ?? "") ~/SM64Repos/baserom.us.z64") ?? "")
print(try? shell.shell("cp \(romURL?.path ?? "") ~/SM64Repos/baserom.us.z64") )

if let doesExist = try? checkRom("ls ~/SM64Repos/baserom.us.z64") {
if doesExist {
Expand Down Expand Up @@ -345,10 +344,7 @@ struct LauncherView: View {
}
}

Text("Homebrew is REQUIRED for this software to work, please install homebrew at brew.sh")
.padding(.horizontal)

Text("\nOptional: Homebrew Intel version is nice to have. Install by launching terminal with Rosetta and installing at brew.sh")
Text(homebrewText)
.padding(.horizontal)

Button(action:{
Expand Down Expand Up @@ -383,11 +379,28 @@ struct LauncherView: View {
Text("Install Dependencies")
}.buttonStyle(.bordered).padding(.vertical)
}

}.onAppear {

devMode = false

let detectArmBrewInstall = try? shell.shell("which brew")
let detectIntelBrewInstall = try? shell.shell("which /usr/local/bin/brew")

if detectArmBrewInstall?.contains("/opt/homebrew/bin/brew") ?? false && detectIntelBrewInstall == "/usr/local/bin/brew\n" {
homebrewText = "Both versions of homebrew are installed."
}
else if !(detectArmBrewInstall?.contains("/opt/homebrew/bin/brew") ?? false) && detectIntelBrewInstall == "/usr/local/bin/brew\n" {

homebrewText = "Arm homebrew is not installed. Please install at brew.sh\n\nIntel homebrew is installed"
}
else if (detectArmBrewInstall?.contains("/opt/homebrew/bin/brew") ?? false) && detectIntelBrewInstall != "/usr/local/bin/brew\n" {

homebrewText = "Arm homebrew is installed\n\nIntel homebrew is not installed. Install by launching your terminal with rosetta, and then follow instructions at brew.sh"
}
else {
homebrewText = "Homebrew is not installed, please install at brew.sh"
}

do {
if try checkRom("ls ~/SM64Repos/baserom.us.z64") {
allowAddingRepos = true
Expand Down
2 changes: 1 addition & 1 deletion sm_osx/RepoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct RepoView: View {

NavigationLink(destination: PatchesView(repo: .sm64ex_alo, repoView: $repoView)) {

Text("sm64ex-alo (No audio at this time)")
Text("sm64ex-alo")
.lineLimit(nil)
}

Expand Down
20 changes: 14 additions & 6 deletions sm_osx/RomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct RomView: View {

if repo == .sm64ex {
if patch.contains(.omm) {
commandsCompile.append("cd ~/SM64Repos && git clone https://github.com/PeachyPeachSM64/sm64pc-omm.git && cp sm64pc-omm/patch/omm.patch \(repo) && rm -rf sm64pc-omm && cd \(repo) && git apply --reject --ignore-whitespace 'omm.patch' && ")
commandsCompile.append("cd ~/SM64Repos && wget -O omm.patch https://raw.githubusercontent.com/PeachyPeachSM64/sm64pc-omm/master/patch/omm.patch && rm -rf sm64pc-omm && cd \(repo) && git apply --reject --ignore-whitespace 'omm.patch' && ")
}

if patch.contains(.highfps) {
Expand All @@ -189,7 +189,7 @@ struct RomView: View {

if repo == .sm64ex_alo {
if patch.contains(.star_road) {
commandsCompile.append("cd ~/SM64Repos/\(repo) && wget -O star_road_release.patch https://raw.githubusercontent.com/EmeraldLoc/star_road_release_patch/main/star_road_release.patch && git apply --reject --ignore-whitespace \"star_road_release.patch\" && ")
commandsCompile.append("cd ~/SM64Repos/\(repo) && wget -O star_road_release.patch http://drive.google.com/uc\\?id\\=1kXskWESOTUJDoeCGVV9JMUkn0tLd_GXO && git apply --reject --ignore-whitespace \"star_road_release.patch\" && ")
}
}

Expand All @@ -205,13 +205,13 @@ struct RomView: View {
commandsCompile.append("echo 'Compiling Now' && ")

if repo == .sm64ex_coop || repo == .sm64ex_coop_dev {
commandsCompile.append("cd ~/SM64Repos/\(repo) && arch -x86_64 /bin/zsh -cl 'gmake OSX_BUILD=1 TARGET_ARCH=x86_64-apple-darwin TARGET_BITS=64 EXTERNAL_DATA=\(extData) DEBUG=\(debug) \(compSpeed.rawValue)' && ")
commandsCompile.append("cd ~/SM64Repos/\(repo) && arch -x86_64 /bin/zsh -cl 'gmake OSX_BUILD=1 TARGET_ARCH=x86_64-apple-darwin TARGET_BITS=64 EXTERNAL_DATA=\(extData) DEBUG=\(debug) COLOR=0 \(compSpeed.rawValue)' && ")
}
else if repo == .moon64 {
commandsCompile.append("cd ~/SM64Repos/\(repo) && arch -x86_64 /bin/zsh -cl 'gmake OSX_BUILD=1 BETTERCAMERA=\(betterCamera) EXTERNAL_DATA=\(extData) NODRAWDISTANCE=\(drawDistance) \(compSpeed.rawValue)' && ")
}
else if repo == .sm64ex_alo {
commandsCompile.append("cd ~/SM64Repos/\(repo) && gmake OSX_BUILD=1 BETTERCAMERA=\(betterCamera) EXTERNAL_DATA=0 NODRAWDISTANCE=\(drawDistance) QOL_FEATURES=\(qolFeatures) QOL_FIXES=\(qolFix) HIGH_FPS_PC=\(highFPS) \(compSpeed.rawValue) && ")
commandsCompile.append("cd ~/SM64Repos/\(repo) && gmake OSX_BUILD=1 BETTERCAMERA=\(betterCamera) EXTERNAL_DATA=0 NODRAWDISTANCE=\(drawDistance) QOL_FEATURES=\(qolFeatures) QOL_FIXES=\(qolFix) HIGH_FPS_PC=\(highFPS) COLOR=0 \(compSpeed.rawValue) && ")
}
else if repo == .sm64port {
commandsCompile.append("cd ~/SM64Repos/\(repo) && gmake \(compSpeed.rawValue) && ")
Expand All @@ -223,11 +223,19 @@ struct RomView: View {
execPath = "\(repo)-build"

if doKeepRepo {
let checkExecPath = try? shell.shell("ls ~/SM64Repos/")

var checkExecPath = ""

do {
checkExecPath = try shell.shell("ls ~/SM64Repos/")
}
catch {
print("thats bad")
}

var numbCur = 0

while checkExecPath!.contains(execPath) {
while checkExecPath.contains(execPath) {

numbCur += 1

Expand Down

0 comments on commit eeb3b2e

Please sign in to comment.