Commit 167194b4 authored by OPNA2608's avatar OPNA2608
Browse files

ayatana-indicator-datetime: 23.10.1 -> 24.2.0

parent 6d6ab741
Loading
Loading
Loading
Loading
+6 −25
Original line number Diff line number Diff line
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, gitUpdater
, nixosTests
, ayatana-indicator-messages
@@ -32,38 +31,20 @@ let
in
stdenv.mkDerivation (finalAttrs: {
  pname = "ayatana-indicator-datetime";
  version = "23.10.1";
  version = "24.2.0";

  src = fetchFromGitHub {
    owner = "AyatanaIndicators";
    repo = "ayatana-indicator-datetime";
    rev = finalAttrs.version;
    hash = "sha256-cm1zhG9TODGe79n/fGuyVnWL/sjxUc3ZCu9FhqA1NLE=";
    hash = "sha256-J3Yp7Dx4UvvdlM8Cp1sPe4Ftm/aAmNzpo4re/jF7pRo=";
  };

  patches = [
    # Fix test-menus building & running
    # Remove when version > 23.10.1
    (fetchpatch {
      name = "0001-ayatana-indicator-datetime-Fix-test-menus-tests.patch";
      url = "https://github.com/AyatanaIndicators/ayatana-indicator-datetime/commit/ddabb4a61a496da14603573b700c5961a3e5b834.patch";
      hash = "sha256-vf8aVXonCoTWMuAQZG6FuklWR2IaGY4hecFtoyNCGg8=";
    })

    # Fix EDS-related tests
    # Remove when version > 23.10.1
    (fetchpatch {
      name = "0002-ayatana-indicator-datetime-Fix-EDS-colour-tests.patch";
      url = "https://github.com/AyatanaIndicators/ayatana-indicator-datetime/commit/6d67f7b458911833e72e0b4a162b1d823609d6f8.patch";
      hash = "sha256-VUdMJuma6rmsjUOeyO0W8UNKADODiM+wDVfj6aDhqgw=";
    })
  ];

  postPatch = ''
    # Queries systemd user unit dir via pkg_get_variable, can't override prefix
    # Override systemd prefix
    substituteInPlace data/CMakeLists.txt \
      --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'set(SYSTEMD_USER_DIR ''${CMAKE_INSTALL_PREFIX}/lib/systemd/user)' \
      --replace-fail '/etc' "\''${CMAKE_INSTALL_FULL_SYSCONFDIR}"
      --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 \
@@ -136,8 +117,8 @@ stdenv.mkDerivation (finalAttrs: {
    ]}
  '';

  preFixup = ''
  # schema is already added automatically by wrapper, EDS needs to be added explicitly
  preFixup = ''
    gappsWrapperArgs+=(
      --prefix XDG_DATA_DIRS : "${edsDataDir}"
    )