2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, docutils
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, dbus
|
|
|
|
, linuxHeaders
|
|
|
|
, systemd
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
let
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
dep = { pname, version, hash, rev ? "v${version}", buildInputs ? [ ] }:
|
2022-09-09 14:08:57 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "c-util";
|
|
|
|
repo = pname;
|
2023-05-24 13:37:59 +00:00
|
|
|
inherit hash rev;
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
nativeBuildInputs = [ meson ninja pkg-config ];
|
|
|
|
inherit buildInputs;
|
|
|
|
};
|
|
|
|
|
|
|
|
# These libraries are not used outside of dbus-broker.
|
|
|
|
#
|
|
|
|
# If that changes, we can always break them out, but they are essentially
|
|
|
|
# part of the dbus-broker project, just in separate repositories.
|
2024-01-02 11:29:13 +00:00
|
|
|
c-dvar = dep { pname = "c-dvar"; version = "1.1.0"; hash = "sha256-p/C+BktclVseCtZJ1Q/YK03vP2ClnYRLB1Vmj2OQJD4="; buildInputs = [ c-stdaux c-utf8 ]; };
|
|
|
|
c-ini = dep { pname = "c-ini"; version = "1.1.0"; hash = "sha256-wa7aNl20hkb/83c4AkQ/0YFDdmBs4XGW+WLUtBWIC98="; buildInputs = [ c-list c-rbtree c-stdaux c-utf8 ]; };
|
2023-07-15 17:15:38 +00:00
|
|
|
c-list = dep { pname = "c-list"; version = "3.1.0"; hash = "sha256-fp3EAqcbFCLaT2EstLSzwP2X13pi2EFpFAullhoCtpw="; };
|
2024-01-02 11:29:13 +00:00
|
|
|
c-rbtree = dep { pname = "c-rbtree"; version = "3.2.0"; hash = "sha256-dTMeawhPLRtHvMXfXCrT5iCdoh7qS3v+raC6c+t+X38="; buildInputs = [ c-stdaux ]; };
|
|
|
|
c-shquote = dep { pname = "c-shquote"; version = "1.1.0"; hash = "sha256-z6hpQ/kpCYAngMNfxLkfsxaGtvP4yBMigX1lGpIIzMQ="; buildInputs = [ c-stdaux ]; };
|
|
|
|
c-stdaux = dep { pname = "c-stdaux"; version = "1.5.0"; hash = "sha256-MsnuEyVCmOIr/q6I1qyPsNXp48jxIEcXoYLHbOAZtW0="; };
|
|
|
|
c-utf8 = dep { pname = "c-utf8"; version = "1.1.0"; hash = "sha256-9vBYylbt1ypJwIAQJd/oiAueh+4VYcn/KzofQuhUea0="; buildInputs = [ c-stdaux ]; };
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
in
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "dbus-broker";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "35";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-09-09 14:08:57 +00:00
|
|
|
owner = "bus1";
|
|
|
|
repo = "dbus-broker";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-Qwi9X5jXHiQ3TOWefzv/p7x8/JkQW1QgdYji5SpLej0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
./paths.patch
|
|
|
|
./disable-test.patch
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ docutils meson ninja pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
buildInputs = [
|
|
|
|
c-dvar
|
|
|
|
c-ini
|
|
|
|
c-list
|
|
|
|
c-rbtree
|
|
|
|
c-shquote
|
|
|
|
c-stdaux
|
|
|
|
c-utf8
|
|
|
|
dbus
|
|
|
|
linuxHeaders
|
|
|
|
systemd
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
mesonFlags = [
|
|
|
|
# while we technically support 4.9 and 4.14, the NixOS module will throw an
|
|
|
|
# error when using a kernel that's too old
|
|
|
|
"-D=linux-4-17=true"
|
|
|
|
"-D=system-console-users=gdm,sddm,lightdm"
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";
|
|
|
|
PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
|
|
|
|
PKG_CONFIG_SYSTEMD_CATALOGDIR = "${placeholder "out"}/lib/systemd/catalog";
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-09-09 14:08:57 +00:00
|
|
|
install -Dm444 $src/README.md $out/share/doc/dbus-broker/README
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
sed -i $out/lib/systemd/{system,user}/dbus-broker.service \
|
|
|
|
-e 's,^ExecReload.*busctl,ExecReload=${systemd}/bin/busctl,'
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Linux D-Bus Message Broker";
|
2022-09-09 14:08:57 +00:00
|
|
|
homepage = "https://github.com/bus1/dbus-broker/wiki";
|
|
|
|
license = licenses.asl20;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2022-09-09 14:08:57 +00:00
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
})
|