Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:building_the_standalone_client [2010/12/28 22:42] – add anchor for smoketest tomrochewikidev:building_the_standalone_client [2017/11/12 19:53] (current) – external edit 127.0.0.1
Line 1: Line 1:
-<html> +<html><id="zotero-5-update-warning" style="color: red; font-weight: bold">We’re 
-<p> +in the process of updating the documentation for 
-  <em> +<a href="https://www.zotero.org/blog/zotero-5-0">Zotero 5.0</a>. Some documentation 
-    (apologies for docuwiki's odd rendering of HTML lists) +may be outdated in the meantime. Thanks for your understanding.</p></html>
-  </em+
-</p>+
  
-<p>After initial inquiry <a href="http://forums.zotero.org/discussion/15700/how-to-migrate-from-firefox/">here</a>, and some trial-and-error, I was able to build the standalone client (aka sa, Zotero Everywhere) from source using a bash scriptlet (<a href="#bash_scriptlet">below</a>). The main things I needed to learn were:</p> 
  
-<ol> +See [[dev/client coding/Building the Standalone Client]].
-  <li>Location of source: shown <a href="http://www.zotero.org/support/dev/svn_and_trac_access">here</a> to be <a href="https://www.zotero.org/svn/standalone/trunk/">https://www.zotero.org/svn/standalone/trunk/</a>.</li> +
- +
-  <li>Location of build script: <code>build_sa</code> is a bash script included with the source, in the root directory.</li> +
- +
-  <li>Build prerequisites: +
- +
-    <ol> +
-      <li>Tools: Required tools appear to be only <code>{bash, perl, subversion}</code>. Given the source location, <em>svn</em> is obvious; fortunately it is provided by ubuntu package(s) by default (IIRC). The build script itself is <em>bash</em>, definitely default ubuntu. The only tool called by the build script that might not (ICBW) be included with a *x-ish environment is <em>perl</em>, but it's easily acquired (even for cygwin).</li> +
- +
-      <li>Non-source inputs: Only required input appears to be <code>xulrunner</code>, with constraints: +
- +
-      <ol> +
-        <li>Version: <code>build_sa</code> states clearly that <code># Requires XULRunner runtime 2.0.*</code>. This was a problem: +
- +
-        <ol> +
-          <li>Ubuntu does not package a 2.x xulrunner before <a href="https://wiki.ubuntu.com/NattyNarwhal">Natty</a>, which is currently pre-release.</li> +
- +
-          <li>The xulrunner-2.x runtimes are also currently pre-release, and Mozilla does not (IMHO) make those builds easy to find.</li> +
- </ol> +
- +
- Fortunately one can get prerelease xulrunners from <a href="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/">http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/</a>: see scriptlet <a href="#bash_scriptlet">below</a>.</li> +
- +
-        <li>Location: <code>build_sa</code> states implicitly that it requires separate runtimes for each target architecture, and expects to find each such runtime in a directory with a conventional name (see scriptlet <a href="#bash_scriptlet">below</a>).</li> +
- +
-      </ol> +
-      </li> +
-    </ol> +
-  </li> +
- +
-  <li>Build control: nothing to do but edit the bash script <code>build_sa</code>. It has no config file, takes no arguments, and is non-interactive. <code>build_sa</code> will build one or more of the target OSs <code>{linux, mac, win32}</code>, but it decides which architectures are built for each.</li> +
- +
-  <li>Running the built sa (as opposed to running the build): after building, and some perusal of (e.g.) the output of <code>ls -alt ${BUILD_PATH} $(find -executable -type f) | grep -ve '.so$'</code>, I found <code>${BUILD_PATH}/Zotero_${BUILD_ARCH}/zotero</code>.</li> +
-</ol> +
- +
-<p>I automated a build on 64-bit linux with the following bash scriptlet. (On my humble laptop, on wireless, wall-clock &#x2245; 3.5 min start-to-finish; the build step proper &#x2245; 2.5 min.) This should be fairly easy to adapt for other OS/arch tuples (famous last words):</p> +
- +
-<a name="bash_scriptlet"></a> +
-<pre>START="$(date)" +
-# edit following vars as desired for your build +
-DOWNLOAD_ROOT="/tmp/xulrunner" +
-BUILD_ARCH="linux-x86_64" +
-BUILD_ROOT="${HOME}/bin/zotero/standalone" +
-BUILD_DIR="20101228" +
-BUILD_PATH="${BUILD_ROOT}/${BUILD_DIR}" +
-BUILD_SCRIPT="build_sa" +
-BUILD_SCRIPT_BAK="${BUILD_SCRIPT}.0" +
-XULR_SOURCE_ROOT="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk" +
-XULR_TARGET_PATH="${BUILD_PATH}/xulrunner_${BUILD_ARCH}" +
-XULR_VERSION="2.0b9pre.en-US" +
-XULR_CHECKSUMS_NAME="xulrunner-${XULR_VERSION}.${BUILD_ARCH}.checksums" +
-XULR_CHECKSUMS_SOURCE="${XULR_SOURCE_ROOT}/${XULR_CHECKSUMS_NAME}" +
-XULR_CHECKSUMS_TARGET="${DOWNLOAD_ROOT}/${XULR_CHECKSUMS_NAME}" +
-XULR_ARCHIVE_NAME="xulrunner-${XULR_VERSION}.${BUILD_ARCH}.tar.bz2" +
-XULR_ARCHIVE_SOURCE="${XULR_SOURCE_ROOT}/${XULR_ARCHIVE_NAME}" +
-XULR_ARCHIVE_TARGET="${DOWNLOAD_ROOT}/${XULR_ARCHIVE_NAME}" +
-ZOTERO_SOURCE_ROOT="https://www.zotero.org/svn/standalone/trunk/" +
-ZOTERO_TARGET_EXEC="${BUILD_PATH}/Zotero_${BUILD_ARCH}/zotero" +
- +
-# setup xulrunner +
-# download xulrunner +
-mkdir -p ${DOWNLOAD_ROOT} +
-wget -O ${XULR_CHECKSUMS_TARGET} ${XULR_CHECKSUMS_SOURCE} +
-wget -O ${XULR_ARCHIVE_TARGET} ${XULR_ARCHIVE_SOURCE} +
-# verify xulrunner +
-pushd ${DOWNLOAD_ROOT} +
-# sha512sum -c < ${XULR_CHECKSUMS_TARGET} +
-# fails with +
-# > sha512sum: standard input: no properly formatted SHA512 checksum lines found +
-# I tried (offline) some other invocations, which similarly all failed +
-# $ sha512sum -c < /tmp/xulrunner/xulrunner-2.0b9pre.en-US.linux-x86_64.checksums  +
-# sha512sum: standard input: no properly formatted SHA512 checksum lines found +
-# $ pushd ${DOWNLOAD_ROOT} +
-# $ sha512sum -c < ${XULR_CHECKSUMS_NAME} +
-# sha512sum: standard input: no properly formatted SHA512 checksum lines found +
-# $ sha512sum -c < xulrunner-2.0b9pre.en-US.linux-x86_64.checksums  +
-# sha512sum: standard input: no properly formatted SHA512 checksum lines found +
-# $ sha512sum -c xulrunner-2.0b9pre.en-US.linux-x86_64.checksums  +
-# sha512sum: xulrunner-2.0b9pre.en-US.linux-x86_64.checksums: no properly formatted SHA512 checksum lines found +
-# unpack xulrunner +
-tar xjf ${XULR_ARCHIVE_NAME} +
-mkdir -p ${BUILD_PATH} +
-# ASSERT: archives expand to ./xulrunner +
-mv ./xulrunner ${XULR_TARGET_PATH} +
-popd +
- +
-# setup sources, including script +
-# checkout sources +
-pushd ${BUILD_ROOT} +
-svn co ${ZOTERO_SOURCE_ROOT} ${BUILD_DIR} +
-popd +
-pushd ${BUILD_PATH} +
-# backup unhacked build script +
-cp ${BUILD_SCRIPT} ${BUILD_SCRIPT_BAK} +
-chmod 444 ${BUILD_SCRIPT_BAK} +
-# hack build script to build only linux +
-chmod 755 ${BUILD_SCRIPT} +
-sed -si 's/BUILD_MAC=1/BUILD_MAC=0/g' ${BUILD_SCRIPT} +
-sed -si 's/BUILD_WIN32=1/BUILD_WIN32=0/g' ${BUILD_SCRIPT} +
-sed -si 's/BUILD_LINUX=0/BUILD_LINUX=1/g' ${BUILD_SCRIPT} +
-diff -u ${BUILD_SCRIPT_BAK} ${BUILD_SCRIPT} +
- +
-# CHECK: you should see stdout like +
-# --- build_sa.0  2010-12-28 16:45:21.000000000 -0500 +
-# +++ build_sa    2010-12-28 16:45:21.000000000 -0500 +
-# @@ -1,7 +1,7 @@ +
-#  #!/bin/bash +
-# -BUILD_MAC=1 +
-# +BUILD_MAC=0 +
-#  BUILD_WIN32=0 +
-# -BUILD_LINUX=0 +
-# +BUILD_LINUX=1 +
- +
-# build +
-BUILD_START="$(date)" +
-./${BUILD_SCRIPT} +
-echo -e "build   end=$(date)" +
-echo -e "build start=${BUILD_START}" +
- +
-# run the built sa +
-${ZOTERO_TARGET_EXEC} & +
-echo -e "  end=$(date)" +
-echo -e "start=${START}" +
-</pre> +
- +
-<p> +
-  The (penultimate) build step produced the output +
-</p> +
- +
-<pre>Getting latest Zotero revision +
-Got Zotero r7528 +
-Building translators.zip +
-Building styles.zip +
-Retrieving Zotero OpenOffice.org Integration +
-Building Zotero_linux-i686 +
-# several errors here, as I did not have the xulrunner for this arch +
-Building Zotero_linux-x86_64 +
-</pre> +
- +
-<p> +
-  The run step puts up a zotero window similar to that normally seen in FirefoxWhen initially run separately from the terminal, it produced the output +
-</p> +
- +
-<pre>$ ./Zotero_linux-x86_64/zotero & +
-ERROR: There is no such extension deployed: org.Zotero.integration.openoffice +
-unopkg failed. +
-</pre> +
- +
-<p> +
-  but I have not observed that subsequently. +
-</p> +
- +
-<p> +
-  Unfortunately I don't currently know how to test the built sa (much less <a href="http://www.zotero.org/static/images/blog/chromedemo.png">from Chrome</a>) aside from the following <a name="smoketest">smoketest</a>: if I</p> +
- +
-<ol> +
-  <li>Run the executable (e.g., <code>${ZOTERO_TARGET_EXEC}</code>, <code>./Zotero_linux-x86_64/zotero</code>).</li> +
-  <li>Wait for the zotero window, then select "Zotero Quick Start" in its middle pane.</li> +
-  <li>Hit button=View in the rightmost pane.</li> +
-</ol> +
- +
-<p>a browser launches and and opens the <a href="http://www.zotero.org/support/quick_start_guide">quick start guide</a>. That's comforting, but I'd prefer to know</p> +
- +
-<ol> +
-  <li>Is there a more extensive test suite? E.g., what do youse do pre-commit?</li> +
- +
-  <li>How to load up my own (backed up) Zotero data (from my Firefox profile, or wherever else it might be) and do actual work?</li> +
- +
-</ol> +
-</html>+
dev/building_the_standalone_client.1293594178.txt.gz · Last modified: 2010/12/28 22:42 by tomrochewiki