]> git.mxchange.org Git - flightgear.git/commitdiff
Mac nightly can use new launcher.
authorJames Turner <zakalawe@mac.com>
Tue, 6 Jan 2015 21:59:06 +0000 (21:59 +0000)
committerJames Turner <zakalawe@mac.com>
Tue, 6 Jan 2015 21:59:06 +0000 (21:59 +0000)
CMakeModules/FlightGearBundleInfo.plist.in
package/mac/build-mac-nightly-dmg.rb

index 068d6f90248525bf04321afc91f6b86712b65f55..d5e26c1777b845dc8a78e139eda8cd70d0947488 100644 (file)
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
-       
+
     <key>LSMinimumSystemVersion</key>
     <string>10.6.0</string>
-       
+
     <key>NSHumanReadableCopyright</key>
        <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
-    
+
     <!-- needed for FlightGear launch to function -->
     <key>NSMainNibFile</key>
     <string>MainMenu</string>
     <key>NSPrincipalClass</key>
     <string>NSApplication</string>
+
+    <!-- when launched via LaunchServices, run the launcher GUI -->
+    <key>LSEnvironment</key>
+    <dict>
+        <key>FG_LAUNCHER</key>
+        <string>1</string>
+    </dict>
 </dict>
 </plist>
index 0b27eb5cb470f6a0d310b131fb7afab0e9396647..a13a19dba90bef48b20a2d6012b70f08e188baec 100755 (executable)
@@ -23,13 +23,13 @@ puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}"
 
 def fix_install_names(object)
   puts "fixing install names for #{object}"
-  
+
   $osgLibs.each do |l|
     oldName = "lib#{l}.#{$osgSoVersion}.dylib"
-    newName = "@executable_path/../Frameworks/#{oldName}"    
+    newName = "@executable_path/../Frameworks/#{oldName}"
     `install_name_tool -change #{oldName} #{newName} #{object}`
   end
-  
+
   oldName = "libOpenThreads.#{$openThreadsSoVersion}.dylib"
   newName= "@executable_path/../Frameworks/#{oldName}"
   `install_name_tool -change #{oldName} #{newName} #{object}`
@@ -44,6 +44,11 @@ puts "Erasing previous image dir"
 
 bundle=dmgDir + "/FlightGear.app"
 
+# run macdeployt before we rename the bundle, otherwise it
+# can't find the bundle executable
+puts "Running macdeployqt on the bundle to copy Qt libraries"
+`macdeployqt #{$prefixDir}/fgfs.app`
+
 puts "Moving & renaming app bundle"
 `mkdir -p #{dmgDir}`
 `mv #{$prefixDir}/fgfs.app #{bundle}`
@@ -78,7 +83,7 @@ bins.each do |b|
   if !File.exist?("#{$prefixDir}/bin/#{b}")
     next
   end
-  
+
   outPath = "#{macosDir}/#{b}"
   `cp #{$prefixDir}/bin/#{b} #{outPath}`
   fix_install_names(outPath)
@@ -105,27 +110,12 @@ end
 `cp #{srcDir}/package/mac/FlightGear.icns #{resourcesDir}/FlightGear.icns`
 `cp #{srcDir}/COPYING #{dmgDir}`
 
-# Macflightgear launcher
-if File.exist?("FlightGearOSX")
-  puts "Copying Macflightgear launcher files"
-  Dir.chdir "FlightGearOSX" do
-    `cp FlightGear #{macosDir}`
-    `rsync -a *.rb *.lproj *.sh *.tiff #{resourcesDir}`
-  end
-  
-  # change CFBundleExecutable in to the Info.plist
-  puts "Adjusting CFBundle executable - needs Ruby plist gem installed"
-  plist = Plist::parse_xml("#{contents}/Info.plist")
-  plist["CFBundleExecutable"] = "FlightGear"
-  plist.save_plist("#{contents}/Info.plist")
-end
-
 if File.exist?("#{$prefixDir}/share/flightgear")
   puts "Copying FGCom data files"
   `ditto #{$prefixDir}/share/flightgear #{resourcesDir}`
 end
 
-# code sign all executables in MacOS dir. Do this last since reource
+# code sign all executables in MacOS dir. Do this last since resource
 # changes will invalidate the signature!
 Dir.foreach(macosDir) do |b|
     if b == '.' or b == '..' then