skreutzer.de

/skreutzer.de/allerlei/: How to build and install GNU IceCat 14.0 with GNU Gnash 0.8.10 as plugin for gNewSense 2.3

How to build and install GNU IceCat 14.0 with GNU Gnash 0.8.10 as plugin for gNewSense 2.3

Preface

It is well known that the 100% free software gNewSense GNU operating system distribution with Linux kernel (free alternative to Ubuntu) doesn't come with the GNU IceCat browser (free alternative to Mozilla Firefox) in its recent version 2.3. Furthermore, there is no standard and easy way to play Adobe Flash files served via the web. Despite the fact that Adobe Flash is a proprietary format and is widely spread because of the Adobe Flash Player plugin for various browsers, the GNU Gnash project has made progress in implementing a free alternative to do at least *some* Flash as standalone player application and GNU IceCat plugin. Both the richer features of GNU IceCat (in comparison to the gNewSense default browser Epiphany) and the basic support of Flash within the browser itself are reasons to build and install those components as long as they're not incorporated in future gNewSense releases. All instructions refer to a plain and fresh gNewSense installation, which should grant the reproducibility as long as the hardware meets the minimum requirements for each step and finally the program run.

Prerequisites

To avoid the need to resolve a lot of dependencies manually, a general patch update should be made by

GNU IceCat 14.0

The next step is to obtain the GNU IceCat source code files. Download the package icecat-14.0.tar.gz from the GNUzilla project. Simply decompress the package with

In order to get ./configure of IceCat statisfied, further dependencies have to be resolved:

Only one dependency is still left – the Yasm Modular assembler. It can't get resolved by apt-get install yasm because the version in the repository is 0.5.0 where the IceCat build system requires at least 1.0.1. So download yasm-1.2.0.tar.gz from the Yasm project page and compile/install it by

The last issue which must be adressed is related to gNewSense's GCC version 4.2.4 and the current form of IceCat 14.0's source code. The linking would abort with the error message


            libxul.so: hidden symbol `int SortedArrayOf<RangeRecord>::search<unsigned int>(unsigned int const&) const' isn't defined
          

for which a bug has been filed on Mozilla's bug tracker system with the number 771222. From there, a hint from Oleg Romashin in the initial bug description leads to the patch set 86802:392319d8c1fa, where the removal of


            #if __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
            // work around GCC 4.3 bug where the search() function gets improperly
            // optimized away from some instantiations of this template
            #pragma GCC visibility push(default)
            #endif
          

...


            #if __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
            #pragma GCC visibility pop
            #endif
          

probably rendered the code linkable for some newer GCC versions, but unlinkable for the version that comes with gNewSense 2.3. To solve the problem, one has to edit the file $/gfx/harfbuzz/src/hb-open-type-private.hh at line 693 and place the #pragmas around the SortedArrayOf template declaration like this:


            #if __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
            // work around GCC 4.3 bug where the search() function gets improperly
            // optimized away from some instantiations of this template
            #pragma GCC visibility push(default)
            #endif
            
            /* An array with sorted elements.  Supports binary searching. */
            template <typename Type>
            struct SortedArrayOf : ArrayOf<Type> {
            
              template <typename SearchType>
              inline int search (const SearchType &x) const {
                struct Cmp {
                  static int cmp (const SearchType *a, const Type *b) { return b->cmp (*a); }
                };
                const Type *p = (const Type *) bsearch (&x, this->array, this->len, sizeof (this->array[0]), (hb_compare_func_t) Cmp::cmp);
                return p ? p - this->array : -1;
              }
            };
            
            #if __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
            #pragma GCC visibility pop
            #endif
          

After having all preparations in place, IceCat should finally compile/install successfully:

IceCat should now come up when invoked by icecat & on the terminal.

GNU Gnash 0.8.10

Download the source code package gnash-0.8.10.tar.gz from the Gnash project, then

Now statisfy some dependencies by

After this preparations, it should compile/install by

Conclusion

Not alone is IceCat very useful at least for its HTML5 support, it is even capable of playing Flash wherever Gnash provides a free way of doing so. In case there are problems with this approach or there are questions about details of the procedure, feel free to contact me.


/skreutzer.de/allerlei/: How to build and install GNU IceCat 14.0 with GNU Gnash 0.8.10 as plugin for gNewSense 2.3