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 [2011/04/17 20:09] rmzelledev:building_the_standalone_client [2017/11/12 19:53] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Building the Standalone Client ======+<html><p id="zotero-5-update-warning" style="color: red; font-weight: bold">We’re 
 +in the process of updating the documentation for 
 +<a href="https://www.zotero.org/blog/zotero-5-0">Zotero 5.0</a>. Some documentation 
 +may be outdated in the meantime. Thanks for your understanding.</p></html>
  
-After initial inquiry in a Zotero [[http://forums.zotero.org/discussion/15700/how-to-migrate-from-firefox/|forum thread]], and some trial-and-error, I was able to build the Zotero Standalone client from source using the [[building_the_standalone_client#bash scriptlet|bash scriptlet]] shown below). The main things I needed to learn were: 
  
-  - Location of the source: https://www.zotero.org/svn/standalone/trunk/ +See [[dev/client coding/Building the Standalone Client]].
-  - Location of build script: ''build_sa'' a bash script in the root directory of the source +
-  - Build prerequisites: +
-    - Tools: ''subversion'', ''bash'' and ''perl''+
-    - Non-source inputs: Only required input appears to be XULRunner, with constraints: +
-      - Version: ''build_sa'' states clearly that ''# Requires XULRunner runtime 2.0.*''. This was a problem: +
-        - Ubuntu does not package a 2.x XULRunner before [[https://wiki.ubuntu.com/NattyNarwhal|Natty]], which is currently pre-release. +
-        - The xulrunner-2.x runtimes are also currently pre-release, and Mozilla does not make those builds easy to find. +
-      Fortunately one can get prerelease xulrunners from http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/: see the bash scriptlet below. +
-      - Location: ''build_sa'' 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 bash scriptlet below). +
-  - Build control: nothing to do but edit the bash script ''build_sa''. It has no config file, takes no arguments, and is non-interactive. ''build_sa'' will build one or more of the target OSs ''{linux, mac, win32}'', but it decides which architectures are built for each. +
-  - Running the built sa (as opposed to running the build): after building, and some perusal of (e.g.) the output of ''ls -alt ${BUILD_PATH} $(find -executable -type f) | grep -ve '.so$''', I found ''${BUILD_PATH}/Zotero_${BUILD_ARCH}/zotero''+
- +
-===== Bash Scriptlet ===== +
- +
-I automated a build on 64-bit Ubuntu with the following bash scriptlet: +
- +
-<code>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}"</code> +
- +
-The (penultimate) build step produced the output +
- +
-<code>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</code> +
- +
-The run step puts up a zotero window similar to that normally seen in Firefox. When initially run separately from the terminal, it produced the output +
- +
-<code>$ ./Zotero_linux-x86_64/zotero & +
-ERROR: There is no such extension deployed: org.Zotero.integration.openoffice +
-unopkg failed.</code> +
- +
-but I have not observed that subsequently. +
- +
-Unfortunately I don't currently know how to test the built sa (much less from Chrome) aside from the following smoketest: if I +
-  - Run the executable (e.g., ''${ZOTERO_TARGET_EXEC}'', ''./Zotero_linux-x86_64/zotero''). +
-  - Wait for the zotero window, then select "Zotero Quick Start" in its middle pane. +
-  - Hit button=View in the rightmost pane. +
- +
-a browser launches and and opens the [[/support/quick_start_guide|quick start guide]]. That's comforting, but I'd prefer to know: +
- +
-  - Is there a more extensive test suite? E.g., what do youse do pre-commit? +
-  - How to load up my own (backed up) Zotero data (from my Firefox profile, or wherever else it might be) and do actual work?+
dev/building_the_standalone_client.1303085395.txt.gz · Last modified: 2011/04/17 20:09 by rmzelle