nixpkgs/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix
Thomas Tuegel e40579d91e qt54: set runtime env vars during build for makeWrapper
Set QT_PLUGIN_PATH, QML_IMPORT_PATH, and QML2_IMPORT_PATH during build
so that Qt programs may easily be wrapped for use outside NixOS. The
paths are set appropriately for the dependencies of the package.
2015-08-23 10:16:21 -05:00

54 lines
1.3 KiB
Nix

{ stdenv, mkDerivation
, srcs, version
, lndir
, base
}:
with stdenv.lib;
args:
mkDerivation (args // {
name = "${args.name}-${version}";
inherit version;
srcs = args.srcs or [srcs."${args.name}-opensource-src"];
qtSubmodule = args.qtSubmodule or true;
dontAddPrefix = args.dontAddPrefix or true;
dontFixLibtool = args.dontFixLibtool or true;
configureScript = args.configureScript or "qmake";
postInstall = ''
rm "$out/bin/qmake" "$out/bin/qt.conf"
cat "$out/nix-support/qt-inputs" | while read file; do
if [[ -h "$out/$file" ]]; then
rm "$out/$file"
fi
done
cat "$out/nix-support/qt-inputs" | while read file; do
if [[ -d "$out/$file" ]]; then
rmdir --ignore-fail-on-non-empty -p "$out/$file"
fi
done
rm "$out/nix-support/qt-inputs"
'';
propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
enableParallelBuilding =
args.enableParallelBuilding or true; # often fails on Hydra, as well as qt4
meta = args.meta or {
homepage = http://qt-project.org;
description = "A cross-platform application framework for C++";
license = "GPL/LGPL";
maintainers = with maintainers; [ bbenoist qknight ttuegel ];
platforms = platforms.linux;
};
})