Unverified Commit aea14e9b authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 1ad619fc 454d208c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ in
{
  meta = {
    doc = ./garage.md;
    maintainers = with pkgs.lib.maintainers; [ raitobezarius ];
    maintainers = [ ];
  };

  options.services.garage = {
+78 −49
Original line number Diff line number Diff line
@@ -19,9 +19,13 @@ in {
      inherit description password;
    };

    # To control mouse via scripting
    programs.ydotool.enable = true;

    services.desktopManager.lomiri.enable = lib.mkForce true;
    services.displayManager.defaultSession = lib.mkForce "lomiri";

    # Help with OCR
    fonts.packages = [ pkgs.inconsolata ];

    environment = {
@@ -114,17 +118,9 @@ in {
  enableOCR = true;

  testScript = { nodes, ... }: ''
    def open_starter():
        """
        Open the starter, and ensure it's opened.
        """
        machine.send_key("meta_l-a")
        # Look for any of the default apps
        machine.wait_for_text(r"(Search|System|Settings|Morph|Browser|Terminal|Alacritty)")

    def toggle_maximise():
        """
        Send the keybind to maximise the current window.
        Maximise the current window.
        """
        machine.send_key("ctrl-meta_l-up")

@@ -135,13 +131,43 @@ in {
        machine.send_key("esc")
        machine.sleep(5)

    def mouse_click(xpos, ypos):
        """
        Move the mouse to a screen location and hit left-click.
        """

        # Need to reset to top-left, --absolute doesn't work?
        machine.execute("ydotool mousemove -- -10000 -10000")
        machine.sleep(2)

        # Move
        machine.execute(f"ydotool mousemove -- {xpos} {ypos}")
        machine.sleep(2)

        # Click (C0 - left button: down & up)
        machine.execute("ydotool click 0xC0")
        machine.sleep(2)

    def open_starter():
        """
        Open the starter, and ensure it's opened.
        """

        # Using the keybind has a chance of instantly closing the menu again? Just click the button
        mouse_click(20, 30)

        # Look for Search box & GUI-less content-hub examples, highest chances of avoiding false positives
        machine.wait_for_text(r"(Search|Export|Import|Share)")

    start_all()
    machine.wait_for_unit("multi-user.target")

    # Lomiri in greeter mode should work & be able to start a session
    with subtest("lomiri greeter works"):
        machine.wait_for_unit("display-manager.service")
        # Start page shows current tie
        machine.wait_until_succeeds("pgrep -u lightdm -f 'lomiri --mode=greeter'")

        # Start page shows current time
        machine.wait_for_text(r"(AM|PM)")
        machine.screenshot("lomiri_greeter_launched")

@@ -152,7 +178,6 @@ in {

        # Login
        machine.send_chars("${password}\n")
        # Best way I can think of to differenciate "Lomiri in LightDM greeter mode" from "Lomiri in user shell mode"
        machine.wait_until_succeeds("pgrep -u ${user} -f 'lomiri --mode=full-shell'")

    # The session should start, and not be stuck in i.e. a crash loop
@@ -196,6 +221,17 @@ in {
        machine.screenshot("alacritty_opens")
        machine.send_key("alt-f4")

    # Morph is how we go online
    with subtest("morph browser works"):
        open_starter()
        machine.send_chars("Morph\n")
        machine.wait_for_text(r"(Bookmarks|address|site|visited any)")
        machine.screenshot("morph_open")

        # morph-browser has a separate VM test, there isn't anything new we could test here

        # Keep it running, we're using it to check content-hub communication from LSS

    # LSS provides DE settings
    with subtest("system settings open"):
        open_starter()
@@ -231,64 +267,57 @@ in {
        machine.wait_for_text("Morph") # or Gallery, but Morph is already packaged
        machine.screenshot("settings_content-hub_peers")

        # Sadly, it doesn't seem possible to actually select a peer and attempt a content-hub data exchange with just the keyboard
        # Select Morph as content source
        mouse_click(300, 100)

        machine.send_key("alt-f4")
        # Expect Morph to be brought into the foreground, with its Downloads page open
        machine.wait_for_text("No downloads")

    # Morph is how we go online
    with subtest("morph browser works"):
        open_starter()
        machine.send_chars("Morph\n")
        machine.wait_for_text(r"(Bookmarks|address|site|visited any)")
        machine.screenshot("morph_open")
        # If content-hub encounters a problem, it may have crashed the original application issuing the request.
        # Check that it's still alive
        machine.succeed("pgrep -u ${user} -f lomiri-system-settings")

        # morph-browser has a separate VM test, there isn't anything new we could test here
        machine.screenshot("content-hub_exchange")

        machine.send_key("alt-f4")
        # Testing any more would require more applications & setup, the fact that it's already being attempted is a good sign
        machine.send_key("esc")

        machine.send_key("alt-f4") # LSS
        machine.sleep(2) # focus is slow to switch to second window, closing it *really* helps with OCR afterwards
        machine.send_key("alt-f4") # Morph

    # The ayatana indicators are an important part of the experience, and they hold the only graphical way of exiting the session.
    # Reaching them via the intended way requires wayland mouse control, but ydotool lacks a module for its daemon:
    # https://github.com/NixOS/nixpkgs/issues/183659
    # Luckily, there's a test app that also displays their contents, but it's abit inconsistent. Hopefully this is *good-enough*.
    # There's a test app we could use that also displays their contents, but it's abit inconsistent.
    with subtest("ayatana indicators work"):
        open_starter()
        machine.send_chars("Indicators\n")
        machine.wait_for_text(r"(Indicators|Client|List|network|datetime|session)")
        mouse_click(735, 0) # the cog in the top-right, for the session indicator
        machine.wait_for_text(r"(Notifications|Time|Date|System)")
        machine.screenshot("indicators_open")

        # Element tab order within the indicator menus is not fully deterministic
        # Only check that the indicators are listed & their items load
        # Indicator order within the menus *should* be fixed based on per-indicator order setting
        # Session is the one we clicked, but the last we should test (logout). Go as far left as we can test.
        machine.send_key("left")
        machine.send_key("left")
        # Notifications are usually empty, nothing to check there

        with subtest("lomiri indicator network works"):
            # Select indicator-network
            machine.send_key("tab")
            # Don't go further down, first entry
            machine.send_key("ret")
            # We start on this, don't go right
            machine.wait_for_text(r"(Flight|Wi-Fi)")
            machine.screenshot("indicators_network")

        machine.send_key("shift-tab")
        machine.send_key("ret")
        machine.wait_for_text(r"(Indicators|Client|List|network|datetime|session)")

        with subtest("ayatana indicator datetime works"):
            # Select ayatana-indicator-datetime
            machine.send_key("tab")
            machine.send_key("down")
            machine.send_key("ret")
            machine.send_key("right")
            machine.wait_for_text("Time and Date Settings")
            machine.screenshot("indicators_timedate")

        machine.send_key("shift-tab")
        machine.send_key("ret")
        machine.wait_for_text(r"(Indicators|Client|List|network|datetime|session)")

        with subtest("ayatana indicator session works"):
            # Select ayatana-indicator-session
            machine.send_key("tab")
            machine.send_key("down")
            machine.send_key("ret")
            machine.send_key("right")
            machine.wait_for_text("Log Out")
            machine.screenshot("indicators_session")

            # We should be able to log out and return to the greeter
            mouse_click(720, 280) # "Log Out"
            mouse_click(400, 240) # confirm logout
            machine.wait_until_fails("pgrep -u ${user} -f 'lomiri --mode=full-shell'")
            machine.wait_until_succeeds("pgrep -u lightdm -f 'lomiri --mode=greeter'")
  '';
})
+9 −3
Original line number Diff line number Diff line
@@ -16,22 +16,28 @@ stdenv.mkDerivation rec {

  src = fetchFromGitHub {
    owner = "geoffreybennett";
    repo = pname;
    repo = "alsa-scarlett-gui";
    rev = version;
    sha256 = "sha256-+74JRQn2xwgPHZSrp5b+uny0+aLnsFvx/cOKIdj4J40=";
    hash = "sha256-+74JRQn2xwgPHZSrp5b+uny0+aLnsFvx/cOKIdj4J40=";
  };

  NIX_CFLAGS_COMPILE = [ "-Wno-error=deprecated-declarations" ];

  makeFlags = [ "DESTDIR=\${out}" "PREFIX=''" ];
  sourceRoot = "${src.name}/src";

  postPatch = ''
    substituteInPlace file.c \
      --replace-fail "/usr/sbin/alsactl" "${alsa-utils}/bin/alsactl"
  '';

  nativeBuildInputs = [ pkg-config wrapGAppsHook4 makeWrapper ];
  buildInputs = [ gtk4 alsa-lib openssl ];
  postInstall = ''
    wrapProgram $out/bin/alsa-scarlett-gui --prefix PATH : ${lib.makeBinPath [ alsa-utils ]}

    substituteInPlace $out/share/applications/vu.b4.alsa-scarlett-gui.desktop \
      --replace "Exec=/bin/alsa-scarlett-gui" "Exec=$out/bin/alsa-scarlett-gui"
      --replace-fail "Exec=/bin/alsa-scarlett-gui" "Exec=$out/bin/alsa-scarlett-gui"
  '';

  # causes redefinition of _FORTIFY_SOURCE
+0 −140
Original line number Diff line number Diff line
{ lib
, stdenv
, copyDesktopItems
, fetchFromGitHub
, makeDesktopItem
, makeWrapper
, fontconfig
, freetype
, glib
, gtk3
, jdk17
, libX11
, libXrender
, libXtst
, zlib
, maven
, webkitgtk
, glib-networking
}:

let
  mavenJdk17 = maven.override {
    jdk = jdk17;
  };
in
mavenJdk17.buildMavenPackage rec {
  pname = "dbeaver";
  version = "22.2.2"; # When updating also update mvnHash

  src = fetchFromGitHub {
    owner = "dbeaver";
    repo = "dbeaver";
    rev = version;
    hash = "sha256-TUdtrhQ1JzqZx+QNauNA1P/+WDSSeOGIgGX3SdS0JTI=";
  };

  mvnHash = "sha256-ERZYDsPxp1YXteSmunFIgTGZUYqjZJhqrNytLnIUNBQ=";
  mvnParameters = "-P desktop,all-platforms";

  nativeBuildInputs = [
    copyDesktopItems
    makeWrapper
  ];

  buildInputs = [
    fontconfig
    freetype
    glib
    gtk3
    jdk17
    libX11
    libXrender
    libXtst
    zlib
  ] ++ lib.optionals stdenv.isLinux [
    webkitgtk
    glib-networking
  ];

  desktopItems = [
    (makeDesktopItem {
      name = "dbeaver";
      exec = "dbeaver";
      icon = "dbeaver";
      desktopName = "dbeaver";
      comment = "SQL Integrated Development Environment";
      genericName = "SQL Integrated Development Environment";
      categories = [ "Development" ];
    })
  ];

  installPhase =
    let
      productTargetPath = "product/community/target/products/org.jkiss.dbeaver.core.product";

      platformMap = {
        aarch64-darwin = "aarch64";
        aarch64-linux = "aarch64";
        x86_64-darwin = "x86_64";
        x86_64-linux = "x86_64";
      };

      systemPlatform = platformMap.${stdenv.hostPlatform.system} or (throw "dbeaver not supported on ${stdenv.hostPlatform.system}");
    in
    if stdenv.isDarwin then ''
      runHook preInstall

      mkdir -p $out/Applications $out/bin
      cp -r ${productTargetPath}/macosx/cocoa/${systemPlatform}/DBeaver.app $out/Applications

      sed -i "/^-vm/d; /bin\/java/d" $out/Applications/DBeaver.app/Contents/Eclipse/dbeaver.ini

      ln -s $out/Applications/DBeaver.app/Contents/MacOS/dbeaver $out/bin/dbeaver

      wrapProgram $out/Applications/DBeaver.app/Contents/MacOS/dbeaver \
        --prefix JAVA_HOME : ${jdk17.home} \
        --prefix PATH : ${jdk17}/bin

      runHook postInstall
    '' else ''
      runHook preInstall

      mkdir -p $out/
      cp -r ${productTargetPath}/linux/gtk/${systemPlatform}/dbeaver $out/dbeaver

      # Patch binaries.
      interpreter=$(cat $NIX_CC/nix-support/dynamic-linker)
      patchelf --set-interpreter $interpreter $out/dbeaver/dbeaver

      makeWrapper $out/dbeaver/dbeaver $out/bin/dbeaver \
        --prefix PATH : ${jdk17}/bin \
        --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ glib gtk3 libXtst webkitgtk glib-networking ])} \
        --prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules" \
        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"

      mkdir -p $out/share/pixmaps
      ln -s $out/dbeaver/icon.xpm $out/share/pixmaps/dbeaver.xpm

      runHook postInstall
    '';

  meta = with lib; {
    homepage = "https://dbeaver.io/";
    description = "Universal SQL Client for developers, DBA and analysts. Supports MySQL, PostgreSQL, MariaDB, SQLite, and more";
    longDescription = ''
      Free multi-platform database tool for developers, SQL programmers, database
      administrators and analysts. Supports all popular databases: MySQL,
      PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access,
      Teradata, Firebird, Derby, etc.
    '';
    sourceProvenance = with sourceTypes; [
      fromSource
      binaryBytecode # dependencies from maven
    ];
    license = licenses.asl20;
    platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
    maintainers = with maintainers; [ jojosch mkg20001 ];
    mainProgram = "dbeaver";
  };
}
+3 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@

((buildMozillaMach rec {
  pname = "floorp";
  packageVersion = "11.12.2";
  packageVersion = "11.13.2";
  applicationName = "Floorp";
  binaryName = "floorp";
  branding = "browser/branding/official";
@@ -15,14 +15,14 @@
  allowAddonSideload = true;

  # Must match the contents of `browser/config/version.txt` in the source tree
  version = "115.10.0";
  version = "115.12.0";

  src = fetchFromGitHub {
    owner = "Floorp-Projects";
    repo = "Floorp";
    fetchSubmodules = true;
    rev = "v${packageVersion}";
    hash = "sha256-KWUoR/0XOz4mCWBkTgDfvvrWukZMa3tQzQ+k5+BfzzY=";
    hash = "sha256-sFtGtxk3vdR5JoZb1yiITybIfGmOYzKLb9NtbhWjBt8=";
  };

  extraConfigureFlags = [
Loading