Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 stdenv, 3 lib, 4 fetchurl, 5 cmake, 6 libGLU, 7 libGL, 8 pkg-config, 9 libpulseaudio, 10 extra-cmake-modules, 11 qtbase, 12 qttools, 13 debug ? false, 14}: 15 16let 17 soname = "phonon4qt5"; 18 buildsystemdir = "share/cmake/${soname}"; 19in 20 21stdenv.mkDerivation rec { 22 pname = "phonon"; 23 version = "4.11.1"; 24 25 meta = { 26 homepage = "https://community.kde.org/Phonon"; 27 description = "Multimedia API for Qt"; 28 mainProgram = "phononsettings"; 29 license = lib.licenses.lgpl2; 30 platforms = lib.platforms.unix; 31 maintainers = with lib.maintainers; [ ttuegel ]; 32 }; 33 34 src = fetchurl { 35 url = "mirror://kde/stable/phonon/${version}/phonon-${version}.tar.xz"; 36 sha256 = "0bfy8iqmjhlg3ma3iqd3kxjc2zkzpjgashbpf5x17y0dc2i1whxl"; 37 }; 38 39 buildInputs = [ 40 libGLU 41 libGL 42 libpulseaudio 43 qtbase 44 qttools 45 ]; 46 47 nativeBuildInputs = [ 48 cmake 49 pkg-config 50 extra-cmake-modules 51 ]; 52 53 outputs = [ 54 "out" 55 "dev" 56 ]; 57 58 env.NIX_CFLAGS_COMPILE = toString ( 59 [ 60 "-fPIC" 61 ] 62 ++ lib.optionals stdenv.cc.isClang [ 63 "-Wno-error=enum-constexpr-conversion" 64 ] 65 ); 66 67 cmakeBuildType = if debug then "Debug" else "Release"; 68 69 dontWrapQtApps = true; 70 71 preConfigure = '' 72 appendToVar cmakeFlags "-DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs" 73 appendToVar cmakeFlags "-DPHONON_QT_IMPORTS_INSTALL_DIR=''${!outputBin}/$qtQmlPrefix" 74 appendToVar cmakeFlags "-DPHONON_QT_PLUGIN_INSTALL_DIR=''${!outputBin}/$qtPluginPrefix/designer" 75 ''; 76 77 postPatch = '' 78 sed -i PhononConfig.cmake.in \ 79 -e "/get_filename_component(rootDir/ s/^.*$//" \ 80 -e "/^set(PHONON_INCLUDE_DIR/ s|\''${rootDir}/||" \ 81 -e "/^set(PHONON_LIBRARY_DIR/ s|\''${rootDir}/||" \ 82 -e "/^set(PHONON_BUILDSYSTEM_DIR/ s|\''${rootDir}|''${!outputDev}|" 83 84 sed -i cmake/FindPhononInternal.cmake \ 85 -e "/set(INCLUDE_INSTALL_DIR/ c set(INCLUDE_INSTALL_DIR \"''${!outputDev}/include\")" 86 87 sed -i cmake/FindPhononInternal.cmake \ 88 -e "/set(PLUGIN_INSTALL_DIR/ c set(PLUGIN_INSTALL_DIR \"$qtPluginPrefix/..\")" 89 90 sed -i CMakeLists.txt \ 91 -e "/set(BUILDSYSTEM_INSTALL_DIR/ c set(BUILDSYSTEM_INSTALL_DIR \"''${!outputDev}/${buildsystemdir}\")" 92 ''; 93 94 postFixup = '' 95 sed -i "''${!outputDev}/lib/pkgconfig/${soname}.pc" \ 96 -e "/^exec_prefix=/ c exec_prefix=''${!outputBin}/bin" 97 ''; 98}