From 1077e452bcd6a2bc09f5e64cef9259c2577b0db5 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Dec 2024 10:32:53 +0100 Subject: [PATCH 1/6] ubports-click: unstable-2023-02-22 -> 0.5.2 --- .../tools/click/dbus-test-runner.patch | 23 ------ pkgs/development/tools/click/default.nix | 82 +++++++++++++++++-- 2 files changed, 73 insertions(+), 32 deletions(-) delete mode 100644 pkgs/development/tools/click/dbus-test-runner.patch diff --git a/pkgs/development/tools/click/dbus-test-runner.patch b/pkgs/development/tools/click/dbus-test-runner.patch deleted file mode 100644 index c705cf99aa7c..000000000000 --- a/pkgs/development/tools/click/dbus-test-runner.patch +++ /dev/null @@ -1,23 +0,0 @@ -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 index 97950147254c..a2f66c4d8fca 100644 --- a/pkgs/development/tools/click/default.nix +++ b/pkgs/development/tools/click/default.nix @@ -1,9 +1,16 @@ { lib, fetchFromGitLab, + fetchpatch, + stdenv, buildPythonApplication, autoreconfHook, + dbus, + dbus-test-runner, + dpkg, + glib, python-debian, + python-apt, perl, vala, pkg-config, @@ -13,26 +20,34 @@ gobject-introspection, getopt, setuptools, + six, pygobject3, + unittestCheckHook, wrapGAppsHook3, }: -buildPythonApplication { +buildPythonApplication rec { pname = "click"; - version = "unstable-2023-02-22"; + version = "0.5.2"; format = "other"; src = fetchFromGitLab { owner = "ubports"; repo = "development/core/click"; - rev = "aaf2735e8e6cbeaf2e429c70136733513a81718a"; - hash = "sha256-pNu995/w3tbz15QQVdVYBnWnAoZmqWj1DN/5PZZ0iZw="; + rev = version; + hash = "sha256-AV3n6tghvpV/6Ew6Lokf8QAGBIMbHFAnp6G4pefVn+8="; }; postPatch = '' # These should be proper Requires, using the header needs their headers substituteInPlace lib/click/click-*.pc.in \ - --replace 'Requires.private' 'Requires' + --replace-fail 'Requires.private' 'Requires' + + # Don't completely override PKG_CONFIG_PATH + substituteInPlace click_package/tests/Makefile.am \ + --replace-fail 'PKG_CONFIG_PATH=$(top_builddir)/lib/click' 'PKG_CONFIG_PATH=$(top_builddir)/lib/click:$(PKG_CONFIG_PATH)' + + patchShebangs bin/click ''; configureFlags = [ @@ -51,8 +66,15 @@ buildPythonApplication { export PYTHON_INSTALL_FLAGS="--prefix=$out" ''; + strictDeps = true; + + pkgsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ autoreconfHook + dbus-test-runner # Always checking for this perl pkg-config gobject-introspection @@ -61,17 +83,59 @@ buildPythonApplication { wrapGAppsHook3 ]; - # Tests were omitted for time constraint reasons - doCheck = false; + nativeCheckInputs = [ + dbus + dpkg + unittestCheckHook + ]; + + checkInputs = [ + python-apt + six + ]; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + preCheck = '' + export HOME=$TMP + + # tests recompile some files for loaded predefines, doesn't use any optimisation level for it + # makes test output harder to read, so make the warning go away + export NIX_CFLAGS_COMPILE+=" -U_FORTIFY_SOURCE" + + for path in $disabledTestPaths; do + rm -v $path + done + ''; + + disabledTestPaths = [ + # From apt: Unable to determine a suitable packaging system type + "click_package/tests/integration/test_signatures.py" + "click_package/tests/test_build.py" + "click_package/tests/test_install.py" + "click_package/tests/test_scripts.py" + ]; enableParallelBuilding = true; patches = [ - # dbus-test-runner not packaged yet, otherwise build-time dependency even when not running tests - ./dbus-test-runner.patch + # Remove when version > 0.5.2 + (fetchpatch { + name = "0001-click-fix-Wimplicit-function-declaration.patch"; + url = "https://gitlab.com/ubports/development/core/click/-/commit/8f654978a12e6f9a0b6ff64296ec5565e3ff5cd0.patch"; + hash = "sha256-kio+DdtuagUNYEosyQY3q3H+dJM3cLQRW9wUKUcpUTY="; + }) + + # Remove when version > 0.5.2 + (fetchpatch { + name = "0002-click-Add-uid_t-and-gid_t-to-the-ctypes-_typemap.patch"; + url = "https://gitlab.com/ubports/development/core/click/-/commit/cbcd23b08b02fa122434e1edd69c2b3dcb6a8793.patch"; + hash = "sha256-QaWRhxO61wAzULVqPLdJrLuBCr3+NhKmQlEPuYq843I="; + }) ]; buildInputs = [ + glib libgee json-glib properties-cpp From ab54cadc2745331e93fbbd736883653179ad146f Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Dec 2024 10:37:36 +0100 Subject: [PATCH 2/6] ubports-click: Modernise - Reorder function arguments in lexicographical order, derivation attributes in more common order - Add changelog, mainProgram, pkgConfigModules + test - Adjust maintainers, heavily related to Lomiri so pulling in that team --- pkgs/development/tools/click/default.nix | 205 ++++++++++++----------- 1 file changed, 108 insertions(+), 97 deletions(-) diff --git a/pkgs/development/tools/click/default.nix b/pkgs/development/tools/click/default.nix index a2f66c4d8fca..a607870cf4bb 100644 --- a/pkgs/development/tools/click/default.nix +++ b/pkgs/development/tools/click/default.nix @@ -1,28 +1,30 @@ { - lib, + buildPythonApplication, fetchFromGitLab, fetchpatch, + lib, stdenv, - buildPythonApplication, + testers, + ubports-click, autoreconfHook, dbus, dbus-test-runner, dpkg, - glib, - python-debian, - python-apt, - perl, - vala, - pkg-config, - libgee, - json-glib, - properties-cpp, - gobject-introspection, getopt, + glib, + gobject-introspection, + json-glib, + libgee, + perl, + pkg-config, + properties-cpp, + pygobject3, + python-apt, + python-debian, setuptools, six, - pygobject3, unittestCheckHook, + vala, wrapGAppsHook3, }: @@ -38,86 +40,6 @@ buildPythonApplication rec { hash = "sha256-AV3n6tghvpV/6Ew6Lokf8QAGBIMbHFAnp6G4pefVn+8="; }; - postPatch = '' - # These should be proper Requires, using the header needs their headers - substituteInPlace lib/click/click-*.pc.in \ - --replace-fail 'Requires.private' 'Requires' - - # Don't completely override PKG_CONFIG_PATH - substituteInPlace click_package/tests/Makefile.am \ - --replace-fail 'PKG_CONFIG_PATH=$(top_builddir)/lib/click' 'PKG_CONFIG_PATH=$(top_builddir)/lib/click:$(PKG_CONFIG_PATH)' - - patchShebangs bin/click - ''; - - 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" - ''; - - strictDeps = true; - - pkgsBuildBuild = [ - pkg-config - ]; - - nativeBuildInputs = [ - autoreconfHook - dbus-test-runner # Always checking for this - perl - pkg-config - gobject-introspection - vala - getopt - wrapGAppsHook3 - ]; - - nativeCheckInputs = [ - dbus - dpkg - unittestCheckHook - ]; - - checkInputs = [ - python-apt - six - ]; - - doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; - - preCheck = '' - export HOME=$TMP - - # tests recompile some files for loaded predefines, doesn't use any optimisation level for it - # makes test output harder to read, so make the warning go away - export NIX_CFLAGS_COMPILE+=" -U_FORTIFY_SOURCE" - - for path in $disabledTestPaths; do - rm -v $path - done - ''; - - disabledTestPaths = [ - # From apt: Unable to determine a suitable packaging system type - "click_package/tests/integration/test_signatures.py" - "click_package/tests/test_build.py" - "click_package/tests/test_install.py" - "click_package/tests/test_scripts.py" - ]; - - enableParallelBuilding = true; - patches = [ # Remove when version > 0.5.2 (fetchpatch { @@ -134,10 +56,39 @@ buildPythonApplication rec { }) ]; + postPatch = '' + # These should be proper Requires, using the header needs their headers + substituteInPlace lib/click/click-*.pc.in \ + --replace-fail 'Requires.private' 'Requires' + + # Don't completely override PKG_CONFIG_PATH + substituteInPlace click_package/tests/Makefile.am \ + --replace-fail 'PKG_CONFIG_PATH=$(top_builddir)/lib/click' 'PKG_CONFIG_PATH=$(top_builddir)/lib/click:$(PKG_CONFIG_PATH)' + + patchShebangs bin/click + ''; + + strictDeps = true; + + pkgsBuildBuild = [ + pkg-config + ]; + + nativeBuildInputs = [ + autoreconfHook + dbus-test-runner # Always checking for this + getopt + gobject-introspection + perl + pkg-config + vala + wrapGAppsHook3 + ]; + buildInputs = [ glib - libgee json-glib + libgee properties-cpp ]; @@ -147,14 +98,74 @@ buildPythonApplication rec { setuptools ]; + nativeCheckInputs = [ + dbus + dpkg + unittestCheckHook + ]; + + checkInputs = [ + python-apt + six + ]; + + preConfigure = '' + export click_cv_perl_vendorlib=$out/${perl.libPrefix} + export PYTHON_INSTALL_FLAGS="--prefix=$out" + ''; + + configureFlags = [ + "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" + ]; + + enableParallelBuilding = true; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + disabledTestPaths = [ + # From apt: Unable to determine a suitable packaging system type + "click_package/tests/integration/test_signatures.py" + "click_package/tests/test_build.py" + "click_package/tests/test_install.py" + "click_package/tests/test_scripts.py" + ]; + + preCheck = '' + export HOME=$TMP + + # tests recompile some files for loaded predefines, doesn't use any optimisation level for it + # makes test output harder to read, so make the warning go away + export NIX_CFLAGS_COMPILE+=" -U_FORTIFY_SOURCE" + + # Haven'tbeen able to get them excluded via disabledTest{s,Paths}, just deleting them + for path in $disabledTestPaths; do + rm -v $path + done + ''; + + preFixup = '' + makeWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "$out/lib" + ) + ''; + + passthru.tests.pkg-config = testers.hasPkgConfigModules { + package = ubports-click; + }; + meta = { - description = "Tool to build click packages. Mainly used for Ubuntu Touch"; + description = "Tool to build click packages, mainly used for Ubuntu Touch"; homepage = "https://gitlab.com/ubports/development/core/click"; + changelog = "https://gitlab.com/ubports/development/core/click/-/blob/${version}/ChangeLog"; license = lib.licenses.gpl3Only; + mainProgram = "click"; maintainers = with lib.maintainers; [ ilyakooo0 - OPNA2608 - ]; + ] ++ lib.teams.lomiri.members; platforms = lib.platforms.linux; + pkgConfigModules = [ + "click-0.4" + ]; }; } From 774cfbe7067b15e906c5d6d4221deb7fb9dc34ec Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Dec 2024 10:39:33 +0100 Subject: [PATCH 3/6] ubports-click: Add passthru.updateScript (Untested on this machine, runs OOM when I attempt to run update.nix) --- pkgs/development/tools/click/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/click/default.nix b/pkgs/development/tools/click/default.nix index a607870cf4bb..c722dcfe7266 100644 --- a/pkgs/development/tools/click/default.nix +++ b/pkgs/development/tools/click/default.nix @@ -2,6 +2,7 @@ buildPythonApplication, fetchFromGitLab, fetchpatch, + gitUpdater, lib, stdenv, testers, @@ -150,8 +151,11 @@ buildPythonApplication rec { ) ''; - passthru.tests.pkg-config = testers.hasPkgConfigModules { - package = ubports-click; + passthru = { + tests.pkg-config = testers.hasPkgConfigModules { + package = ubports-click; + }; + updateScript = gitUpdater { }; }; meta = { From 65121a80804feaa02d4da23694b398fc737aca56 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Dec 2024 10:43:21 +0100 Subject: [PATCH 4/6] ubports-click: Migrate to by-pkgs --- .../ub/ubports-click/package.nix} | 16 +++++----------- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 5 insertions(+), 13 deletions(-) rename pkgs/{development/tools/click/default.nix => by-name/ub/ubports-click/package.nix} (94%) diff --git a/pkgs/development/tools/click/default.nix b/pkgs/by-name/ub/ubports-click/package.nix similarity index 94% rename from pkgs/development/tools/click/default.nix rename to pkgs/by-name/ub/ubports-click/package.nix index c722dcfe7266..f00b1a302597 100644 --- a/pkgs/development/tools/click/default.nix +++ b/pkgs/by-name/ub/ubports-click/package.nix @@ -1,5 +1,4 @@ { - buildPythonApplication, fetchFromGitLab, fetchpatch, gitUpdater, @@ -19,17 +18,12 @@ perl, pkg-config, properties-cpp, - pygobject3, - python-apt, - python-debian, - setuptools, - six, - unittestCheckHook, + python3Packages, vala, wrapGAppsHook3, }: -buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "click"; version = "0.5.2"; format = "other"; @@ -93,7 +87,7 @@ buildPythonApplication rec { properties-cpp ]; - propagatedBuildInputs = [ + propagatedBuildInputs = with python3Packages; [ python-debian pygobject3 setuptools @@ -102,10 +96,10 @@ buildPythonApplication rec { nativeCheckInputs = [ dbus dpkg - unittestCheckHook + python3Packages.unittestCheckHook ]; - checkInputs = [ + checkInputs = with python3Packages; [ python-apt six ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7057e2550531..b57fc088dbea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6957,8 +6957,6 @@ with pkgs; llvmPackages = llvmPackages_18; }; - ubports-click = python3Packages.callPackage ../development/tools/click { }; - urweb = callPackage ../development/compilers/urweb { icu = icu67; }; From 5f3da539cccb91cb0966767fb8b16a424015011c Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Dec 2024 11:11:45 +0100 Subject: [PATCH 5/6] ubports-click: Get rid of externally-supplied self --- pkgs/by-name/ub/ubports-click/package.nix | 283 +++++++++++----------- 1 file changed, 144 insertions(+), 139 deletions(-) diff --git a/pkgs/by-name/ub/ubports-click/package.nix b/pkgs/by-name/ub/ubports-click/package.nix index f00b1a302597..7cf007b91f9e 100644 --- a/pkgs/by-name/ub/ubports-click/package.nix +++ b/pkgs/by-name/ub/ubports-click/package.nix @@ -5,7 +5,6 @@ lib, stdenv, testers, - ubports-click, autoreconfHook, dbus, dbus-test-runner, @@ -23,147 +22,153 @@ wrapGAppsHook3, }: -python3Packages.buildPythonApplication rec { - pname = "click"; - version = "0.5.2"; - format = "other"; +let + self = python3Packages.buildPythonApplication rec { + pname = "click"; + version = "0.5.2"; + format = "other"; - src = fetchFromGitLab { - owner = "ubports"; - repo = "development/core/click"; - rev = version; - hash = "sha256-AV3n6tghvpV/6Ew6Lokf8QAGBIMbHFAnp6G4pefVn+8="; - }; - - patches = [ - # Remove when version > 0.5.2 - (fetchpatch { - name = "0001-click-fix-Wimplicit-function-declaration.patch"; - url = "https://gitlab.com/ubports/development/core/click/-/commit/8f654978a12e6f9a0b6ff64296ec5565e3ff5cd0.patch"; - hash = "sha256-kio+DdtuagUNYEosyQY3q3H+dJM3cLQRW9wUKUcpUTY="; - }) - - # Remove when version > 0.5.2 - (fetchpatch { - name = "0002-click-Add-uid_t-and-gid_t-to-the-ctypes-_typemap.patch"; - url = "https://gitlab.com/ubports/development/core/click/-/commit/cbcd23b08b02fa122434e1edd69c2b3dcb6a8793.patch"; - hash = "sha256-QaWRhxO61wAzULVqPLdJrLuBCr3+NhKmQlEPuYq843I="; - }) - ]; - - postPatch = '' - # These should be proper Requires, using the header needs their headers - substituteInPlace lib/click/click-*.pc.in \ - --replace-fail 'Requires.private' 'Requires' - - # Don't completely override PKG_CONFIG_PATH - substituteInPlace click_package/tests/Makefile.am \ - --replace-fail 'PKG_CONFIG_PATH=$(top_builddir)/lib/click' 'PKG_CONFIG_PATH=$(top_builddir)/lib/click:$(PKG_CONFIG_PATH)' - - patchShebangs bin/click - ''; - - strictDeps = true; - - pkgsBuildBuild = [ - pkg-config - ]; - - nativeBuildInputs = [ - autoreconfHook - dbus-test-runner # Always checking for this - getopt - gobject-introspection - perl - pkg-config - vala - wrapGAppsHook3 - ]; - - buildInputs = [ - glib - json-glib - libgee - properties-cpp - ]; - - propagatedBuildInputs = with python3Packages; [ - python-debian - pygobject3 - setuptools - ]; - - nativeCheckInputs = [ - dbus - dpkg - python3Packages.unittestCheckHook - ]; - - checkInputs = with python3Packages; [ - python-apt - six - ]; - - preConfigure = '' - export click_cv_perl_vendorlib=$out/${perl.libPrefix} - export PYTHON_INSTALL_FLAGS="--prefix=$out" - ''; - - configureFlags = [ - "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" - ]; - - enableParallelBuilding = true; - - doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; - - disabledTestPaths = [ - # From apt: Unable to determine a suitable packaging system type - "click_package/tests/integration/test_signatures.py" - "click_package/tests/test_build.py" - "click_package/tests/test_install.py" - "click_package/tests/test_scripts.py" - ]; - - preCheck = '' - export HOME=$TMP - - # tests recompile some files for loaded predefines, doesn't use any optimisation level for it - # makes test output harder to read, so make the warning go away - export NIX_CFLAGS_COMPILE+=" -U_FORTIFY_SOURCE" - - # Haven'tbeen able to get them excluded via disabledTest{s,Paths}, just deleting them - for path in $disabledTestPaths; do - rm -v $path - done - ''; - - preFixup = '' - makeWrapperArgs+=( - --prefix LD_LIBRARY_PATH : "$out/lib" - ) - ''; - - passthru = { - tests.pkg-config = testers.hasPkgConfigModules { - package = ubports-click; + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/click"; + rev = version; + hash = "sha256-AV3n6tghvpV/6Ew6Lokf8QAGBIMbHFAnp6G4pefVn+8="; }; - updateScript = gitUpdater { }; - }; - meta = { - description = "Tool to build click packages, mainly used for Ubuntu Touch"; - homepage = "https://gitlab.com/ubports/development/core/click"; - changelog = "https://gitlab.com/ubports/development/core/click/-/blob/${version}/ChangeLog"; - license = lib.licenses.gpl3Only; - mainProgram = "click"; - maintainers = with lib.maintainers; [ - ilyakooo0 - ] ++ lib.teams.lomiri.members; - platforms = lib.platforms.linux; - pkgConfigModules = [ - "click-0.4" + patches = [ + # Remove when version > 0.5.2 + (fetchpatch { + name = "0001-click-fix-Wimplicit-function-declaration.patch"; + url = "https://gitlab.com/ubports/development/core/click/-/commit/8f654978a12e6f9a0b6ff64296ec5565e3ff5cd0.patch"; + hash = "sha256-kio+DdtuagUNYEosyQY3q3H+dJM3cLQRW9wUKUcpUTY="; + }) + + # Remove when version > 0.5.2 + (fetchpatch { + name = "0002-click-Add-uid_t-and-gid_t-to-the-ctypes-_typemap.patch"; + url = "https://gitlab.com/ubports/development/core/click/-/commit/cbcd23b08b02fa122434e1edd69c2b3dcb6a8793.patch"; + hash = "sha256-QaWRhxO61wAzULVqPLdJrLuBCr3+NhKmQlEPuYq843I="; + }) ]; + + postPatch = '' + # These should be proper Requires, using the header needs their headers + substituteInPlace lib/click/click-*.pc.in \ + --replace-fail 'Requires.private' 'Requires' + + # Don't completely override PKG_CONFIG_PATH + substituteInPlace click_package/tests/Makefile.am \ + --replace-fail 'PKG_CONFIG_PATH=$(top_builddir)/lib/click' 'PKG_CONFIG_PATH=$(top_builddir)/lib/click:$(PKG_CONFIG_PATH)' + + patchShebangs bin/click + ''; + + strictDeps = true; + + pkgsBuildBuild = [ + pkg-config + ]; + + nativeBuildInputs = [ + autoreconfHook + dbus-test-runner # Always checking for this + getopt + gobject-introspection + perl + pkg-config + vala + wrapGAppsHook3 + ]; + + buildInputs = [ + glib + json-glib + libgee + properties-cpp + ]; + + propagatedBuildInputs = with python3Packages; [ + python-debian + pygobject3 + setuptools + ]; + + nativeCheckInputs = [ + dbus + dpkg + python3Packages.unittestCheckHook + ]; + + checkInputs = with python3Packages; [ + python-apt + six + ]; + + preConfigure = '' + export click_cv_perl_vendorlib=$out/${perl.libPrefix} + export PYTHON_INSTALL_FLAGS="--prefix=$out" + ''; + + configureFlags = [ + "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" + ]; + + enableParallelBuilding = true; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + disabledTestPaths = [ + # From apt: Unable to determine a suitable packaging system type + "click_package/tests/integration/test_signatures.py" + "click_package/tests/test_build.py" + "click_package/tests/test_install.py" + "click_package/tests/test_scripts.py" + ]; + + preCheck = '' + export HOME=$TMP + + # tests recompile some files for loaded predefines, doesn't use any optimisation level for it + # makes test output harder to read, so make the warning go away + export NIX_CFLAGS_COMPILE+=" -U_FORTIFY_SOURCE" + + # Haven'tbeen able to get them excluded via disabledTest{s,Paths}, just deleting them + for path in $disabledTestPaths; do + rm -v $path + done + ''; + + preFixup = '' + makeWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "$out/lib" + ) + ''; + + passthru = { + updateScript = gitUpdater { }; + }; + + meta = { + description = "Tool to build click packages, mainly used for Ubuntu Touch"; + homepage = "https://gitlab.com/ubports/development/core/click"; + changelog = "https://gitlab.com/ubports/development/core/click/-/blob/${version}/ChangeLog"; + license = lib.licenses.gpl3Only; + mainProgram = "click"; + maintainers = with lib.maintainers; [ + ilyakooo0 + ] ++ lib.teams.lomiri.members; + platforms = lib.platforms.linux; + pkgConfigModules = [ + "click-0.4" + ]; + }; + }; +in +self // { + passthru = self.passthru // { + tests.pkg-config = testers.hasPkgConfigModules { + package = self; + }; }; } From dba1cb7d78c8c6cca892b070166502bc9e5888a0 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Dec 2024 11:15:09 +0100 Subject: [PATCH 6/6] ubports-click: nixfmt --- pkgs/by-name/ub/ubports-click/package.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ub/ubports-click/package.nix b/pkgs/by-name/ub/ubports-click/package.nix index 7cf007b91f9e..c6597596e206 100644 --- a/pkgs/by-name/ub/ubports-click/package.nix +++ b/pkgs/by-name/ub/ubports-click/package.nix @@ -155,9 +155,12 @@ let changelog = "https://gitlab.com/ubports/development/core/click/-/blob/${version}/ChangeLog"; license = lib.licenses.gpl3Only; mainProgram = "click"; - maintainers = with lib.maintainers; [ - ilyakooo0 - ] ++ lib.teams.lomiri.members; + maintainers = + with lib.maintainers; + [ + ilyakooo0 + ] + ++ lib.teams.lomiri.members; platforms = lib.platforms.linux; pkgConfigModules = [ "click-0.4" @@ -165,7 +168,8 @@ let }; }; in -self // { +self +// { passthru = self.passthru // { tests.pkg-config = testers.hasPkgConfigModules { package = self;