summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/firefox-2/builder.sh
blob: 4fa7fbb84ab5f4b6c928a39a6b5f50b3e1a6991f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
source $stdenv/setup

postInstall=postInstall
postInstall() {

    # Strip some more stuff
    strip -S $out/lib/*/* || true

    # Fix some references to /bin paths in the Firefox shell script.
    substituteInPlace $out/bin/firefox \
        --replace /bin/pwd "$(type -tP pwd)" \
        --replace /bin/ls "$(type -tP ls)"
    
    # This fixes starting Firefox when there already is a running
    # instance.  The `firefox' wrapper script actually expects to be
    # in the same directory as `run-mozilla.sh', apparently.
    libDir=$(cd $out/lib && ls -d firefox-*)
    test -n "$libDir"
    cd $out/bin
    mv firefox ../lib/$libDir/
    ln -s ../lib/$libDir/firefox .

    # Register extensions etc.
    echo "running firefox -register..."
    (cd $out/lib/$libDir && LD_LIBRARY_PATH=. ./firefox-bin -register) || false

    echo "running regxpcom..."
    (cd $out/lib/$libDir && LD_LIBRARY_PATH=. ./regxpcom) || false

    # Put the Firefox icon in the right place.
    ensureDir $out/lib/$libDir/chrome/icons/default
    ln -s ../../../icons/default.xpm  $out/lib/$libDir/chrome/icons/default/
    
}

genericBuild