]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Create OS X application bundles for PuTTY and pterm.
authorSimon Tatham <anakin@pobox.com>
Wed, 23 Mar 2016 22:14:13 +0000 (22:14 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 23 Mar 2016 22:22:48 +0000 (22:22 +0000)
This commit adds two .plist files, which go in the app bundles; two
.bundle files, which are input to gtk-mac-bundler and explain to it
how to _create_ the bundles; and a piece of manual addition to
Makefile.am that actually runs gtk-mac-bundler after building the
gtkapp.c based binaries and the OSX launcher. The latter is
conditionalised on configuring --with-quartz (unlike the binaries
themselves, which you can build on other platforms too, though they
won't do much that's useful).

.gitignore
Recipe
configure.ac
unix/gtkapp.c
unix/pterm.bundle [new file with mode: 0644]
unix/pterm.plist [new file with mode: 0644]
unix/putty.bundle [new file with mode: 0644]
unix/putty.plist [new file with mode: 0644]

index 39501cf78a89297a0d0a09f80f7584071bacf321..6dac3cf50cadfc2182d243aaf7198acb0ec77f1b 100644 (file)
@@ -38,6 +38,8 @@
 /puttyapp
 /ptermapp
 /osxlaunch
+/unix/PuTTY.app
+/unix/Pterm.app
 /fuzzterm
 /testbn
 /*.DSA
diff --git a/Recipe b/Recipe
index f944c62e21699c95410ed2383e032652b374a29b..e8801da59bd59992a562d70cf197acebec5a5cea 100644 (file)
--- a/Recipe
+++ b/Recipe
@@ -192,6 +192,18 @@ install-exec-local:
 endif
 !end
 
+# In automake makefile, build the OS X app bundle, if configured in
+# Quartz mode.
+!begin am
+if HAVE_QUARTZ
+noinst_SCRIPTS = unix/PuTTY.app unix/Pterm.app
+unix/PuTTY.app: unix/putty.bundle puttyapp osxlaunch
+       rm -rf $@ && gtk-mac-bundler $<
+unix/Pterm.app: unix/pterm.bundle ptermapp osxlaunch
+       rm -rf $@ && gtk-mac-bundler $<
+endif
+!end
+
 # Random symbols.
 !begin cygwin vars
 # _WIN32_IE is required to expose identifiers that only make sense on
index 82fae26c40d02b6fa644d29c69bc382ac73ae690..e951a286b2e884128d2b821b05ed612956052c21 100644 (file)
@@ -51,8 +51,11 @@ AC_ARG_WITH([gssapi],
 AC_ARG_WITH([quartz],
   [AS_HELP_STRING([--with-quartz],
                   [build for the MacOS Quartz GTK back end])],
-  [AC_DEFINE([OSX_GTK], [1], [Define if building with GTK for MacOS.])],
-  [])
+  [AC_DEFINE([OSX_GTK], [1], [Define if building with GTK for MacOS.])
+   with_quartz=yes],
+  [with_quartz=no])
+
+AM_CONDITIONAL([HAVE_QUARTZ],[test "x$with_quartz" = "xyes"])
 
 WITH_GSSAPI=
 AS_IF([test "x$with_gssapi" != xno],
index 3c299270c0dfc7d748d2c3500d8d0e1db0f590bf..c7b5942efa1b94649b6ca8ebfc4ce01d00b71b49 100644 (file)
@@ -7,6 +7,22 @@
  * it's fully working.)
  */
 
+/*
+
+To build on OS X, you will need a build environment with GTK 3 and
+gtk-mac-bundler, and also Halibut on the path (to build the man pages,
+without which the standard Makefile will complain). Then, from a clean
+checkout, do this:
+
+./mkfiles.pl -U --with-quartz
+make -C icons icns
+make -C doc
+make
+
+and you should get unix/PuTTY.app and unix/PTerm.app as output.
+
+*/
+
 #include <assert.h>
 #include <stdlib.h>
 
diff --git a/unix/pterm.bundle b/unix/pterm.bundle
new file mode 100644 (file)
index 0000000..377fee0
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<app-bundle>
+
+  <meta>
+    <prefix name="default">${env:JHBUILD_PREFIX}</prefix>
+    <run-install-name-tool/>
+    <gtk>gtk+-3.0</gtk>
+    <!-- Optionally specify a launcher script to use. If the
+         application sets up everything needed itself, like
+         environment variable, linker paths, etc, a launcher script is
+         not needed. If the source path is left out, the default
+         script will be used.
+    -->
+    <launcher-script>${project}/../osxlaunch</launcher-script >
+  </meta>
+
+  <plist>${project}/pterm.plist</plist>
+
+  <main-binary dest="${bundle}/Contents/MacOS">
+    ${project}/../ptermapp
+  </main-binary>
+
+  <binary>
+    ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so
+  </binary>
+
+  <binary>
+    ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
+  </binary>
+
+  <data>
+    ${prefix}/share/themes/Adwaita
+  </data>
+
+  <data dest="${bundle}/Contents/Resources">
+    ${project}/../icons/Pterm.icns
+  </data>
+
+  <icon-theme icons="auto">
+    Adwaita
+  </icon-theme>
+
+</app-bundle>
diff --git a/unix/pterm.plist b/unix/pterm.plist
new file mode 100644 (file)
index 0000000..e8bd943
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleIconFile</key>
+       <string>Pterm.icns</string>
+       <key>CFBundleName</key>
+       <string>Pterm</string>
+       <key>CFBundleDisplayName</key>
+       <string>Pterm</string>
+       <key>CFBundleExecutable</key>
+       <string>Pterm</string>
+       <key>CFBundleVersion</key>
+       <string>Unidentified build</string>
+       <key>CFBundleShortVersionString</key>
+       <string>Unidentified build</string>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>en</string>
+       <key>CFBundleIdentifier</key>
+       <string>org.tartarus.projects.putty.macpterm</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>NSHumanReadableCopyright</key>
+       <string>© 1997-2015 Simon Tatham. All rights reserved.</string>
+</dict>
+</plist>
diff --git a/unix/putty.bundle b/unix/putty.bundle
new file mode 100644 (file)
index 0000000..91b0def
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<app-bundle>
+
+  <meta>
+    <prefix name="default">${env:JHBUILD_PREFIX}</prefix>
+    <run-install-name-tool/>
+    <gtk>gtk+-3.0</gtk>
+    <!-- Optionally specify a launcher script to use. If the
+         application sets up everything needed itself, like
+         environment variable, linker paths, etc, a launcher script is
+         not needed. If the source path is left out, the default
+         script will be used.
+    -->
+    <launcher-script>${project}/../osxlaunch</launcher-script >
+  </meta>
+
+  <plist>${project}/putty.plist</plist>
+
+  <main-binary dest="${bundle}/Contents/MacOS">
+    ${project}/../puttyapp
+  </main-binary>
+
+  <binary>
+    ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so
+  </binary>
+
+  <binary>
+    ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
+  </binary>
+
+  <data>
+    ${prefix}/share/themes/Adwaita
+  </data>
+
+  <data dest="${bundle}/Contents/Resources">
+    ${project}/../icons/PuTTY.icns
+  </data>
+
+  <icon-theme icons="auto">
+    Adwaita
+  </icon-theme>
+
+</app-bundle>
diff --git a/unix/putty.plist b/unix/putty.plist
new file mode 100644 (file)
index 0000000..cf8d53d
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleIconFile</key>
+       <string>PuTTY.icns</string>
+       <key>CFBundleName</key>
+       <string>PuTTY</string>
+       <key>CFBundleDisplayName</key>
+       <string>PuTTY</string>
+       <key>CFBundleExecutable</key>
+       <string>PuTTY</string>
+       <key>CFBundleVersion</key>
+       <string>Unidentified build</string>
+       <key>CFBundleShortVersionString</key>
+       <string>Unidentified build</string>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>en</string>
+       <key>CFBundleIdentifier</key>
+       <string>org.tartarus.projects.putty.macputty</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>NSHumanReadableCopyright</key>
+       <string>© 1997-2015 Simon Tatham. All rights reserved.</string>
+</dict>
+</plist>