Author Topic: wxLauncher Test Builds [Updated: 2016-09-04]  (Read 8587 times)

0 Members and 1 Guest are viewing this topic.

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
For what it's worth, I got wxLauncher to configure, but it won't build.  I attempted to build a Release build (I had configured CMake to default to Release before running this command).

Code: [Select]
[email protected]:~/wxLauncher/build [master]  $ xcodebuild -configuration Release
=== BUILD AGGREGATE TARGET ZERO_CHECK OF PROJECT wxlauncher WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
write-file /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/ZERO_CHECK.build/Script-67EF77E1D4984A3F9D5BD4DD.sh
chmod 0755 /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/ZERO_CHECK.build/Script-67EF77E1D4984A3F9D5BD4DD.sh

PhaseScriptExecution CMake\ Rules build/wxlauncher.build/Release/ZERO_CHECK.build/Script-67EF77E1D4984A3F9D5BD4DD.sh
    cd /Users/cliffgordon/wxLauncher
    /bin/sh -c /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/ZERO_CHECK.build/Script-67EF77E1D4984A3F9D5BD4DD.sh
echo ""

make -f /Users/cliffgordon/wxLauncher/build/CMakeScripts/ReRunCMake.make
make[1]: `/Users/cliffgordon/wxLauncher/build/CMakeFiles/cmake.check_cache' is up to date.

=== BUILD AGGREGATE TARGET helpmaker OF PROJECT wxlauncher WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
write-file /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/helpmaker.build/Script-37301D1C165B455EAED2C838.sh
chmod 0755 /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/helpmaker.build/Script-37301D1C165B455EAED2C838.sh

PhaseScriptExecution CMake\ Rules build/wxlauncher.build/Release/helpmaker.build/Script-37301D1C165B455EAED2C838.sh
    cd /Users/cliffgordon/wxLauncher
    /bin/sh -c /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/helpmaker.build/Script-37301D1C165B455EAED2C838.sh
echo ""

cd /Users/cliffgordon/wxLauncher && /usr/local/bin/python scripts/onlinehelpmaker.py -q build /Users/cliffgordon/wxLauncher/build/generated/onlinehelp.htb /Users/cliffgordon/wxLauncher/onlinehelp -t /Users/cliffgordon/wxLauncher/build/onlinehelpmaker -c /Users/cliffgordon/wxLauncher/build/generated/helplinks.cpp
Traceback (most recent call last):
  File "scripts/onlinehelpmaker.py", line 9, in <module>
    from ohm.utilfunctions import rmtree_error_handler
  File "/Users/cliffgordon/wxLauncher/scripts/ohm/utilfunctions.py", line 6, in <module>
    from builtins import *
ImportError: No module named builtins
make: *** [/Users/cliffgordon/wxLauncher/build/CMakeFiles/helpmaker] Error 1
Command /bin/sh failed with exit code 2

** BUILD FAILED **


The following build commands failed:
PhaseScriptExecution CMake\ Rules build/wxlauncher.build/Release/helpmaker.build/Script-37301D1C165B455EAED2C838.sh
(1 failure)

Edit:  I got past that by commenting out the builtins import * line in two different python files.  Not sure it's necessary on Python 2.7 at least.  But then I run into a ton of undefined symbol errors for wxWidgets and SDL2 symbols.  So configuring went fine, but compiling won't now.  Also, should mention how I got it to configure.  I didn't use the SDL2.frameworks file after I all, I just installed SDL2 with brew like I installed wxWidgets.
« Last Edit: September 06, 2016, 09:58:36 am by chief1983 »
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
On a hunch, how do I force wxLauncher to only build x86_64 instead of i386?  I'll look around for how but if someone knows it might help.  I don't think libs typically work with 32bit stuff these days as Mac has been 64-bit only for years now.

Edit: In the interim of figuring out how to make CMake do this (CMAKE_OSX_ARCHITECTURES doesn't seem to work for me), I modified the generated XCode project.  Now I get the following during the build process.

Code: [Select]
Ld build/Release/wxlauncher.app/Contents/MacOS/wxlauncher normal x86_64
    cd /Users/cliffgordon/wxLauncher
    export MACOSX_DEPLOYMENT_TARGET=10.11
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/cliffgordon/wxLauncher/build/Release -L/usr/local/lib/Release -L/usr/local/lib -F/Users/cliffgordon/wxLauncher/build/Release -filelist /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/wxlauncher.build/Objects-normal/x86_64/wxlauncher.LinkFileList -Xlinker -rpath -Xlinker /usr/local/lib -mmacosx-version-min=10.11 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL /usr/local/lib/libwx_baseu_net-3.0.a /usr/local/lib/libwx_osx_cocoau_qa-3.0.a /usr/local/lib/libwx_osx_cocoau_richtext-3.0.a /usr/local/lib/libwx_osx_cocoau_html-3.0.a /usr/local/lib/libwx_osx_cocoau_adv-3.0.a /usr/local/lib/libwx_osx_cocoau_core-3.0.a /usr/local/lib/libwx_baseu_xml-3.0.a /usr/local/lib/libwx_baseu-3.0.a -lpng -ljpeg -ltiff -framework WebKit -lexpat -lwxregexu-3.0 -lz -lpthread -liconv -lSDL2 -Xlinker -dependency_info -Xlinker /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/wxlauncher.build/Objects-normal/x86_64/wxlauncher_dependency_info.dat -o /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/MacOS/wxlauncher
ld: warning: directory not found for option '-L/usr/local/lib/Release'

PhaseScriptExecution CMake\ PostBuild\ Rules build/wxlauncher.build/Release/wxlauncher.build/Script-2A8E10E75501468DBFB1B53B.sh
    cd /Users/cliffgordon/wxLauncher
    /bin/sh -c /Users/cliffgordon/wxLauncher/build/wxlauncher.build/Release/wxlauncher.build/Script-2A8E10E75501468DBFB1B53B.sh
rm -rf /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/Resources
rm -rf /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/Frameworks
mkdir /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/Resources
mkdir /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/Frameworks
cp /Users/cliffgordon/wxLauncher/resources/* /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/Resources
cp /Users/cliffgordon/wxLauncher/build/generated/onlinehelp.htb /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/Resources
cp /Users/cliffgordon/wxLauncher/platform/macosx/wxlauncher.icns /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/Resources
cp -R /Users/cliffgordon/wxLauncher/build/Release/wxlauncher.app/Contents/Frameworks
usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-f | -i | -n] [-apvX] source_file ... target_directory
make: *** [wxlauncher_buildpart_1] Error 64
Command /bin/sh failed with exit code 2

It seems to be missing the source argument for a copy command.
« Last Edit: September 06, 2016, 10:18:50 am by chief1983 »
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Iss Mneur

  • Moderator
  • 210
  • Posts: 1,278
  • TODO:
Re: wxLauncher Test Builds [Updated: 2016-09-04]
Sorry, I have no idea.  Though for some reason CI builds with cmake.  Unfortunately, I don't know why it works, it was contributed by m!m, maybe he can elaborate.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline jg18

  • A very happy zod
  • 210
  • Posts: 1,257
  • can do more than spellcheck
Re: wxLauncher Test Builds [Updated: 2016-09-04]
It's trying to copy the SDL2.framework into the wxL app bundle, based on the assumption that you're linking against the framework. If you're statically linking against an SDL2 library you built using Homebrew then you can comment out that entire section of commands from the CMakeLists.txt.

Good point that wxL should be 64-bit on OS X. Not sure if setting CMAKE_OSX_ARCHITECTURES in CMakeLists.txt to x86_64 is enough.
wxLauncher 0.10.1 beta now available! Toggle FRED launching with F3! | wxLauncher 2.0 Request for Comments
Hey mod authors! Did you know you can customize wxL's recommended lighting preset through your mod.ini? Check it out!

 

Offline m!m

  • 210
  • Posts: 1,620
Re: wxLauncher Test Builds [Updated: 2016-09-04]
Sorry, I have no idea.  Though for some reason CI builds with cmake.  Unfortunately, I don't know why it works, it was contributed by m!m, maybe he can elaborate.
CMake just calls the native build tool (in this case xcodebuild).

 

Offline Iss Mneur

  • Moderator
  • 210
  • Posts: 1,278
  • TODO:
Re: wxLauncher Test Builds [Updated: 2016-09-04]
CMake just calls the native build tool (in this case xcodebuild).
Fair enough, I wasn't sure if it setup an environment before calling the native tool, because it appears to be where the x64 arch is set.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
I wasn't statically linking I don't think, the SDL2 installed by brew was 'bottled', it didn't build it, it downloaded an existing bundle of some sort and installed it to /usr/local/Cellar/sdl2.  Somehow CMake managed to find it there but not the official bundle in /Library/Frameworks.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline jg18

  • A very happy zod
  • 210
  • Posts: 1,257
  • can do more than spellcheck
Re: wxLauncher Test Builds [Updated: 2016-09-04]
Some progress on wxL for OS X but still not there. :sigh:

Both wxWidgets and wxL are now 64-bit.

I put SDL2.framework from the FSO source tree in ~/Library/Frameworks.

I tried both wxWidgets 3.0.2 and 3.1.0, downloading them from wxwidgets.org.

In both cases, here’s what I did starting from the wxWidgets root folder:

Code: [Select]
mkdir build-debug
cd build-debug
../configure --enable-stl --enable-unicode --enable-debug --disable-shared --with-macosx-version-min=10.7 CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS=-stdlib=libc++

I think I have to use clang instead of g++ if I want C++11 support while maintaining OS X 10.7 compatibility.

The compiler/linker flags were from this thread after I was getting linking errors when trying to build wxL.

I then made the following changes to CMakeLists.txt in wxL to get it to find and link with SDL2.framework and also set compatibility mode to 10.7. (Although the info.plist inside the wxlauncher app bundle doesn’t mention 10.7 as the minimum version so maybe I did it wrong.)

Code: [Select]
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bfad077..1731124 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,8 +22,6 @@ include(${3RD_PARTY_SOURCE_DIR}/GetVersionFromGitTag.cmake)
 
 message("--- Configuring wxLauncher ${wxlauncher_VERSION_STRING_FULL}")
 
-set(CMAKE_OSX_ARCHITECTURES i386)
-
 if(NOT(DEFINED IS_WIN32 OR DEFINED IS_LINUX OR DEFINED IS_APPLE))
   if(WIN32)
     set(IS_WIN32 TRUE)
@@ -146,7 +144,16 @@ if(USE_OPENAL)
   include_directories(${OPENAL_INCLUDE_DIR})
 endif(USE_OPENAL)
 
-IF(UNIX)
+if(IS_APPLE)
+    set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
+    find_library(SDL2_FRAMEWORK SDL2)
+#    if (NOT SDL2_FRAMEWORK)
+#        message(FATAL_ERROR “SDL2 not found")
+#    endif()
+    set(SDL2_INCLUDES ${SDL2_FRAMEWORK}/Headers)
+    set(SDL2_LIBRARIES ${SDL2_FRAMEWORK})
+
+elseIF(UNIX)
     INCLUDE(FindPkgConfig)
 
     PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
@@ -341,9 +348,11 @@ add_executable(wxlauncher WIN32 MACOSX_BUNDLE
   ${RESOURCE_FILES}
   ${CODE_FILES}
   )
-if (COMMAND target_compile_features)
-  target_compile_features(wxlauncher PRIVATE cxx_auto_type) # Enable C++11 because it is required for wxWidgets 3.0
-endif()
+
+# FIXME TODO with Clang on OS X use CXX FLAGS
+#if (COMMAND target_compile_features)
+#  target_compile_features(wxlauncher PRIVATE cxx_auto_type) # Enable C++11 because #it is required for wxWidgets 3.0
+#endif()
   
 set_target_properties(wxlauncher
   PROPERTIES LINKER_LANGUAGE CXX
@@ -383,7 +392,7 @@ if(IS_APPLE)
     COMMAND cp ${PROJECT_SOURCE_DIR}/platform/macosx/wxlauncher.icns ${APP_RESOURCES_PATH})
   if(USING_SDL_FRAMEWORK) # then copy the framework into the app
     add_custom_command(TARGET wxlauncher POST_BUILD
-      COMMAND cp -R ${SDL_LIBRARY} ${APP_FRAMEWORKS_PATH})
+      COMMAND cp -R ${SDL2_FRAMEWORK} ${APP_FRAMEWORKS_PATH})
   endif(USING_SDL_FRAMEWORK)
 endif(IS_APPLE)

(I need to fix generating an error when SDL2 can't be found, haven't gotten around to that yet.)

Then from the wxL repo root  folder I ran this:
Code: [Select]
mkdir build
cd build
/Applications/CMake.app/Contents/bin/cmake -G Xcode -DwxWidgets_CONFIG_EXECUTABLE=/PATH/TO/wxWidgetsFolder/build-debug/wx-config -DPYTHON_EXECUTABLE=/usr/local/bin/python3 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 -DCMAKE_C_COMPILER_ID=Clang -DCMAKE_CXX_COMPILER_ID=Clang -DCMAKE_CXX_FLAGS="-stdlib=libc++ -std=c++11" -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ ../

I couldn’t get the Python scripts to work with Python 2, something about no module named ‘builtins’ so I got Python 3 from python.org.

With all of this, wxL builds successfully.

However when I run it, there’s no window and I have to force quit wxL.

Running the wxL Unix executable insside the app bundle from the command line produces this output:

Code: [Select]
$ /path/to/wxLauncherRepo/build/Debug/wxlauncher.app/Contents/MacOS/wxlauncher ; exit;
2016-09-12 19:14:46.951 wxlauncher[54989:120699] _createMenuRef called with existing principal MenuRef already associated with menu
2016-09-12 19:14:46.953 wxlauncher[54989:120699] (
0   CoreFoundation                      0x00007fff8f9f64f2 __exceptionPreprocess + 178
1   libobjc.A.dylib                     0x00007fff838e3f7e objc_exception_throw + 48
2   CoreFoundation                      0x00007fff8fa5d4bd +[NSException raise:format:] + 205
3   AppKit                              0x00007fff86c13c86 -[NSCarbonMenuImpl _createMenuRef] + 62
4   AppKit                              0x00007fff86c135c5 -[NSCarbonMenuImpl _instantiateCarbonMenu] + 140
5   AppKit                              0x00007fff86c11270 -[NSApplication finishLaunching] + 856
6   AppKit                              0x00007fff86c10bbd -[NSApplication run] + 231
7   wxlauncher                          0x0000000103b8eaad _ZN5wxApp10CallOnInitEv + 349
8   wxlauncher                          0x0000000103ee53c0 _Z7wxEntryRiPPw + 192
9   wxlauncher                          0x0000000103ee558c _Z7wxEntryRiPPc + 60
10  wxlauncher                          0x0000000103aecfd0 main + 240
11  wxlauncher                          0x00000001039dc1f4 start + 52
12  ???                                 0x0000000000000001 0x0 + 1
)

For all I know the error is just from trying to run the Unix executable this way and isn’t actually the real problem.

No wxLauncher.log is produced. Looking in ~/Library/Application Support/wxlauncher/ .

Any thoughts from anyone?

Perhaps the compiler warnings from building wxWidgets and/or wxL could provide some insight into the problem. Haven't taken a close look at them yet.

EDIT: Correction.

EDIT 2: Not sure that CPack is configured correctly for OS X anymore. Looked like DragNDrop mode is off, although the build produced what looks like a drag and drop app.
« Last Edit: September 12, 2016, 10:22:12 pm by jg18 »
wxLauncher 0.10.1 beta now available! Toggle FRED launching with F3! | wxLauncher 2.0 Request for Comments
Hey mod authors! Did you know you can customize wxL's recommended lighting preset through your mod.ini? Check it out!

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
That's odd.  I went a completely different route than you but ended up with the same result, an app that doesn't create a window and must be force quit.  I used wxmac, sdl2 from homebrew, deleted the builtin lines in the python scripts, and modified the build archs using the command line from the Travis scripts.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Posts: 5,147
  • Anims: 418, Cutscenes: 8, Mainhalls: 7, Logos: 52
    • Steam
    • Twitter
    • Mix-Hai Productions
Re: wxLauncher Test Builds [Updated: 2016-09-04]
Randomly, I've noticed that wxL does not show it's own version anywhere as far as I can tell. This might be a useful little piece of info to make visible somewhere.
Oddgrim: I AM PUSHING MY BELLY BUTTON AS HARD I CAN BUT NOTHING HAPPENS. NOTHING!
Cutscene Upgrade Project - Mainhall Remakes - MixaelANITools - Between the Ashes - MjnMixael's Render Boutique - Mix-Hai Productions
Youtube Channel - P3D Model Box - Photobucket Albums - Model Releases - Downloads
Between the Ashes is looking for committed testers, PM me for details.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
On Mac at least, 0.12 has an about dialog with it.  Not sure if windows has that.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline jg18

  • A very happy zod
  • 210
  • Posts: 1,257
  • can do more than spellcheck
Re: wxLauncher Test Builds [Updated: 2016-09-04]
Issue tracked down. It was a conflict between SDL2 initializeing and wxWidgets initializing. Apparently only happens on OS X with wxWidgets 3.x.

Best solution IMO is to initialize SDL Video only when we need it to detect resolutions, rather than trying to initialize it at wxL startup. wxL works correctly on OS X when this change is made.

I do not recommend using SDL_Init() because according to the  SDL Wiki it initializes subsystems that we never use like File I/O and Threads. IMO it’s best to just initialize the subsystems we actually need.

If we make this change, then we need to decide when to shut the SDL video subsystem down. Two options:
- right after we’re done detecting resolutions, similar to how SDL joystick subsystem is initialized right before detecting joysticks and shut down right after detecting joysticks. It does mean we’d be repeatedly initializing and shutting down the SDL video subsystem as wxL runs, dunno if that’s an issue. We already do just that with the SDL joystick subsystem.
- when shutting down wxL, something like the following in wxLauncher::OnExit():
Code: [Select]
#if HAS_SDL == 1
Uint32 initedSubsystems = SDL_WasInit(0);
if (initedSubsystems) {
SDL_QuitSubSystem(initedSubsystems);
}
#endif
We could shut down the SDL joystick subsystem the same way (that is, at wxL exit) rather than repeatedly initializing/quitting it.


On a related note, why are we still using Win32 API to detect resolutions on Windows? If we’re using SDL everywhere then why not use SDL on all platforms for resolution detection?

Also apparently the SDL joystick subsystem was being initialized without checking the return value from SDL_InitSubsystem(), so we weren’t checking if the init actually succeeded. :wtf: Might as well fix that too while tinkering with the SDL code.


Here is a patch that initializes SDL video before detecting resolutions and shuts it down right after detecting resolutions (that is, option #1 mentioned above). Since SDL is no longer being initialized at wxL startup, we can remove the custom main() function, so I did that as well.

Tested on OS X, needs testing on Windows/Linux. I’ll try to get around to it if someone else doesn’t first.

EDIT 3: Patch doesn't work on Linux, see this post for updated patch.

One known issue: looks like the top bar menu on OS X for wxL is empty, meaning no About dialog. I don't feel like this is worth trying to fix and is probably something in wxWidgets anyway.

While testing on OS X, I got a couple crashes on wxL shutdown. Here’s  a patch to plug those holes:

Code: [Select]
diff --git a/code/apis/ProfileManager.h b/code/apis/ProfileManager.h
index 0990057..d567be2 100644
--- a/code/apis/ProfileManager.h
+++ b/code/apis/ProfileManager.h
@@ -55,6 +55,7 @@ public:
  };
  static bool Initialize(Flags flags = None);
  static bool DeInitialize();
+ static bool IsInitialized() { return isInitialized; }
  static ProMan* GetProfileManager();
 
  virtual ~ProMan();
diff --git a/code/apis/TCManager.cpp b/code/apis/TCManager.cpp
index 6afde00..078e7de 100644
--- a/code/apis/TCManager.cpp
+++ b/code/apis/TCManager.cpp
@@ -35,7 +35,9 @@ TCManager::TCManager() {
 }
 /** Destructor. Static class does nothing. */
 TCManager::~TCManager() {
- ProMan::GetProfileManager()->RemoveEventHandler(this);
+ if (ProMan::IsInitialized()) {
+ ProMan::GetProfileManager()->RemoveEventHandler(this);
+ }
 }
 
 TCManager* TCManager::manager = NULL;
diff --git a/code/controls/ModList.cpp b/code/controls/ModList.cpp
index 3195ab8..c290cb5 100644
--- a/code/controls/ModList.cpp
+++ b/code/controls/ModList.cpp
@@ -604,7 +604,9 @@ ModList::ModList(wxWindow *parent, wxSize& size, wxString tcPath)
 
 /** the dtor.  Cleans up stuff. */
 ModList::~ModList() {
- SkinSystem::UnRegisterTCSkinChanged(this);
+ if (SkinSystem::IsInitialized()) {
+ SkinSystem::UnRegisterTCSkinChanged(this);
+ }
 
  if ( this->configFiles != NULL ) {
  delete this->configFiles;


Once this is sorted out we can work on getting CMakeLists.txt updated to support OS X again, and I can also update the ReadMe with current build instructions for OS X.

Randomly, I've noticed that wxL does not show it's own version anywhere as far as I can tell. This might be a useful little piece of info to make visible somewhere.
I think it's printed to the log but yeah it'd probably be good to show it somewhere in the GUI. A cross-platform About dialog would be a considerable amount of work. Maybe we could stick it in the default window title? As in "wxLauncher 0.12.0-rc2 for the FreeSpace 2 Source Code PRoject". Not sure offhand how hard that would be to do, probably not very though. EDIT: Or maybe display it prominently in the Help manual? Displaying it in the default window title isn't foolproof because TCs (and maybe also mods, I forget) can change the window title through the skin system.


EDIT 2: While we're fixing stuff in wxL, could also fix that annoying bug in displaying build versions where certain commit hashes don't appear in the GUI. I have a patch for it somewhere in the nightly builds forum, would have to dig it up.
« Last Edit: September 16, 2016, 07:01:04 pm by jg18 »
wxLauncher 0.10.1 beta now available! Toggle FRED launching with F3! | wxLauncher 2.0 Request for Comments
Hey mod authors! Did you know you can customize wxL's recommended lighting preset through your mod.ini? Check it out!

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
I was able to get an About dialog to open up on my Mac the other day, using the top menu bar.  I can't with the 0.10.x version but I did with my build of 0.12.0, even though there was no program window.  I could still interact with the top menu, and opened an About dialog with a version number in it.

Edit: 
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline AdmiralRalwood

  • 211
  • Posts: 3,122
  • Mister Subspace Strikes
    • Skype
    • Steam
    • Twitter
Re: wxLauncher Test Builds [Updated: 2016-09-04]
[img]https://photos-6.dropbox.com/t/2/AABRR5c_AQ7uXZnm3DwHxlTX89iNn4WJbtoWlGYqAVz7kA/12/63963020/png/32x32/1/_/1/2/Screenshot%202016-09-15%2015.13.33.png/EMLUzTEY5wEgAigCKAQ/MKPG-fumn48N9GqtPQcwTfri6oERfGtrXrB627y4BB0?size=1280x960&size_mode=3[/img]
That URL gives me a 403 error.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
I keep forgetting Dropbox doesn't like that
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Iss Mneur

  • Moderator
  • 210
  • Posts: 1,278
  • TODO:
Re: wxLauncher Test Builds [Updated: 2016-09-04]
I do not recommend using SDL_Init() because according to the  SDL Wiki it initializes subsystems that we never use like File I/O and Threads. IMO it’s best to just initialize the subsystems we actually need.
Agreed. Espcially since wxWidgets has its own versions that we are already using.

If we make this change, then we need to decide when to shut the SDL video subsystem down. Two options:
- right after we’re done detecting resolutions [snip]
- when shutting down wxL [snip]
My only concern with initializing once on start up, would be "hotplug" detecting changes to the resolution capabilities.  I could not find any information on if this is actually a concern.  Otherwise either option works for me.

On a related note, why are we still using Win32 API to detect resolutions on Windows? If we’re using SDL everywhere then why not use SDL on all platforms for resolution detection?
Because it was missed when support for SDL joysticks was added. The laucher should use the API that FSO will be using, just like with the joysticks.

Tested on OS X, needs testing on Windows/Linux. I’ll try to get around to it if someone else doesn’t first.
I can try it on Windows tomorrow evening.

One known issue: looks like the top bar menu on OS X for wxL is empty, meaning no About dialog. I don't feel like this is worth trying to fix and is probably something in wxWidgets anyway.

Randomly, I've noticed that wxL does not show it's own version anywhere as far as I can tell. This might be a useful little piece of info to make visible somewhere.
I think it's printed to the log but yeah it'd probably be good to show it somewhere in the GUI. A cross-platform About dialog would be a considerable amount of work. Maybe we could stick it in the default window title? As in "wxLauncher 0.12.0-rc2 for the FreeSpace 2 Source Code PRoject". Not sure offhand how hard that would be to do, probably not very though. EDIT: Or maybe display it prominently in the Help manual? Displaying it in the default window title isn't foolproof because TCs (and maybe also mods, I forget) can change the window title through the skin system.
There is supposed to be an about button beside the help button, bits of the code for it are even still in the code base.  It is just one of those features that has yet to be completed.

Only TCs should be able to change the title bar, though I don't recall if they can change the entire thing or just the bit after wxLauncher.

Trying to figure out what to do with the online help.  It hasn't even been updated recently and still references 0.9.0 as the newest version (and is utterly broken in 0.12.0-rc.2, since fixed in master).  Will probably end up doing something with the wiki(s) and the github releases api.  But also may just remove it and have help drop a person on a suitable landing page on the wxLauncher wiki.

EDIT 2: While we're fixing stuff in wxL, could also fix that annoying bug in displaying build versions where certain commit hashes don't appear in the GUI. I have a patch for it somewhere in the nightly builds forum, would have to dig it up.
I had not heard of this one.  Do we have any examples of hashes that don't appear?
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
Here's that about dialog  Maybe this will work?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline jg18

  • A very happy zod
  • 210
  • Posts: 1,257
  • can do more than spellcheck
Re: wxLauncher Test Builds [Updated: 2016-09-04]
If we make this change, then we need to decide when to shut the SDL video subsystem down. Two options:
- right after we’re done detecting resolutions [snip]
- when shutting down wxL [snip]
My only concern with initializing once on start up, would be "hotplug" detecting changes to the resolution capabilities.  I could not find any information on if this is actually a concern.  Otherwise either option works for me.
Well the patch I posted above initializes SDL video every time resolution detection is needed and shuts it down right afterwards so might as well go with that approach.

On a related note, why are we still using Win32 API to detect resolutions on Windows? If we’re using SDL everywhere then why not use SDL on all platforms for resolution detection?
Because it was missed when support for SDL joysticks was added. The laucher should use the API that FSO will be using, just like with the joysticks.
Ok. Maybe not worth fixing for 0.12.0 given that it’d involve non-trivial changes to support both Win32 and SDL resolution detection on Windows?


Tested on OS X, needs testing on Windows/Linux. I’ll try to get around to it if someone else doesn’t first.
I can try it on Windows tomorrow evening.
Ok, I’ll try it on Linux. I got the Ubuntu GNOME 16.04.1 ISO and can set it up in VMWare.

One known issue: looks like the top bar menu on OS X for wxL is empty, meaning no About dialog. I don't feel like this is worth trying to fix and is probably something in wxWidgets anyway.

Randomly, I've noticed that wxL does not show it's own version anywhere as far as I can tell. This might be a useful little piece of info to make visible somewhere.
I think it's printed to the log but yeah it'd probably be good to show it somewhere in the GUI. A cross-platform About dialog would be a considerable amount of work. Maybe we could stick it in the default window title? As in "wxLauncher 0.12.0-rc2 for the FreeSpace 2 Source Code PRoject". Not sure offhand how hard that would be to do, probably not very though. EDIT: Or maybe display it prominently in the Help manual? Displaying it in the default window title isn't foolproof because TCs (and maybe also mods, I forget) can change the window title through the skin system.
There is supposed to be an about button beside the help button, bits of the code for it are even still in the code base.  It is just one of those features that has yet to be completed.
Yeah, and since finishing it is probably a significant amount of work, maybe something quicker like putting the version in the default window title is worth doing, possibly even for 0.12.0?

Only TCs should be able to change the title bar, though I don't recall if they can change the entire thing or just the bit after wxLauncher.
I think they can change the entire window title, which IMO is fine. FOr example Diaspora might as well put the window title as “Diaspora Launcher” or “Launch Diaspora” or something that doesn’t mention wxLauncher. I don’t feel like they have to explicitly mention that it’s wxLauncher. Not that important though TBH.

Trying to figure out what to do with the online help.  It hasn't even been updated recently and still references 0.9.0 as the newest version (and is utterly broken in 0.12.0-rc.2, since fixed in master).  Will probably end up doing something with the wiki(s) and the github releases api.  But also may just remove it and have help drop a person on a suitable landing page on the wxLauncher wiki.
Removing the help system and making the Help button point people to the wiki makes sense to me. It’s easier to keep the wiki up-to-date than the help system. Also means we can get rid of the Python scripts/dependency I think?

EDIT 2: While we're fixing stuff in wxL, could also fix that annoying bug in displaying build versions where certain commit hashes don't appear in the GUI. I have a patch for it somewhere in the nightly builds forum, would have to dig it up.
I had not heard of this one.  Do we have any examples of hashes that don't appear?
Here you go.

While I’m cranking out patches, here’s one to fix the copyright symbol that appears when you right-click on wxlauncher.app in OS X and select Get Info:
Code: [Select]
diff --git a/cmake/wxLauncherInstaller.cmake b/cmake/wxLauncherInstaller.cmake
index 6ad1885..e1d91f6 100644
--- a/cmake/wxLauncherInstaller.cmake
+++ b/cmake/wxLauncherInstaller.cmake
@@ -71,7 +71,7 @@ if(IS_APPLE)
 #  set(MACOSX_BUNDLE_LONG_VERSION_STRING "wxLauncher for the SCP, version ${MACOSX_BUNDLE_SHORT_VERSION_STRING}")
   set(MACOSX_BUNDLE_ICON_FILE wxlauncher.icns)
   set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${wxlauncher_VERSION})
-  set(MACOSX_BUNDLE_COPYRIGHT "Copyright � 2009-2016 ${CPACK_PACKAGE_VENDOR}")
+  set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2009-2016 ${CPACK_PACKAGE_VENDOR}")
 endif(IS_APPLE)
 
 if(IS_LINUX)
I don’t think there’s any equivalent of this copyright string on other platforms. Dunno if it’s worth looking into or if it’s even possible.

Here's that about dialog  Maybe this will work?
Pretty sure that dialog is  auto-generated by OS X and does not appear on other platforms. When I build wxL using SDL2.framework, wxWidgets 3.0.2 and the patch I posted above, when you click on the “wxlauncher” top menubar, the menu is empty. You can try the patch on your own setup and  see if that’s the case for you as well.


Also, is the patch I posted above to fix the crashes when exiting wxL good to commit? I don't think I have commit access to wxL. Maybe we could collect all of these patches as separate commits into a single PR when we're done (including updating CMakeLists.txt and the ReadMe)? Admittedly a PR labeled "Fix various things" or the like sounds sloppy, even if the individual commits are fine. *shrug*
wxLauncher 0.10.1 beta now available! Toggle FRED launching with F3! | wxLauncher 2.0 Request for Comments
Hey mod authors! Did you know you can customize wxL's recommended lighting preset through your mod.ini? Check it out!

 

Offline jg18

  • A very happy zod
  • 210
  • Posts: 1,257
  • can do more than spellcheck
Re: wxLauncher Test Builds [Updated: 2016-09-04]
Here's something I whipped up to put the version in the default window title.

I tried putting the VERSION_STRING as a const wxString within version.cpp and making it an extern const wxString in version.h but could not for the life of me get it to work. :mad: The VERSION_STRING always appeared as empty and i could not figure out why. That is, the window title always appeared as "wxLauncher  for the FreeSpace 2 Source Code Project". Note the extra space after "wxLauncher". With the patch below though it appears correctly.

Code: [Select]
diff --git a/code/global/SkinDefaults.cpp b/code/global/SkinDefaults.cpp
index 2ea8649..bb0b86d 100644
--- a/code/global/SkinDefaults.cpp
+++ b/code/global/SkinDefaults.cpp
@@ -17,9 +17,13 @@
  */
 
 #include "SkinDefaults.h"
+#include "version.h"
 #include <wx/intl.h> // for _() macro
 
-const wxString DEFAULT_SKIN_WINDOW_TITLE (_("wxLauncher for the FreeSpace 2 Source Code Project"));
+// not needed externally
+static const wxString VERSION_STRING(wxString::Format(_T("%d.%d.%d"), MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION));
+
+const wxString DEFAULT_SKIN_WINDOW_TITLE (wxString::Format(_T("wxLauncher %s for the FreeSpace 2 Source Code Project"), VERSION_STRING.c_str()));
 const wxString DEFAULT_SKIN_WINDOW_ICON (_T("wxlauncher.ico"));
 const wxString DEFAULT_SKIN_BANNER (_T("SCP_Header.png"));
 const wxString DEFAULT_SKIN_WELCOME_TEXT
wxLauncher 0.10.1 beta now available! Toggle FRED launching with F3! | wxLauncher 2.0 Request for Comments
Hey mod authors! Did you know you can customize wxL's recommended lighting preset through your mod.ini? Check it out!

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • Posts: 7,825
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: wxLauncher Test Builds [Updated: 2016-09-04]
That dialog only appeared in this new release I built.  Wasn't in the last official mac builds.  So maybe it auto generated since I used a newer wxwidgets library, I don't know.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays