Unverified Commit 2744cb0d authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

oxwm: 0.9.0 -> 0.11.3 (Zig rewrite) (#495120)

parents f0055fd4 e362d9e6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1218,6 +1218,7 @@ in
  owi = runTest ./owi.nix;
  owncast = runTest ./owncast.nix;
  oxidized = handleTest ./oxidized.nix { };
  oxwm = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./oxwm.nix;
  pacemaker = runTest ./pacemaker.nix;
  packagekit = runTest ./packagekit.nix;
  pairdrop = runTest ./web-apps/pairdrop.nix;

nixos/tests/oxwm.nix

0 → 100644
+39 −0
Original line number Diff line number Diff line
{ lib, ... }:
{
  name = "oxwm";

  meta = {
    maintainers = with lib.maintainers; [
      sigmanificient
      tonybanters
    ];
  };

  nodes.machine =
    { pkgs, lib, ... }:
    {
      imports = [
        ./common/x11.nix
        ./common/user-account.nix
      ];
      test-support.displayManager.auto.user = "alice";
      services.displayManager.defaultSession = lib.mkForce "oxwm";
      services.xserver.windowManager.oxwm.enable = true;

      environment.systemPackages = [ pkgs.alacritty ];
    };

  testScript = ''
    with subtest("ensure x starts"):
        machine.wait_for_x()
        machine.wait_for_file("/home/alice/.Xauthority")
        machine.succeed("xauth merge ~alice/.Xauthority")

    with subtest("ensure we can open a new terminal"):
        machine.sleep(2)
        machine.send_key("meta_l-ret")
        machine.wait_for_window(r"alice.*?machine")
        machine.sleep(2)
        machine.screenshot("terminal")
  '';
}
+20 −12
Original line number Diff line number Diff line
{
  lib,
  rustPlatform,
  stdenv,
  fetchFromGitHub,
  zig,
  pkg-config,
  libx11,
  libxft,
  libxrender,
  libxinerama,
  lua5_4,
  freetype,
  fontconfig,
  versionCheckHook,
  writableTmpDirAsHomeHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
stdenv.mkDerivation (finalAttrs: {
  pname = "oxwm";
  version = "0.9.0";
  version = "0.11.3";

  src = fetchFromGitHub {
    owner = "tonybanters";
    repo = "oxwm";
    tag = "v${finalAttrs.version}";
    hash = "sha256-zVYYRGe5ZIR1AJgKZi9s403NKM7hKAqhEbNWYSkgpT0=";
    hash = "sha256-W6muqajSk9UR646ZmLkx/wWfiaWLo+d1lJMiLm82NC8=";
  };

  cargoHash = "sha256-Rs8eGR8WY7qOPM0rfu6lTNDl6TVMR+rrIc6Ub+M7vfs=";

  nativeBuildInputs = [ pkg-config ];
  nativeBuildInputs = [
    zig.hook
    pkg-config
  ];

  buildInputs = [
    libx11
    libxft
    libxrender
    libxinerama
    lua5_4
    freetype
    fontconfig
  ];
@@ -36,8 +40,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
  # tests require a running X server
  doCheck = false;

  nativeInstallCheckInputs = [ versionCheckHook ];
  doInstallCheck = true;
  versionCheckProgramArg = "--version";
  versionCheckKeepEnvironment = [ "HOME" ];
  nativeInstallCheckInputs = [
    writableTmpDirAsHomeHook
  ];

  postInstall = ''
    install -Dm644 resources/oxwm.desktop -t $out/share/xsessions
@@ -48,7 +56,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
  passthru.providedSessions = [ "oxwm" ];

  meta = {
    description = "Dynamic window manager written in Rust, inspired by dwm";
    description = "Dynamic window manager written in Zig, inspired by dwm";
    homepage = "https://github.com/tonybanters/oxwm";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ tonybanters ];