Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-19.03 59 lines 1.6 kB view raw
1{ lib, mkDerivation, perl }: 2 3let inherit (lib) licenses maintainers platforms; in 4 5{ self, srcs, patches }: 6 7args: 8 9let 10 inherit (args) name; 11 version = args.version or srcs."${name}".version; 12 src = args.src or srcs."${name}".src; 13in 14 15mkDerivation (args // { 16 name = "${name}-${version}"; 17 inherit src; 18 patches = args.patches or patches."${name}" or []; 19 20 nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake ]; 21 propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []); 22 23 outputs = args.outputs or [ "out" "dev" ]; 24 setOutputFlags = args.setOutputFlags or false; 25 26 preHook = '' 27 . ${./hooks/move-qt-dev-tools.sh} 28 . ${./hooks/fix-qt-builtin-paths.sh} 29 ''; 30 31 preConfigure = '' 32 ${args.preConfigure or ""} 33 34 fixQtBuiltinPaths . '*.pr?' 35 ''; 36 37 postFixup = '' 38 if [ -d "''${!outputDev}/lib/pkgconfig" ]; then 39 find "''${!outputDev}/lib/pkgconfig" -name '*.pc' | while read pc; do 40 sed -i "$pc" \ 41 -e "/^prefix=/ c prefix=''${!outputLib}" \ 42 -e "/^exec_prefix=/ c exec_prefix=''${!outputBin}" \ 43 -e "/^includedir=/ c includedir=''${!outputDev}/include" 44 done 45 fi 46 47 moveQtDevTools 48 49 ${args.postFixup or ""} 50 ''; 51 52 meta = { 53 homepage = http://www.qt.io; 54 description = "A cross-platform application framework for C++"; 55 license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ]; 56 maintainers = with maintainers; [ qknight ttuegel periklis bkchr ]; 57 platforms = platforms.unix; 58 } // (args.meta or {}); 59})