packagekit_dart 0.5.0
packagekit_dart: ^0.5.0 copied to clipboard
Dart FFI bindings for PackageKit, the cross-distro Linux package manager. Search, install, update, and remove packages via D-Bus with async streams.
0.5.0 #
- Breaking: migrate the native build hook from
hooks1.x to 2.x (andcode_assetsto 1.2.x). hooks 2.x requires Dart >=3.10, so the SDK lower bound rises from 3.6.0 — consumers on Dart 3.6–3.9 should stay on 0.4.x. The hook's behaviour is unchanged (it still buildslibpackagekit_nc.sovia CMake and skips cleanly when cmake/ninja/sd-bus are absent); the migration is a dependency bump only, verified end to end against a consumer build. - Drop the
native_toolchain_cdependency: it was declared but never imported (the hook drives CMake directly rather thanCBuilder).
0.4.3 #
A build-hook fix so the package installs on hosts that lack the native-bridge toolchain.
- Skip the native bridge cleanly when its build prerequisites are absent.
The bridge needs a C++ toolchain (cmake + ninja) and libsystemd's sd-bus;
on Alpine/OpenRC, a minimal image, or any non-systemd host, the build hook
now probes for these up front and returns without building — the PackageKit
backend is simply unavailable, which is fine where it is unused. Previously a
missing tool threw
ProcessException(only a present-but-failing tool was handled), failing the whole build hook and blockingdart pub get/ install for every consumer on such a host. Probing first also avoids a needless sdbus-cpp clone.
0.4.2 #
Documentation only — no code change.
- Lead the WSL guidance with the polkit rule rather than running as root.
Recommending root to library consumers pushes them to relay that to their
own users, and most tools keep caches or configuration under
$HOME, where running as root leaves artifacts the user can no longer modify. Keeping the client unprivileged is what PackageKit exists to make possible. - Document that the suggested rule covers only install/remove/update.
refreshCachemaps tosystem-sources-refresh, which needs no authorization for a caller in a login session but does for one without — the CI and WSL case.
0.4.1 #
Documentation only — no code change. Released so the README rendered on pub.flutter-io.cn stops handing out a polkit rule that does nothing on Debian/Ubuntu.
- Fix the documented polkit rule, which granted only to
wheel— the admin group on Fedora/RHEL/Arch but not on Debian/Ubuntu, where it issudo. Awheel-only rule silently does nothing on Debian and is hard to diagnose, because the rule looks installed and the error is unchanged. Match both. - Document that installing the rule is not sufficient: you must be in the
group, passwordless
sudois not the same thing, andusermoddoes not affect a running session. All three produce the same unchanged denial.
0.4.0 #
- Send the
interactivehint on every transaction. The daemon treats an absent hint as false, which stripsALLOW_USER_INTERACTIONfrom its polkit check — so any transaction needing authorization failed synchronously withPkError.notAuthorizedand a 0 ms runtime, on any host where the polkit action isauth_adminand the caller is not root. - Add
PkClient.connect({bool interactive = true})and the matchingPkClient.interactivegetter. Interactive is the default: transactions that need authorization now prompt instead of failing. Passinteractive: falsefor unattended callers that must fail fast rather than block on a prompt — it suppresses the prompt, it does not grant authorization. - Document authorization on WSL, where polkit cannot reliably prompt because a logind session owned by the calling user is often absent. Recommends running as root, with a narrowly scoped polkit rule as an opt-in alternative, plus how to tell a session problem from a real denial.
- C ABI change:
pk_transaction_set_hintstakes a third parameter,bool interactive. Consumers linkinglibpackagekit_ncdirectly must update their declaration; consumers using the build hook are unaffected, as it compiles the library from source.
0.3.2 #
- Point
repositoryandissue_trackerat the jwinarske fork, fixing pub.flutter-io.cn repository verification.
0.3.1 #
- Add
WhatProvides(nativepk_what_provides, FFI binding, andPkClient.whatProvides) — resolve capabilities / provides / file paths (e.g.pkg-config, provided bypkgconf-pkg-config), matchingdnf/aptinstall behavior. Mirrors the existingResolvepath. - Add
setPackagekitLibraryPath()to point the native-library loader at a prebuiltlibpackagekit_nc.so, taking precedence overPK_NC_LIB. Useful for path/git dependencies that ship or build the.sooutside the build hook.
0.3.0 #
- Extract TransactionDispatcher and dispatchManagerEvent for testable message dispatch without a live daemon
- 102 unit tests covering all codec discriminators, model constructors, enum round-trips, dispatcher paths, and error handling
- ~98% coverage on testable Dart code (FFI glue excluded)
- Remove unused generated sdbus-cpp proxy headers and D-Bus XML interfaces
- Remove go_router; use index-based navigation for instant screen switching
- Fix CI: add libclang-rt-19-dev for ASAN, exclude test/ from clang-tidy, add dart pub get before format check, add flutter analyze step
- Lower Dart coverage threshold to 10% (FFI-heavy package)
- Add Flutter example screenshot to README
- Fix detail pane overlay on screen switch and package selection
0.2.0 #
- Native build hook (
hook/build.dart) usingpackage:hooksandpackage:code_assets— automatically compiles libpackagekit_nc.so via CMake at build time and bundles it as a CodeAsset - Auto-clone sdbus-cpp at pinned commit when submodule is unavailable (pub.flutter-io.cn installs)
- Flutter example app (
example/packagekit_catalog/) — Material 3 desktop catalog with Riverpod state management, GoRouter navigation, search, installed packages, updates, and repository views - Codecov integration with 60% threshold enforcement
- Dart and C++ coverage collection in CI
0.1.0 #
- Initial release
- PkClient with async stream-based API for PackageKit D-Bus operations
- Query methods: searchName, searchDetails, searchFiles, resolve, getPackages, getUpdates, getDetails, getUpdateDetail, getFiles, getRepoList, dependsOn, requiredBy, getDistroUpgrades
- Write methods: installPackages, removePackages, updatePackages, refreshCache, downloadPackages, installFiles, repoEnable, acceptEula
- Simulate-first pattern: simulateInstall, simulateRemove, simulateUpdate returning PkInstallPlan with full dependency resolution
- Typed enums: PkFilter, PkTransactionFlag, PkInfo, PkStatus, PkExit, PkError
- Domain models: PkPackage, PkPackageDetail, PkUpdateDetail, PkRepoDetail, PkFiles, PkProgress, PkInstallPlan
- Daemon event monitoring: UpdatesChanged, RepoListChanged
- Native bridge using sdbus-cpp v2 with glaze binary encoding
- Supports APT, DNF, Zypper, and other PackageKit backends