1{ lib
2, substituteAll
3, mkDerivation
4, fetchFromGitLab
5, mobile-broadband-provider-info
6, qmake
7, qtbase
8, qtdeclarative
9}:
10
11mkDerivation rec {
12 pname = "libqofono";
13 version = "0.103";
14
15 src = fetchFromGitLab {
16 domain = "git.sailfishos.org";
17 owner = "mer-core";
18 repo = "libqofono";
19 rev = version;
20 sha256 = "1ly5aj412ljcjvhqyry6nhiglbzzhczsy1a6w4i4fja60b2m1z45";
21 };
22
23 patches = [
24 (substituteAll {
25 src = ./0001-NixOS-provide-mobile-broadband-provider-info-path.patch;
26 inherit mobile-broadband-provider-info;
27 })
28 ./0001-NixOS-Skip-tests-they-re-shock-full-of-hardcoded-FHS.patch
29 ];
30
31 # Replaces paths from the Qt store path to this library's store path.
32 postPatch = ''
33 substituteInPlace src/src.pro \
34 --replace /usr $out \
35 --replace '$$[QT_INSTALL_PREFIX]' "$out" \
36 --replace 'target.path = $$[QT_INSTALL_LIBS]' "target.path = $out/lib"
37
38 substituteInPlace plugin/plugin.pro \
39 --replace '$$[QT_INSTALL_QML]' $out'/${qtbase.qtQmlPrefix}'
40 '';
41
42 nativeBuildInputs = [
43 qmake
44 ];
45
46 buildInputs = [
47 qtbase
48 qtdeclarative
49 ];
50
51 meta = with lib; {
52 description = "Library for accessing the ofono daemon, and declarative plugin for it";
53 homepage = "https://git.sailfishos.org/mer-core/libqofono/";
54 license = licenses.lgpl21Plus;
55 maintainers = with maintainers; [ samueldr ];
56 platforms = platforms.linux;
57 };
58}