Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nixos/modules/services/desktop-managers/lomiri.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ in
packages = (
with pkgs;
[
ayatana-indicator-datetime # Clock
ayatana-indicator-session # Controls for shutting down etc
]
++ (with lomiri; [
lomiri-indicator-datetime # Clock
])
);
};
})
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/ayatana-indicators.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ in
ayatana-indicator-sound
]
++ (with pkgs.lomiri; [
lomiri-indicator-datetime
lomiri-indicator-network
lomiri-telephony-service
]);
Expand Down
171 changes: 119 additions & 52 deletions pkgs/by-name/ay/ayatana-indicator-datetime/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
dbus,
dbus-test-runner,
evolution-data-server,
extra-cmake-modules,
glib,
gst_all_1,
gtest,
intltool,
libaccounts-glib,
libayatana-common,
libical,
mkcal,
libnotify,
libsForQt5,
libuuid,
lomiri,
pkg-config,
Expand All @@ -25,51 +28,57 @@
systemd,
tzdata,
wrapGAppsHook3,
# Generates a different indicator
enableLomiriFeatures ? false,
}:

let
edsDataDir = "${evolution-data-server}/share";
in
stdenv.mkDerivation (finalAttrs: {
pname = "ayatana-indicator-datetime";
version = "24.5.1";
pname = "${if enableLomiriFeatures then "lomiri" else "ayatana"}-indicator-datetime";
version = "25.4.0";

src = fetchFromGitHub {
owner = "AyatanaIndicators";
repo = "ayatana-indicator-datetime";
tag = finalAttrs.version;
hash = "sha256-rbKAixFjXOMYzduABmoIXissQXAoehfbkNntdtRyAqA=";
hash = "sha256-8E9ucy8I0w9DDzsLtzJgICz/e0TNqOHgls9LrgA5nk4=";
};

postPatch = ''
# Override systemd prefix
substituteInPlace data/CMakeLists.txt \
--replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \
--replace-fail 'XDG_AUTOSTART_DIR "/etc' 'XDG_AUTOSTART_DIR "''${CMAKE_INSTALL_FULL_SYSCONFDIR}'

# Looking for Lomiri schemas for code generation
substituteInPlace src/CMakeLists.txt \
--replace-fail '/usr/share/accountsservice' '${lomiri.lomiri-schemas}/share/accountsservice'
'';
postPatch =
''
# Override systemd prefix
substituteInPlace data/CMakeLists.txt \
--replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \
--replace-fail 'XDG_AUTOSTART_DIR "/etc' 'XDG_AUTOSTART_DIR "''${CMAKE_INSTALL_FULL_SYSCONFDIR}'
''
+ lib.optionalString enableLomiriFeatures ''
# Looking for Lomiri schemas for code generation
substituteInPlace src/CMakeLists.txt \
--replace-fail '/usr/share/accountsservice' '${lomiri.lomiri-schemas}/share/accountsservice'
'';

strictDeps = true;

nativeBuildInputs = [
cmake
glib # for schema hook
intltool
pkg-config
wrapGAppsHook3
];
nativeBuildInputs =
[
cmake
glib # for schema hook
intltool
pkg-config
wrapGAppsHook3
]
++ lib.optionals enableLomiriFeatures [
libsForQt5.wrapQtAppsHook
];

buildInputs =
[
ayatana-indicator-messages
evolution-data-server
glib
libaccounts-glib
libayatana-common
libical
libnotify
libuuid
properties-cpp
Expand All @@ -82,10 +91,30 @@ stdenv.mkDerivation (finalAttrs: {
])
++ (with lomiri; [
cmake-extras
lomiri-schemas
lomiri-sounds
lomiri-url-dispatcher
]);
])
++ (
if enableLomiriFeatures then
(
[
extra-cmake-modules
mkcal
]
++ (with libsForQt5; [
kcalendarcore
qtbase
])
++ (with lomiri; [
lomiri-schemas
lomiri-sounds
lomiri-url-dispatcher
])
)
else
[
evolution-data-server
libical
]
);

nativeCheckInputs = [
dbus
Expand All @@ -99,47 +128,83 @@ stdenv.mkDerivation (finalAttrs: {
gtest
];

cmakeFlags = [
(lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
(lib.cmakeBool "GSETTINGS_COMPILE" true)
(lib.cmakeBool "ENABLE_LOMIRI_FEATURES" true)
(lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
];
dontWrapQtApps = true;

cmakeFlags =
[
(lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
(lib.cmakeBool "GSETTINGS_COMPILE" true)
(lib.cmakeBool "ENABLE_LOMIRI_FEATURES" enableLomiriFeatures)
(lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
]
++ lib.optionals enableLomiriFeatures [
(lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
lib.concatStringsSep ";" [
# Exclude tests
"-E"
(lib.strings.escapeShellArg "(${
lib.concatStringsSep "|" [
# Don't know why these fail yet
"^test-eds-ics-repeating-events"
"^test-eds-ics-nonrepeating-events"
"^test-eds-ics-missing-trigger"
]
})")
]
))
];

doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;

enableParallelChecking = false;

preCheck = ''
export XDG_DATA_DIRS=${
lib.strings.concatStringsSep ":" [
# org.ayatana.common schema
(glib.passthru.getSchemaDataDirPath libayatana-common)

# loading EDS engines to handle ICS-loading
edsDataDir
]
lib.strings.concatStringsSep ":" (
[
# org.ayatana.common schema
(glib.passthru.getSchemaDataDirPath libayatana-common)
]
++ lib.optionals (!enableLomiriFeatures) [
# loading EDS engines to handle ICS-loading
edsDataDir
]
)
}
'';

# schema is already added automatically by wrapper, EDS needs to be added explicitly
preFixup = ''
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : "${edsDataDir}"
preFixup =
''
gappsWrapperArgs+=(
''
+ (
if enableLomiriFeatures then
''
"''${qtWrapperArgs[@]}"
''
else
# schema is already added automatically by wrapper, EDS needs to be added explicitly
''
--prefix XDG_DATA_DIRS : "${edsDataDir}"
''
)
'';
+ ''
)
'';

passthru = {
ayatana-indicators = {
ayatana-indicator-datetime = [
"ayatana"
"lomiri"
"${if enableLomiriFeatures then "lomiri" else "ayatana"}-indicator-datetime" = [
(if enableLomiriFeatures then "lomiri" else "ayatana")
];
};
tests = {
startup = nixosTests.ayatana-indicators;
lomiri = nixosTests.lomiri.desktop-ayatana-indicator-datetime;
};
tests =
{
startup = nixosTests.ayatana-indicators;
}
// lib.optionalAttrs enableLomiriFeatures {
lomiri = nixosTests.lomiri.desktop-ayatana-indicator-datetime;
};
updateScript = gitUpdater { };
};

Expand All @@ -152,7 +217,9 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://github.com/AyatanaIndicators/ayatana-indicator-datetime";
changelog = "https://github.com/AyatanaIndicators/ayatana-indicator-datetime/blob/${finalAttrs.version}/ChangeLog";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ OPNA2608 ];
teams = [
lib.teams.lomiri
];
platforms = lib.platforms.linux;
};
})
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
gitUpdater,
testers,
accountsservice,
ayatana-indicator-datetime,
biometryd,
cmake,
cmake-extras,
Expand All @@ -24,6 +23,7 @@
libqtdbustest,
libqtdbusmock,
lomiri-content-hub,
lomiri-indicator-datetime,
lomiri-indicator-network,
lomiri-schemas,
lomiri-settings-components,
Expand Down Expand Up @@ -121,10 +121,10 @@ stdenv.mkDerivation (finalAttrs: {

# QML components and schemas the wrapper needs
propagatedBuildInputs = [
ayatana-indicator-datetime
biometryd
libqofono
lomiri-content-hub
lomiri-indicator-datetime
lomiri-indicator-network
lomiri-schemas
lomiri-settings-components
Expand Down
8 changes: 6 additions & 2 deletions pkgs/desktops/lomiri/applications/lomiri/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
linkFarm,
replaceVars,
nixosTests,
ayatana-indicator-datetime,
bash,
biometryd,
boost,
Expand All @@ -33,6 +32,7 @@
lomiri-api,
lomiri-app-launch,
lomiri-download-manager,
lomiri-indicator-datetime,
lomiri-indicator-network,
lomiri-notifications,
lomiri-settings-components,
Expand Down Expand Up @@ -119,6 +119,10 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace tests/mocks/CMakeLists.txt \
--replace-fail 'add_subdirectory(QtMir/Application)' ""

# This needs to launch the *lomiri* indicators, now that datetime is split into lomiri and non-lomiri variants
substituteInPlace data/lomiri-greeter-wrapper \
--replace-fail 'ayatana-indicators.target' 'lomiri-indicators.target'

# NixOS-ify

# Use Nix flake instead of Canonical's Ubuntu logo
Expand All @@ -143,7 +147,6 @@ stdenv.mkDerivation (finalAttrs: {
];

buildInputs = [
ayatana-indicator-datetime
bash
boost
cmake-extras
Expand All @@ -163,6 +166,7 @@ stdenv.mkDerivation (finalAttrs: {
lomiri-api
lomiri-app-launch
lomiri-download-manager
lomiri-indicator-datetime
lomiri-indicator-network
lomiri-schemas
lomiri-system-settings-unwrapped
Expand Down
2 changes: 2 additions & 0 deletions pkgs/desktops/lomiri/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
config,
lib,
pkgs,
ayatana-indicator-datetime,
libsForQt5,
}:

Expand Down Expand Up @@ -63,6 +64,7 @@ let
hfd-service = callPackage ./services/hfd-service { };
lomiri-download-manager = callPackage ./services/lomiri-download-manager { };
lomiri-history-service = callPackage ./services/lomiri-history-service { };
lomiri-indicator-datetime = ayatana-indicator-datetime.override { enableLomiriFeatures = true; };
lomiri-indicator-network = callPackage ./services/lomiri-indicator-network { };
lomiri-polkit-agent = callPackage ./services/lomiri-polkit-agent { };
lomiri-telephony-service = callPackage ./services/lomiri-telephony-service { };
Expand Down