Skip to content

Commit eeb3b2e

Browse files
committed
Updated to 1.2.1
1 parent 2329eeb commit eeb3b2e

File tree

5 files changed

+48
-25
lines changed

5 files changed

+48
-25
lines changed

sm_osx.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
CODE_SIGN_IDENTITY = "Apple Development";
346346
CODE_SIGN_STYLE = Automatic;
347347
COMBINE_HIDPI_IMAGES = YES;
348-
CURRENT_PROJECT_VERSION = 21;
348+
CURRENT_PROJECT_VERSION = 1;
349349
DEVELOPMENT_ASSET_PATHS = "\"sm_osx/Preview Content\"";
350350
DEVELOPMENT_TEAM = 25RK3JMVLT;
351351
ENABLE_HARDENED_RUNTIME = NO;
@@ -359,7 +359,7 @@
359359
"$(inherited)",
360360
"@executable_path/../Frameworks",
361361
);
362-
MARKETING_VERSION = 1.1.9;
362+
MARKETING_VERSION = 1.2.1;
363363
ONLY_ACTIVE_ARCH = NO;
364364
PRODUCT_BUNDLE_IDENTIFIER = "com.CubingStudios.sm-osx";
365365
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -377,7 +377,7 @@
377377
CODE_SIGN_IDENTITY = "Apple Development";
378378
CODE_SIGN_STYLE = Automatic;
379379
COMBINE_HIDPI_IMAGES = YES;
380-
CURRENT_PROJECT_VERSION = 21;
380+
CURRENT_PROJECT_VERSION = 1;
381381
DEVELOPMENT_ASSET_PATHS = "\"sm_osx/Preview Content\"";
382382
DEVELOPMENT_TEAM = 25RK3JMVLT;
383383
ENABLE_HARDENED_RUNTIME = NO;
@@ -391,7 +391,7 @@
391391
"$(inherited)",
392392
"@executable_path/../Frameworks",
393393
);
394-
MARKETING_VERSION = 1.1.9;
394+
MARKETING_VERSION = 1.2.1;
395395
ONLY_ACTIVE_ARCH = NO;
396396
PRODUCT_BUNDLE_IDENTIFIER = "com.CubingStudios.sm-osx";
397397
PRODUCT_NAME = "$(TARGET_NAME)";

sm_osx/CompilationView.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ struct CompilationView: View {
4040

4141
Spacer()
4242

43-
TextEditor(text: $totalLog)
44-
.disabled(true)
43+
TextEditor(text: .constant(totalLog))
4544

4645
Spacer()
4746

@@ -51,6 +50,9 @@ struct CompilationView: View {
5150
}
5251

5352
}.onAppear {
53+
54+
print("Exec Path: \(execPath)\n Repo Path: \(repo)")
55+
5456
task.executableURL = URL(fileURLWithPath: "/bin/zsh")
5557
task.arguments = ["-cl", "cd ~/SM64Repos && rm -rf \(execPath) && cd ~/; \(compileCommands)"]
5658

@@ -178,7 +180,7 @@ struct CompilationView: View {
178180

179181
compilesSucess = false
180182

181-
height = 150
183+
height = 550
182184

183185
try? shell.shell("cd ~/SM64Repos && rm -rf \(execPath)", false)
184186
try? shell.shell("cd ~/SM64Repos && rm -rf \(repo)", false)

sm_osx/LauncherView.swift

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct LauncherView: View {
1818
@FetchRequest(sortDescriptors:[SortDescriptor(\.title)]) var launcherRepos: FetchedResults<LauncherRepos>
1919
@State var existingRepo = URL(string: "")
2020
@State var repoTitle = ""
21-
@State var currentVersion = "v1.2.0\n"
21+
@State var currentVersion = "v1.2.1\n"
2222
@State var updateAlert = false
2323
@State var latestVersion = ""
2424
@State var repoArgs = ""
@@ -31,6 +31,7 @@ struct LauncherView: View {
3131
@State var romURL = URL(string: "")
3232
@State var crashIndex = 0
3333
@State var logIndex = 0
34+
@State var homebrewText = ""
3435
let sm64: UTType = .init(filenameExtension: "f3dex2e") ?? UTType.unixExecutable
3536
let rom: UTType = .init(filenameExtension: "z64") ?? UTType.unixExecutable
3637

@@ -281,12 +282,10 @@ struct LauncherView: View {
281282

282283
romURL = showOpenPanelForRom()
283284

284-
romURL? = URL(fileURLWithPath: romURL?.path.replacingOccurrences(of: " ", with: "\\ ") ?? "")
285+
romURL? = URL(fileURLWithPath: romURL?.path.replacingOccurrences(of: " ", with: #"\ "#
286+
, options: .literal, range: nil) ?? "")
285287

286-
print(romURL?.path ?? "")
287-
print(romURL?.pathExtension ?? "")
288-
289-
print(try? shell.shell("cp \(romURL?.path ?? "") ~/SM64Repos/baserom.us.z64") ?? "")
288+
print(try? shell.shell("cp \(romURL?.path ?? "") ~/SM64Repos/baserom.us.z64") )
290289

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

348-
Text("Homebrew is REQUIRED for this software to work, please install homebrew at brew.sh")
349-
.padding(.horizontal)
350-
351-
Text("\nOptional: Homebrew Intel version is nice to have. Install by launching terminal with Rosetta and installing at brew.sh")
347+
Text(homebrewText)
352348
.padding(.horizontal)
353349

354350
Button(action:{
@@ -383,11 +379,28 @@ struct LauncherView: View {
383379
Text("Install Dependencies")
384380
}.buttonStyle(.bordered).padding(.vertical)
385381
}
386-
387382
}.onAppear {
388383

389384
devMode = false
390385

386+
let detectArmBrewInstall = try? shell.shell("which brew")
387+
let detectIntelBrewInstall = try? shell.shell("which /usr/local/bin/brew")
388+
389+
if detectArmBrewInstall?.contains("/opt/homebrew/bin/brew") ?? false && detectIntelBrewInstall == "/usr/local/bin/brew\n" {
390+
homebrewText = "Both versions of homebrew are installed."
391+
}
392+
else if !(detectArmBrewInstall?.contains("/opt/homebrew/bin/brew") ?? false) && detectIntelBrewInstall == "/usr/local/bin/brew\n" {
393+
394+
homebrewText = "Arm homebrew is not installed. Please install at brew.sh\n\nIntel homebrew is installed"
395+
}
396+
else if (detectArmBrewInstall?.contains("/opt/homebrew/bin/brew") ?? false) && detectIntelBrewInstall != "/usr/local/bin/brew\n" {
397+
398+
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"
399+
}
400+
else {
401+
homebrewText = "Homebrew is not installed, please install at brew.sh"
402+
}
403+
391404
do {
392405
if try checkRom("ls ~/SM64Repos/baserom.us.z64") {
393406
allowAddingRepos = true

sm_osx/RepoView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct RepoView: View {
4444

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

47-
Text("sm64ex-alo (No audio at this time)")
47+
Text("sm64ex-alo")
4848
.lineLimit(nil)
4949
}
5050

sm_osx/RomView.swift

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ struct RomView: View {
167167

168168
if repo == .sm64ex {
169169
if patch.contains(.omm) {
170-
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' && ")
170+
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' && ")
171171
}
172172

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

190190
if repo == .sm64ex_alo {
191191
if patch.contains(.star_road) {
192-
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\" && ")
192+
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\" && ")
193193
}
194194
}
195195

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

207207
if repo == .sm64ex_coop || repo == .sm64ex_coop_dev {
208-
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)' && ")
208+
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)' && ")
209209
}
210210
else if repo == .moon64 {
211211
commandsCompile.append("cd ~/SM64Repos/\(repo) && arch -x86_64 /bin/zsh -cl 'gmake OSX_BUILD=1 BETTERCAMERA=\(betterCamera) EXTERNAL_DATA=\(extData) NODRAWDISTANCE=\(drawDistance) \(compSpeed.rawValue)' && ")
212212
}
213213
else if repo == .sm64ex_alo {
214-
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) && ")
214+
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) && ")
215215
}
216216
else if repo == .sm64port {
217217
commandsCompile.append("cd ~/SM64Repos/\(repo) && gmake \(compSpeed.rawValue) && ")
@@ -223,11 +223,19 @@ struct RomView: View {
223223
execPath = "\(repo)-build"
224224

225225
if doKeepRepo {
226-
let checkExecPath = try? shell.shell("ls ~/SM64Repos/")
226+
227+
var checkExecPath = ""
228+
229+
do {
230+
checkExecPath = try shell.shell("ls ~/SM64Repos/")
231+
}
232+
catch {
233+
print("thats bad")
234+
}
227235

228236
var numbCur = 0
229237

230-
while checkExecPath!.contains(execPath) {
238+
while checkExecPath.contains(execPath) {
231239

232240
numbCur += 1
233241

0 commit comments

Comments
 (0)