nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitLab,
5 gitUpdater,
6 makeFontsConf,
7 testers,
8 cmake,
9 cmake-extras,
10 dbus,
11 doxygen,
12 glib,
13 graphviz,
14 gtest,
15 libqtdbustest,
16 pkg-config,
17 python3,
18 qtbase,
19 qtdeclarative,
20}:
21
22stdenv.mkDerivation (finalAttrs: {
23 pname = "lomiri-api";
24 version = "0.2.2";
25
26 src = fetchFromGitLab {
27 owner = "ubports";
28 repo = "development/core/lomiri-api";
29 tag = finalAttrs.version;
30 hash = "sha256-+ttmtvt18NMKYfGntEXgBOSJ3lW9Bf55327XYIzxMh8=";
31 };
32
33 outputs = [
34 "out"
35 "dev"
36 "doc"
37 ];
38
39 postPatch = ''
40 patchShebangs $(find test -name '*.py')
41
42 substituteInPlace data/liblomiri-api.pc.in \
43 --replace "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" '@CMAKE_INSTALL_FULL_LIBDIR@'
44
45 # Variable is queried via pkg-config by reverse dependencies
46 # TODO This is likely not supposed to be the regular Qt QML import prefix
47 # but otherwise i.e. lomiri-notifications cannot be found in lomiri
48 substituteInPlace CMakeLists.txt \
49 --replace 'SHELL_PLUGINDIR ''${CMAKE_INSTALL_LIBDIR}/lomiri/qml' 'SHELL_PLUGINDIR ${qtbase.qtQmlPrefix}'
50 '';
51
52 strictDeps = true;
53
54 nativeBuildInputs = [
55 cmake
56 doxygen
57 graphviz
58 pkg-config
59 qtdeclarative
60 ];
61
62 buildInputs = [
63 cmake-extras
64 glib
65 gtest
66 libqtdbustest
67 qtbase
68 qtdeclarative
69 ];
70
71 nativeCheckInputs = [
72 dbus
73 python3
74 ];
75
76 dontWrapQtApps = true;
77
78 env.FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
79
80 preBuild = ''
81 # Makes fontconfig produce less noise in logs
82 export HOME=$TMPDIR
83 '';
84
85 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
86
87 preCheck = ''
88 # needs minimal plugin and QtTest QML
89 export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
90 export QML2_IMPORT_PATH=${lib.getBin qtdeclarative}/${qtbase.qtQmlPrefix}
91 '';
92
93 passthru = {
94 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
95 updateScript = gitUpdater { };
96 };
97
98 meta = {
99 description = "Lomiri API Library for integrating with the Lomiri shell";
100 homepage = "https://gitlab.com/ubports/development/core/lomiri-api";
101 license = with lib.licenses; [
102 lgpl3Only
103 gpl3Only
104 ];
105 teams = [ lib.teams.lomiri ];
106 platforms = lib.platforms.linux;
107 pkgConfigModules = [
108 "liblomiri-api"
109 "lomiri-shell-api"
110 "lomiri-shell-application"
111 "lomiri-shell-launcher"
112 "lomiri-shell-notifications"
113 ];
114 };
115})