[Nix-dev] nix expression for qt5

Jos van den Oever jos at vandenoever.info
Fri Dec 21 13:37:24 CET 2012


Qt5 was released a few days ago. I thought it would be a good idea to add it 
to NixPkgs.

Here is the nix expressions that compiles all of the libraries as well as all 
the examples. I've tried to enable all of the options.

An interesting observation is that 
  export MAKEFLAGS=-j$NIX_BUILD_CORES
makes configuration a lot faster too, especially on a machine with 8 cores.

Cheers,
Jos
-------------- next part --------------
{ stdenv, fetchurl, substituteAll,
  python, perl, ruby, flex, bison, gperf, gdb,
  xlibs, libX11, libxcb, libXext, mesa, libXrender,
  fontconfig, freetype, icu, 
  openssl, cups, dbus, glib, udev, libxml2, libxslt, pcre,
  zlib, libjpeg, libpng, libtiff, libwebp,
  sqlite, mysql, postgresql,
  alsaLib, gstreamer, gst_plugins_base, pulseaudio,
  pkgconfig,
  buildExamples ? true, buildTests ? true
}: 

let
  v = "5.0.0";
in

stdenv.mkDerivation {
  name = "qt-${v}";

  src = fetchurl {
    url = http://releases.qt-project.org/qt5/5.0.0/single/qt-everywhere-opensource-src-5.0.0.tar.gz;
    sha256 = "8a4d7c14c8a80c7aa2899cc285f432bbf4017fcfbaa315e5504525dfdb4a33f6";
  };

  enableParallelBuilding = true;

  prefixKey = "-prefix ";

  # configure is much faster with MAKEFLAGS set
  preConfigure =
    ''
      export MAKEFLAGS=-j$NIX_BUILD_CORES
    '';

  configureFlags =
    ''
      -release -confirm-license -opensource
      -c++11 -shared -process -no-fast -largefile -accessibility
      -qt-sql-sqlite -system-sqlite
      -plugin-sql-mysql -plugin-sql-psql
      -javascript-jit -qml-debug
      -pkg-config -force-pkg-config
      -system-zlib -system-libpng -system-libjpeg -openssl-linked -system-pcre
      -make libs -make tools
      ${if buildExamples == true then "-make examples" else "-nomake examples"}
      ${if buildTests == true then "-make tests" else "-nomake tests"}
      -gui -widgets -rpath
      -continue -verbose -optimized-qmake
      -nis -cups -iconv -icu
      -strip -pch
      -dbus-linked
      -reduce-relocations -no-separate-debug-info
      -qt-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms -qpa xcb
      -opengl
      -system-proxies
      -glib
    '';

  buildInputs = [ 
    python perl ruby flex bison gperf gdb
  ];

  propagatedBuildInputs = [
    xlibs.libXcomposite libX11 libxcb libXext mesa libXrender
    fontconfig freetype icu 
    openssl cups dbus glib udev libxml2 libxslt pcre
    zlib libjpeg libpng libtiff libwebp
    sqlite mysql postgresql
    alsaLib gstreamer gst_plugins_base pulseaudio
    pkgconfig
  ];

  meta = with stdenv.lib; {
    homepage = http://qt-project.org;
    description = "A cross-platform application framework for C++";
    license = "GPL/LGPL";
    maintainers = with maintainers; [ urkud sander ];
    platforms = platforms.linux;
  };
}


More information about the nix-dev mailing list