Update to enigmail 0.89.0 #64547. Add patch for freetype-2.1.8+ binary compatibility...
authorAron Griffis <agriffis@gentoo.org>
Thu, 18 Nov 2004 14:04:33 +0000 (14:04 +0000)
committerAron Griffis <agriffis@gentoo.org>
Thu, 18 Nov 2004 14:04:33 +0000 (14:04 +0000)
net-www/mozilla/ChangeLog
net-www/mozilla/Manifest
net-www/mozilla/files/digest-mozilla-1.7.3-r3 [new file with mode: 0644]
net-www/mozilla/files/mozilla-1.7.3-4ft2.patch [new file with mode: 0644]
net-www/mozilla/mozilla-1.7.3-r3.ebuild [new file with mode: 0644]

index a4db948750d32390d9a4bad2e1fc960b062112c0..e9fe18ab947b429faaef6a6e77f7f83682666417 100644 (file)
@@ -1,6 +1,15 @@
 # ChangeLog for net-www/mozilla
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla/ChangeLog,v 1.208 2004/11/16 16:07:57 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla/ChangeLog,v 1.209 2004/11/18 14:04:33 agriffis Exp $
+
+*mozilla-1.7.3-r3 (18 Nov 2004)
+
+  18 Nov 2004; Aron Griffis <agriffis@gentoo.org>
+  +files/mozilla-1.7.3-4ft2.patch, +mozilla-1.7.3-r3.ebuild:
+  Update to enigmail 0.89.0 #64547. Add patch for freetype-2.1.8+ binary
+  compatibility #59849. Switch from svg-libart to svg-cairo because the libart
+  version we were using depends on the bad freetype APIs. Additionally we're
+  using cairo in firefox so it's good to be in sync
 
   16 Nov 2004; Aron Griffis <agriffis@gentoo.org> mozilla-1.7.3-r2.ebuild:
   Remove IUSE=gtk2 because we always depend on gtk2 now
index c78bb22097b0794ee90c5648e24c25668a0ea4d1..20a9a959a80a0e3679091e9f897b4534aad38304 100644 (file)
@@ -1,4 +1,4 @@
-MD5 94be83ee531cdbea360bcda10f667713 ChangeLog 35500
+MD5 0426dd700e7d808f5d4cac0d27c5cb39 ChangeLog 35926
 MD5 ce23390351fe8020387d93ee29e09a3d metadata.xml 160
 MD5 7c90e1ccb807e874f4bfa5796d3c513d mozilla-1.6-r1.ebuild 16979
 MD5 21fbce86f739b098e11b5225b58f452d mozilla-1.7-r1.ebuild 16620
@@ -6,6 +6,7 @@ MD5 aa7166da0319e88d9ad909403631ab70 mozilla-1.7.2-r1.ebuild 8874
 MD5 1b86c01a90c75d55fc70099410d8cd0d mozilla-1.7.3-r2.ebuild 9947
 MD5 f4b18993ea4e902777640a7afe26b4de mozilla-1.7.3.ebuild 8822
 MD5 9320e2015bdfdecec9c9bcd3a6f65cfb mozilla-1.7.ebuild 16477
+MD5 2f8ef9ccd172a752e47472eef710c2fb mozilla-1.7.3-r3.ebuild 9822
 MD5 b99dabe3c40cfafe2e63bdef95815596 files/10mozilla 105
 MD5 11cae063228d9997b2cf9f150d9837fe files/digest-mozilla-1.6-r1 201
 MD5 c3b63fbbf42894e19fff553092660af6 files/digest-mozilla-1.7 204
@@ -29,6 +30,8 @@ MD5 e4adf41536cf80df5f8f5f6ff9bd88a7 files/mozilla-rebuild-databases.pl 2310
 MD5 d2a2c551fe8991a27d4abe4e3bbedbe3 files/mozilla-xft-unix-prefs.patch 1320
 MD5 2e275ac9f0f12d670020e3b18a295dfb files/mozilla.sh 6688
 MD5 7d244b888dbd302c14414cbfc1f62501 files/xft.js 135
+MD5 e79634ee1e611182b6c227daa362b20d files/mozilla-1.7.3-4ft2.patch 22360
+MD5 81a50166a3d53f53af6bcbf38da71071 files/digest-mozilla-1.7.3-r3 281
 MD5 8803e1d528f2f49a3f3fa98ba14d9ff0 files/1.2/mozilla-1.2-branch-update.patch.bz2 8240
 MD5 83da5242120c74b0ca6cceae9d6cf237 files/1.2/mozilla-1.2-cutnpaste-limit-fix.patch.bz2 2838
 MD5 4877db25d49b916e55a5d11238c63d8c files/1.2/mozilla-1.2-image-reload-memleak.patch 1489
diff --git a/net-www/mozilla/files/digest-mozilla-1.7.3-r3 b/net-www/mozilla/files/digest-mozilla-1.7.3-r3
new file mode 100644 (file)
index 0000000..8b10d98
--- /dev/null
@@ -0,0 +1,4 @@
+MD5 15cb68da1d58f055f871b77ff655df77 mozilla-source-1.7.3.tar.bz2 29716200
+MD5 47ed5962d3d18f5792f805eff706cfbd mozilla-1.7.2-libart_lgpl.tar.bz2 102117
+MD5 5e8ced79811ce4986fc840de8d9fc938 ipc-1.1.1.tar.gz 102900
+MD5 a377f8296aa5013350a05085faa336b1 enigmail-0.89.0.tar.gz 332923
diff --git a/net-www/mozilla/files/mozilla-1.7.3-4ft2.patch b/net-www/mozilla/files/mozilla-1.7.3-4ft2.patch
new file mode 100644 (file)
index 0000000..18b8028
--- /dev/null
@@ -0,0 +1,656 @@
+This patch is from
+https://bugzilla.mozilla.org/show_bug.cgi?id=234035#c65 to enable
+linking against freetype-2.1.8+.  It disables the experimental
+freetype caching.  I modified this patch slightly to apply to 1.7.3;
+some things had moved around in the files since the original patch.
+
+Note this is the same patch as we apply to mozilla-firefox-1.0
+
+15 Nov 2004 agriffis
+
+--- gfx/idl/nsIFreeType2.idl.agriffis  2004-04-15 21:09:33.000000000 -0400
++++ gfx/idl/nsIFreeType2.idl   2004-11-15 13:29:05.120343408 -0500
+@@ -98,8 +98,6 @@
+ {
+ 
+     readonly attribute FT_Library library;
+-    readonly attribute FTC_Manager FTCacheManager;
+-    readonly attribute FTC_Image_Cache ImageCache;
+ 
+     void    doneFace(in FT_Face face);
+     void    doneFreeType(in FT_Library lib);
+@@ -114,17 +112,8 @@
+                     in FT_Long face_num, out FT_Face face);
+     void    outlineDecompose(in FT_Outline_p outline,
+                              in const_FT_Outline_Funcs_p funcs, in voidPtr p);
++    void    setPixelSizes(in FT_Face face, in FT_UInt width, in FT_UInt height); 
+     void    setCharmap(in FT_Face face, in FT_CharMap charmap);
+-    void    imageCacheLookup(in FTC_Image_Cache cache, in FTC_Image_Desc_p desc,
+-                             in FT_UInt gindex, out FT_Glyph glyph);
+-    void    managerLookupSize(in FTC_Manager manager, in FTC_Font font,
+-                              out FT_Face face, out FT_Size size);
+-    void    managerDone(in FTC_Manager manager);
+-    void    managerNew(in FT_Library lib, in FT_UInt max_faces,
+-                       in FT_UInt max_sizes, in FT_ULong max_bytes,
+-                       in FTC_Face_Requester requester, in FT_Pointer req_data,
+-                       out FTC_Manager manager);
+-    void    imageCacheNew(in FTC_Manager manager, out FTC_Image_Cache cache);
+ /* #ifdef MOZ_SVG */
+     void glyphTransform(in FT_Glyph glyph, in FT_Matrix_p matrix,
+                         in FT_Vector_p delta);
+--- gfx/src/ps/nsFontMetricsPS.h.agriffis      2003-04-22 12:25:09.000000000 -0400
++++ gfx/src/ps/nsFontMetricsPS.h       2004-11-15 13:37:58.431267824 -0500
+@@ -320,7 +320,8 @@
+   nsCOMPtr<nsITrueTypeFontCatalogEntry> mFaceID;
+   nsCOMPtr<nsIFreeType2> mFt2;
+   PRUint16        mPixelSize;
+-  FTC_Image_Desc  mImageDesc;
++  FT_Face         mFace; 
++  FT_Library      mFreeTypeLibrary;
+ 
+ 
+   static PRBool AddUserPref(nsIAtom *aLang, const nsFont& aFont,
+@@ -363,7 +364,8 @@
+ protected:
+   nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
+   nsCOMPtr<nsIFreeType2> mFt2;
+-  FTC_Image_Desc  mImageDesc;
++  FT_Face         mFace; 
++  FT_Library      mFreeTypeLibrary;
+ };
+ #endif
+ 
+--- gfx/src/ps/nsFontMetricsPS.cpp.agriffis    2004-02-04 20:57:05.000000000 -0500
++++ gfx/src/ps/nsFontMetricsPS.cpp     2004-11-15 13:29:05.123342952 -0500
+@@ -1141,21 +1141,26 @@
+   
+   mPixelSize = NSToIntRound(app2dev * mFont->size);
+ 
+-  mImageDesc.font.face_id    = (void*)mEntry;
+-  mImageDesc.font.pix_width  = mPixelSize;
+-  mImageDesc.font.pix_height = mPixelSize;
+-  mImageDesc.image_type = 0;
+-
+   nsresult rv;
+   mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
+   if (NS_FAILED(rv)) {
++    NS_ERROR("failed to get ft2 service");
++    return NS_ERROR_FAILURE;
++  }
++
++  if (NS_FAILED(mFt2->GetLibrary(&mFreeTypeLibrary))) {
++    NS_ERROR("failed to get ft2 library");
+     return NS_ERROR_FAILURE;
+   }
++
++  mFace = nsnull; 
+   return NS_OK;
+ }
+ 
+ nsFontPSFreeType::~nsFontPSFreeType()
+ {
++  if (mFace) 
++    mFt2->DoneFace(mFace);
+   mEntry = nsnull;
+ }
+ 
+@@ -1180,32 +1185,26 @@
+ nscoord
+ nsFontPSFreeType::GetWidth(const PRUnichar* aString, PRUint32 aLength)
+ {
+-  FT_UInt glyph_index;
+-  FT_Glyph glyph;
+-  double origin_x = 0;
+-
+   // get the face/size from the FreeType cache
+   FT_Face face = getFTFace();
+   NS_ASSERTION(face, "failed to get face/size");
+   if (!face)
+     return 0;
+ 
+-  FTC_Image_Cache iCache;
+-  nsresult rv = mFt2->GetImageCache(&iCache);
+-  if (NS_FAILED(rv)) {
+-    NS_ERROR("Failed to get Image Cache");
+-    return 0;
+-  }
++  FT_UInt glyph_index;
++  FT_Glyph glyph;
++  double origin_x = 0;
+ 
++  // XXX : we might need some caching here
+   for (PRUint32 i=0; i<aLength; i++) {
+-    mFt2->GetCharIndex((FT_Face)face, aString[i], &glyph_index);
+-    nsresult rv = mFt2->ImageCacheLookup(iCache, &mImageDesc,
+-                                         glyph_index, &glyph);
+-    if (NS_FAILED(rv)) {
++    mFt2->GetCharIndex(face, aString[i], &glyph_index);
++    if (NS_FAILED(mFt2->LoadGlyph(face, glyph_index, FT_LOAD_DEFAULT)) ||
++        NS_FAILED(mFt2->GetGlyph(face->glyph, &glyph))) {     
+       origin_x += FT_REG_TO_16_16(face->size->metrics.x_ppem/2 + 2);
+       continue;
+     }
+     origin_x += glyph->advance.x;
++    mFt2->DoneGlyph(glyph);
+   }
+ 
+   NS_ENSURE_TRUE(mFontMetrics, 0);
+@@ -1224,16 +1223,26 @@
+ FT_Face
+ nsFontPSFreeType::getFTFace()
+ {
+-  FT_Face face = nsnull;
+-  
+-  FTC_Manager cManager;
+-  mFt2->GetFTCacheManager(&cManager);
+-  nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
+-                                        &face, nsnull);
++  if (mFace) return mFace;
++
++  nsCAutoString fileName;
++  PRInt16       faceIndex; 
++  mEntry->GetFileName(fileName);
++  mEntry->GetFaceIndex(&faceIndex);
++
++  nsresult rv = 
++    mFt2->NewFace(mFreeTypeLibrary, fileName.get(), faceIndex, &mFace);
++
+   NS_ASSERTION(rv==0, "failed to get face/size");
+-  if (rv)
+-    return nsnull;
+-  return face;
++  if (NS_FAILED(rv)) {
++    return nsnull; 
++  }
++
++  if (NS_FAILED(mFt2->SetPixelSizes(mFace, mPixelSize, 0))) {
++    return nsnull; 
++  }
++
++  return mFace; 
+ }
+ 
+ nscoord
+@@ -1618,26 +1627,23 @@
+ 
+ void nsFT2Type8Generator::GeneratePSFont(FILE* aFile)
+ {
+-  nsCAutoString fontName, styleName;
+-  mEntry->GetFamilyName(fontName);
+-  mEntry->GetStyleName(styleName);
+-  
+-  mImageDesc.font.face_id    = (void*)mEntry;
+-  // TT glyph has no relation to size
+-  mImageDesc.font.pix_width  = 16;
+-  mImageDesc.font.pix_height = 16;
+-  mImageDesc.image_type = 0;
+-  FT_Face face = nsnull;
+-  FTC_Manager cManager;
+-  mFt2->GetFTCacheManager(&cManager);
+-  nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
+-                                        &face, nsnull);
+-  if (NS_FAILED(rv))
+-    return;
++  if (mFace == nsnull) {
++    nsCAutoString fileName;
++    PRInt16       faceIndex; 
++
++    mEntry->GetFileName(fileName);
++    mEntry->GetFaceIndex(&faceIndex);
++    if (NS_FAILED(mFt2->
++          NewFace(mFreeTypeLibrary, fileName.get(), faceIndex, &mFace))) {
++      return;
++    }
++    NS_ASSERTION(mFace != nsnull, "mFace is null");
++  }
++
+  
+   int wmode = 0;
+   if (!mSubset.IsEmpty())
+-    FT2SubsetToType8(face, mSubset.get(), mSubset.Length(), wmode, aFile);
++    FT2SubsetToType8(mFace, mSubset.get(), mSubset.Length(), wmode, aFile);
+ }
+ #endif //MOZ_ENABLE_FREETYPE2
+ 
+--- gfx/src/x11shared/nsFontFreeType.cpp.agriffis      2003-12-25 03:24:52.000000000 -0500
++++ gfx/src/x11shared/nsFontFreeType.cpp       2004-11-15 13:29:05.125342648 -0500
+@@ -173,15 +173,22 @@
+ FT_Face
+ nsFreeTypeFont::getFTFace()
+ {
+-  FT_Face face = nsnull;
+-  FTC_Manager mgr;
++  if (mFace) return mFace;
++
++  nsCAutoString fileName;
++  PRInt16       faceIndex; 
++  mFaceID->GetFileName(fileName);
++  mFaceID->GetFaceIndex(&faceIndex);
++
+   nsresult rv;
+-  mFt2->GetFTCacheManager(&mgr);
+-  rv = mFt2->ManagerLookupSize(mgr, &mImageDesc.font, &face, nsnull);
++  rv = mFt2->NewFace(mFreeTypeLibrary, fileName.get(), faceIndex, &mFace);
+   NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
+   if (NS_FAILED(rv))
+     return nsnull;
+-  return face;
++  rv = mFt2->SetPixelSizes(mFace, mPixelSize, 0);
++  if (NS_FAILED(rv))
++    return nsnull;
++  return mFace;
+ }
+ 
+ nsFreeTypeFont::nsFreeTypeFont(nsITrueTypeFontCatalogEntry *aFaceID,
+@@ -191,21 +198,20 @@
+   PRBool embedded_bimap = PR_FALSE;
+   mFaceID = aFaceID;
+   mPixelSize = aPixelSize;
+-  mImageDesc.font.face_id    = (void*)mFaceID;
+-  mImageDesc.font.pix_width  = aPixelSize;
+-  mImageDesc.font.pix_height = aPixelSize;
+-  mImageDesc.image_type = 0;
++//mLoadFlag = FT_LOAD_RENDER;
++  mLoadFlag = 0;
++  mFace = nsnull;
+ 
+   if (aPixelSize < nsFreeType2::gAntiAliasMinimum) {
+-    mImageDesc.image_type |= ftc_image_mono;
++    mLoadFlag |= FT_LOAD_MONOCHROME; 
+     anti_alias = PR_FALSE;
+   }
+ 
+   if (nsFreeType2::gFreeType2Autohinted)
+-    mImageDesc.image_type |= ftc_image_flag_autohinted;
++    mLoadFlag |= FT_LOAD_FORCE_AUTOHINT;
+ 
+   if (nsFreeType2::gFreeType2Unhinted)
+-    mImageDesc.image_type |= ftc_image_flag_unhinted;
++    mLoadFlag |= FT_LOAD_NO_HINTING;
+ 
+   PRUint32  num_embedded_bitmaps, i;
+   PRInt32*  embedded_bitmapheights;
+@@ -218,7 +224,7 @@
+         if (embedded_bitmapheights[i] == aPixelSize) {
+           embedded_bimap = PR_TRUE;
+           // unhinted must be set for embedded bitmaps to be used
+-          mImageDesc.image_type |= ftc_image_flag_unhinted;
++          mLoadFlag |= FT_LOAD_NO_HINTING;
+           break;
+         }
+       }
+@@ -230,6 +236,11 @@
+   mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
+   NS_ASSERTION(NS_SUCCEEDED(rv), "failed to find FreeType routines");
+ 
++  if (mFt2) {
++    rv = mFt2->GetLibrary(&mFreeTypeLibrary); 
++    NS_ASSERTION(NS_SUCCEEDED(rv), "failed to find FreeType library");
++  }
++
+   FREETYPE_FONT_PRINTF(("anti_alias=%d, embedded_bitmap=%d, "
+                         "AutoHinted=%d, gFreeType2Unhinted = %d, "
+                         "size=%dpx, \"%s\"",
+@@ -288,8 +299,6 @@
+                                      PRInt32* aDescent,
+                                      PRInt32* aWidth)
+ {
+-  nsresult rv;
+-
+   *aLeftBearing = 0;
+   *aRightBearing = 0;
+   *aAscent = 0;
+@@ -312,11 +321,6 @@
+   if (!face)
+     return NS_ERROR_FAILURE;
+ 
+-  FTC_Image_Cache icache;
+-  mFt2->GetImageCache(&icache);
+-  if (!icache)
+-    return NS_ERROR_FAILURE;
+-
+   // get the text size
+   PRUint32 i, extraSurrogateLength;
+   for (i=0; i<aLength; i+=1+extraSurrogateLength) {
+@@ -337,16 +341,17 @@
+     }
+     mFt2->GetCharIndex(face, code_point, &glyph_index);
+ 
+-    //NS_ASSERTION(glyph_index,"failed to get glyph");
+-    if (glyph_index) {
+-      rv = mFt2->ImageCacheLookup(icache, &mImageDesc, glyph_index, &glyph);
+-      NS_ASSERTION(NS_SUCCEEDED(rv),"error loading glyph");
+-    }
+-    if ((glyph_index) && (NS_SUCCEEDED(rv))) {
++    // XXX : we need some caching here
++    if (glyph_index && 
++        NS_SUCCEEDED(mFt2->LoadGlyph(face, glyph_index, mLoadFlag)) &&
++//      NS_SUCCEEDED(mFt2->LoadGlyph(face, glyph_index, FT_LOAD_DEFAULT)) &&
++        NS_SUCCEEDED(mFt2->GetGlyph(face->glyph, &glyph))) {
+       mFt2->GlyphGetCBox(glyph, ft_glyph_bbox_pixels, &glyph_bbox);
+       advance = FT_16_16_TO_REG(glyph->advance.x);
++      mFt2->DoneGlyph(glyph);
+     }
+     else {
++      NS_ERROR("failed to get or load glyph");
+       // allocate space to draw an empty box in
+       GetFallbackGlyphMetrics(&glyph_bbox, face);
+       advance = glyph_bbox.xMax + 1;
+@@ -401,11 +406,6 @@
+   if (!face)
+     return 0;
+ 
+-  FTC_Image_Cache icache;
+-  mFt2->GetImageCache(&icache);
+-  if (!icache)
+-    return 0;
+-
+   PRUint32 i, extraSurrogateLength;
+   for (i=0; i<aLength; i+=1+extraSurrogateLength) {
+     extraSurrogateLength=0;
+@@ -418,15 +418,18 @@
+       // skip aString[i+1], it is already used as low surrogate
+       extraSurrogateLength = 1;
+     }
++
++    // XXX : we need some caching here
+     mFt2->GetCharIndex((FT_Face)face, code_point, &glyph_index);
+-    nsresult rv;
+-    rv = mFt2->ImageCacheLookup(icache, &mImageDesc, glyph_index, &glyph);
+-    NS_ASSERTION(NS_SUCCEEDED(rv),"error loading glyph");
+-    if (NS_FAILED(rv)) {
++    if (NS_FAILED(mFt2->LoadGlyph(face, glyph_index, mLoadFlag)) ||
++//  if (NS_FAILED(mFt2->LoadGlyph(face, glyph_index, FT_LOAD_DEFAULT)) ||
++          NS_FAILED(mFt2->GetGlyph(face->glyph, &glyph))) {
++      NS_ERROR("error loading glyph");
+       origin_x += face->size->metrics.x_ppem/2 + 2;
+       continue;
+     }
+     origin_x += FT_16_16_TO_REG(glyph->advance.x);
++    mFt2->DoneGlyph(glyph);
+   }
+ 
+   return origin_x;
+@@ -723,11 +726,6 @@
+     if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
+ #endif
+ 
+-  FTC_Image_Cache icache;
+-  mFt2->GetImageCache(&icache);
+-  if (!icache)
+-    return 0;
+-
+   //
+   // Get aa glyphs and blend with background
+   //
+@@ -736,7 +734,6 @@
+   for (i=0; i<aLength; i+=1+extraSurrogateLength) {
+     FT_UInt glyph_index;
+     FT_Glyph glyph;
+-    nsresult rv;
+     FT_BBox glyph_bbox;
+     FT_ULong code_point = aString[i];
+     extraSurrogateLength = 0;
+@@ -750,11 +747,12 @@
+       extraSurrogateLength = 1;
+     }
+ 
++    // XXX : we need some caching here
+     mFt2->GetCharIndex(face, code_point, &glyph_index);
+-    if (glyph_index) {
+-      rv = mFt2->ImageCacheLookup(icache, &mImageDesc, glyph_index, &glyph);
+-    }
+-    if ((glyph_index) && (NS_SUCCEEDED(rv))) {
++    if (glyph_index && 
++        NS_SUCCEEDED(mFt2->LoadGlyph(face, glyph_index, mLoadFlag)) &&
++//      NS_SUCCEEDED(mFt2->LoadGlyph(face, glyph_index, FT_LOAD_DEFAULT)) &&
++        NS_SUCCEEDED(mFt2->GetGlyph(face->glyph, &glyph))) {
+       mFt2->GlyphGetCBox(glyph, ft_glyph_bbox_pixels, &glyph_bbox);
+     }
+     else {
+@@ -775,13 +773,26 @@
+       continue;
+     }
+ 
+-    FT_BitmapGlyph slot = (FT_BitmapGlyph)glyph;
++    FT_BitmapGlyph slot;
++
++    if (glyph->format != FT_GLYPH_FORMAT_BITMAP) 
++    {
++      if (mFt2->GlyphToBitmap(&glyph, FT_RENDER_MODE_NORMAL, 0, 1)) {
++        NS_ERROR("failed to convert outline to bitmap ");
++        XDestroyImage(sub_image);
++        mFt2->DoneGlyph(glyph);
++        return 0;
++      }
++    }
++
++    slot = (FT_BitmapGlyph)glyph;
+     nsAntiAliasedGlyph aaglyph(glyph_bbox.xMax-glyph_bbox.xMin,
+                                glyph_bbox.yMax-glyph_bbox.yMin, 0);
+     PRUint8 buf[IMAGE_BUFFER_SIZE]; // try to use the stack for data
+     if (!aaglyph.WrapFreeType(&glyph_bbox, slot, buf, IMAGE_BUFFER_SIZE)) {
+       NS_ERROR("failed to wrap freetype image");
+       XDestroyImage(sub_image);
++      mFt2->DoneGlyph(glyph);
+       return 0;
+     }
+ 
+@@ -815,6 +826,7 @@
+                   x_pos + aaglyph.GetLBearing(), ascent-glyph_bbox.yMax);
+ 
+     x_pos += aaglyph.GetAdvance();
++    mFt2->DoneGlyph(glyph);
+   }
+ 
+   //
+--- gfx/src/x11shared/nsFontFreeType.h.agriffis        2003-04-22 12:25:13.000000000 -0400
++++ gfx/src/x11shared/nsFontFreeType.h 2004-11-15 13:29:05.125342648 -0500
+@@ -110,8 +110,10 @@
+   XImage *GetXImage(PRUint32 width, PRUint32 height);
+   nsITrueTypeFontCatalogEntry *mFaceID;
+   PRUint16        mPixelSize;
+-  FTC_Image_Desc  mImageDesc;
+   nsCOMPtr<nsIFreeType2> mFt2;
++  FT_Face         mFace;
++  FT_Int32        mLoadFlag;
++  FT_Library      mFreeTypeLibrary;
+ };
+ 
+ void WeightTableInitCorrection(PRUint8*, PRUint8, double);
+--- gfx/src/freetype/nsFreeType.cpp.agriffis   2004-02-07 10:22:30.000000000 -0500
++++ gfx/src/freetype/nsFreeType.cpp    2004-11-15 13:29:05.121343256 -0500
+@@ -109,12 +109,8 @@
+   {"FT_Load_Glyph",           NS_FT2_OFFSET(nsFT_Load_Glyph),           PR_TRUE},
+   {"FT_New_Face",             NS_FT2_OFFSET(nsFT_New_Face),             PR_TRUE},
+   {"FT_Outline_Decompose",    NS_FT2_OFFSET(nsFT_Outline_Decompose),    PR_TRUE},
++  {"FT_Set_Pixel_Sizes",      NS_FT2_OFFSET(nsFT_Set_Pixel_Sizes),      PR_TRUE},
+   {"FT_Set_Charmap",          NS_FT2_OFFSET(nsFT_Set_Charmap),          PR_TRUE},
+-  {"FTC_Image_Cache_Lookup",  NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup),  PR_TRUE},
+-  {"FTC_Manager_Lookup_Size", NS_FT2_OFFSET(nsFTC_Manager_Lookup_Size), PR_TRUE},
+-  {"FTC_Manager_Done",        NS_FT2_OFFSET(nsFTC_Manager_Done),        PR_TRUE},
+-  {"FTC_Manager_New",         NS_FT2_OFFSET(nsFTC_Manager_New),         PR_TRUE},
+-  {"FTC_Image_Cache_New",     NS_FT2_OFFSET(nsFTC_Image_Cache_New),     PR_TRUE},
+ // #ifdef MOZ_SVG
+   {"FT_Glyph_Transform",      NS_FT2_OFFSET(nsFT_Glyph_Transform),      PR_TRUE},
+   {"FT_Get_Kerning",          NS_FT2_OFFSET(nsFT_Get_Kerning),          PR_TRUE},
+@@ -274,59 +270,21 @@
+ } 
+  
+ NS_IMETHODIMP
+-nsFreeType2::SetCharmap(FT_Face face, FT_CharMap  charmap)
+-{ 
+-  // call the FreeType2 function via the function pointer
+-  FT_Error error = nsFT_Set_Charmap(face, charmap);
+-  return error ? NS_ERROR_FAILURE : NS_OK;
+-} 
+- 
+-NS_IMETHODIMP
+-nsFreeType2::ImageCacheLookup(FTC_Image_Cache cache, FTC_Image_Desc *desc,
+-                              FT_UInt glyphID, FT_Glyph *glyph)
+-{ 
+-  // call the FreeType2 function via the function pointer
+-  FT_Error error = nsFTC_Image_Cache_Lookup(cache, desc, glyphID, glyph);
+-  return error ? NS_ERROR_FAILURE : NS_OK;
+-} 
+- 
+-NS_IMETHODIMP
+-nsFreeType2::ManagerLookupSize(FTC_Manager manager, FTC_Font font,
+-                               FT_Face *face, FT_Size *size)
++nsFreeType2::SetPixelSizes(FT_Face face, FT_UInt width, FT_UInt height)
+ { 
+   // call the FreeType2 function via the function pointer
+-  FT_Error error = nsFTC_Manager_Lookup_Size(manager, font, face, size);
++  FT_Error error = nsFT_Set_Pixel_Sizes(face, width, height); 
+   return error ? NS_ERROR_FAILURE : NS_OK;
+ } 
+- 
+-NS_IMETHODIMP
+-nsFreeType2::ManagerDone(FTC_Manager manager)
+-{ 
+-  // call the FreeType2 function via the function pointer
+-  nsFTC_Manager_Done(manager);
+-  return NS_OK;
+-} 
+- 
++
+ NS_IMETHODIMP
+-nsFreeType2::ManagerNew(FT_Library library, FT_UInt max_faces,
+-                        FT_UInt max_sizes, FT_ULong max_bytes,
+-                        FTC_Face_Requester requester, FT_Pointer req_data,
+-                        FTC_Manager *manager)
++nsFreeType2::SetCharmap(FT_Face face, FT_CharMap  charmap)
+ { 
+   // call the FreeType2 function via the function pointer
+-  FT_Error error = nsFTC_Manager_New(library, max_faces, max_sizes, max_bytes,
+-                                     requester, req_data, manager);
++  FT_Error error = nsFT_Set_Charmap(face, charmap);
+   return error ? NS_ERROR_FAILURE : NS_OK;
+ } 
+  
+-NS_IMETHODIMP
+-nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_Image_Cache *cache)
+-{ 
+-  // call the FreeType2 function via the function pointer
+-  FT_Error error = nsFTC_Image_Cache_New(manager, cache);
+-  return error ? NS_ERROR_FAILURE : NS_OK;
+-} 
+-
+ // #ifdef MOZ_SVG
+ NS_IMETHODIMP
+ nsFreeType2::GlyphTransform(FT_Glyph glyph, FT_Matrix * matrix, FT_Vector * delta)
+@@ -389,20 +347,6 @@
+ } 
+  
+ NS_IMETHODIMP
+-nsFreeType2::GetImageCache(FTC_Image_Cache *aCache)
+-{
+-  *aCache = mImageCache;
+-  return NS_OK;
+-}
+-
+-NS_IMETHODIMP
+-nsFreeType2::GetFTCacheManager(FTC_Manager *aManager)
+-{ 
+-  *aManager = mFTCacheManager;
+-  return NS_OK;
+-} 
+- 
+-NS_IMETHODIMP
+ nsFreeType2::GetLibrary(FT_Library *aLibrary)
+ { 
+   *aLibrary = mFreeTypeLibrary;
+@@ -425,8 +369,6 @@
+ {
+   mSharedLib = nsnull;
+   mFreeTypeLibrary = nsnull;
+-  mFTCacheManager  = nsnull;
+-  mImageCache      = nsnull;
+ }
+ 
+ // I would like to make this a static member function but the compilier 
+@@ -456,12 +398,6 @@
+     delete gFreeTypeFaces;
+     gFreeTypeFaces = nsnull;
+   }
+-  // mImageCache released by cache manager
+-  if (mFTCacheManager) {
+-    // use "this->" to make sure it is obivious we are calling the member func
+-    this->ManagerDone(mFTCacheManager);
+-    mFTCacheManager = nsnull;
+-  }
+   if (mFreeTypeLibrary) {
+     // use "this->" to make sure it is obivious we are calling the member func
+     this->DoneFreeType(mFreeTypeLibrary);
+@@ -658,17 +594,6 @@
+     mFreeTypeLibrary = nsnull;
+     goto cleanup_and_return;
+   }
+-  // use "this->" to make sure it is obivious we are calling the member func
+-  rv = this->ManagerNew(mFreeTypeLibrary, 0, 0, 0, nsFreeTypeFaceRequester,
+-                         this, &mFTCacheManager);
+-  NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create FreeType Cache manager");
+-  if (NS_FAILED(rv))
+-    goto cleanup_and_return;
+-  // use "this->" to make sure it is obivious we are calling the member func
+-  rv = this->ImageCacheNew(mFTCacheManager, &mImageCache);
+-  NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create FreeType image cache");
+-  if (NS_FAILED(rv))
+-    goto cleanup_and_return;
+   return PR_TRUE;
+ 
+ cleanup_and_return:
+--- gfx/src/freetype/nsFreeType.h.agriffis     2004-04-16 17:31:42.000000000 -0400
++++ gfx/src/freetype/nsFreeType.h      2004-11-15 13:29:05.122343104 -0500
+@@ -102,15 +102,8 @@
+ typedef FT_Error (*FT_Outline_Decompose_t)
+                       (FT_Outline*, const FT_Outline_Funcs*, void*);
+ typedef FT_Error (*FT_New_Face_t)(FT_Library, const char*, FT_Long, FT_Face*);
++typedef FT_Error (*FT_Set_Pixel_Sizes_t)(FT_Face face, FT_UInt, FT_UInt);
+ typedef FT_Error (*FT_Set_Charmap_t)(FT_Face face, FT_CharMap  charmap);
+-typedef FT_Error (*FTC_Image_Cache_Lookup_t)
+-                      (FTC_Image_Cache, FTC_Image_Desc*, FT_UInt, FT_Glyph*);
+-typedef FT_Error (*FTC_Manager_Lookup_Size_t)
+-                      (FTC_Manager, FTC_Font, FT_Face*, FT_Size*);
+-typedef FT_Error (*FTC_Manager_Done_t)(FTC_Manager);
+-typedef FT_Error (*FTC_Manager_New_t)(FT_Library, FT_UInt, FT_UInt, FT_ULong,
+-                       FTC_Face_Requester, FT_Pointer, FTC_Manager*);
+-typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_Image_Cache*);
+ // #ifdef MOZ_SVG
+ typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
+ typedef FT_Error (*FT_Get_Kerning_t)
+@@ -163,12 +156,8 @@
+   FT_Load_Glyph_t           nsFT_Load_Glyph;
+   FT_New_Face_t             nsFT_New_Face;
+   FT_Outline_Decompose_t    nsFT_Outline_Decompose;
++  FT_Set_Pixel_Sizes_t      nsFT_Set_Pixel_Sizes;
+   FT_Set_Charmap_t          nsFT_Set_Charmap;
+-  FTC_Image_Cache_Lookup_t  nsFTC_Image_Cache_Lookup;
+-  FTC_Manager_Lookup_Size_t nsFTC_Manager_Lookup_Size;
+-  FTC_Manager_Done_t        nsFTC_Manager_Done;
+-  FTC_Manager_New_t         nsFTC_Manager_New;
+-  FTC_Image_Cache_New_t     nsFTC_Image_Cache_New;
+ // #ifdef MOZ_SVG
+   FT_Glyph_Transform_t      nsFT_Glyph_Transform;
+   FT_Get_Kerning_t          nsFT_Get_Kerning;
+@@ -181,9 +170,9 @@
+   // this array needs to be big enough to hold all the function pointers
+   // plus one extra for the null at the end
+ // #ifdef MOZ_SVG
+-  static FtFuncList FtFuncs[24];
++  static FtFuncList FtFuncs[20];
+ // #else
+-//  static FtFuncList FtFuncs[20];
++//  static FtFuncList FtFuncs[17];
+ // #endif
+   
+ protected:
+@@ -212,8 +201,6 @@
+ 
+   PRLibrary      *mSharedLib;
+   FT_Library      mFreeTypeLibrary;
+-  FTC_Manager     mFTCacheManager;
+-  FTC_Image_Cache mImageCache;
+ 
+   static nsHashtable   *sFontFamilies;
+   static nsHashtable   *sRange1CharSetNames;
diff --git a/net-www/mozilla/mozilla-1.7.3-r3.ebuild b/net-www/mozilla/mozilla-1.7.3-r3.ebuild
new file mode 100644 (file)
index 0000000..6c8c760
--- /dev/null
@@ -0,0 +1,332 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla/mozilla-1.7.3-r3.ebuild,v 1.1 2004/11/18 14:04:33 agriffis Exp $
+
+unset ALLOWED_FLAGS  # stupid extra-functions.sh ... bug 49179
+inherit flag-o-matic gcc eutils nsplugins mozilla-launcher mozconfig makeedit
+
+IUSE="java crypt ssl moznomail"
+
+EMVER="0.89.0"
+IPCVER="1.1.1"
+
+# handle _rc versions
+MY_PV=${PV/_alpha/a}   # handle alpha
+MY_PV=${MY_PV/_beta/b} # handle beta
+MY_PV=${MY_PV/_rc/rc}  # handle rc
+
+DESCRIPTION="Mozilla Application Suite - web browser, email, HTML editor, IRC"
+HOMEPAGE="http://www.mozilla.org"
+SRC_URI="http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/${PN}${MY_PV}/src/${PN}-source-${MY_PV}.tar.bz2
+       crypt? ( !moznomail? (
+               http://downloads.mozdev.org/enigmail/src/ipc-${IPCVER}.tar.gz
+               http://downloads.mozdev.org/enigmail/src/enigmail-${EMVER}.tar.gz
+       ) )"
+
+KEYWORDS="~x86 ~ppc ~sparc ~alpha ~amd64 ~ia64"
+SLOT="0"
+LICENSE="MPL-1.1 NPL-1.1"
+
+RDEPEND="java? ( virtual/jre )
+       mozsvg? ( x11-libs/cairo )
+       crypt? ( !moznomail? ( >=app-crypt/gnupg-1.2.1 ) )"
+
+DEPEND="${RDEPEND}
+       java? ( >=dev-java/java-config-0.2.0 )
+       dev-lang/perl"
+
+S="${WORKDIR}/mozilla"
+
+src_unpack() {
+       typeset x
+
+       unpack ${A} || die "unpack failed"
+       cd ${S} || die "cd failed"
+
+       if [[ $(gcc-major-version) -eq 3 ]]; then
+               # ABI Patch for alpha/xpcom for gcc-3.x
+               if [[ ${ARCH} == alpha ]]; then
+                       epatch ${FILESDIR}/${PN}-alpha-xpcom-subs-fix.patch
+               fi
+       fi
+
+       # Fix logic error when using RAW target
+       # <azarah@gentoo.org> (23 Feb 2003)
+       epatch ${FILESDIR}/1.3/${PN}-1.3-fix-RAW-target.patch
+
+       # patch out ft caching code since the API changed between releases of
+       # freetype; this enables freetype-2.1.8+ compat.
+       # https://bugzilla.mozilla.org/show_bug.cgi?id=234035#c65
+       epatch ${FILESDIR}/mozilla-1.7.3-4ft2.patch
+
+       WANT_AUTOCONF=2.1 autoconf || die "WANT_AUTOCONF failed"
+
+       # Unpack the enigmail plugin
+       if use crypt && ! use moznomail; then
+               for x in ipc enigmail; do
+                       mv ${WORKDIR}/${x} ${S}/extensions || die "mv failed"
+                       cd ${S}/extensions/${x} || die "cd failed"
+                       makemake        # from mozilla.eclass
+               done
+       fi
+}
+
+src_compile() {
+       ####################################
+       #
+       # mozconfig, CFLAGS and CXXFLAGS setup
+       #
+       ####################################
+
+       mozconfig_init
+
+       # Bug 60668: Galeon doesn't build without oji enabled, so enable it
+       # regardless of java setting.
+       mozconfig_annotate '' --enable-oji --enable-mathml
+
+       # Other moz-specific settings
+       mozconfig_use_enable mozdevelop jsd
+       mozconfig_use_enable mozdevelop xpctools
+       mozconfig_use_extension mozdevelop venkman
+       mozconfig_use_enable gnome gnomevfs
+       mozconfig_use_extension gnome gnomevfs
+       mozconfig_use_extension !moznoirc irc
+       mozconfig_use_extension mozxmlterm xmlterm
+       mozconfig_use_enable mozcalendar calendar
+       mozconfig_use_enable ldap
+       mozconfig_use_enable ldap ldap-experimental
+       mozconfig_use_enable mozsvg svg
+       mozconfig_use_enable mozsvg svg-renderer-cairo
+       mozconfig_annotate '' --prefix=/usr/lib/mozilla
+       mozconfig_annotate '' --with-default-mozilla-five-home=/usr/lib/mozilla
+
+       if use moznomail && ! use mozcalendar; then
+               mozconfig_annotate "+moznomail -mozcalendar" --disable-mailnews
+       fi
+       if use moznocompose && use moznomail; then
+               mozconfig_annotate "+moznocompose +moznomail" --disable-composer
+       fi
+
+       # Finalize and report settings
+       mozconfig_final
+
+       ####################################
+       #
+       #  Configure and build Mozilla
+       #
+       ####################################
+
+       # ./configure picks up the mozconfig stuff
+       ./configure || die "configure failed"
+
+       # This removes extraneous CFLAGS from the Makefiles to reduce RAM
+       # requirements while compiling
+       edit_makefiles
+
+       emake || die "emake failed"
+
+       ####################################
+       #
+       #  Build Mozilla NSS
+       #
+       ####################################
+
+       # Build the NSS/SSL support
+       if use ssl; then
+               einfo "Building Mozilla NSS..."
+
+               # Fix #include problem
+               cd ${S}/security/coreconf || die "cd coreconf failed"
+               echo 'INCLUDES += -I$(DIST)/include/nspr -I$(DIST)/include/dbm'\
+                       >>headers.mk
+               emake -j1 || die "make security headers failed"
+
+               cd ${S}/security/nss || die "cd nss failed"
+               emake -j1 moz_import || die "make moz_import failed"
+               emake -j1 || die "make nss failed"
+       fi
+
+       ####################################
+       #
+       #  Build Enigmail plugin
+       #
+       ####################################
+
+       # Build the enigmail plugin
+       if use crypt && ! use moznomail; then
+               einfo "Building Enigmail plugin..."
+               cd ${S}/extensions/ipc || die "cd ipc failed"
+               emake || die "make ipc failed"
+
+               cd ${S}/extensions/enigmail || die "cd enigmail failed"
+               emake || die "make enigmail failed"
+       fi
+}
+
+src_install() {
+       # Install, don't create tarball
+       dodir /usr/lib
+       cd ${S}/xpinstall/packager
+       einfo "Installing mozilla into build root..."
+       make MOZ_PKG_FORMAT="RAW" TAR_CREATE_FLAGS="-chf" > /dev/null || die "make failed"
+       mv -f ${S}/dist/mozilla ${D}/usr/lib/mozilla
+
+       einfo "Installing includes and idl files..."
+       # Copy the include and idl files
+       dodir /usr/lib/mozilla/include/idl /usr/include
+       cd ${S}/dist
+       cp -LfR include/* ${D}/usr/lib/mozilla/include
+       cp -LfR idl/* ${D}/usr/lib/mozilla/include/idl
+       dosym /usr/lib/mozilla/include /usr/include/mozilla
+
+       # Install the development tools in /usr
+       dodir /usr/bin
+       mv ${D}/usr/lib/mozilla/{xpcshell,xpidl,xpt_dump,xpt_link} ${D}/usr/bin
+
+       # Install the NSS/SSL libs, headers and tools
+       if use ssl; then
+               einfo "Installing Mozilla NSS..."
+               # Install the headers ('make install' do not work for headers ...)
+               insinto /usr/lib/mozilla/include/nss
+               [ -d ${S}/dist/public/nss ] && doins ${S}/dist/public/nss/*.h
+               [ -d ${S}/dist/public/seccmd ] && doins ${S}/dist/public/seccmd/*.h
+               [ -d ${S}/dist/public/security ] && doins ${S}/dist/public/security/*.h
+               # These come with zlib ...
+               rm -f ${D}/usr/lib/mozilla/include/nss/{zconf.h,zlib.h}
+
+               cd ${S}/security/nss
+
+               mkdir -p ${WORKDIR}/nss/{bin,lib}
+               export SOURCE_BIN_DIR=${WORKDIR}/nss/bin
+               export SOURCE_LIB_DIR=${WORKDIR}/nss/lib
+
+               make install || die "make failed"
+               # Gets installed as symbolic links ...
+               cp -Lf ${WORKDIR}/nss/bin/* ${D}/usr/bin
+               cp -Lf ${WORKDIR}/nss/lib/* ${D}/usr/lib/mozilla
+
+               # Need to unset these incase we want to rebuild, else the build
+               # gets newked.
+               unset SOURCE_LIB_DIR
+               unset SOURCE_BIN_DIR
+       fi
+
+       cd ${S}/build/unix
+       # Fix mozilla-config and install it
+       perl -pi -e "s:/lib/mozilla-${MY_PV}::g" mozilla-config
+       perl -pi -e "s:/mozilla-${MY_PV}::g" mozilla-config
+       exeinto /usr/lib/mozilla
+       doexe mozilla-config
+       # Fix pkgconfig files and install them
+       insinto /usr/lib/pkgconfig
+       for x in *.pc; do
+               if [[ -f ${x} ]]; then
+                       perl -pi -e "s:/lib/mozilla-${MY_PV}::g" ${x}
+                       perl -pi -e "s:/mozilla-${MY_PV}::g" ${x}
+                       doins ${x}
+               fi
+       done
+       cd ${S}
+
+       dodir /usr/bin
+       dosym /usr/libexec/mozilla-launcher /usr/bin/mozilla
+       insinto /etc/env.d
+       doins ${FILESDIR}/10mozilla
+       dodoc LEGAL LICENSE README/mozilla/README*
+
+       # Install rebuild script
+       exeinto /usr/lib/mozilla/
+       doexe ${FILESDIR}/mozilla-rebuild-databases.pl
+
+       # Move plugins dir
+       src_mv_plugins /usr/lib/mozilla/plugins
+
+       # Update Google search plugin to use UTF8 charset ...
+       insinto /usr/lib/mozilla/searchplugins
+       doins ${FILESDIR}/google.src
+
+       if [[ -f "${WORKDIR}/.xft" ]]; then
+               # We are using Xft, so change the default font
+               insinto /usr/lib/mozilla/defaults/pref
+               doins ${FILESDIR}/xft.js
+       fi
+
+       # Fix icons to look the same everywhere
+       insinto /usr/lib/mozilla/icons
+       doins ${S}/widget/src/gtk/mozicon16.xpm
+       doins ${S}/widget/src/gtk/mozicon50.xpm
+
+       # Install icon and .desktop for menu entry
+       insinto /usr/share/pixmaps
+       doins ${FILESDIR}/icon/mozilla-icon.png
+       insinto /usr/share/applications
+       doins ${FILESDIR}/icon/mozilla.desktop
+
+       # Take care of non root execution
+       # (seems the problem is that not all files are readible by the user)
+       einfo "Fixing Permissions..."
+       chmod -R g+r,o+r ${D}/usr/lib/mozilla
+       find ${D}/usr/lib/mozilla/ -type d -exec chmod 0755 {} \; || :
+}
+
+pkg_preinst() {
+       # Move old plugins dir
+       pkg_mv_plugins /usr/lib/mozilla/plugins
+
+       if true; then
+               # Remove entire installed instance to solve various problems,
+               # for example see bug 27719
+               rm -rf ${ROOT}/usr/lib/mozilla
+       else
+               # Stale components and chrome files break when unmerging old
+               rm -rf ${ROOT}/usr/lib/mozilla/components
+               rm -rf ${ROOT}/usr/lib/mozilla/chrome
+
+               # Remove stale component registry.
+               rm -f ${ROOT}/usr/lib/mozilla/component.reg
+               rm -f ${ROOT}/usr/lib/mozilla/components/compreg.dat
+
+               # Make sure these are removed.
+               rm -f ${ROOT}/usr/lib/mozilla/lib{Xft,Xrender}.so*
+       fi
+}
+
+pkg_postinst() {
+       export MOZILLA_FIVE_HOME="${ROOT}/usr/lib/mozilla"
+
+       # Needed to update the run time bindings for REGXPCOM
+       # (do not remove next line!)
+       env-update
+
+       # Register Components and Chrome
+       einfo "Registering Components and Chrome..."
+       ${MOZILLA_FIVE_HOME}/mozilla-rebuild-databases.pl
+
+       # Fix permissions of component registry
+       chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat
+
+       # Fix directory permissions
+       find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \;
+
+       # Fix permissions on chrome files
+       find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \;
+
+       update_mozilla_launcher_symlinks
+}
+
+pkg_postrm() {
+       # Regenerate component.reg in case some things changed
+       if [[ -e ${ROOT}/usr/lib/mozilla/regxpcom ]]; then
+               export MOZILLA_FIVE_HOME="${ROOT}/usr/lib/mozilla"
+
+               if [[ -x ${MOZILLA_FIVE_HOME}/mozilla-rebuild-databases.pl ]]; then
+                       ${MOZILLA_FIVE_HOME}/mozilla-rebuild-databases.pl
+                       # Fix directory permissions
+                       find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 755 {} \;
+                       # Fix permissions on chrome files
+                       find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \;
+               fi
+       fi
+
+       update_mozilla_launcher_symlinks
+}