From e3660b2fdf88f70a0c0f573523e7ef1c372e2c37 Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Thu, 19 May 2011 00:19:12 -0500
Subject: Ported viewerinfo.cpp from Kokua.
It defines the ViewerInfo module/namespace, which contains a variety
of functions for querying the viewer name and version. It is designed
to be a replacement for viewerversion.cpp and viewerversion.xml.
viewerversion.cpp has been removed, but viewerversion.xml remains
(albeit with a bogus version number) until the packaging system no
longer uses it.
---
linden/indra/llcommon/llversionviewer.h | 22 ++-
linden/indra/newview/CMakeLists.txt | 4 +-
.../indra/newview/app_settings/viewerversion.xml | 9 +-
linden/indra/newview/llappviewer.cpp | 55 ++++----
linden/indra/newview/llfloaterabout.cpp | 18 +--
linden/indra/newview/llfloaterreporter.cpp | 25 ++--
linden/indra/newview/llpanellogin.cpp | 40 +-----
linden/indra/newview/llstartup.cpp | 8 +-
linden/indra/newview/llviewermedia.cpp | 4 +-
linden/indra/newview/viewerinfo.cpp | 148 +++++++++++++++++++++
linden/indra/newview/viewerinfo.h | 93 +++++++++++++
linden/indra/newview/viewerversion.cpp | 89 -------------
linden/indra/newview/viewerversion.h | 79 -----------
13 files changed, 308 insertions(+), 286 deletions(-)
create mode 100644 linden/indra/newview/viewerinfo.cpp
create mode 100644 linden/indra/newview/viewerinfo.h
delete mode 100644 linden/indra/newview/viewerversion.cpp
delete mode 100644 linden/indra/newview/viewerversion.h
diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h
index ab74a3f..4162234 100644
--- a/linden/indra/llcommon/llversionviewer.h
+++ b/linden/indra/llcommon/llversionviewer.h
@@ -33,8 +33,6 @@
#ifndef LL_LLVERSIONVIEWER_H
#define LL_LLVERSIONVIEWER_H
-// Version info should be accessed using newview\viewerversion.h -- MC
-
const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 23;
const S32 LL_VERSION_PATCH = 5;
@@ -42,17 +40,13 @@ const S32 LL_VERSION_BUILD = 136262;
const char * const LL_VIEWER_NAME = "Second Life";
-// These aren't used anymore.
-// The channel is ViewerChannelName in settings.xml
-// The Imprudence version is set in app_settings\viewerversion.xml -- MC
-
-/*const char * const LL_CHANNEL = "Imprudence";
-
-const char * const IMP_VIEWER_NAME = "Imprudence";
-
-const S32 IMP_VERSION_MAJOR = 1;
-const S32 IMP_VERSION_MINOR = 3;
-const S32 IMP_VERSION_PATCH = 0;
-const char * const IMP_VERSION_TEST = "beta 4";*/
+// These aren't used anymore. See newview/viewerinfo.cpp instead.
+//
+// const char * const LL_CHANNEL = "Imprudence";
+// const char * const IMP_VIEWER_NAME = "Imprudence";
+// const S32 IMP_VERSION_MAJOR = 0;
+// const S32 IMP_VERSION_MINOR = 0;
+// const S32 IMP_VERSION_PATCH = 0;
+// const char * const IMP_VERSION_TEST = "";
#endif
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index df6d8b5..7ffb32b 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -500,8 +500,8 @@ set(viewer_SOURCE_FILES
rlvextensions.cpp
rlvfloaterbehaviour.cpp
slfloatermediafilter.cpp
+ viewerinfo.cpp
viewertime.cpp
- viewerversion.cpp
windlightsettingsupdate.cpp
wlfloatermanager.cpp
wlfloaterwindlightsend.cpp
@@ -973,8 +973,8 @@ set(viewer_HEADER_FILES
slfloatermediafilter.h
VertexCache.h
VorbisFramework.h
+ viewerinfo.h
viewertime.h
- viewerversion.h
wlfloatermanager.h
wlfloaterwindlightsend.h
wlretrievesettings.h
diff --git a/linden/indra/newview/app_settings/viewerversion.xml b/linden/indra/newview/app_settings/viewerversion.xml
index 33d810e..cadb946 100644
--- a/linden/indra/newview/app_settings/viewerversion.xml
+++ b/linden/indra/newview/app_settings/viewerversion.xml
@@ -1,5 +1,6 @@
-
+
-
+
-
+
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index aa3de97..aeb52a2 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -154,7 +154,7 @@
#include "llflexibleobject.h"
#include "llvosurfacepatch.h"
#include "llslider.h"
-#include "viewerversion.h"
+#include "viewerinfo.h"
// includes for idle() idleShutdown()
#include "floaterao.h"
@@ -597,7 +597,7 @@ bool LLAppViewer::init()
// Need to do this initialization before we do anything else, since anything
// that touches files should really go through the lldir API
- gDirUtilp->initAppDirs(ViewerVersion::getImpViewerName());
+ gDirUtilp->initAppDirs(ViewerInfo::viewerName());
// set skin search path to default, will be overridden later
// this allows simple skinned file lookups to work
gDirUtilp->setSkinFolder("default");
@@ -619,15 +619,8 @@ bool LLAppViewer::init()
writeSystemInfo();
- // Build a string representing the current version number.
- gCurrentVersion = llformat(
- "%s %d.%d.%d.%d",
- gSavedSettings.getString("VersionChannelName").c_str(),
- ViewerVersion::getImpMajorVersion(),
- ViewerVersion::getImpMinorVersion(),
- ViewerVersion::getImpPatchVersion(),
- 0 // our 'build number'
- );
+ // String representing the current version name/number.
+ gCurrentVersion = ViewerInfo::terseInfo();
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
@@ -1796,9 +1789,6 @@ std::string LLAppViewer::getSettingsFilename(const std::string& location_key,
bool LLAppViewer::initConfiguration()
{
- // init Imprudence version - MC
- ViewerVersion::initViewerVersion();
-
//Set up internal pointers
gSettings[sGlobalSettingsName] = &gSavedSettings;
gSettings[sPerAccountSettingsName] = &gSavedPerAccountSettings;
@@ -1846,7 +1836,7 @@ bool LLAppViewer::initConfiguration()
// gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global")));
gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_imprudence.xml"));
- gSavedSettings.setString("VersionChannelName", ViewerVersion::getImpViewerName());
+ gSavedSettings.setString("VersionChannelName", ViewerInfo::nameWithVariant());
//*FIX:Mani - Set default to disabling watchdog mainloop
// timeout for mac and linux. There is no call stack info
@@ -2092,7 +2082,7 @@ bool LLAppViewer::initConfiguration()
mYieldTime = gSavedSettings.getS32("YieldTime");
// XUI:translate
- gSecondLife = ViewerVersion::getImpViewerName();
+ gSecondLife = ViewerInfo::viewerName();
// Read skin/branding settings if specified.
//if (! gDirUtilp->getSkinDir().empty() )
@@ -2464,11 +2454,12 @@ void LLAppViewer::writeSystemInfo()
{
gDebugInfo["SLLog"] = LLError::logFileName();
- gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName");
- gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerVersion::getImpMajorVersion();
- gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerVersion::getImpMinorVersion();
- gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerVersion::getImpPatchVersion();
- gDebugInfo["ClientInfo"]["BuildVersion"] = 0;
+ gDebugInfo["ClientInfo"]["Name"] = ViewerInfo::viewerName();
+ gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerInfo::versionMajor();
+ gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerInfo::versionMinor();
+ gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerInfo::versionPatch();
+ gDebugInfo["ClientInfo"]["ReleaseVersion"] = ViewerInfo::versionRelease();
+ gDebugInfo["ClientInfo"]["ExtraVersion"] = ViewerInfo::versionExtra();
gDebugInfo["CAFilename"] = gDirUtilp->getCAFile();
@@ -2553,11 +2544,12 @@ void LLAppViewer::handleViewerCrash()
//We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version
//to check against no matter what
- gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName");
- gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerVersion::getImpMajorVersion();
- gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerVersion::getImpMinorVersion();
- gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerVersion::getImpPatchVersion();
- gDebugInfo["ClientInfo"]["BuildVersion"] = 0;
+ gDebugInfo["ClientInfo"]["Name"] = ViewerInfo::viewerName();
+ gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerInfo::versionMajor();
+ gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerInfo::versionMinor();
+ gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerInfo::versionPatch();
+ gDebugInfo["ClientInfo"]["ReleaseVersion"] = ViewerInfo::versionRelease();
+ gDebugInfo["ClientInfo"]["ExtraVersion"] = ViewerInfo::versionExtra();
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if ( parcel && parcel->getMusicURL()[0])
@@ -4333,11 +4325,12 @@ void LLAppViewer::handleLoginComplete()
initMainloopTimeout("Mainloop Init");
// Store some data to DebugInfo in case of a freeze.
- gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName");
- gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerVersion::getImpMajorVersion();
- gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerVersion::getImpMinorVersion();
- gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerVersion::getImpPatchVersion();
- gDebugInfo["ClientInfo"]["BuildVersion"] = 0;
+ gDebugInfo["ClientInfo"]["Name"] = ViewerInfo::viewerName();
+ gDebugInfo["ClientInfo"]["MajorVersion"] = ViewerInfo::versionMajor();
+ gDebugInfo["ClientInfo"]["MinorVersion"] = ViewerInfo::versionMinor();
+ gDebugInfo["ClientInfo"]["PatchVersion"] = ViewerInfo::versionPatch();
+ gDebugInfo["ClientInfo"]["ReleaseVersion"] = ViewerInfo::versionRelease();
+ gDebugInfo["ClientInfo"]["ExtraVersion"] = ViewerInfo::versionExtra();
gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile");
gDebugInfo["CAFilename"] = gDirUtilp->getCAFile();
diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp
index a5d2c98..8878de5 100644
--- a/linden/indra/newview/llfloaterabout.cpp
+++ b/linden/indra/newview/llfloaterabout.cpp
@@ -59,7 +59,7 @@
#include "llglheaders.h"
#include "llviewerwindow.h"
#include "llwindow.h"
-#include "viewerversion.h"
+#include "viewerinfo.h"
// [RLVa:KB]
#include "rlvhandler.h"
@@ -120,11 +120,7 @@ LLFloaterAbout::LLFloaterAbout()
viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
// Version string
- std::string version = llformat(
- "%s %d.%d.%d %s (%s %s)\n",
- ViewerVersion::getImpViewerName().c_str(),
- ViewerVersion::getImpMajorVersion(), ViewerVersion::getImpMinorVersion(), ViewerVersion::getImpPatchVersion(), ViewerVersion::getImpTestVersion().c_str(),
- __DATE__, __TIME__);
+ std::string version = llformat("%s (%s %s)\n", ViewerInfo::prettyInfo().c_str(), __DATE__, __TIME__);
support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);
@@ -318,13 +314,13 @@ void LLFloaterAbout::onClickCopy(void* user_data)
static std::string get_viewer_release_notes_url()
{
std::ostringstream version;
- version << ViewerVersion::getImpMajorVersion() << "."
- << ViewerVersion::getImpMinorVersion() << "."
- << ViewerVersion::getImpPatchVersion();
+ version << ViewerInfo::versionMajor() << "."
+ << ViewerInfo::versionMinor() << "."
+ << ViewerInfo::versionPatch();
// Append the test version if it's not empty
- if( !(ViewerVersion::getImpTestVersion().empty()) )
- version << "-" << ViewerVersion::getImpTestVersion();
+ if( !(ViewerInfo::versionExtra().empty()) )
+ version << "-" << ViewerInfo::versionExtra();
std::ostringstream url;
url << RELEASE_NOTES_BASE_URL << version.str();
diff --git a/linden/indra/newview/llfloaterreporter.cpp b/linden/indra/newview/llfloaterreporter.cpp
index 15f278d..16123ae 100644
--- a/linden/indra/newview/llfloaterreporter.cpp
+++ b/linden/indra/newview/llfloaterreporter.cpp
@@ -80,7 +80,7 @@
#include "llselectmgr.h"
#include "lluictrlfactory.h"
#include "llviewernetwork.h"
-#include "viewerversion.h"
+#include "viewerinfo.h"
#include "llassetuploadresponders.h"
@@ -742,13 +742,11 @@ LLSD LLFloaterReporter::gatherReport()
if ( mReportType == BUG_REPORT)
{
- summary << short_platform << " V" << ViewerVersion::getLLMajorVersion() << "."
- << ViewerVersion::getLLMinorVersion() << "."
- << ViewerVersion::getLLPatchVersion() << "."
- << ViewerVersion::getLLBuildVersion()
- << " (" << regionp->getName() << ")"
- << "[" << category_name << "] "
- << "\"" << childGetValue("summary_edit").asString() << "\"";
+ summary << short_platform << " "
+ << ViewerInfo::terseInfo()
+ << " (" << regionp->getName() << ")"
+ << "[" << category_name << "] "
+ << "\"" << childGetValue("summary_edit").asString() << "\"";
}
else
{
@@ -763,10 +761,7 @@ LLSD LLFloaterReporter::gatherReport()
std::ostringstream details;
if (mReportType != BUG_REPORT)
{
- details << "V" << ViewerVersion::getLLMajorVersion() << "." // client version moved to body of email for abuse reports
- << ViewerVersion::getLLMinorVersion() << "."
- << ViewerVersion::getLLPatchVersion() << "."
- << ViewerVersion::getLLBuildVersion() << std::endl << std::endl;
+ details << ViewerInfo::terseInfo() << std::endl << std::endl;
}
std::string object_name = childGetText("object_name");
std::string owner_name = childGetText("owner_name");
@@ -786,10 +781,8 @@ LLSD LLFloaterReporter::gatherReport()
std::string version_string;
version_string = llformat(
- "%d.%d.%d %s %s %s %s",
- ViewerVersion::getLLMajorVersion(),
- ViewerVersion::getLLMinorVersion(),
- ViewerVersion::getLLPatchVersion(),
+ "%s %s %s %s %s",
+ ViewerInfo::terseInfo().c_str(),
platform,
gSysCPU.getFamily().c_str(),
gGLManager.mGLRenderer.c_str(),
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index e83a466..824c5b0 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -73,7 +73,7 @@
#include "lluictrlfactory.h"
#include "llhttpclient.h"
#include "llweb.h"
-#include "viewerversion.h"
+#include "viewerinfo.h"
#include "llmediactrl.h"
#include "llfloatermediabrowser.h"
@@ -264,25 +264,10 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
// childSetAction("quit_btn", onClickQuit, this);
- std::string imp_channel = gSavedSettings.getString("VersionChannelName");
- std::string imp_version = llformat("%d.%d.%d %s",
- ViewerVersion::getImpMajorVersion(),
- ViewerVersion::getImpMinorVersion(),
- ViewerVersion::getImpPatchVersion(),
- ViewerVersion::getImpTestVersion().c_str() );
-
- std::string ll_channel = ViewerVersion::getLLViewerName();
- std::string ll_version = llformat("%d.%d.%d (%d)",
- ViewerVersion::getLLMajorVersion(),
- ViewerVersion::getLLMinorVersion(),
- ViewerVersion::getLLPatchVersion(),
- ViewerVersion::getLLBuildVersion() );
+ std::string imp_version = ViewerInfo::prettyInfo();
LLTextBox* channel_text = getChild("channel_text");
- channel_text->setTextArg("[CHANNEL]", imp_channel);
channel_text->setTextArg("[VERSION]", imp_version);
- channel_text->setTextArg("[ALT_CHANNEL]", ll_channel);
- channel_text->setTextArg("[ALT_VERSION]", ll_version);
channel_text->setClickedCallback(onClickVersion);
channel_text->setCallbackUserData(this);
@@ -916,12 +901,8 @@ void LLPanelLogin::loadLoginPage()
}
// Channel and Version
- std::string version = llformat("%d.%d.%d %s",
- ViewerVersion::getImpMajorVersion(), ViewerVersion::getImpMinorVersion(),
- ViewerVersion::getImpPatchVersion(), ViewerVersion::getImpTestVersion().c_str() );
-
- char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0);
- char* curl_version = curl_escape(version.c_str(), 0);
+ char* curl_channel = curl_escape(ViewerInfo::nameWithVariant().c_str(), 0);
+ char* curl_version = curl_escape(ViewerInfo::versionNumbers4().c_str(), 0);
oStr << "&channel=" << curl_channel;
oStr << "&version=" << curl_version;
@@ -1373,19 +1354,10 @@ bool LLPanelLogin::loadNewsBar()
full_url << "?";
}
- std::string channel = gSavedSettings.getString("VersionChannelName");
+ std::string channel = ViewerInfo::nameWithVariant();
+ std::string version = ViewerInfo::versionNumbers4();
std::string skin = gSavedSettings.getString("SkinCurrent");
- std::string version =
- llformat("%d.%d.%d",
- ViewerVersion::getImpMajorVersion(),
- ViewerVersion::getImpMinorVersion(),
- ViewerVersion::getImpPatchVersion());
- if (!ViewerVersion::getImpTestVersion().empty())
- {
- version += " " + ViewerVersion::getImpTestVersion();
- }
-
char* curl_channel = curl_escape(channel.c_str(), 0);
char* curl_version = curl_escape(version.c_str(), 0);
char* curl_skin = curl_escape(skin.c_str(), 0);
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index e29dc5a..b05e36d 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -190,7 +190,7 @@
#include "llwaterparammanager.h"
#include "llagentlanguage.h"
#include "llsocks5.h"
-#include "viewerversion.h"
+#include "viewerinfo.h"
#include "lgghunspell_wrapper.h"
#include "jcfloater_animation_list.h"
@@ -533,9 +533,9 @@ bool idle_startup()
if(!start_messaging_system(
message_template_path,
port,
- ViewerVersion::getLLMajorVersion(),
- ViewerVersion::getLLMinorVersion(),
- ViewerVersion::getLLPatchVersion(),
+ ViewerInfo::versionMajor(),
+ ViewerInfo::versionMinor(),
+ ViewerInfo::versionPatch(),
FALSE,
std::string(),
responder,
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp
index c228468..89d7b1f 100644
--- a/linden/indra/newview/llviewermedia.cpp
+++ b/linden/indra/newview/llviewermedia.cpp
@@ -40,7 +40,7 @@
#include "llviewerimage.h"
#include "llviewerwindow.h"
#include "llviewerimagelist.h"
-//#include "viewerversion.h"
+//#include "viewerinfo.h"
#include "llpluginclassmedia.h"
@@ -261,7 +261,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
std::ostringstream codec;
codec << "SecondLife/";
codec << "C64 Basic V2";
- //codec << ViewerVersion::getImpMajorVersion() << "." << ViewerVersion::getImpMinorVersion() << "." << ViewerVersion::getImpPatchVersion() << " " << ViewerVersion::getImpTestVersion();
+ //codec << " " << ViewerInfo::versionNumbers3();
//codec << " (" << channel << "; " << skin_name << " skin)";
// llinfos << codec.str() << llendl;
diff --git a/linden/indra/newview/viewerinfo.cpp b/linden/indra/newview/viewerinfo.cpp
new file mode 100644
index 0000000..3da924c
--- /dev/null
+++ b/linden/indra/newview/viewerinfo.cpp
@@ -0,0 +1,148 @@
+/**
+ * @file viewerinfo.cpp
+ * @brief Functions for querying the viewer name, version, and other info.
+ * @author Jacek Antonelli
+ *
+ * Copyright (c) 2010-2011, Jacek Antonelli
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "viewerinfo.h"
+
+namespace ViewerInfo
+{
+
+ // These are intentionally defined here instead of in the header,
+ // because they should NOT be read directly. Use the functions.
+ const std::string NAME = "Imprudence";
+ const std::string VARNT = "";
+ const S32 MAJOR = 1;
+ const S32 MINOR = 4;
+ const S32 PATCH = 1;
+ const S32 RLEAS = 1; // increment for each beta/RC/release
+ const std::string EXTRA = "beta 1";
+
+ // Mac OS X bundle identifier. Should match the one in Info.plist.
+ const std::string BUNDLE_ID = "org.imprudenceviewer.viewer";
+
+
+ const std::string& viewerName()
+ {
+ return NAME;
+ }
+
+ const std::string& viewerVariant()
+ {
+ return VARNT;
+ }
+
+ const std::string& nameWithVariant()
+ {
+ static std::string s;
+ if (!s.empty())
+ {
+ return s;
+ }
+
+ if (VARNT.empty())
+ {
+ s = NAME;
+ }
+ else
+ {
+ s = NAME + " " + VARNT;
+ }
+
+ return s;
+ }
+
+ S32 versionMajor()
+ {
+ return MAJOR;
+ }
+
+ S32 versionMinor()
+ {
+ return MINOR;
+ }
+
+ S32 versionPatch()
+ {
+ return PATCH;
+ }
+
+ S32 versionRelease()
+ {
+ return RLEAS;
+ }
+
+ const std::string& versionExtra()
+ {
+ return EXTRA;
+ }
+
+ const std::string& versionNumbers3()
+ {
+ static std::string s = llformat("%d.%d.%d", MAJOR, MINOR, PATCH);
+ return s;
+ }
+
+ const std::string& versionNumbers4()
+ {
+ static std::string s = llformat("%d.%d.%d.%d",
+ MAJOR, MINOR, PATCH, RLEAS);
+ return s;
+ }
+
+ const std::string& prettyVersion()
+ {
+ static std::string s;
+ if (s.length() > 0)
+ {
+ return s;
+ }
+
+ s = versionNumbers3();
+
+ if (EXTRA.length() > 0)
+ {
+ s += " " + EXTRA;
+ }
+
+ return s;
+ }
+
+ const std::string& prettyInfo()
+ {
+ static std::string s = nameWithVariant() + " " + prettyVersion();
+ return s;
+ }
+
+ const std::string& terseInfo()
+ {
+ static std::string s = nameWithVariant() + " " + versionNumbers4();
+ return s;
+ }
+
+ const std::string& bundleID()
+ {
+ return BUNDLE_ID;
+ }
+
+}
diff --git a/linden/indra/newview/viewerinfo.h b/linden/indra/newview/viewerinfo.h
new file mode 100644
index 0000000..fe2e829
--- /dev/null
+++ b/linden/indra/newview/viewerinfo.h
@@ -0,0 +1,93 @@
+/**
+ * @file viewerinfo.h
+ * @brief Functions for querying the viewer name, version, and other info.
+ * @author Jacek Antonelli
+ *
+ * Copyright (c) 2010-2011, Jacek Antonelli
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+#ifndef VERSIONINFO_H
+#define VERSIONINFO_H
+
+#include "linden_common.h"
+
+namespace ViewerInfo
+{
+ /// Returns the name of the viewer.
+ const std::string& viewerName();
+
+ /// Returns the viewer variant (e.g. "Experimental").
+ /// May be empty, if no variant string was set.
+ const std::string& viewerVariant();
+
+ /// Returns a string with the viewer name and variant
+ /// (if it has one).
+ const std::string& nameWithVariant();
+
+ /// Returns the major (first) version number.
+ /// This number increases for each major release, and the
+ /// minor, patch, and release numbers are reset to zero.
+ S32 versionMajor();
+
+ /// Returns the minor (second) version number.
+ /// This number increases for each minor release, and the
+ /// patch and release numbers are reset to zero.
+ S32 versionMinor();
+
+ /// Returns the patch (third) version number.
+ /// This number increases for each patch (bugfix) release,
+ /// and the release number is reset to zero.
+ S32 versionPatch();
+
+ /// Returns the release (fourth) version number.
+ /// This number increases for each beta, release candidate,
+ /// and final release.
+ S32 versionRelease();
+
+ /// Returns the extra version string (e.g. "beta 1", "RC1").
+ /// May be empty, if no extra string was set.
+ const std::string& versionExtra();
+
+ /// Returns a three-segment dot-separated version string
+ /// ("major.minor.patch"). Intended for human reading.
+ const std::string& versionNumbers3();
+
+ /// Returns a four-segment dot-separated version string
+ /// ("major.minor.patch.release"). Intended for computer use, e.g.
+ /// login channel or version number comparison.
+ const std::string& versionNumbers4();
+
+ /// Returns the three-segment version number with extra version
+ /// string (if not empty). Intended for human reading.
+ const std::string& prettyVersion();
+
+ /// Returns the viewer name, variant (if not empty), and pretty
+ /// version. Intended for human reading.
+ const std::string& prettyInfo();
+
+ /// Returns the the viewer name, variant (if not empty), and
+ /// 4-segment version. Intended for computer use, e.g. login channel
+ /// or version number comparison.
+ const std::string& terseInfo();
+
+ /// Returns a string with the viewer's Mac OS X bundle identifier.
+ const std::string& bundleID();
+
+}
+
+#endif // VERSIONINFO_H
diff --git a/linden/indra/newview/viewerversion.cpp b/linden/indra/newview/viewerversion.cpp
deleted file mode 100644
index 95c8f76..0000000
--- a/linden/indra/newview/viewerversion.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
-* @file viewerversion.cpp
-* @brief set the viewer version in xml
-*
-* $LicenseInfo:firstyear=2009&license=viewergpl$
-*
-* Copyright (c) 2010, McCabe Maxsted
-*
-* Imprudence Viewer Source Code
-* The source code in this file ("Source Code") is provided to you
-* under the terms of the GNU General Public License, version 2.0
-* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
-* this distribution, or online at
-* http://secondlifegrid.net/programs/open_source/licensing/gplv2
-*
-* There are special exceptions to the terms and conditions of the GPL as
-* it is applied to this Source Code. View the full text of the exception
-* in the file doc/FLOSS-exception.txt in this software distribution, or
-* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
-*
-* By copying, modifying or distributing this software, you acknowledge
-* that you have read and understood your obligations described above,
-* and agree to abide by those obligations.
-*
-* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
-* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
-* COMPLETENESS OR PERFORMANCE.
-* $/LicenseInfo$
-*/
-
-#include "llviewerprecompiledheaders.h"
-
-#include "lldir.h"
-#include "llxmltree.h"
-#include "viewerversion.h"
-
-
-S32 ViewerVersion::sVersionMajor = 0;
-S32 ViewerVersion::sVersionMinor = 0;
-S32 ViewerVersion::sVersionPatch = 0;
-std::string ViewerVersion::sVersionTest = "";
-
-const std::string ViewerVersion::sViewerName = "Imprudence";
-
-ViewerVersion::ViewerVersion()
-{
-}
-
-bool ViewerVersion::initViewerVersion()
-{
- std::string file_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "viewerversion.xml");
-
- if (!gDirUtilp->fileExists(file_path))
- {
- llwarns << "Unable to find viewerversion.xml in app_settings folder" << llendl;
- return false;
- }
- else
- {
- LLXMLNodePtr root;
-
- if (!LLXMLNode::parseFile(file_path, root, NULL))
- {
- llwarns << "Unable to parse version file: " << file_path << llendl;
- return false;
- }
-
- if (root.isNull()) // shouldn't ever happen
- {
- llwarns << "Error while trying to read viewerversion.xml" << llendl;
- return false;
- }
-
- LLXMLNodePtr child_nodep = root->getFirstChild();
- while (child_nodep.notNull())
- {
- child_nodep->getAttributeS32("version_major", sVersionMajor);
- child_nodep->getAttributeS32("version_minor", sVersionMinor);
- child_nodep->getAttributeS32("version_patch", sVersionPatch);
- child_nodep->getAttributeString("version_test", sVersionTest);
-
- child_nodep = child_nodep->getNextSibling();
- }
-
- llinfos << "Version set to: " << sVersionMajor << "." << sVersionMinor << "." << sVersionPatch << " " << sVersionTest << llendl;
-
- return true;
- }
-}
diff --git a/linden/indra/newview/viewerversion.h b/linden/indra/newview/viewerversion.h
deleted file mode 100644
index d67cee5..0000000
--- a/linden/indra/newview/viewerversion.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
-* @file viewerversion.h
-* @brief set the viewer version in xml
-*
-* $LicenseInfo:firstyear=2009&license=viewergpl$
-*
-* Copyright (c) 2010, McCabe Maxsted
-*
-* Imprudence Viewer Source Code
-* The source code in this file ("Source Code") is provided to you
-* under the terms of the GNU General Public License, version 2.0
-* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
-* this distribution, or online at
-* http://secondlifegrid.net/programs/open_source/licensing/gplv2
-*
-* There are special exceptions to the terms and conditions of the GPL as
-* it is applied to this Source Code. View the full text of the exception
-* in the file doc/FLOSS-exception.txt in this software distribution, or
-* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
-*
-* By copying, modifying or distributing this software, you acknowledge
-* that you have read and understood your obligations described above,
-* and agree to abide by those obligations.
-*
-* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
-* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
-* COMPLETENESS OR PERFORMANCE.
-* $/LicenseInfo$
-*/
-
-#ifndef VIEWERVERSION_H
-#define VIEWERVERSION_H
-
-#include "llversionviewer.h" // for LL versioning only
-
-class ViewerVersion
-{
-public:
- ViewerVersion();
- /*virtual*/ ~ViewerVersion();
-
- static bool initViewerVersion();
-
- // Returns the major version of Imprudence
- static S32 getImpMajorVersion() { return sVersionMajor; }
- // Returns the minor version of Imprudence
- static S32 getImpMinorVersion() { return sVersionMinor; }
- // Returns the patch version of Imprudence
- static S32 getImpPatchVersion() { return sVersionPatch; }
- // Returns the test version of Imprudence
- static std::string getImpTestVersion() { return sVersionTest; }
- // Returns the name of the viewer. Currently always "Imprudence"
- static std::string getImpViewerName() { return sViewerName; }
-
- // Returns the major version of Second Life
- static S32 getLLMajorVersion() { return LL_VERSION_MAJOR; }
- // Returns the minor version of Second Life
- static S32 getLLMinorVersion() { return LL_VERSION_MINOR; }
- // Returns the patch version of Second Life
- static S32 getLLPatchVersion() { return LL_VERSION_PATCH; }
- // Returns the build version of Second Life
- static S32 getLLBuildVersion() { return LL_VERSION_BUILD; }
- // Returns the name of the LL viewer ("Second Life")
- static std::string getLLViewerName() { return LL_VIEWER_NAME; }
-
- // Note that the viewer channel is set in settings.xml
- // as VersionChannelName. LL_VIEWER_CHANNEL is not
- // used in Imprudence
-
-private:
- static S32 sVersionMajor;
- static S32 sVersionMinor;
- static S32 sVersionPatch;
- static std::string sVersionTest;
-
- static const std::string sViewerName;
-};
-
-#endif // VIEWERVERSION_H
--
cgit v1.1
From 7a5a907f4918b20cf77d2a3ed33ef5e6d8c3844a Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Thu, 19 May 2011 00:40:19 -0500
Subject: Ported viewer_info.py and BuildVersion.cmake from Kokua.
viewer_info.py provides a way to easily query the viewer name and
version (from viewerinfo.cpp). It replaces build_version.py, which has
been removed. BuildVersion.cmake has been updated to use
viewer_info.py instead of build_version.py.
---
linden/indra/cmake/BuildVersion.cmake | 25 +++++++--
linden/scripts/build_version.py | 62 ---------------------
linden/scripts/viewer_info.py | 101 ++++++++++++++++++++++++++++++++++
3 files changed, 121 insertions(+), 67 deletions(-)
delete mode 100755 linden/scripts/build_version.py
create mode 100755 linden/scripts/viewer_info.py
diff --git a/linden/indra/cmake/BuildVersion.cmake b/linden/indra/cmake/BuildVersion.cmake
index 59b36ff..f86e9e5 100644
--- a/linden/indra/cmake/BuildVersion.cmake
+++ b/linden/indra/cmake/BuildVersion.cmake
@@ -2,17 +2,32 @@
include(Python)
+if (NOT SCRIPTS_DIR)
+ set( SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../scripts" )
+endif (NOT SCRIPTS_DIR)
+
macro (build_version _target)
execute_process(
- COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py
- viewerversion.xml ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/
+ COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/viewer_info.py --version
OUTPUT_VARIABLE ${_target}_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- if (${_target}_VERSION)
- message(STATUS "Version of ${_target} is ${${_target}_VERSION}")
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/viewer_info.py --name
+ OUTPUT_VARIABLE ${_target}_NAME
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/viewer_info.py --bundle-id
+ OUTPUT_VARIABLE ${_target}_BUNDLE_ID
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ if ("${_target}_VERSION" AND "${_target}_NAME")
+ message(STATUS "Version of ${_target} is ${${_target}_NAME} ${${_target}_VERSION}")
else (${_target}_VERSION)
message(SEND_ERROR "Could not determine ${_target} version")
- endif (${_target}_VERSION)
+ endif ("${_target}_VERSION" AND "${_target}_NAME")
endmacro (build_version)
diff --git a/linden/scripts/build_version.py b/linden/scripts/build_version.py
deleted file mode 100755
index f6b88a9..0000000
--- a/linden/scripts/build_version.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-#
-# Print the build information embedded in a header file.
-#
-# Expects to be invoked from the command line with a file name and a
-# list of directories to search. The file name will be one of the
-# following:
-#
-# llversionserver.h
-# llversionviewer.h
-#
-# The directory list that follows will include indra/llcommon, where
-# these files live.
-
-import errno, os, re
-
-def get_version(filename):
- fp = open(filename)
- data = fp.read()
- fp.close()
-
- vals = {}
- m = re.search('', data)
- vals['major'] = m.group(1)
- m = re.search('', data)
- vals['minor'] = m.group(1)
- m = re.search('', data)
- vals['patch'] = m.group(1)
- m = re.search('', data)
- vals['test'] = m.group(1)
-
- version = "%(major)s.%(minor)s.%(patch)s" % vals
-
- if len(vals['test']) > 0:
- # Replace some puncuation and spaces with '-' in the test version
- vals['test'] = re.sub('[ \t:;,+/\\"\'`]+', '-', vals['test'])
- version += "-%(test)s" % vals
-
- return version
-
-
-if __name__ == '__main__':
- import sys
-
- try:
- for path in sys.argv[2:]:
- name = os.path.join(path, sys.argv[1])
- try:
- print get_version(name)
- break
- except OSError, err:
- if err.errno != errno.ENOENT:
- raise
- else:
- print >> sys.stderr, 'File not found:', sys.argv[1]
- sys.exit(1)
- except AttributeError:
- print >> sys.stderr, 'Error: malformatted file: ', name
- sys.exit(1)
- except IndexError:
- print >> sys.stderr, ('Usage: %s llversion[...].h [directories]' %
- sys.argv[0])
diff --git a/linden/scripts/viewer_info.py b/linden/scripts/viewer_info.py
new file mode 100755
index 0000000..53ea432
--- /dev/null
+++ b/linden/scripts/viewer_info.py
@@ -0,0 +1,101 @@
+#!/usr/bin/env python
+#
+# @file viewer_info.py
+# @author Jacek Antonelli
+# @brief Scans and prints the viewer name and/or version.
+#
+# Copyright (c) 2010, Jacek Antonelli
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+#
+# Usage:
+#
+# viewer_info.py --name # viewer name (e.g. "Kokua")
+# viewer_info.py --version # viewer version (e.g. "1.0.0-RC1"
+# viewer_info.py --combined # name + version (e.g. "Kokua-1.0.0-RC1")
+#
+# You can pass multiple flags to print each thing on a separate line.
+# E.g. `viewer_info.py --name --version' will print 2 lines, e.g.:
+#
+# Kokua
+# 1.0.0-RC1
+#
+
+import errno, os, re, string, sys
+
+
+class ViewerInfo:
+
+ def __init__(self, filepath=None):
+ f = open(filepath or self.default_file())
+ data = f.read()
+ f.close()
+
+ self.name = re.search('NAME\s*=\s*"([^"]*)"', data).group(1)
+ self.major = re.search('MAJOR\s*=\s*(\d+)', data).group(1)
+ self.minor = re.search('MINOR\s*=\s*(\d+)', data).group(1)
+ self.patch = re.search('PATCH\s*=\s*(\d+)', data).group(1)
+ self.extra = re.search('EXTRA\s*=\s*"([^"]*)"', data).group(1)
+ self.bundle_id = re.search('BUNDLE_ID\s*=\s*"([^"]*)"', data).group(1)
+
+ self.version = "%s.%s.%s"%(self.major, self.minor, self.patch)
+ if len(self.extra) > 0:
+ # Replace spaces and some puncuation with '-' in extra
+ extra = re.sub('[- \t:;,!+/\\"\'`]+', '-', self.extra)
+ # Strip any leading or trailing "-"s
+ extra = string.strip(extra, '-')
+ self.version += "-" + extra
+
+ self.combined = self.name + "-" + self.version
+
+ @classmethod
+ def default_file(klass):
+ scripts_dir = sys.path[0] # directory containing this script
+ viewerinfo = os.path.join('indra', 'newview', 'viewerinfo.cpp')
+ filepath = os.path.join(scripts_dir, '..', viewerinfo)
+ return os.path.abspath(filepath)
+
+
+if __name__ == '__main__':
+
+ try:
+ info = ViewerInfo()
+ except IOError, err:
+ if err.errno == errno.ENOENT:
+ print >> sys.stderr, 'File not found:', ViewerInfo.default_file()
+ sys.exit(1)
+ else:
+ raise
+
+ args = sys.argv[1:]
+
+ if not args:
+ print "Usage: %s [--name] [--version] [--combined]"%(sys.argv[0])
+ for arg in args:
+ if '--name' == arg:
+ print info.name
+ elif '--version' == arg:
+ print info.version
+ elif '--combined' == arg:
+ print info.combined
+ elif '--bundle-id' == arg:
+ print info.bundle_id
--
cgit v1.1
From 13b3170509117b6e00e612137afab1ec7a543cd3 Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Fri, 20 May 2011 20:37:38 -0500
Subject: Ported Linux packaging system from Kokua.
Run "make package" in the build directory to create a tarball.
---
linden/indra/cmake/AddPackageTarget.cmake | 32 +++
linden/indra/newview/CMakeLists.txt | 73 ++++---
linden/scripts/package.py | 338 ++++++++++++++++++++++++++++++
3 files changed, 412 insertions(+), 31 deletions(-)
create mode 100644 linden/indra/cmake/AddPackageTarget.cmake
create mode 100755 linden/scripts/package.py
diff --git a/linden/indra/cmake/AddPackageTarget.cmake b/linden/indra/cmake/AddPackageTarget.cmake
new file mode 100644
index 0000000..66adf3e
--- /dev/null
+++ b/linden/indra/cmake/AddPackageTarget.cmake
@@ -0,0 +1,32 @@
+# This function adds a custom target named 'package', which runs
+# scripts/package.py to create an installer package.
+#
+# By default, you must manually build the 'package' target when you
+# are ready to create the installer package. But if the global
+# AUTOPACKAGE variable is ON ("cmake -D AUTOPACKAGE:BOOL=ON"), the
+# 'package' target will be added to the default build target.
+
+
+set(AUTOPACKAGE OFF CACHE BOOL
+ "Automatically build an installer package after compiling.")
+
+
+function( add_package_target )
+
+ if (AUTOPACKAGE)
+ add_custom_target(package ALL)
+ else (AUTOPACKAGE)
+ add_custom_target(package)
+ endif (AUTOPACKAGE)
+
+ add_custom_command(
+ TARGET package POST_BUILD
+ COMMAND
+ ${PYTHON_EXECUTABLE}
+ ${SCRIPTS_DIR}/package.py
+ --build-dir=${CMAKE_BINARY_DIR}
+ --build-type=${CMAKE_BUILD_TYPE}
+ --source-dir=${CMAKE_SOURCE_DIR}
+ )
+
+endfunction( add_package_target )
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 7ffb32b..7389075 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -3,6 +3,7 @@
project(viewer)
include(00-Common)
+include(AddPackageTarget)
include(Boost)
include(BuildVersion)
include(DBusGlib)
@@ -1290,6 +1291,10 @@ add_executable(${VIEWER_BINARY_NAME}
)
check_message_template(${VIEWER_BINARY_NAME})
+
+# NOTE: This variable is DEPRECATED, and should not be used anymore.
+# The package target should always be added. The variable AUTOPACKAGE
+# (in AddPackageTarget.cmake) controls whether package is auto-built.
set(PACKAGE OFF CACHE BOOL
"Add a package target that builds an installer package.")
@@ -1431,43 +1436,49 @@ set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH
if (LINUX)
- add_custom_command(
- OUTPUT imprudence-stripped
- COMMAND strip
- ARGS --strip-debug -o imprudence-stripped ${VIEWER_BINARY_NAME}
- DEPENDS imprudence-bin
- )
- set(product Imprudence-${ARCH}-${viewer_VERSION})
+ string(REPLACE "-bin" "-stripped"
+ VIEWER_STRIPPED_NAME ${VIEWER_BINARY_NAME})
+
+ add_dependencies(${VIEWER_BINARY_NAME}
+ SLPlugin
+ media_plugin_gstreamer010
+ media_plugin_webkit)
add_custom_command(
- OUTPUT ${product}.tar.bz2
- COMMAND ${PYTHON_EXECUTABLE}
- ARGS
- ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- --standalone=${STANDALONE}
- --buildtype=${CMAKE_BUILD_TYPE}
- --grid=${GRID}
- --channel=${VIEWER_CHANNEL}
- --login_channel=${VIEWER_LOGIN_CHANNEL}
- --installer_name=${product}
- --arch=${ARCH}
- --source=${CMAKE_CURRENT_SOURCE_DIR}
- --artwork=${ARTWORK_DIR}
- --build=${CMAKE_CURRENT_BINARY_DIR}
- --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged
- --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
- DEPENDS imprudence-stripped ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- )
-
- add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer010 media_plugin_webkit)
+ OUTPUT ${VIEWER_STRIPPED_NAME}
+ COMMAND strip
+ ARGS --strip-debug -o ${VIEWER_STRIPPED_NAME} ${VIEWER_BINARY_NAME}
+ DEPENDS ${VIEWER_BINARY_NAME}
+ )
+
+ add_custom_target(
+ viewer-manifest-target
+ COMMAND
+ ${PYTHON_EXECUTABLE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
+ --standalone=${STANDALONE}
+ --buildtype=${CMAKE_BUILD_TYPE}
+ --grid=${GRID}
+ --channel=${VIEWER_CHANNEL}
+ --login_channel=${VIEWER_LOGIN_CHANNEL}
+ --arch=${ARCH}
+ --source=${CMAKE_CURRENT_SOURCE_DIR}
+ --artwork=${ARTWORK_DIR}
+ --build=${CMAKE_CURRENT_BINARY_DIR}
+ --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged
+ DEPENDS
+ ${VIEWER_STRIPPED_NAME}
+ linux-crash-logger
+ ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
+ )
+
+ add_package_target()
+ add_dependencies(package viewer-manifest-target)
- if (NOT INSTALL)
- add_custom_target(package ALL DEPENDS ${product}.tar.bz2)
- add_dependencies(package linux-crash-logger-strip-target)
- endif (NOT INSTALL)
endif (LINUX)
+
if (DARWIN)
set(product "Imprudence")
set_target_properties(
diff --git a/linden/scripts/package.py b/linden/scripts/package.py
new file mode 100755
index 0000000..59aef79
--- /dev/null
+++ b/linden/scripts/package.py
@@ -0,0 +1,338 @@
+#!/usr/bin/env python
+#
+# @file package.py
+# @author Jacek Antonelli
+# @brief Script for generating viewer installer packages.
+#
+# Usage: package.py --build-dir=PATH [options]
+#
+# Copyright (c) 2007-2009, Linden Research, Inc.
+# Copyright (c) 2010-2011, Jacek Antonelli
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+
+import os, sys
+from viewer_info import ViewerInfo
+
+
+SCRIPTS_DIR = sys.path[0] # directory containing this script
+TOP_DIR = os.path.abspath(os.path.join(SCRIPTS_DIR,'..'))
+SOURCE_DIR = os.path.abspath(os.path.join(TOP_DIR,'indra'))
+BUILD_TYPE = "RelWithDebInfo"
+
+
+class PackagerError(Exception): pass
+
+class BadDir(PackagerError): pass
+
+class WeirdPlatform(PackagerError): pass
+
+class CmdFailed(PackagerError): pass
+
+
+def indent(text, amount=4):
+ import string
+ lines = [(' '*amount + line) for line in string.split(text, '\n')]
+ return string.join(lines, '\n')
+
+def message(*args):
+ """Prints an informational message with a leading '#'."""
+ print '# ' + ' '.join([str(arg) for arg in args])
+
+def error(*args):
+ """Prints an error message to stderr."""
+ print >> sys.stderr, 'Error: ' + ' '.join([str(arg) for arg in args])
+
+
+class Packager:
+
+ def __init__(self, build_dir, opts={}):
+ options = {'source_dir': SOURCE_DIR,
+ 'build_type': BUILD_TYPE,
+ 'verbose': False,
+ }
+ options.update(opts)
+
+ self.build_dir = os.path.abspath(build_dir)
+ self.__check_build_dir()
+
+ # Package results go in the top build directory.
+ self.dest_dir = build_dir
+
+ self.source_dir = os.path.abspath(options['source_dir'])
+ self.__check_source_dir()
+
+ self.build_type = options['build_type']
+ self.platform = self.__get_platform()
+ self.verbose = options['verbose']
+ self.viewer_info = ViewerInfo()
+
+
+ def make(self):
+ plat = self.platform
+ if plat == 'linux': self.make_linux()
+ elif plat == 'mac': self.make_mac()
+ elif plat == 'windows': self.make_windows()
+
+
+ #########
+ # LINUX #
+ #########
+
+ def make_linux(self):
+ import shutil
+
+ packaged_dir = os.path.join(self.build_dir, 'newview', 'packaged')
+
+ if not os.path.exists(packaged_dir):
+ raise BadDir("invalid build dir, has no 'newview/packaged/' "
+ 'subdirectory: %(d)r'%{'d': self.build_dir})
+
+ self.__run_command( 'Checking/fixing file permissions...',
+"""find %(d)r -type d | xargs --no-run-if-empty chmod 755;
+find %(d)r -type f -perm 0700 | xargs --no-run-if-empty chmod 0755;
+find %(d)r -type f -perm 0500 | xargs --no-run-if-empty chmod 0555;
+find %(d)r -type f -perm 0600 | xargs --no-run-if-empty chmod 0644;
+find %(d)r -type f -perm 0400 | xargs --no-run-if-empty chmod 0444;
+true""" % {'d': packaged_dir})
+
+ plat = 'Linux'
+ from platform import architecture
+ if architecture()[0] == '64bit':
+ plat += '-x86_64'
+ elif architecture()[0] == '32bit':
+ plat += '-x86'
+
+ inst_name = self.viewer_info.combined + '-' + plat
+ dest_file = os.path.join(self.dest_dir, inst_name + '.tar.bz2')
+
+ if (os.path.exists(dest_file)):
+ bkp = dest_file + ".bkp"
+ message("Renaming existing package to %r..." % bkp)
+ shutil.move(dest_file, bkp)
+
+ self.__run_command(
+ 'Creating package %r (this takes a while)...'%dest_file,
+ 'tar -C %(dir)s --numeric-owner '
+ '--transform "s,^./,%(inst_name)s/," '
+ #'--verbose --show-transformed-names '
+ '-cjf %(dest_file)s .' % { 'dir': packaged_dir,
+ 'inst_name': inst_name,
+ 'dest_file': dest_file})
+
+ message('Package complete: %r' % dest_file)
+
+
+ #######
+ # MAC #
+ #######
+
+ def make_mac(self):
+ import shutil
+
+ volname = self.viewer_info.name + " Installer"
+
+ # Where the DMG files (background image, etc.) come from.
+ dmg_src = os.path.join(self.source_dir, 'newview', 'packaging', 'mac')
+
+ # Everything that will be in the package is copied to here.
+ dmg_dst = os.path.join('/Volumes', volname)
+
+ if (os.path.exists(dmg_dst)):
+ error('%r is currently attached. Eject it and try again.' % dmg_dst)
+ sys.exit(1)
+
+ app_name = self.viewer_info.name + ".app"
+ app_orig = os.path.join(self.build_dir, 'newview', self.build_type, app_name)
+ app_dst = os.path.join(dmg_dst, app_name)
+
+ if (not os.path.exists(app_orig)):
+ error("App does not exist: %r" % app_orig)
+ sys.exit(1)
+
+ dmg_name = "%s-Mac"%(self.viewer_info.combined)
+ temp_dmg = os.path.join(self.build_dir, dmg_name+".sparseimage")
+ final_dmg = os.path.join(self.dest_dir, dmg_name+".dmg")
+
+ if (os.path.exists(temp_dmg)):
+ message("Removing stale temp disk image...")
+ os.remove(temp_dmg)
+
+ self.__run_command(
+ 'Creating temp disk image...',
+ 'hdiutil create %(temp)r -volname %(volname)r -fs HFS+ '
+ '-layout SPUD -type SPARSE' %
+ {'temp': temp_dmg, 'volname': volname, 'src': dmg_dst})
+
+ self.__run_command(
+ 'Mounting temp disk image...',
+ 'hdiutil attach %r -readwrite -noautoopen' % temp_dmg)
+
+ # Move the .app to the staging area (temporarily).
+ message("Copying %r (this takes a while)..."%(app_name))
+ shutil.copytree(app_orig, app_dst, symlinks=True)
+
+ message("Copying background.png...")
+ shutil.copy2( os.path.join(dmg_src, 'background.png'),
+ os.path.join(dmg_dst, 'background.png'))
+
+ config_script = os.path.join(self.source_dir, 'newview',
+ 'packaging', 'mac', 'ConfigureDMG.scpt')
+
+ self.__run_command(
+ "Configuring temp disk image's view options...",
+ 'osascript %(script)r %(volname)r %(app_name)r' %
+ {'script': config_script, 'volname': volname, 'app_name': app_name})
+
+ # self.__run_command(
+ # 'Hiding background.png...',
+ # 'SetFile -a V %r' % os.path.join(dmg_dst, 'background.png'))
+
+ self.__run_command(
+ 'Unmounting temp disk image...',
+ 'hdiutil detach %r' % dmg_dst)
+
+ if (os.path.exists(final_dmg)):
+ bkp = final_dmg + ".bkp"
+ message("Renaming existing final disk image to %r..." % bkp)
+ shutil.move(final_dmg, bkp)
+
+ self.__run_command(
+ 'Creating compressed final disk image (this takes a while)...',
+ 'hdiutil convert %(temp)r -format UDBZ -o %(final)r' %
+ {'temp':temp_dmg, 'final':final_dmg})
+
+ message("Removing temp disk image...")
+ os.remove(temp_dmg)
+
+ message('Package complete: %r'%final_dmg)
+
+
+ ###########
+ # WINDOWS #
+ ###########
+
+ def make_windows(self):
+ print "Packaging for Windows is not supported yet."
+
+
+ ###################
+ # PRIVATE METHODS #
+ ###################
+
+ def __check_build_dir(self):
+ if not os.path.exists(self.build_dir):
+ raise BadDir('build dir %(dir)r does not exist.' %
+ {'dir': self.build_dir})
+ if not os.path.isdir(self.build_dir):
+ raise BadDir('build dir %(dir)r is not a directory.' %
+ {'dir': self.build_dir})
+
+ def __check_source_dir(self):
+ if not os.path.exists(self.source_dir):
+ raise BadDir('source dir %(dir)r does not exist.' %
+ {'dir': self.source_dir})
+ if not os.path.isdir(self.source_dir):
+ raise BadDir('source dir %(dir)r is not a directory.' %
+ {'dir': self.source_dir})
+
+ def __get_platform(self):
+ platform = sys.platform
+ try:
+ return {'linux2':'linux',
+ 'linux1':'linux',
+ 'cygwin':'windows',
+ 'win32' :'windows',
+ 'darwin':'mac',
+ }[platform]
+ except KeyError:
+ raise WeirdPlatform(
+ "Unrecognized platform/operating system: %r" % platform)
+
+ def __run_command(self, summary=None, command=None):
+ if summary: message(summary)
+
+ if not command: return
+
+ import subprocess
+
+ out = subprocess.PIPE # = intercept command's output
+ if self.verbose:
+ print indent(command)
+ out = None # = don't intercept
+
+ child = subprocess.Popen(command, shell=True, stdout=out, stderr=None)
+ status = child.wait()
+
+ if status:
+ raise CmdFailed('A command returned non-zero status (%s):\n%s'%
+ (status, indent(command)))
+
+
+
+def main(args=sys.argv[1:]):
+ from optparse import OptionParser
+
+ op = OptionParser(usage='%prog --build-dir=PATH [options]')
+
+ op.add_option('--build-dir', dest='build_dir', nargs=1, metavar='PATH',
+ help='path to the \'build\' directory, which contains '
+ 'CMakeCache.txt and the compile result subdirectories')
+
+ op.add_option('--source-dir', dest='source_dir', nargs=1, metavar='PATH',
+ default=SOURCE_DIR,
+ help='optional path to an alternate source directory, '
+ 'i.e. \'indra\'. Default: %(SOURCE_DIR)r'
+ %{ 'SOURCE_DIR': SOURCE_DIR } )
+
+ op.add_option('--build-type', dest='build_type', nargs=1, metavar='TYPE',
+ default=BUILD_TYPE,
+ help='\'Debug\', \'RelWithDebInfo\', or \'Release\'. '
+ 'Default: %(BUILD_TYPE)r'
+ %{ 'BUILD_TYPE': BUILD_TYPE } )
+
+ op.add_option('-v', '--verbose', action='store_true', default=False,
+ help='print all shell commands as they are run')
+
+ if not args:
+ op.print_help()
+ return
+
+ options = op.parse_args(args)[0]
+
+ if not options.build_dir:
+ error('--build-dir=PATH is required.')
+ sys.exit(1)
+
+ opts_dict = {'source_dir': options.source_dir,
+ 'build_type': options.build_type,
+ 'verbose': options.verbose}
+
+ try:
+ Packager(options.build_dir, opts_dict).make()
+ except PackagerError, err:
+ error(err.args[0])
+ sys.exit(1)
+
+
+if __name__ == '__main__':
+ main()
--
cgit v1.1
From 19af86907c63308f325c283cd51d367060ee0641 Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Thu, 19 May 2011 09:48:15 -0500
Subject: Moved Mac packaging files to newview/packaging/mac.
---
linden/indra/newview/CMakeLists.txt | 14 +-
.../indra/newview/English.lproj/InfoPlist.strings | 5 -
linden/indra/newview/English.lproj/language.txt | 1 -
linden/indra/newview/German.lproj/language.txt | 1 -
linden/indra/newview/Info-Imprudence.plist | 39 ----
linden/indra/newview/Japanese.lproj/language.txt | 1 -
linden/indra/newview/Korean.lproj/language.txt | 1 -
linden/indra/newview/SecondLife.nib/classes.nib | 4 -
linden/indra/newview/SecondLife.nib/info.nib | 23 --
linden/indra/newview/SecondLife.nib/objects.xib | 259 ---------------------
linden/indra/newview/da.lproj/language.txt | 1 -
linden/indra/newview/es.lproj/language.txt | 1 -
linden/indra/newview/fr.lproj/language.txt | 1 -
linden/indra/newview/hu.lproj/language.txt | 1 -
linden/indra/newview/it.lproj/language.txt | 1 -
linden/indra/newview/nl.lproj/language.txt | 1 -
.../packaging/mac/English.lproj/InfoPlist.strings | 5 +
.../packaging/mac/English.lproj/language.txt | 1 +
.../packaging/mac/German.lproj/language.txt | 1 +
linden/indra/newview/packaging/mac/Info.plist.in | 39 ++++
.../packaging/mac/Japanese.lproj/language.txt | 1 +
.../packaging/mac/Korean.lproj/language.txt | 1 +
.../packaging/mac/SecondLife.nib/classes.nib | 4 +
.../newview/packaging/mac/SecondLife.nib/info.nib | 23 ++
.../packaging/mac/SecondLife.nib/objects.xib | 259 +++++++++++++++++++++
.../newview/packaging/mac/da.lproj/language.txt | 1 +
.../newview/packaging/mac/es.lproj/language.txt | 1 +
.../newview/packaging/mac/fr.lproj/language.txt | 1 +
.../newview/packaging/mac/hu.lproj/language.txt | 1 +
.../newview/packaging/mac/it.lproj/language.txt | 1 +
.../newview/packaging/mac/nl.lproj/language.txt | 1 +
.../newview/packaging/mac/pl.lproj/language.txt | 1 +
.../newview/packaging/mac/pt.lproj/language.txt | 1 +
.../newview/packaging/mac/ru.lproj/language.txt | 1 +
.../newview/packaging/mac/tr.lproj/language.txt | 1 +
.../newview/packaging/mac/uk.lproj/language.txt | 1 +
.../packaging/mac/zh-Hans.lproj/language.txt | 1 +
linden/indra/newview/pl.lproj/language.txt | 1 -
linden/indra/newview/pt.lproj/language.txt | 1 -
linden/indra/newview/ru.lproj/language.txt | 1 -
linden/indra/newview/tr.lproj/language.txt | 1 -
linden/indra/newview/uk.lproj/language.txt | 1 -
linden/indra/newview/zh-Hans.lproj/language.txt | 1 -
43 files changed, 353 insertions(+), 353 deletions(-)
delete mode 100644 linden/indra/newview/English.lproj/InfoPlist.strings
delete mode 100644 linden/indra/newview/English.lproj/language.txt
delete mode 100644 linden/indra/newview/German.lproj/language.txt
delete mode 100644 linden/indra/newview/Info-Imprudence.plist
delete mode 100644 linden/indra/newview/Japanese.lproj/language.txt
delete mode 100644 linden/indra/newview/Korean.lproj/language.txt
delete mode 100644 linden/indra/newview/SecondLife.nib/classes.nib
delete mode 100644 linden/indra/newview/SecondLife.nib/info.nib
delete mode 100644 linden/indra/newview/SecondLife.nib/objects.xib
delete mode 100644 linden/indra/newview/da.lproj/language.txt
delete mode 100644 linden/indra/newview/es.lproj/language.txt
delete mode 100644 linden/indra/newview/fr.lproj/language.txt
delete mode 100644 linden/indra/newview/hu.lproj/language.txt
delete mode 100644 linden/indra/newview/it.lproj/language.txt
delete mode 100644 linden/indra/newview/nl.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/English.lproj/InfoPlist.strings
create mode 100644 linden/indra/newview/packaging/mac/English.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/German.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/Info.plist.in
create mode 100644 linden/indra/newview/packaging/mac/Japanese.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/Korean.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/SecondLife.nib/classes.nib
create mode 100644 linden/indra/newview/packaging/mac/SecondLife.nib/info.nib
create mode 100644 linden/indra/newview/packaging/mac/SecondLife.nib/objects.xib
create mode 100644 linden/indra/newview/packaging/mac/da.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/es.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/fr.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/hu.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/it.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/nl.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/pl.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/pt.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/ru.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/tr.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/uk.lproj/language.txt
create mode 100644 linden/indra/newview/packaging/mac/zh-Hans.lproj/language.txt
delete mode 100644 linden/indra/newview/pl.lproj/language.txt
delete mode 100644 linden/indra/newview/pt.lproj/language.txt
delete mode 100644 linden/indra/newview/ru.lproj/language.txt
delete mode 100644 linden/indra/newview/tr.lproj/language.txt
delete mode 100644 linden/indra/newview/uk.lproj/language.txt
delete mode 100644 linden/indra/newview/zh-Hans.lproj/language.txt
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 7389075..313227c 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -1005,14 +1005,14 @@ if (DARWIN)
viewer.icns
macview.r
gpu_table.txt
- Info-Imprudence.plist
- Imprudence.nib/
+ packaging/mac/Info.plist.in
+ packaging/mac/SecondLife.nib/
# CMake doesn't seem to support Xcode language variants well just yet
- English.lproj/InfoPlist.strings
- English.lproj/language.txt
- German.lproj/language.txt
- Japanese.lproj/language.txt
- Korean.lproj/language.txt
+ packaging/mac/English.lproj/InfoPlist.strings
+ packaging/mac/English.lproj/language.txt
+ packaging/mac/German.lproj/language.txt
+ packaging/mac/Japanese.lproj/language.txt
+ packaging/mac/Korean.lproj/language.txt
)
set_source_files_properties(
${viewer_RESOURCE_FILES}
diff --git a/linden/indra/newview/English.lproj/InfoPlist.strings b/linden/indra/newview/English.lproj/InfoPlist.strings
deleted file mode 100644
index 1ebe727..0000000
--- a/linden/indra/newview/English.lproj/InfoPlist.strings
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Localized versions of Info.plist keys */
-
-CFBundleName = "Imprudence";
-CFBundleShortVersionString = "Imprudence 1.4.0 beta 1";
-CFBundleGetInfoString = "Imprudence 1.4.0 beta 1";
diff --git a/linden/indra/newview/English.lproj/language.txt b/linden/indra/newview/English.lproj/language.txt
deleted file mode 100644
index bc0aa57..0000000
--- a/linden/indra/newview/English.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-en-us
\ No newline at end of file
diff --git a/linden/indra/newview/German.lproj/language.txt b/linden/indra/newview/German.lproj/language.txt
deleted file mode 100644
index c42e816..0000000
--- a/linden/indra/newview/German.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-de
\ No newline at end of file
diff --git a/linden/indra/newview/Info-Imprudence.plist b/linden/indra/newview/Info-Imprudence.plist
deleted file mode 100644
index b3045c9..0000000
--- a/linden/indra/newview/Info-Imprudence.plist
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- English
- CFBundleExecutable
- Imprudence
- CFBundleIconFile
- viewer.icns
- CFBundleIdentifier
- org.imprudenceviewer.viewer
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- Imprudence
- CFBundlePackageType
- APPL
- CFBundleSignature
- ????
- CFBundleURLTypes
-
-
- CFBundleURLName
- Second Life URL
- CFBundleURLSchemes
-
- secondlife
-
- LSIsAppleDefaultForScheme
-
-
-
- CFBundleVersion
- 1.4.0 beta 1
- CSResourcesFileMapped
-
-
-
diff --git a/linden/indra/newview/Japanese.lproj/language.txt b/linden/indra/newview/Japanese.lproj/language.txt
deleted file mode 100644
index c6e3ab6..0000000
--- a/linden/indra/newview/Japanese.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-ja
\ No newline at end of file
diff --git a/linden/indra/newview/Korean.lproj/language.txt b/linden/indra/newview/Korean.lproj/language.txt
deleted file mode 100644
index b03ec72..0000000
--- a/linden/indra/newview/Korean.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-ko
\ No newline at end of file
diff --git a/linden/indra/newview/SecondLife.nib/classes.nib b/linden/indra/newview/SecondLife.nib/classes.nib
deleted file mode 100644
index ea58db1..0000000
--- a/linden/indra/newview/SecondLife.nib/classes.nib
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-IBClasses = ();
-IBVersion = 1;
-}
diff --git a/linden/indra/newview/SecondLife.nib/info.nib b/linden/indra/newview/SecondLife.nib/info.nib
deleted file mode 100644
index 1b531de..0000000
--- a/linden/indra/newview/SecondLife.nib/info.nib
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- IBDocumentLocation
- 85 13 356 240 0 0 1280 1002
- IBEditorPositions
-
- 29
- 27 314 247 44 0 0 1280 1002
-
- IBFramework Version
- 362.0
- IBOpenObjects
-
- 191
-
- IBSystem Version
- 7D24
- targetFramework
- IBCarbonFramework
-
-
diff --git a/linden/indra/newview/SecondLife.nib/objects.xib b/linden/indra/newview/SecondLife.nib/objects.xib
deleted file mode 100644
index 553b6f3..0000000
--- a/linden/indra/newview/SecondLife.nib/objects.xib
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
diff --git a/linden/indra/newview/da.lproj/language.txt b/linden/indra/newview/da.lproj/language.txt
deleted file mode 100644
index 316d25d..0000000
--- a/linden/indra/newview/da.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-da
\ No newline at end of file
diff --git a/linden/indra/newview/es.lproj/language.txt b/linden/indra/newview/es.lproj/language.txt
deleted file mode 100644
index 6c43814..0000000
--- a/linden/indra/newview/es.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-es
\ No newline at end of file
diff --git a/linden/indra/newview/fr.lproj/language.txt b/linden/indra/newview/fr.lproj/language.txt
deleted file mode 100644
index 717280a..0000000
--- a/linden/indra/newview/fr.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-fr
\ No newline at end of file
diff --git a/linden/indra/newview/hu.lproj/language.txt b/linden/indra/newview/hu.lproj/language.txt
deleted file mode 100644
index 6c604cf..0000000
--- a/linden/indra/newview/hu.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-hu
\ No newline at end of file
diff --git a/linden/indra/newview/it.lproj/language.txt b/linden/indra/newview/it.lproj/language.txt
deleted file mode 100644
index c919714..0000000
--- a/linden/indra/newview/it.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-it
\ No newline at end of file
diff --git a/linden/indra/newview/nl.lproj/language.txt b/linden/indra/newview/nl.lproj/language.txt
deleted file mode 100644
index d5f5c2a..0000000
--- a/linden/indra/newview/nl.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-nl
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/English.lproj/InfoPlist.strings b/linden/indra/newview/packaging/mac/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..1ebe727
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/English.lproj/InfoPlist.strings
@@ -0,0 +1,5 @@
+/* Localized versions of Info.plist keys */
+
+CFBundleName = "Imprudence";
+CFBundleShortVersionString = "Imprudence 1.4.0 beta 1";
+CFBundleGetInfoString = "Imprudence 1.4.0 beta 1";
diff --git a/linden/indra/newview/packaging/mac/English.lproj/language.txt b/linden/indra/newview/packaging/mac/English.lproj/language.txt
new file mode 100644
index 0000000..bc0aa57
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/English.lproj/language.txt
@@ -0,0 +1 @@
+en-us
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/German.lproj/language.txt b/linden/indra/newview/packaging/mac/German.lproj/language.txt
new file mode 100644
index 0000000..c42e816
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/German.lproj/language.txt
@@ -0,0 +1 @@
+de
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/Info.plist.in b/linden/indra/newview/packaging/mac/Info.plist.in
new file mode 100644
index 0000000..b3045c9
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/Info.plist.in
@@ -0,0 +1,39 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ Imprudence
+ CFBundleIconFile
+ viewer.icns
+ CFBundleIdentifier
+ org.imprudenceviewer.viewer
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ Imprudence
+ CFBundlePackageType
+ APPL
+ CFBundleSignature
+ ????
+ CFBundleURLTypes
+
+
+ CFBundleURLName
+ Second Life URL
+ CFBundleURLSchemes
+
+ secondlife
+
+ LSIsAppleDefaultForScheme
+
+
+
+ CFBundleVersion
+ 1.4.0 beta 1
+ CSResourcesFileMapped
+
+
+
diff --git a/linden/indra/newview/packaging/mac/Japanese.lproj/language.txt b/linden/indra/newview/packaging/mac/Japanese.lproj/language.txt
new file mode 100644
index 0000000..c6e3ab6
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/Japanese.lproj/language.txt
@@ -0,0 +1 @@
+ja
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/Korean.lproj/language.txt b/linden/indra/newview/packaging/mac/Korean.lproj/language.txt
new file mode 100644
index 0000000..b03ec72
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/Korean.lproj/language.txt
@@ -0,0 +1 @@
+ko
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/SecondLife.nib/classes.nib b/linden/indra/newview/packaging/mac/SecondLife.nib/classes.nib
new file mode 100644
index 0000000..ea58db1
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/SecondLife.nib/classes.nib
@@ -0,0 +1,4 @@
+{
+IBClasses = ();
+IBVersion = 1;
+}
diff --git a/linden/indra/newview/packaging/mac/SecondLife.nib/info.nib b/linden/indra/newview/packaging/mac/SecondLife.nib/info.nib
new file mode 100644
index 0000000..1b531de
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/SecondLife.nib/info.nib
@@ -0,0 +1,23 @@
+
+
+
+
+ IBDocumentLocation
+ 85 13 356 240 0 0 1280 1002
+ IBEditorPositions
+
+ 29
+ 27 314 247 44 0 0 1280 1002
+
+ IBFramework Version
+ 362.0
+ IBOpenObjects
+
+ 191
+
+ IBSystem Version
+ 7D24
+ targetFramework
+ IBCarbonFramework
+
+
diff --git a/linden/indra/newview/packaging/mac/SecondLife.nib/objects.xib b/linden/indra/newview/packaging/mac/SecondLife.nib/objects.xib
new file mode 100644
index 0000000..553b6f3
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/SecondLife.nib/objects.xib
@@ -0,0 +1,259 @@
+
+
+ IBCarbonFramework
+
+ NSApplication
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0 0 482 694
+ 0 0 694 482
+
+
+ 442 604 462 674
+ 604 442 70 20
+ OK
+ ok
+
+ 2
+ 2
+
+ 1
+
+
+ 20 20 422 674
+ 20 20 654 402
+
+
+ 20 20 422 659
+ 0 0 639 402
+ text
+ 5
+ TRUE
+
+
+ FALSE
+
+
+
+
+ 84 72 566 766
+ Release Notes
+
+ FALSE
+ FALSE
+ FALSE
+ FALSE
+ FALSE
+ FALSE
+ TRUE
+ TRUE
+ 4
+ 1
+ FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Files Owner
+
+ MenuBar
+
+ Release Notes
+
+
+ 202
+
diff --git a/linden/indra/newview/packaging/mac/da.lproj/language.txt b/linden/indra/newview/packaging/mac/da.lproj/language.txt
new file mode 100644
index 0000000..316d25d
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/da.lproj/language.txt
@@ -0,0 +1 @@
+da
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/es.lproj/language.txt b/linden/indra/newview/packaging/mac/es.lproj/language.txt
new file mode 100644
index 0000000..6c43814
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/es.lproj/language.txt
@@ -0,0 +1 @@
+es
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/fr.lproj/language.txt b/linden/indra/newview/packaging/mac/fr.lproj/language.txt
new file mode 100644
index 0000000..717280a
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/fr.lproj/language.txt
@@ -0,0 +1 @@
+fr
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/hu.lproj/language.txt b/linden/indra/newview/packaging/mac/hu.lproj/language.txt
new file mode 100644
index 0000000..6c604cf
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/hu.lproj/language.txt
@@ -0,0 +1 @@
+hu
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/it.lproj/language.txt b/linden/indra/newview/packaging/mac/it.lproj/language.txt
new file mode 100644
index 0000000..c919714
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/it.lproj/language.txt
@@ -0,0 +1 @@
+it
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/nl.lproj/language.txt b/linden/indra/newview/packaging/mac/nl.lproj/language.txt
new file mode 100644
index 0000000..d5f5c2a
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/nl.lproj/language.txt
@@ -0,0 +1 @@
+nl
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/pl.lproj/language.txt b/linden/indra/newview/packaging/mac/pl.lproj/language.txt
new file mode 100644
index 0000000..55239f3
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/pl.lproj/language.txt
@@ -0,0 +1 @@
+pl
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/pt.lproj/language.txt b/linden/indra/newview/packaging/mac/pt.lproj/language.txt
new file mode 100644
index 0000000..9e3340e
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/pt.lproj/language.txt
@@ -0,0 +1 @@
+pt
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/ru.lproj/language.txt b/linden/indra/newview/packaging/mac/ru.lproj/language.txt
new file mode 100644
index 0000000..adc719b
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/ru.lproj/language.txt
@@ -0,0 +1 @@
+ru
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/tr.lproj/language.txt b/linden/indra/newview/packaging/mac/tr.lproj/language.txt
new file mode 100644
index 0000000..44266bf
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/tr.lproj/language.txt
@@ -0,0 +1 @@
+tr
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/uk.lproj/language.txt b/linden/indra/newview/packaging/mac/uk.lproj/language.txt
new file mode 100644
index 0000000..fbc658f
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/uk.lproj/language.txt
@@ -0,0 +1 @@
+uk
\ No newline at end of file
diff --git a/linden/indra/newview/packaging/mac/zh-Hans.lproj/language.txt b/linden/indra/newview/packaging/mac/zh-Hans.lproj/language.txt
new file mode 100644
index 0000000..147d659
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/zh-Hans.lproj/language.txt
@@ -0,0 +1 @@
+zh
\ No newline at end of file
diff --git a/linden/indra/newview/pl.lproj/language.txt b/linden/indra/newview/pl.lproj/language.txt
deleted file mode 100644
index 55239f3..0000000
--- a/linden/indra/newview/pl.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-pl
\ No newline at end of file
diff --git a/linden/indra/newview/pt.lproj/language.txt b/linden/indra/newview/pt.lproj/language.txt
deleted file mode 100644
index 9e3340e..0000000
--- a/linden/indra/newview/pt.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-pt
\ No newline at end of file
diff --git a/linden/indra/newview/ru.lproj/language.txt b/linden/indra/newview/ru.lproj/language.txt
deleted file mode 100644
index adc719b..0000000
--- a/linden/indra/newview/ru.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-ru
\ No newline at end of file
diff --git a/linden/indra/newview/tr.lproj/language.txt b/linden/indra/newview/tr.lproj/language.txt
deleted file mode 100644
index 44266bf..0000000
--- a/linden/indra/newview/tr.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-tr
\ No newline at end of file
diff --git a/linden/indra/newview/uk.lproj/language.txt b/linden/indra/newview/uk.lproj/language.txt
deleted file mode 100644
index fbc658f..0000000
--- a/linden/indra/newview/uk.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-uk
\ No newline at end of file
diff --git a/linden/indra/newview/zh-Hans.lproj/language.txt b/linden/indra/newview/zh-Hans.lproj/language.txt
deleted file mode 100644
index 147d659..0000000
--- a/linden/indra/newview/zh-Hans.lproj/language.txt
+++ /dev/null
@@ -1 +0,0 @@
-zh
\ No newline at end of file
--
cgit v1.1
From 01f983f6788a2722a08897d7613c9caab3b933a1 Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Sat, 21 May 2011 01:45:29 -0500
Subject: Ported Mac packaging system from Kokua.
Build the "package" target in Xcode to create a DMG.
---
linden/indra/develop.py | 6 +-
linden/indra/newview/CMakeLists.txt | 89 ++++++-----------
.../indra/newview/packaging/mac/ConfigureDMG.scpt | 110 +++++++++++++++++++++
.../newview/packaging/mac/GenerateInfoPlist.cmake | 39 ++++++++
linden/indra/newview/packaging/mac/Info.plist.in | 30 +++---
linden/indra/newview/packaging/mac/background.png | Bin 0 -> 19029 bytes
linden/indra/newview/viewer_manifest.py | 41 ++++----
linden/scripts/package.py | 6 +-
8 files changed, 222 insertions(+), 99 deletions(-)
create mode 100644 linden/indra/newview/packaging/mac/ConfigureDMG.scpt
create mode 100644 linden/indra/newview/packaging/mac/GenerateInfoPlist.cmake
create mode 100644 linden/indra/newview/packaging/mac/background.png
diff --git a/linden/indra/develop.py b/linden/indra/develop.py
index e804374..094ce3b 100755
--- a/linden/indra/develop.py
+++ b/linden/indra/develop.py
@@ -121,7 +121,7 @@ class PlatformSetup(object):
opts=quote(opts),
standalone=self.standalone,
unattended=self.unattended,
- type=self.build_type.upper(),
+ type=self.build_type,
)
#if simple:
# return 'cmake %(opts)s %(dir)r' % args
@@ -287,7 +287,7 @@ class LinuxSetup(UnixSetup):
opts=quote(opts),
standalone=self.standalone,
unattended=self.unattended,
- type=self.build_type.upper(),
+ type=self.build_type,
project_name=self.project_name
)
if not self.is_internal_tree():
@@ -419,7 +419,7 @@ class DarwinSetup(UnixSetup):
unattended=self.unattended,
project_name=self.project_name,
universal=self.universal,
- type=self.build_type.upper()
+ type=self.build_type
)
if self.universal == 'ON':
args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386\''
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 313227c..65eacaa 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -1480,83 +1480,58 @@ endif (LINUX)
if (DARWIN)
- set(product "Imprudence")
+ set(product "${viewer_NAME}")
+
set_target_properties(
${VIEWER_BINARY_NAME}
PROPERTIES
OUTPUT_NAME "${product}"
- MACOSX_BUNDLE_INFO_STRING "info string - localize me"
- MACOSX_BUNDLE_ICON_FILE "viewer.icns"
- MACOSX_BUNDLE_GUI_IDENTIFIER "Imprudence"
- MACOSX_BUNDLE_LONG_VERSION_STRING "ververver"
- MACOSX_BUNDLE_BUNDLE_NAME "Imprudence"
- MACOSX_BUNDLE_SHORT_VERSION_STRING "asdf"
- MACOSX_BUNDLE_BUNDLE_VERSION "asdf"
- MACOSX_BUNDLE_COPYRIGHT "copyright linden lab 2007 - localize me and run me through a legal wringer"
)
+
+ # Generate Info.plist from the template.
+ add_custom_target(
+ GenerateInfoPlist
+ ALL
+ COMMENT "Generating Info.plist..."
+ VERBATIM
+ DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/packaging/mac/GenerateInfoPlist.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/packaging/mac/Info.plist.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/viewerinfo.cpp
+ COMMAND
+ ${CMAKE_COMMAND}
+ -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
+ -DBINARY_DIR=${CMAKE_BINARY_DIR}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/packaging/mac/GenerateInfoPlist.cmake
+ )
+
+ # Ensure that it's generated before the binary is built, so
+ # that it will definitely be ready when viewer_manifest.py runs.
+ add_dependencies(${VIEWER_BINARY_NAME} GenerateInfoPlist)
+
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${PYTHON_EXECUTABLE}
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- --grid=${GRID}
--actions=copy
- --configuration=${CMAKE_CFG_INTDIR}
- --source=${CMAKE_CURRENT_SOURCE_DIR}
--artwork=${ARTWORK_DIR}
--build=${CMAKE_CURRENT_BINARY_DIR}
+ --buildtype=${CMAKE_BUILD_TYPE}
+ --configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
+ --grid=${GRID}
+ --source=${CMAKE_CURRENT_SOURCE_DIR}
+ --standalone=${STANDALONE}
DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
)
-
- add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_gstreamer010)
-
- if (PACKAGE)
- add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME})
- add_dependencies(package mac-updater mac-crash-logger)
-
- add_custom_command(
- TARGET package POST_BUILD
- COMMAND ${PYTHON_EXECUTABLE}
- ARGS
- ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- --standalone=${STANDALONE}
- --buildtype=${CMAKE_BUILD_TYPE}
- --grid=${GRID}
- --configuration=${CMAKE_CFG_INTDIR}
- --channel=${VIEWER_CHANNEL}
- --login_channel=${VIEWER_LOGIN_CHANNEL}
- --source=${CMAKE_CURRENT_SOURCE_DIR}
- --artwork=${ARTWORK_DIR}
- --build=${CMAKE_CURRENT_BINARY_DIR}
- --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
- --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
- DEPENDS
- ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- )
+ add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_gstreamer010 mac-updater mac-crash-logger)
- add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_gstreamer010)
- add_custom_command(
- TARGET package POST_BUILD
- COMMAND ${PYTHON_EXECUTABLE}
- ARGS
- ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- --grid=${GRID}
- --configuration=${CMAKE_CFG_INTDIR}
- --channel=${VIEWER_CHANNEL}
- --login_channel=${VIEWER_LOGIN_CHANNEL}
- --source=${CMAKE_CURRENT_SOURCE_DIR}
- --artwork=${ARTWORK_DIR}
- --build=${CMAKE_CURRENT_BINARY_DIR}
- --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
- --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
- DEPENDS
- ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- )
+ add_package_target()
+ add_dependencies(package ${VIEWER_BINARY_NAME})
- endif (PACKAGE)
endif (DARWIN)
if (INSTALL)
diff --git a/linden/indra/newview/packaging/mac/ConfigureDMG.scpt b/linden/indra/newview/packaging/mac/ConfigureDMG.scpt
new file mode 100644
index 0000000..198ab9e
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/ConfigureDMG.scpt
@@ -0,0 +1,110 @@
+(*
+
+@file ConfigureDMG.scpt
+@author Jacek Antonelli
+@brief Script for configuring the Mac installer disk image.
+
+Copyright (c) 2011, Jacek Antonelli
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+-----
+
+This AppleScript script configures the view options and icon layout of
+the Mac installer disk image (DMG) as part of the packaging process.
+See also scripts/package.py, which executes this script.
+
+This script takes two required positional command line arguments:
+
+ 1: the name of the mounted volume (e.g. for "/Volumes/Imprudence Installer",
+ the volume name is "Imprudence Installer").
+ 2: the name of the application file (e.g. "Imprudence.app").
+
+Example usage:
+
+ osascript ConfigureDMG.scpt "Imprudence Installer" "Imprudence.app"
+
+Some preparation is necessary before running this script:
+
+ * The target disk image must be currently attached as a volume, with
+ the volume name specified by the first command line argument.
+ * The volume must contain the application file, with the file
+ name specified by the second command line argument.
+ * The volume must contain the "background.png" image file.
+ * The volume must not contain a file or folder named "Applications".
+ * It might be necessary to "Enable access for assistive devices"
+ in System Preferences > Universal Access.
+
+*)
+
+on run argv
+
+ -- Read the first positional argument, the volume name.
+ set volumeName to item 1 of argv
+
+ -- Read the second positional argument, the app name.
+ set appName to item 2 of argv
+
+ tell application "Finder" to tell disk volumeName
+ -- Open the volume in a Finder window.
+ open
+ set theWindow to the container window
+
+ -- Tweak some options.
+ set current view of theWindow to icon view
+ set toolbar visible of theWindow to false
+ set statusbar visible of theWindow to false
+
+ -- Set window to position {150,150}, size {+600,+420}.
+ set bounds of theWindow to {150, 150, 750, 570}
+
+ -- Tweak some more options.
+ set viewOptions to the icon view options of theWindow
+ set arrangement of viewOptions to not arranged
+ set icon size of viewOptions to 128
+
+ -- Make sure background.png is visible, so Finder can see it.
+ set bgPicPath to the quoted form of (the POSIX path of (it as alias) & "background.png")
+ do shell script ("SetFile -a v " & bgPicPath)
+ update without registering applications
+
+ -- Use background.png as the background picture.
+ set background picture of viewOptions to file "background.png"
+
+ -- Now set background.png to invisible, so the end user won't see it.
+ do shell script ("SetFile -a V " & bgPicPath)
+
+ -- Position the application file.
+ set position of item appName of theWindow to {138, 260}
+
+ -- Create and position an alias to the Applications folder.
+ set appAlias to make new alias file at theWindow to POSIX file "/Applications"
+ set name of appAlias to "Applications"
+ set position of appAlias to {470, 260}
+
+ -- Visually update the window so all the changes take effect.
+ update without registering applications
+
+ -- Pause briefly so we can admire the results.
+ delay 2
+ end tell
+
+end run
diff --git a/linden/indra/newview/packaging/mac/GenerateInfoPlist.cmake b/linden/indra/newview/packaging/mac/GenerateInfoPlist.cmake
new file mode 100644
index 0000000..ecbec34
--- /dev/null
+++ b/linden/indra/newview/packaging/mac/GenerateInfoPlist.cmake
@@ -0,0 +1,39 @@
+#
+# Generate the Info.plist file from the template.
+# Only @-style "@VARIABLES@" are substituted in the template (not "${VARIABLES}").
+#
+# This script is needed because CMake has no other way to perform
+# configure_file() as a build-time custom command. :(
+#
+# When running this script, you must define (-D) SOURCE_DIR and
+# BINARY_DIR to refer to indra and the build directory respectively.
+# (Equivalent to CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR in
+# CMakeLists.txt )
+#
+
+if (NOT SOURCE_DIR)
+ message( FATAL_ERROR "You forgot to define SOURCE_DIR!" )
+endif (NOT SOURCE_DIR)
+
+if (NOT BINARY_DIR)
+ message( FATAL_ERROR "You forgot to define BINARY_DIR!" )
+endif (NOT BINARY_DIR)
+
+set(SCRIPTS_DIR "${SOURCE_DIR}/../scripts")
+set(CMAKE_MODULE_PATH "${SOURCE_DIR}/cmake/" "${CMAKE_ROOT/Modules}")
+
+include(BuildVersion)
+build_version(viewer)
+
+SET( BUNDLE_NAME "${viewer_NAME}" )
+SET( EXECUTABLE "${viewer_NAME}" )
+set( BUNDLE_VERSION "${viewer_VERSION}" )
+set( SHORT_VERSION_STRING "${viewer_NAME} ${viewer_VERSION}" )
+set( ICON_FILE "viewer.icns" )
+set( IDENTIFIER "${viewer_BUNDLE_ID}" )
+set( SIGNATURE "impr" )
+
+configure_file(
+ ${SOURCE_DIR}/newview/packaging/mac/Info.plist.in
+ ${BINARY_DIR}/newview/packaging/mac/Info.plist
+ @ONLY)
diff --git a/linden/indra/newview/packaging/mac/Info.plist.in b/linden/indra/newview/packaging/mac/Info.plist.in
index b3045c9..78cc6b7 100644
--- a/linden/indra/newview/packaging/mac/Info.plist.in
+++ b/linden/indra/newview/packaging/mac/Info.plist.in
@@ -2,22 +2,20 @@
- CFBundleDevelopmentRegion
- English
+ CFBundleName
+ @BUNDLE_NAME@
CFBundleExecutable
- Imprudence
+ @EXECUTABLE@
+ CFBundleVersion
+ @BUNDLE_VERSION@
+ CFBundleShortVersionString
+ @SHORT_VERSION_STRING@
CFBundleIconFile
- viewer.icns
+ @ICON_FILE@
CFBundleIdentifier
- org.imprudenceviewer.viewer
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- Imprudence
- CFBundlePackageType
- APPL
+ @IDENTIFIER@
CFBundleSignature
- ????
+ @SIGNATURE@
CFBundleURLTypes
@@ -31,8 +29,12 @@
- CFBundleVersion
- 1.4.0 beta 1
+ CFBundleDevelopmentRegion
+ English
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundlePackageType
+ APPL
CSResourcesFileMapped
diff --git a/linden/indra/newview/packaging/mac/background.png b/linden/indra/newview/packaging/mac/background.png
new file mode 100644
index 0000000..9b0b0b2
Binary files /dev/null and b/linden/indra/newview/packaging/mac/background.png differ
diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py
index 0f129dd..5e1e816 100755
--- a/linden/indra/newview/viewer_manifest.py
+++ b/linden/indra/newview/viewer_manifest.py
@@ -585,7 +585,8 @@ class DarwinManifest(ViewerManifest):
if self.prefix(src="", dst="Contents"): # everything goes in Contents
- self.path("Info-Imprudence.plist", dst="Info.plist")
+ # Info.plist goes directly in Contents
+ self.path("packaging/mac/Info.plist", dst="Info.plist")
# copy additional libs in /Contents/MacOS/
if (not self.standalone()) and self.prefix(src="../../libraries/universal-darwin/lib_release", dst="MacOS/"):
@@ -653,27 +654,27 @@ class DarwinManifest(ViewerManifest):
self.gather_documents()
self.path("featuretable_mac.txt")
- self.path("SecondLife.nib")
-
self.path("viewer.icns")
- # Translations
- self.path("English.lproj")
- self.path("German.lproj")
- self.path("Japanese.lproj")
- self.path("Korean.lproj")
- self.path("da.lproj")
- self.path("es.lproj")
- self.path("fr.lproj")
- self.path("hu.lproj")
- self.path("it.lproj")
- self.path("nl.lproj")
- self.path("pl.lproj")
- self.path("pt.lproj")
- self.path("ru.lproj")
- self.path("tr.lproj")
- self.path("uk.lproj")
- self.path("zh-Hans.lproj")
+ if self.prefix(src="packaging/mac", dst=""):
+ self.path("SecondLife.nib")
+ self.path("English.lproj")
+ self.path("German.lproj")
+ self.path("Japanese.lproj")
+ self.path("Korean.lproj")
+ self.path("da.lproj")
+ self.path("es.lproj")
+ self.path("fr.lproj")
+ self.path("hu.lproj")
+ self.path("it.lproj")
+ self.path("nl.lproj")
+ self.path("pl.lproj")
+ self.path("pt.lproj")
+ self.path("ru.lproj")
+ self.path("tr.lproj")
+ self.path("uk.lproj")
+ self.path("zh-Hans.lproj")
+ self.end_prefix("packaging/mac")
# if (not self.standalone()) and self.prefix(src="../../libraries/universal-darwin/lib_release/gstreamer-plugins", dst="lib/gstreamer-plugins"):
diff --git a/linden/scripts/package.py b/linden/scripts/package.py
index 59aef79..e02a9cc 100755
--- a/linden/scripts/package.py
+++ b/linden/scripts/package.py
@@ -196,17 +196,13 @@ true""" % {'d': packaged_dir})
os.path.join(dmg_dst, 'background.png'))
config_script = os.path.join(self.source_dir, 'newview',
- 'packaging', 'mac', 'ConfigureDMG.scpt')
+ 'packaging', 'mac', 'ConfigureDMG.scpt')
self.__run_command(
"Configuring temp disk image's view options...",
'osascript %(script)r %(volname)r %(app_name)r' %
{'script': config_script, 'volname': volname, 'app_name': app_name})
- # self.__run_command(
- # 'Hiding background.png...',
- # 'SetFile -a V %r' % os.path.join(dmg_dst, 'background.png'))
-
self.__run_command(
'Unmounting temp disk image...',
'hdiutil detach %r' % dmg_dst)
--
cgit v1.1
From fc2a53043a9b2fd59b71ab1f8c40a18421771eb7 Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Sat, 21 May 2011 01:59:26 -0500
Subject: Coax Xcode into selecting the right build type by default.
This is accomplished by dynamically reordering the CMake variable
CMAKE_CONFIGURATION_TYPES so that the current build type (the value
of CMAKE_BUILD_TYPE) is listed first.
---
linden/indra/cmake/00-Common.cmake | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/linden/indra/cmake/00-Common.cmake b/linden/indra/cmake/00-Common.cmake
index 7e85ce0..1a24a41 100644
--- a/linden/indra/cmake/00-Common.cmake
+++ b/linden/indra/cmake/00-Common.cmake
@@ -14,10 +14,13 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
-# Don't bother with a MinSizeRel build.
+# Available build types / configurations.
+# Add our current build type first, to coax Xcode into selecting it by default.
-set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
- "Supported build types." FORCE)
+set(TYPES ${CMAKE_BUILD_TYPE} RelWithDebInfo Release Debug)
+list(REMOVE_DUPLICATES TYPES)
+set(CMAKE_CONFIGURATION_TYPES ${TYPES} CACHE STRING "Supported build types." FORCE)
+unset(TYPES)
# Determine the number of bits of this processor
--
cgit v1.1
From 4e611f98515c2d2009122a227122bc7c73c1f12f Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Wed, 25 May 2011 23:39:14 -0500
Subject: Removed viewerversion.xml, since it's not used anymore.
---
linden/indra/newview/CMakeLists.txt | 1 -
.../indra/newview/app_settings/viewerversion.xml | 26 ----------------------
2 files changed, 27 deletions(-)
delete mode 100644 linden/indra/newview/app_settings/viewerversion.xml
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 65eacaa..72b2d02 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -1213,7 +1213,6 @@ set(viewer_APPSETTINGS_FILES
app_settings/trees.xml
app_settings/ultra_graphics.xml
app_settings/viewerart.xml
- app_settings/viewerversion.xml
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
)
diff --git a/linden/indra/newview/app_settings/viewerversion.xml b/linden/indra/newview/app_settings/viewerversion.xml
deleted file mode 100644
index cadb946..0000000
--- a/linden/indra/newview/app_settings/viewerversion.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--
cgit v1.1