shithub: choc

Download patch

ref: f176ac404ad709e6c1254f8685f8d9fe7b995115
parent: df6a794052bc5c5f28ca15eca7d924ae29002d85
author: Simon Howard <[email protected]>
date: Fri Jan 15 13:13:05 EST 2010

Extend osx makefile to allow building of a working GNUstep application,
for testing purposes. Add GNUstep version of Info.plist, remove
app-skeleton directory and move contents up.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1813

--- a/configure.in
+++ b/configure.in
@@ -120,6 +120,7 @@
 pkg/Makefile
 pkg/config.make
 pkg/osx/Info.plist
+pkg/osx/Info-GNUstep.plist
 setup/Makefile
 setup/setup-res.rc
 src/Makefile
--- a/pkg/Makefile.am
+++ b/pkg/Makefile.am
@@ -1,14 +1,15 @@
 
 OSX_FILES=                                                              \
-osx/app-skeleton/Contents/PkgInfo                                       \
-osx/app-skeleton/Contents/Resources/128x128.png                         \
-osx/app-skeleton/Contents/Resources/app.icns                            \
-osx/app-skeleton/Contents/Resources/wadfile.icns                        \
-osx/app-skeleton/Contents/Resources/launcher.nib/classes.nib            \
-osx/app-skeleton/Contents/Resources/launcher.nib/info.nib               \
-osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib       \
+osx/Resources/128x128.png                                               \
+osx/Resources/app.icns                                                  \
+osx/Resources/app.png                                                   \
+osx/Resources/wadfile.icns                                              \
+osx/Resources/launcher.nib/classes.nib                                  \
+osx/Resources/launcher.nib/info.nib                                     \
+osx/Resources/launcher.nib/keyedobjects.nib                             \
 osx/GNUmakefile                                                         \
-osx/Info.plist.in                                                       \
+osx/Info.plist.in       osx/Info-GNUstep.plist.in                       \
+osx/PkgInfo                                                             \
 osx/cp-with-libs                                                        \
 osx/main.m                                                              \
 osx/AppController.m     osx/AppController.h                             \
--- a/pkg/osx/GNUmakefile
+++ b/pkg/osx/GNUmakefile
@@ -1,4 +1,9 @@
 
+# Makefile for building the OS X launcher program and DMG package.
+# It is also possible to build and run the launcher under Unix
+# systems using GNUstep, although this is only here for development
+# and debugging purposes.
+
 include ../config.make
 
 STAGING_DIR=staging
@@ -20,17 +25,37 @@
 # Staging dir build for package:
 
 APP_DIR=$(STAGING_DIR)/$(PACKAGE_NAME).app
-APP_BIN_DIR=$(APP_DIR)/Contents/MacOS/
 
+# OS X and GNUstep apps have a slightly different internal structure:
+# OS X apps have their files within a containing "Contents" directory
+# that does not exist in GNUstep apps.  Similarly, the binaries are
+# installed at the top level, rather than in a "MacOS" directory.
+# Finally, we must install a different Info.plist file.
+
+ifdef GNUSTEP_MAKEFILES
+APP_TOP_DIR=$(APP_DIR)
+APP_BIN_DIR=$(APP_DIR)
+SRC_INFO_PLIST=Info-GNUstep.plist
+else
+APP_TOP_DIR=$(APP_DIR)/Contents
+APP_BIN_DIR=$(APP_DIR)/Contents/MacOS
+SRC_INFO_PLIST=Info.plist
+endif
+
 $(STAGING_DIR): launcher $(TOPLEVEL_DOCS)
 	rm -rf $(STAGING_DIR)
 	mkdir $(STAGING_DIR)
 
-	cp -R app-skeleton "$(APP_DIR)"
-	mkdir "$(APP_BIN_DIR)"
-	cp Info.plist "$(APP_DIR)/Contents/"
+	cp $(TOPLEVEL_DOCS) "$(STAGING_DIR)"
 
-	cp launcher "$(APP_BIN_DIR)/"
+	mkdir -p "$(APP_TOP_DIR)"
+	cp -R Resources "$(APP_TOP_DIR)"
+	cp PkgInfo "$(APP_TOP_DIR)"
+	cp $(SRC_INFO_PLIST) "$(APP_TOP_DIR)/Info.plist"
+
+	mkdir -p "$(APP_BIN_DIR)"
+
+	cp launcher "$(APP_BIN_DIR)"
 	$(STRIP) "$(APP_BIN_DIR)/launcher"
 
 	./cp-with-libs $(TOPLEVEL)/src/$(PACKAGE_TARNAME) "$(APP_BIN_DIR)"
@@ -37,8 +62,6 @@
 	$(STRIP) "$(APP_BIN_DIR)/$(PACKAGE_TARNAME)"
 	./cp-with-libs $(TOPLEVEL)/setup/chocolate-setup "$(APP_BIN_DIR)"
 	$(STRIP) "$(APP_BIN_DIR)/chocolate-setup"
-
-	cp $(TOPLEVEL_DOCS) "$(STAGING_DIR)"
 
 	find $(STAGING_DIR) -name .svn -delete -exec rm -rf {} \; || true
 
--- /dev/null
+++ b/pkg/osx/Info-GNUstep.plist.in
@@ -1,0 +1,31 @@
+{
+    ApplicationDescription = "@PACKAGE_NAME@";
+    ApplicationIcon = app.png;
+    ApplicationName = "@PACKAGE_NAME@";
+    ApplicationRelease = @PACKAGE_VERSION@;
+    Copyright = "Copyright (C) 2009-2010";
+    CopyrightDescription = "GNU General Public License, version 2";
+    FullVersionID = @PACKAGE_VERSION@;
+    GSMainMarkupFile = "";
+    NSExecutable = "launcher";
+    NSIcon = app.png;
+    NSMainNibFile = launcher.nib;
+    NSPrincipalClass = NSApplication;
+    NSRole = Application;
+    NSTypes = (
+        {
+            NSHumanReadableName = "Doom WAD file";
+            NSUnixExtensions = ( wad );
+            NSRole = Viewer;
+            NSMimeTypes = (
+                "application/x-doom"
+            );
+        },
+        {
+            NSHumanReadableName = "Dehacked patch";
+            NSUnixExtensions = ( deh );
+            NSRole = Viewer;
+            NSIcon = "wadfile.png";
+        }
+    );
+}
--- /dev/null
+++ b/pkg/osx/PkgInfo
@@ -1,0 +1,1 @@
+APPL????
binary files /dev/null b/pkg/osx/Resources/128x128.png differ
binary files /dev/null b/pkg/osx/Resources/app.icns differ
binary files /dev/null b/pkg/osx/Resources/app.png differ
--- /dev/null
+++ b/pkg/osx/Resources/launcher.nib/classes.nib
@@ -1,0 +1,46 @@
+{
+    IBClasses = (
+        {
+            CLASS = AppController; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {launcherManager = id; }; 
+            SUPERCLASS = NSObject; 
+        }, 
+        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
+        {
+            ACTIONS = {closeConfigWindow = id; openConfigWindow = id; }; 
+            CLASS = IWADController; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {
+                chex = id; 
+                configWindow = id; 
+                doom1 = id; 
+                doom2 = id; 
+                iwadSelector = id; 
+                plutonia = id; 
+                tnt = id; 
+            }; 
+            SUPERCLASS = NSObject; 
+        }, 
+        {
+            ACTIONS = {setButtonClicked = id; }; 
+            CLASS = IWADLocation; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {locationConfigBox = id; }; 
+            SUPERCLASS = NSObject; 
+        }, 
+        {
+            ACTIONS = {launch = id; runSetup = id; }; 
+            CLASS = LauncherManager; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {
+                commandLineArguments = id; 
+                iwadController = id; 
+                launcherWindow = id; 
+                packageLabel = id; 
+            }; 
+            SUPERCLASS = NSObject; 
+        }
+    ); 
+    IBVersion = 1; 
+}
\ No newline at end of file
--- /dev/null
+++ b/pkg/osx/Resources/launcher.nib/info.nib
@@ -1,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IBDocumentLocation</key>
+	<string>170 140 612 260 0 0 1440 878 </string>
+	<key>IBEditorPositions</key>
+	<dict>
+		<key>29</key>
+		<string>108 337 163 44 0 0 1440 878 </string>
+	</dict>
+	<key>IBFramework Version</key>
+	<string>446.1</string>
+	<key>IBOpenObjects</key>
+	<array>
+		<integer>21</integer>
+		<integer>29</integer>
+		<integer>227</integer>
+	</array>
+	<key>IBSystem Version</key>
+	<string>8S2167</string>
+</dict>
+</plist>
binary files /dev/null b/pkg/osx/Resources/launcher.nib/keyedobjects.nib differ
binary files /dev/null b/pkg/osx/Resources/wadfile.icns differ
--- a/pkg/osx/app-skeleton/Contents/PkgInfo
+++ /dev/null
@@ -1,1 +1,0 @@
-APPL????
binary files a/pkg/osx/app-skeleton/Contents/Resources/128x128.png /dev/null differ
binary files a/pkg/osx/app-skeleton/Contents/Resources/app.icns /dev/null differ
--- a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/classes.nib
+++ /dev/null
@@ -1,46 +1,0 @@
-{
-    IBClasses = (
-        {
-            CLASS = AppController; 
-            LANGUAGE = ObjC; 
-            OUTLETS = {launcherManager = id; }; 
-            SUPERCLASS = NSObject; 
-        }, 
-        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
-        {
-            ACTIONS = {closeConfigWindow = id; openConfigWindow = id; }; 
-            CLASS = IWADController; 
-            LANGUAGE = ObjC; 
-            OUTLETS = {
-                chex = id; 
-                configWindow = id; 
-                doom1 = id; 
-                doom2 = id; 
-                iwadSelector = id; 
-                plutonia = id; 
-                tnt = id; 
-            }; 
-            SUPERCLASS = NSObject; 
-        }, 
-        {
-            ACTIONS = {setButtonClicked = id; }; 
-            CLASS = IWADLocation; 
-            LANGUAGE = ObjC; 
-            OUTLETS = {locationConfigBox = id; }; 
-            SUPERCLASS = NSObject; 
-        }, 
-        {
-            ACTIONS = {launch = id; runSetup = id; }; 
-            CLASS = LauncherManager; 
-            LANGUAGE = ObjC; 
-            OUTLETS = {
-                commandLineArguments = id; 
-                iwadController = id; 
-                launcherWindow = id; 
-                packageLabel = id; 
-            }; 
-            SUPERCLASS = NSObject; 
-        }
-    ); 
-    IBVersion = 1; 
-}
\ No newline at end of file
--- a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
+++ /dev/null
@@ -1,23 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IBDocumentLocation</key>
-	<string>170 140 612 260 0 0 1440 878 </string>
-	<key>IBEditorPositions</key>
-	<dict>
-		<key>29</key>
-		<string>108 337 163 44 0 0 1440 878 </string>
-	</dict>
-	<key>IBFramework Version</key>
-	<string>446.1</string>
-	<key>IBOpenObjects</key>
-	<array>
-		<integer>21</integer>
-		<integer>29</integer>
-		<integer>227</integer>
-	</array>
-	<key>IBSystem Version</key>
-	<string>8S2167</string>
-</dict>
-</plist>
binary files a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib /dev/null differ
binary files a/pkg/osx/app-skeleton/Contents/Resources/wadfile.icns /dev/null differ