AMD64 seamonkey, enigmime not found.

This forum is for discussions regarding Enigmail alpha and beta versions (Nightly Builds). The versions discussed in this forum are not stable and should not be used in production.

AMD64 seamonkey, enigmime not found.

Postby andyr » 7th Dec 2008 13:02

I've built enigmail for Ubuntu 8.10 on AMD64, following the same procedure I used to build it for i386.
All goes well during the compilation and I get an enigmail xpi package for installation.
The installation appears to go ok (start seamonkey with sudo & install).
However, in the preferences I have "Could not find GnuPG" and in the "About OpenPGP" box I have
"OpenPGP provided by Enigmail
Running Enigmail version 0.95.7 (20081130)
Warning: Enigmime module not available
ERROR: Failed to access Enigmime service!
Enigmime Service not available"
If I look in the .xpi file I have a file :
/platform/Linux_x86_64-gcc3/components/libenigmime.so
this doesn't appear to have been installed, but copying it to /usr/lib/seamonkey/components (as under the 32-bit version) doesn't help any.
Any pointers or advice - plenty of results from google regarding libenigmime not being available, but I found nothing of any help.
andyr
New user
New user
 
Posts: 3
Joined: 8th Nov 2008 19:05

Re: AMD64 seamonkey, enigmime not found.

Postby patrick » 7th Dec 2008 18:05

Seamonkey 1.x does not yet support binary components in the profile directory. Thus, libenigmime.so needs to be put into the components directory of the installation, together with the files enigmime.xpt and ipc.xpt.

Afterwards, I think you best delete the file compreg.dat in the components directory. Then start Seamonkey once as root.
User avatar
patrick
Developer
Developer
 
Posts: 517
Joined: 13th Nov 2005 22:16
Location: Zurich, Switzerland

Re: AMD64 seamonkey, enigmime not found.

Postby rainydayz » 7th Dec 2008 20:14

Great, thanks for that, it now appears to be working - at first inspection. I'll try on a clean install of seamonkey over the next couple of days and see exactly what wasn't installed correctly.
rainydayz
Average User
Average User
 
Posts: 18
Joined: 5th Aug 2007 17:39

Re: AMD64 seamonkey, enigmime not found.

Postby rainydayz » 8th Dec 2008 18:10

After some investigation I found the following:
The install.log shows :
Code: Select all
-------------------------------------------------------------------------------
file:///home/username/download/enigmail-0.95.7-linux-x86_64.xpi  --  2008-12-08 17:41:01
-------------------------------------------------------------------------------

     Enigmail v0.95.7.0 (version 0.95.7.0)
     ------------------

     ** initInstall: 0
     ** fProgram: /usr/lib/seamonkey/
     ** platform dependent directory does not exist: -214
     [1/36]   Deleting file: /usr/lib/seamonkey/components/compreg.dat
     [2/36]   Installing: /usr/lib/seamonkey/components/enigmail.xpt
     [3/36]   Installing: /usr/lib/seamonkey/components/enigmime.xpt
     [4/36]   Installing: /usr/lib/seamonkey/components/enigprefs-service.js
     [5/36]   Installing: /usr/lib/seamonkey/components/enigmail.js
     [6/36]   Installing: /usr/lib/seamonkey/components/ipc.xpt
     [7/36]   Replacing: /usr/lib/seamonkey/chrome/enigmail-skin.jar
     [8/36]   Replacing: /usr/lib/seamonkey/chrome/enigmail-skin-tbird.jar
     [9/36]   Replacing: /usr/lib/seamonkey/chrome/enigmail-locale.jar
     [10/36]   Replacing: /usr/lib/seamonkey/chrome/enigmail.jar
     [11/36]   Replacing: /usr/lib/seamonkey/defaults/pref/enigmail.js
     [12/36]   Register Package: jar:resource:/chrome/enigmail.jar!/content/enigmail/
     [13/36]   Register Skin: jar:resource:/chrome/enigmail-skin.jar!/skin/modern/enigmail/
     [14/36]   Register Skin: jar:resource:/chrome/enigmail-skin.jar!/skin/classic/enigmail/
     [15/36]   Register Locale: jar:resource:/chrome/enigmail.jar!/locale/en-US/enigmail/
     [16/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/ca-AD/enigmail/
     [17/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/de-AT/enigmail/
     [18/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/de-DE/enigmail/
     [19/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/el/enigmail/
     [20/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/es-ES/enigmail/
     [21/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/fi-FI/enigmail/
     [22/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/fr-FR/enigmail/
     [23/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/hu-HU/enigmail/
     [24/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/it-IT/enigmail/
     [25/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/ja-JP/enigmail/
     [26/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/ko-KR/enigmail/
     [27/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/nb-NO/enigmail/
     [28/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/pl-PL/enigmail/
     [29/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/pt-BR/enigmail/
     [30/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/pt-PT/enigmail/
     [31/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/ru-RU/enigmail/
     [32/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/sl-SI/enigmail/
     [33/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/sv-SE/enigmail/
     [34/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/tr-TR/enigmail/
     [35/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/zh-CN/enigmail/
     [36/36]   Register Locale: jar:resource:/chrome/enigmail-locale.jar!/locale/zh-TW/enigmail/

     Install completed successfully  --  2008-12-08 17:41:02

The file libenigmime.so is not copied to /usr/lib/seamonkey/components, I'm assuming this is something to do with the error "platform dependent directory does not exist: -214"
After copying libenigmime.so to the components directory and deleting compreg.dat enigmail works.

Any pointers to documentation regarding this issue of the "platform dependent directory" - this is now close to having to a version for Ubuntu on AMD64.
I assume this is related to the xpinstall - I'll start by looking at the source there.
rainydayz
Average User
Average User
 
Posts: 18
Joined: 5th Aug 2007 17:39

Re: AMD64 seamonkey, enigmime not found.

Postby rainydayz » 8th Dec 2008 18:32

Sorry for replying to myself - the problem seems to be that the enigmail install.js determines that the the platform is Linux, and then looks for libenigmime.so in the platform/Linux_x86-gcc3 directory in the enigmail xpi.
However, for AMD64, libenigmime.so is created in platform/Linux_x86_64-gcc3
So, I should be able to put

const ABI_PLATFORM_LINUX_64="Linux_x86_64-gcc3";

in install.js and then set platformNode appropriately.

Only question is, in function getPlatform() how do I distinguish between Linux x86 and Linux x86_64 ?
rainydayz
Average User
Average User
 
Posts: 18
Joined: 5th Aug 2007 17:39

Re: AMD64 seamonkey, enigmime not found - fixed

Postby rainydayz » 9th Dec 2008 18:22

Success!

In genxpi I added :
const ABI_PLATFORM_LINUX64="Linux_x86_64-gcc3"
immediately after the definition of ABI_PLATFORM_LINUX

A little further down in the script I added :
addDirectory("", "platform/"+ABI_PLATFORM_LINUX64+"/components", fComponents, "");
immediately after addDirectory("", "platform/"+ABI_PLATFORM_LINUX+"/components", fComponents, "");

Rebuild the xpi and install.

Here's my new genxpi.
Code: Select all
#!/bin/sh

# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "MPL"); you may not use this file
# except in compliance with the MPL. You may obtain a copy of
# the MPL at http://www.mozilla.org/MPL/
#
# Software distributed under the MPL is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the MPL for the specific language governing
# rights and limitations under the MPL.
#
# The Original Code is Enigmail.
#
# The Initial Developer of the Original Code is Patrick Brunschwig.
# Portions created by Patrick Brunschwig <patrick.brunschwig@gmx.net> are
# Copyright (C) 2004 Patrick Brunschwig. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License (the "GPL"), in which case
# the provisions of the GPL are applicable instead of
# those above. If you wish to allow use of your version of this
# file only under the terms of the GPL and not to allow
# others to use your version of this file under the MPL, indicate
# your decision by deleting the provisions above and replace them
# with the notice and other provisions required by the GPL.
# If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.

#
# This script generates the Enigmail XPI
#

echo "genxpi: Generating $1 in $5"

if [ $# -lt 8 ]; then
  echo "Wrong number of parameters"
  exit 1
fi

xpiFile=$1
xpiVersion="$2"
platform=$3
mozApp=$4
srcDir=$6
xpiModule=$7
dllSuffix=$8
libPrefix=$9
cwd=`pwd`
cd "$5"
targetDir=`pwd`
cd "$cwd"

# Prepare chrome.manifest
cat  ${srcDir}/package/chrome.manifest > ${targetDir}/chrome.manifest

# Pepare install.rdf
sed 's/<!-- targetPlatform placeholder -->/<em:targetPlatform>'${platform}'<\/em:targetPlatform>/' < ${srcDir}/package/install.rdf > ${targetDir}/install.rdf.t1

# Prepare install.js

cat <<EOT > ${targetDir}/install.js
// Install script for Enigmail

var err;
const APP_VERSION="${xpiVersion}.0";


const ABI_PLATFORM_LINUX="Linux_x86-gcc3";
const ABI_PLATFORM_LINUX64="Linux_x86_64-gcc3";
const ABI_PLATFORM_WIN="WINNT_x86-msvc";
const ABI_PLATFORM_DARWIN_PPC="Darwin_ppc-gcc3";
const ABI_PLATFORM_DARWIN_X86="Darwin_x86-gcc3";
const ABI_PLATFORM_OS2="OS2_x86-gcc3";

const APP_PLATFORM_LINUX="linux";
const APP_PLATFORM_WIN="win";
const APP_PLATFORM_MAC="mac";
const APP_PLATFORM_OS2="os2";
const APP_PLATFORM_OTHER="other";


// this function verifies disk space in kilobytes
function verifyDiskSpace(dirPath, spaceRequired) {
  var spaceAvailable;

  // Get the available disk space on the given path
  spaceAvailable = fileGetDiskSpaceAvailable(dirPath);

  // Convert the available disk space into kilobytes
  spaceAvailable = parseInt(spaceAvailable / 1024);

  // do the verification
  if(spaceAvailable < spaceRequired) {
    logComment("Insufficient disk space: " + dirPath);
    logComment("  required : " + spaceRequired + " K");
    logComment("  available: " + spaceAvailable + " K");
    return false;
  }

  return true;
}

// OS type detection
// which platform?
function getPlatform() {
  var platformStr;
  var platformNode = "";

  if('platform' in Install) {
    platformStr = new String(Install.platform);

    if (!platformStr.search(/^Macintosh/))
      platformNode = APP_PLATFORM_MAC;
    else if (!platformStr.search(/^Win/))
      platformNode = APP_PLATFORM_WIN;
    else if (platformStr.search(/Linux/) >= 0)
      platformNode = APP_PLATFORM_LINUX;
    else if (!platformStr.search(/^OS\/2/))
      platformNode = APP_PLATFORM_OS2;
    else
      platformNode = APP_PLATFORM_OTHER;
  }

  return platformNode;
}

err = initInstall("Enigmail v"+APP_VERSION,  // name for install UI
                  "/enigmail",               // registered name
                  APP_VERSION);              // package version

logComment("initInstall: " + err);

var srDest = 500;       // Disk space required for installation (KB)

var fProgram    = getFolder("Program");
logComment("fProgram: " + fProgram);

if (!verifyDiskSpace(fProgram, srDest)) {
  cancelInstall(INSUFFICIENT_DISK_SPACE);

} else {

  var fChrome     = getFolder("Chrome");
  var fComponents = getFolder("Components");
  var fDefaults   = getFolder("Program", "defaults/pref");

  // workaround for Mozilla 1.8a3 and newer, failing to register enigmime correctly

  var delComps = [ "compreg.dat" ]; // Components registry

  for (var j=0; j<delComps.length; j++) {
     var delFile = getFolder(fComponents, delComps[j]);
     if (File.exists(delFile))
        File.remove(delFile);
  }

  switch (getPlatform()) {
  case APP_PLATFORM_LINUX:
    addDirectory("", "platform/"+ABI_PLATFORM_LINUX+"/components",    fComponents, "");
    addDirectory("", "platform/"+ABI_PLATFORM_LINUX64+"/components",    fComponents, "");
    break;
  case APP_PLATFORM_WIN:
    addDirectory("", "platform/"+ABI_PLATFORM_WIN+"/components",    fComponents, "");
    break;
  case APP_PLATFORM_MAC:
    addDirectory("", "platform/"+ABI_PLATFORM_DARWIN_PPC+"/components",    fComponents, "");
    addDirectory("", "platform/"+ABI_PLATFORM_DARWIN_X86+"/components",    fComponents, "");
    break;
  case APP_PLATFORM_OS2:
    addDirectory("", "platform/"+ABI_PLATFORM_OS2+"/components",    fComponents, "");
    break;
  default:
    addDirectory("", "platform/${platform}/components",    fComponents, "");
  }

  err = getLastError();
  if (err == DOES_NOT_EXIST) {
    // error code: file does not exist
    logComment("platform dependent directory does not exist: " + err);
    resetError();
  }
  else if (err != SUCCESS) {
    cancelInstall(err);
  }

  // addDirectory: blank, archive_dir, install_dir, install_subdir
  addDirectory("", "components",    fComponents, "");
  addDirectory("", "chrome",        fChrome,     "");
  addDirectory("", "defaults/pref", fDefaults,   "");


  err = getLastError();
  if (err == ACCESS_DENIED) {
    alert("Unable to write to components directory "+fComponents+".\n You will need to restart the browser with administrator/root privileges to install this software. After installing as root (or administrator), you will need to restart the browser one more time, as a privileged user, to register the installed software.\n After the second restart, you can go back to running the browser without privileges!");

    cancelInstall(ACCESS_DENIED);

  } else if (err != SUCCESS) {
    cancelInstall(err);

  } else {
    // Register chrome

    var isTbird = false;

    registerChrome(PACKAGE | DELAYED_CHROME, getFolder("Chrome","enigmail.jar"), "content/enigmail/");

    if (! isTbird) {
      registerChrome(   SKIN | DELAYED_CHROME, getFolder("Chrome","enigmail-skin.jar"), "skin/modern/enigmail/");

      registerChrome(   SKIN | DELAYED_CHROME, getFolder("Chrome","enigmail-skin.jar"), "skin/classic/enigmail/");
    }
    else {
      registerChrome(   SKIN | DELAYED_CHROME, getFolder("Chrome","enigmail-skin-tbird.jar"), "skin/classic/enigmail/");
    }
    registerChrome( LOCALE | DELAYED_CHROME, getFolder("Chrome","enigmail.jar"), "locale/en-US/enigmail/");
EOT

# Prepare languages other than en-US

if [ -s ${srcDir}/lang/current-languages.txt ]; then
  localeJar=chrome/${xpiModule}-locale.jar

  echo '      <Description about="urn:mozilla:extension:file:enigmail-locale.jar">' > ${targetDir}/install.rdf.t2

  for lang in `cat ${srcDir}/lang/current-languages.txt`; do
    echo '        <em:locale>locale/'$lang'/enigmail/</em:locale>' >> ${targetDir}/install.rdf.t2
    echo 'locale        enigmail    '$lang'       jar:chrome/enigmail-locale.jar!/locale/'$lang'/enigmail/' >> ${targetDir}/chrome.manifest
    echo '    registerChrome( LOCALE | DELAYED_CHROME, getFolder("Chrome","enigmail-locale.jar"), "locale/'$lang'/enigmail/");' >> ${targetDir}/install.js
  done
  echo '      </Description>' >> ${targetDir}/install.rdf.t2

  awk -v langFile=${targetDir}/install.rdf.t2 '
    BEGIN {
      lines=0
      while (getline < langFile) {
        lineTxt[++lines] = $0
      }
    }
    /<!-- localeFile placeholder -->/ {
      for (i=0; i<lines; i++) {
        print lineTxt[i+1]
      }
      next;
    }
    {
      print $0
    }' ${targetDir}/install.rdf.t1 >${targetDir}/install.rdf
    rm ${targetDir}/install.rdf.t1 ${targetDir}/install.rdf.t2
else
  localeJar=""
  mv ${targetDir}/install.rdf.t1 ${targetDir}/install.rdf
fi


# finalize install.js
cat <<EOT >> ${targetDir}/install.js
    err = getLastError();

    if (err != SUCCESS) {
      cancelInstall(err);

    } else {
      performInstall();
    }
  }
}
EOT

cat << EOT > ${targetDir}/components/gpg-wrapper.sh
#!/bin/sh

GPG="\$1"
shift

\$GPG "\$@"
exitCode=\$?

sleep 2
exit $exitCode
EOT

chmod 755 ${targetDir}/components/gpg-wrapper.sh
cd ${srcDir}/package

enigmimeDll=${libPrefix}enigmime${dllSuffix}
dllFile=platform/${platform}/components/${enigmimeDll}

cd "$targetDir"


mkdir -p platform/${platform}/components
cp components/${enigmimeDll} ${dllFile}


zip ${xpiFile} \
    components/${xpiModule}.xpt \
    components/${xpiModule}.js \
    components/enigprefs-service.js \
    defaults/preferences/enigmail.js \
    defaults/pref/enigmail.js \
    chrome/${xpiModule}.jar \
    chrome/${xpiModule}-skin.jar \
    chrome/${xpiModule}-skin-tbird.jar \
    ${localeJar} \
    components/ipc.xpt \
    components/enigmime.xpt \
    ${dllFile} \
    chrome.manifest \
    install.js \
    install.rdf

rm install.rdf chrome.manifest install.js
rainydayz
Average User
Average User
 
Posts: 18
Joined: 5th Aug 2007 17:39


Return to Development Discussions