1{ lib
2, fetchFromGitLab
3, buildPythonApplication
4, autoreconfHook
5, debian
6, perl
7, vala
8, pkg-config
9, libgee
10, json-glib
11, properties-cpp
12, gobject-introspection
13, getopt
14, setuptools
15, pygobject3
16, wrapGAppsHook
17}:
18
19buildPythonApplication {
20 pname = "click";
21 version = "unstable-2023-02-22";
22 format = "other";
23
24 src = fetchFromGitLab {
25 owner = "ubports";
26 repo = "development/core/click";
27 rev = "aaf2735e8e6cbeaf2e429c70136733513a81718a";
28 sha256 = "sha256-pNu995/w3tbz15QQVdVYBnWnAoZmqWj1DN/5PZZ0iZw=";
29 };
30
31 postPatch = ''
32 # These should be proper Requires, using the header needs their headers
33 substituteInPlace lib/click/click-*.pc.in \
34 --replace 'Requires.private' 'Requires'
35 '';
36
37 configureFlags = [
38 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
39 "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user"
40 ];
41
42 preFixup = ''
43 makeWrapperArgs+=(
44 --prefix LD_LIBRARY_PATH : "$out/lib"
45 )
46 '';
47
48 preConfigure = ''
49 export click_cv_perl_vendorlib=$out/${perl.libPrefix}
50 export PYTHON_INSTALL_FLAGS="--prefix=$out"
51 '';
52
53 nativeBuildInputs = [
54 autoreconfHook
55 perl
56 pkg-config
57 gobject-introspection
58 vala
59 getopt
60 wrapGAppsHook
61 ];
62
63 # Tests were omitted for time constraint reasons
64 doCheck = false;
65
66 enableParallelBuilding = true;
67
68 patches = [
69 # dbus-test-runner not packaged yet, otherwise build-time dependency even when not running tests
70 ./dbus-test-runner.patch
71 ];
72
73 buildInputs = [
74 libgee
75 json-glib
76 properties-cpp
77 ];
78
79 propagatedBuildInputs = [
80 debian
81 pygobject3
82 setuptools
83 ];
84
85 meta = {
86 description = "A tool to build click packages. Mainly used for Ubuntu Touch.";
87 homepage = "https://gitlab.com/ubports/development/core/click";
88 license = lib.licenses.gpl3Only;
89 maintainers = with lib.maintainers; [ ilyakooo0 OPNA2608 ];
90 platforms = lib.platforms.linux;
91 };
92}