From c73f25564f8abf9747ab8a1168f6a2dfe2c80d21 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 23 Mar 2016 22:14:13 +0000 Subject: [PATCH] Create OS X application bundles for PuTTY and pterm. 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 | 2 ++ Recipe | 12 ++++++++++++ configure.ac | 7 +++++-- unix/gtkapp.c | 16 ++++++++++++++++ unix/pterm.bundle | 43 +++++++++++++++++++++++++++++++++++++++++++ unix/pterm.plist | 30 ++++++++++++++++++++++++++++++ unix/putty.bundle | 43 +++++++++++++++++++++++++++++++++++++++++++ unix/putty.plist | 30 ++++++++++++++++++++++++++++++ 8 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 unix/pterm.bundle create mode 100644 unix/pterm.plist create mode 100644 unix/putty.bundle create mode 100644 unix/putty.plist diff --git a/.gitignore b/.gitignore index 39501cf7..6dac3cf5 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,8 @@ /puttyapp /ptermapp /osxlaunch +/unix/PuTTY.app +/unix/Pterm.app /fuzzterm /testbn /*.DSA diff --git a/Recipe b/Recipe index f944c62e..e8801da5 100644 --- 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 diff --git a/configure.ac b/configure.ac index 82fae26c..e951a286 100644 --- a/configure.ac +++ b/configure.ac @@ -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], diff --git a/unix/gtkapp.c b/unix/gtkapp.c index 3c299270..c7b5942e 100644 --- a/unix/gtkapp.c +++ b/unix/gtkapp.c @@ -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 #include diff --git a/unix/pterm.bundle b/unix/pterm.bundle new file mode 100644 index 00000000..377fee0d --- /dev/null +++ b/unix/pterm.bundle @@ -0,0 +1,43 @@ + + + + + ${env:JHBUILD_PREFIX} + + gtk+-3.0 + + ${project}/../osxlaunch + + + ${project}/pterm.plist + + + ${project}/../ptermapp + + + + ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so + + + + ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so + + + + ${prefix}/share/themes/Adwaita + + + + ${project}/../icons/Pterm.icns + + + + Adwaita + + + diff --git a/unix/pterm.plist b/unix/pterm.plist new file mode 100644 index 00000000..e8bd943d --- /dev/null +++ b/unix/pterm.plist @@ -0,0 +1,30 @@ + + + + + CFBundleIconFile + Pterm.icns + CFBundleName + Pterm + CFBundleDisplayName + Pterm + CFBundleExecutable + Pterm + CFBundleVersion + Unidentified build + CFBundleShortVersionString + Unidentified build + CFBundleDevelopmentRegion + en + CFBundleIdentifier + org.tartarus.projects.putty.macpterm + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + NSHumanReadableCopyright + © 1997-2015 Simon Tatham. All rights reserved. + + diff --git a/unix/putty.bundle b/unix/putty.bundle new file mode 100644 index 00000000..91b0def0 --- /dev/null +++ b/unix/putty.bundle @@ -0,0 +1,43 @@ + + + + + ${env:JHBUILD_PREFIX} + + gtk+-3.0 + + ${project}/../osxlaunch + + + ${project}/putty.plist + + + ${project}/../puttyapp + + + + ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so + + + + ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so + + + + ${prefix}/share/themes/Adwaita + + + + ${project}/../icons/PuTTY.icns + + + + Adwaita + + + diff --git a/unix/putty.plist b/unix/putty.plist new file mode 100644 index 00000000..cf8d53db --- /dev/null +++ b/unix/putty.plist @@ -0,0 +1,30 @@ + + + + + CFBundleIconFile + PuTTY.icns + CFBundleName + PuTTY + CFBundleDisplayName + PuTTY + CFBundleExecutable + PuTTY + CFBundleVersion + Unidentified build + CFBundleShortVersionString + Unidentified build + CFBundleDevelopmentRegion + en + CFBundleIdentifier + org.tartarus.projects.putty.macputty + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + NSHumanReadableCopyright + © 1997-2015 Simon Tatham. All rights reserved. + +