summary refs log tree commit diff
path: root/pkgs/development/libraries/webkit/default.nix
blob: ef4d259cb029900fa2fa45e2e9714ab82f2457e7 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
args : with args; 
let 
  s = import ./src-for-default.nix; # 1.8.3 needs newer gtk3, wait for x-updates
  version = lib.attrByPath ["version"] s.version args;
in
rec {
  src = fetchurl {
    url = s.url;
    sha256 = s.hash;
  };

  buildInputs = with xlibs; [
    pkgconfig libtool intltool autoconf automake gperf bison flex
    gtk3 gtk2 glib atk cairo pango fontconfig freetype libsoup gtkdoc
    libjpeg libpng libtiff libxml2 libxslt sqlite icu curl
    which libproxy geoclue enchant python ruby perl
    mesa libXt libXrender renderproto libXcomposite compositeproto
    libXdamage damageproto kbproto
    ];

  propagatedBuildInputs = [
    gstreamer gst_plugins_base gst_ffmpeg gst_plugins_good
    ];

  configureFlags = [
    # "--enable-3D-transforms" # no longer recognized
    "--enable-web-sockets"
    "--enable-web-timing"

    # https://bugs.webkit.org/show_bug.cgi?id=55294
    "--enable-image-resizer"

    "--enable-geolocation"

    # Not implemented?
    # "--enable-web-audio"

    "--enable-mathml"

    #"--enable-wml"

    # https://bugs.webkit.org/show_bug.cgi?id=45110
    #"--enable-indexed-database"

    # Doesn't work in release...
    #"--enable-xhtmlmp"

    # "--enable-input-speech"

    #"--enable-file-writer" # no longer recognized
    "--enable-blob"

    # https://bugs.webkit.org/show_bug.cgi?id=59430
    # "--enable-directory-upload"

    # https://bugs.webkit.org/show_bug.cgi?id=58443
    # "--enable-file-system"

    "--enable-dependency-tracking" # to fix parallel building
    ];

  # instead of enableParallelBuilding = true;
  makeFlags = "-j$NIX_BUILD_CORES";

  /* doConfigure should be specified separately */
  phaseNames = ["doPatch" "fixConfigure" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
    "doReplaceUsrBin" "doMakeInstall" "doAddPrograms"];

  patches = [ ./bison26.patch ]; # http://trac.webkit.org/changeset/124099
  patchFlags = "-p2";

  #doCheck = true; # tests still have problems

  doReplaceUsrBin = fullDepEntry (''
    for i in $(find . -name '*.pl') $(find . -name '*.pm'); do 
        sed -e 's@/usr/bin/gcc@gcc@' -i $i
    done
  '') ["minInit" "doUnpack"];

  doAddPrograms = fullDepEntry (''
    mkdir -p $out/bin
    for i in Programs/.libs/* Programs/*; do 
        cp $i $out/bin/webkit-program-$(basename $i) || true
    done
  '') ["minInit" "doMake" "defEnsureDir"];
      
  paranoidFixComments = fullDepEntry (''
    sed -re 's@( |^)//.*@/* & */@' -i $(find . -name '*.c' -o -name '*.h')
  '') ["minInit" "doUnpack"];

  # See http://archive.linuxfromscratch.org/mail-archives/blfs-dev/2012-April/022893.html
  fixConfigure = fullDepEntry (''
    sed   -i -e 's/=GSTREAMER_0_10_REQUIRED_VERSION/=\$GSTREAMER_0_10_REQUIRED_VERSION/' \
      -e 's/=GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION/=\$GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION/' \
      configure{,.ac}
  '') ["minInit" "doUnpack"];

  name = s.name;
  meta = {
    description = "WebKit - a fast and correct HTML renderer";
    maintainers = [stdenv.lib.maintainers.raskin];
  };
  passthru = {
    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg libsoup;
  };
}