Introduce --with-product-name superseding --with-macosx-app-name

The new option thoroughly replaces the product name mentioned in the
AC_INIT() call. Work in progress.

Also take care of spaces in the product name in a more systematic
fashion.

This should affect mainly OS X where the final app bundle that is
installed should use the product name as such, including spaces, if
any. However, our build system does not cope that well with having an
app bundle with spaces in it in instdir. So in instdir, and also in
test-install, spaces are stripped away from the product name when used
as part of the app bundle name.

Change-Id: Ic16b5039f23c96a4f39387a1869faeb25e05aafb
This commit is contained in:
Tor Lillqvist 2016-08-04 09:17:20 +03:00
parent 33a5ab1eb7
commit b640a1343b
8 changed files with 29 additions and 33 deletions

View file

@ -324,37 +324,37 @@ ifneq ($(MACOSX_CODESIGNING_IDENTITY),)
#
# Create Resources/*.lproj directories for languages supported by OS X
set -x; for lang in ca cs da de el en es fi fr hr hu id it ja ko ms nl no pl pt pt_PT ro ru sk sv th tr uk vi zh_CN zh_TW; do \
lproj=$(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Resources/$$lang.lproj; \
mkdir $$lproj; \
lproj=$(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/Resources/$$lang.lproj; \
mkdir "$$lproj"; \
done
#
# And remove the "bin" folder which should not be there
rm -rf $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/bin
rm -rf $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/bin
#
# Remove unnecessary executables in the LibreOfficePython framework
rm -rf $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/bin
rm -rf $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/bin
#
# Remove the python.o object file which is weird and interferes with app store uploading
# And with it removed, presumably the other stuff in the Python lib/python3.3/config-3.3m probably does not make sense either.
rm -rf $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/lib/python[1-9]*/config-[1-9]*
rm -rf $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/lib/python[1-9]*/config-[1-9]*
#
ifneq ($ENABLE_MACOSX_SANDBOX),)
# Remove the gengal.bin binary and unopkg script that we don't want
rm $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/MacOS/gengal.bin
rm $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/MacOS/unopkg
# Remove the gengal binary and unopkg script that we don't want
rm $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/MacOS/gengal
rm $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/MacOS/unopkg
endif
#
# Then use the macosx-codesign-app-bundle script
@$(SRCDIR)/solenv/bin/macosx-codesign-app-bundle $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app
@$(SRCDIR)/solenv/bin/macosx-codesign-app-bundle $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app
endif
endif
@$(call gb_Top_InstallFinished,Test Installation,$(TESTINSTALLDIR))
mac-app-store-package: test-install
ifneq ($(MACOSX_PACKAGE_SIGNING_IDENTITY),)
rm -rf "$(MACOSX_APP_NAME).app"
mv "$(TESTINSTALLDIR)/$(PRODUCTNAME).app" "$(MACOSX_APP_NAME).app"
productbuild --component "$(MACOSX_APP_NAME).app" /Applications --sign $(MACOSX_PACKAGE_SIGNING_IDENTITY) $(shell echo "$(MACOSX_APP_NAME)" | tr ' ' '-').pkg
rm -rf "$(PRODUCTNAME).app"
mv "$(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app" "$(PRODUCTNAME).app"
productbuild --component "$(PRODUCTNAME).app" /Applications --sign $(MACOSX_PACKAGE_SIGNING_IDENTITY) $(PRODUCTNAME_WITHOUT_SPACES).pkg
else
@echo You did not provide an installer signing identity with --enable-macosx-package-signing
@exit 1

View file

@ -369,7 +369,6 @@ export LIBXSLT_LIBS=$(gb_SPACE)@LIBXSLT_LIBS@
export LINK_X64_BINARY=@LINK_X64_BINARY@
@x_Cygwin@ export LS=@WIN_LS@
export MACOSX_BUNDLE_IDENTIFIER=@MACOSX_BUNDLE_IDENTIFIER@
export MACOSX_APP_NAME=@MACOSX_APP_NAME@
export MACOSX_CODESIGNING_IDENTITY=@MACOSX_CODESIGNING_IDENTITY@
export MACOSX_DEPLOYMENT_TARGET=@MACOSX_DEPLOYMENT_TARGET@
export MACOSX_PACKAGE_SIGNING_IDENTITY=@MACOSX_PACKAGE_SIGNING_IDENTITY@
@ -460,6 +459,7 @@ export POSTGRESQL_INC=@POSTGRESQL_INC@
export POSTGRESQL_LIB=@POSTGRESQL_LIB@
export PREFIXDIR=@PREFIXDIR@
export PRODUCTNAME=@PRODUCTNAME@
export PRODUCTNAME_WITHOUT_SPACES=@PRODUCTNAME_WITHOUT_SPACES@
export PRODUCTVERSION=@PRODUCTVERSION@
export PROGRESSBARCOLOR=@PROGRESSBARCOLOR@
export PROGRESSFRAMECOLOR=@PROGRESSFRAMECOLOR@

View file

@ -153,11 +153,16 @@ AC_CANONICAL_HOST
AC_MSG_CHECKING([for product name])
PRODUCTNAME="AC_PACKAGE_NAME"
if test -n "$with_product_name" -a "$with_product_name" != no; then
PRODUCTNAME="$with_product_name"
fi
if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
PRODUCTNAME="${PRODUCTNAME}Dev"
fi
AC_MSG_RESULT([$PRODUCTNAME])
AC_SUBST(PRODUCTNAME)
PRODUCTNAME_WITHOUT_SPACES=${PRODUCTNAME// /}
AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
dnl ===================================================================
dnl Our version is defined by the AC_INIT() at the top of this script.
@ -724,7 +729,7 @@ darwin*) # Mac OS X or iOS
mac_sanitize_path
AC_MSG_NOTICE([sanitized the PATH to $PATH])
fi
INSTROOTSUFFIX=/$PRODUCTNAME.app/Contents
INSTROOTSUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app/Contents
SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
fi
enable_systray=no
@ -1433,10 +1438,10 @@ AC_ARG_WITH(macosx-bundle-identifier,
org.libreoffice.script ("script", huh?).]),
,with_macosx_bundle_identifier=org.libreoffice.script)
AC_ARG_WITH(macosx-app-name,
AS_HELP_STRING([--with-macosx-app-name='My Own Office Suite'],
[Define the OS X app name. Default is AC_PACKAGE_NAME.]),
,with_macosx_app_name=$PRODUCTNAME)
AC_ARG_WITH(product-name,
AS_HELP_STRING([--with-product-name='My Own Office Suite'],
[Define the product name. Default is AC_PACKAGE_NAME.]),
,with_product_name=$PRODUCTNAME)
AC_ARG_ENABLE(ios-simulator,
AS_HELP_STRING([--enable-ios-simulator],
@ -3031,11 +3036,6 @@ if test $_os = Darwin; then
AC_MSG_CHECKING([what OS X app bundle identifier to use])
MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
AC_MSG_CHECKING([what OS X app name to use])
MACOSX_APP_NAME="$with_macosx_app_name"
AC_MSG_RESULT([$MACOSX_APP_NAME])
fi
AC_SUBST(MACOSX_SDK_PATH)
AC_SUBST(MACOSX_SDK_VERSION)
@ -3048,7 +3048,6 @@ AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
AC_SUBST(ENABLE_MACOSX_SANDBOX)
AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
AC_SUBST(MACOSX_APP_NAME)
dnl ===================================================================
dnl Check iOS SDK and compiler

View file

@ -44,7 +44,7 @@ LibreOffice
{
variables
{
PRODUCTNAME LibreOffice
PRODUCTNAME @PRODUCTNAME@
PRODUCTVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@
PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@
POSTVERSIONEXTENSION

View file

@ -21,7 +21,7 @@
#ifdef MACOSX
Directory gid_Dir_Bundle
ParentID = PD_PROGDIR;
HostName = "%PRODUCTNAME.app";
HostName = "%ONEWORDPRODUCTNAME.app";
End
Directory gid_Dir_Bundle_Contents

View file

@ -98,7 +98,7 @@ done
#
# At this stage we also attach the entitlements in the sandboxing case
id=`echo ${MACOSX_APP_NAME} | tr ' ' '-'`
id=`echo ${PRODUCTNAME} | tr ' ' '-'`
if test -n "$ENABLE_MACOSX_SANDBOX"; then
entitlements="--entitlements $BUILDDIR/lo.xcent"

View file

@ -89,14 +89,11 @@ if ($destdir && "$ENV{DESTDIR}" ne "/" && -d "$ENV{DESTDIR}") {
print "Running LibreOffice installer\n";
my $PRODUCTNAME_no_spaces = $ENV{PRODUCTNAME};
$PRODUCTNAME_no_spaces =~ s/ //g;
system ("cd $ENV{SRC_ROOT}/instsetoo_native/util ; " .
"perl " .
(scalar keys(%DB::sub) ? "-d " : "") .
"-w $ENV{SRCDIR}/solenv/bin/make_installer.pl " .
"-f $ENV{BUILDDIR}/instsetoo_native/util/openoffice.lst -l $langs -p $PRODUCTNAME_no_spaces " .
"-f $ENV{BUILDDIR}/instsetoo_native/util/openoffice.lst -l $langs -p LibreOffice " .
"-u $tmp_dir " .
"-buildid $BUILD $destdir $strip $msi " .
"-simple $path") && die "Failed to install: $!";

View file

@ -1828,7 +1828,7 @@
<key>CFBundleExecutable</key>
<string>soffice</string>
<key>CFBundleGetInfoString</key>
<string>@MACOSX_APP_NAME@ @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@.@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@</string>
<string>@PRODUCTNAME@ @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@.@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@</string>
<key>CFBundleIconFile</key>
<string>main.icns</string>
<key>CFBundleShortVersionString</key>
@ -1840,7 +1840,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>@MACOSX_APP_NAME@</string>
<string>@PRODUCTNAME@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>