Unverified Commit 5d44e716 authored by Cosima Neidahl's avatar Cosima Neidahl Committed by GitHub
Browse files

ayatana-indicator-datetime: 24.5.1 -> 25.4.0, init lomiri-indicator-datetime (#415356)

parents 97295f66 bf0458a3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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
          ])
        );
      };
    })
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ in
            ayatana-indicator-sound
          ]
          ++ (with pkgs.lomiri; [
            lomiri-indicator-datetime
            lomiri-indicator-network
            lomiri-telephony-service
          ]);
+119 −52
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
  dbus,
  dbus-test-runner,
  evolution-data-server,
  extra-cmake-modules,
  glib,
  gst_all_1,
  gtest,
@@ -16,7 +17,9 @@
  libaccounts-glib,
  libayatana-common,
  libical,
  mkcal,
  libnotify,
  libsForQt5,
  libuuid,
  lomiri,
  pkg-config,
@@ -25,28 +28,32 @@
  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 = ''
  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'
@@ -54,22 +61,24 @@ stdenv.mkDerivation (finalAttrs: {

  strictDeps = true;

  nativeBuildInputs = [
  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
@@ -82,10 +91,30 @@ stdenv.mkDerivation (finalAttrs: {
    ])
    ++ (with lomiri; [
      cmake-extras
    ])
    ++ (
      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
@@ -99,11 +128,30 @@ stdenv.mkDerivation (finalAttrs: {
    gtest
  ];

  cmakeFlags = [
  dontWrapQtApps = true;

  cmakeFlags =
    [
      (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
      (lib.cmakeBool "GSETTINGS_COMPILE" true)
    (lib.cmakeBool "ENABLE_LOMIRI_FEATURES" 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;
@@ -112,32 +160,49 @@ stdenv.mkDerivation (finalAttrs: {

  preCheck = ''
    export XDG_DATA_DIRS=${
      lib.strings.concatStringsSep ":" [
      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 = ''
  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 = {
    tests =
      {
        startup = nixosTests.ayatana-indicators;
      }
      // lib.optionalAttrs enableLomiriFeatures {
        lomiri = nixosTests.lomiri.desktop-ayatana-indicator-datetime;
      };
    updateScript = gitUpdater { };
@@ -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;
  };
})
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
  gitUpdater,
  testers,
  accountsservice,
  ayatana-indicator-datetime,
  biometryd,
  cmake,
  cmake-extras,
@@ -24,6 +23,7 @@
  libqtdbustest,
  libqtdbusmock,
  lomiri-content-hub,
  lomiri-indicator-datetime,
  lomiri-indicator-network,
  lomiri-schemas,
  lomiri-settings-components,
@@ -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
+6 −2
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
  linkFarm,
  replaceVars,
  nixosTests,
  ayatana-indicator-datetime,
  bash,
  biometryd,
  boost,
@@ -33,6 +32,7 @@
  lomiri-api,
  lomiri-app-launch,
  lomiri-download-manager,
  lomiri-indicator-datetime,
  lomiri-indicator-network,
  lomiri-notifications,
  lomiri-settings-components,
@@ -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
@@ -143,7 +147,6 @@ stdenv.mkDerivation (finalAttrs: {
  ];

  buildInputs = [
    ayatana-indicator-datetime
    bash
    boost
    cmake-extras
@@ -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
Loading