about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-03-01 18:05:03 +0800
committerGitHub <noreply@github.com>2023-03-01 18:05:03 +0800
commiteb201d6d8ae9f4fa7397200b592ebefcea57e17a (patch)
tree5005bb50e02d22629e23538f656904fe50b3e4be /pkgs
parente96fc9ddf5fb271886236c94354240d81c0e0b69 (diff)
parente9c3f417dd0f687979237c10eb7945ea2ab390ed (diff)
Merge pull request #218182 from ilyakooo0/iko/init-click
ubports-click: init at 22-02-2023
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/click/dbus-test-runner.patch23
-rw-r--r--pkgs/development/tools/click/default.nix86
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 111 insertions, 0 deletions
diff --git a/pkgs/development/tools/click/dbus-test-runner.patch b/pkgs/development/tools/click/dbus-test-runner.patch
new file mode 100644
index 0000000000000..c705cf99aa7cc
--- /dev/null
+++ b/pkgs/development/tools/click/dbus-test-runner.patch
@@ -0,0 +1,23 @@
+diff --git a/click_package/Makefile.am b/click_package/Makefile.am
+index 4981d74..9df9e79 100644
+--- a/click_package/Makefile.am
++++ b/click_package/Makefile.am
+@@ -1,5 +1,3 @@
+-SUBDIRS = tests
+-
+ noinst_SCRIPTS = paths.py
+ CLEANFILES = $(noinst_SCRIPTS)
+ 
+diff --git a/configure.ac b/configure.ac
+index 8f4dc9e..adbd366 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,8 +52,6 @@ PKG_CHECK_MODULES([SERVICE], [
+ AC_SUBST([SERVICE_CFLAGS])
+ AC_SUBST([SERVICE_LIBS])
+ 
+-AC_CHECK_PROG(DBUS_TEST_RUNNER_CHECK,dbus-test-runner,yes)
+-AS_IF([test "${DBUS_TEST_RUNNER_CHECK}" != "yes"], [AC_MSG_ERROR([dbus-test-runner not found])])
+ AC_CHECK_PROG(GDBUS_CHECK,gdbus,yes)
+ AS_IF([test "${GDBUS_CHECK}" != "yes"], [AC_MSG_ERROR([gdbus (glib) not found])])
+ 
diff --git a/pkgs/development/tools/click/default.nix b/pkgs/development/tools/click/default.nix
new file mode 100644
index 0000000000000..4adaf11088b82
--- /dev/null
+++ b/pkgs/development/tools/click/default.nix
@@ -0,0 +1,86 @@
+{ lib
+, fetchFromGitLab
+, buildPythonApplication
+, autoreconfHook
+, debian
+, perl
+, vala
+, pkg-config
+, libgee
+, json-glib
+, properties-cpp
+, gobject-introspection
+, getopt
+, setuptools
+, pygobject3
+, wrapGAppsHook
+}:
+
+buildPythonApplication {
+  pname = "click";
+  version = "unstable-2023-02-22";
+  format = "other";
+
+  src = fetchFromGitLab {
+    owner = "ubports";
+    repo = "development/core/click";
+    rev = "aaf2735e8e6cbeaf2e429c70136733513a81718a";
+    sha256 = "sha256-pNu995/w3tbz15QQVdVYBnWnAoZmqWj1DN/5PZZ0iZw=";
+  };
+
+  configureFlags = [
+    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
+    "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user"
+  ];
+
+  preFixup = ''
+    makeWrapperArgs+=(
+      --prefix LD_LIBRARY_PATH : "$out/lib"
+    )
+  '';
+
+  preConfigure = ''
+    export click_cv_perl_vendorlib=$out/${perl.libPrefix}
+    export PYTHON_INSTALL_FLAGS="--prefix=$out"
+  '';
+
+  nativeBuildInputs = [
+    autoreconfHook
+    perl
+    pkg-config
+    gobject-introspection
+    vala
+    getopt
+    wrapGAppsHook
+  ];
+
+  # Tests were omitted for time constraint reasons
+  doCheck = false;
+
+  enableParallelBuilding = true;
+
+  patches = [
+    # dbus-test-runner not packaged yet, otherwise build-time dependency even when not running tests
+    ./dbus-test-runner.patch
+  ];
+
+  buildInputs = [
+    libgee
+    json-glib
+    properties-cpp
+  ];
+
+  propagatedBuildInputs = [
+    debian
+    pygobject3
+    setuptools
+  ];
+
+  meta = {
+    description = "A tool to build click packages. Mainly used for Ubuntu Touch.";
+    homepage = "https://gitlab.com/ubports/development/core/click";
+    license = lib.licenses.gpl3Only;
+    maintainers = with lib.maintainers; [ ilyakooo0 OPNA2608 ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1ddec927d9533..5330ec62b31f1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16207,6 +16207,8 @@ with pkgs;
 
   bupc = callPackage ../development/compilers/bupc { };
 
+  ubports-click = python3Packages.callPackage ../development/tools/click { };
+
   uasm = callPackage ../development/compilers/uasm { };
 
   urn = callPackage ../development/compilers/urn { };