From 5e7dcb62a49a0a2ec924e4b563656a263056b8dc Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Fri, 21 Feb 2025 14:44:30 -0500 Subject: [PATCH 1/2] xterm: format with nixfmt-rfc-style Signed-off-by: Ethan Carter Edwards --- pkgs/by-name/xt/xterm/package.nix | 39 ++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/xt/xterm/package.nix b/pkgs/by-name/xt/xterm/package.nix index b3ceeac4b34b..3949538776d7 100644 --- a/pkgs/by-name/xt/xterm/package.nix +++ b/pkgs/by-name/xt/xterm/package.nix @@ -1,6 +1,17 @@ -{ lib, stdenv, fetchurl, xorg, ncurses, freetype, fontconfig -, pkg-config, makeWrapper, nixosTests, gitUpdater -, enableDecLocator ? true }: +{ + lib, + stdenv, + fetchurl, + xorg, + ncurses, + freetype, + fontconfig, + pkg-config, + makeWrapper, + nixosTests, + gitUpdater, + enableDecLocator ? true, +}: stdenv.mkDerivation rec { pname = "xterm"; @@ -18,7 +29,11 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = [ makeWrapper pkg-config fontconfig ]; + nativeBuildInputs = [ + makeWrapper + pkg-config + fontconfig + ]; buildInputs = [ xorg.libXaw @@ -48,13 +63,15 @@ stdenv.mkDerivation rec { "--with-app-defaults=$(out)/lib/X11/app-defaults" ] ++ lib.optional enableDecLocator "--enable-dec-locator"; - env = { - # Work around broken "plink.sh". - NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig"; - } // lib.optionalAttrs stdenv.hostPlatform.isMusl { - # Various symbols missing without this define: TAB3, NLDLY, CRDLY, BSDLY, FFDLY, CBAUD - NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; - }; + env = + { + # Work around broken "plink.sh". + NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig"; + } + // lib.optionalAttrs stdenv.hostPlatform.isMusl { + # Various symbols missing without this define: TAB3, NLDLY, CRDLY, BSDLY, FFDLY, CBAUD + NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; + }; # Hack to get xterm built with the feature of releasing a possible setgid of 'utmp', # decided by the sysadmin to allow the xterm reporting to /var/run/utmp From c76e00362f86c37fde047fc9bf59a1820acb6954 Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Fri, 21 Feb 2025 14:45:35 -0500 Subject: [PATCH 2/2] xterm.tests.musl: init This would have caught the build regression introduced by 3bf2356 ("xterm: 390 -> 392 (#311472)"), and fixed by 5b2bbd8 ("Revert "xterm: patch from alpine to fix pty on musl""). Taking over from Alyssa Ross due to age of PR and merge conflicts. Link: https://github.com/NixOS/nixpkgs/pull/327357 Co-developed-by: Alyssa Ross Signed-off-by: Ethan Carter Edwards --- pkgs/by-name/xt/xterm/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/xt/xterm/package.nix b/pkgs/by-name/xt/xterm/package.nix index 3949538776d7..5eb767f1ff86 100644 --- a/pkgs/by-name/xt/xterm/package.nix +++ b/pkgs/by-name/xt/xterm/package.nix @@ -9,6 +9,7 @@ pkg-config, makeWrapper, nixosTests, + pkgsCross, gitUpdater, enableDecLocator ? true, }: @@ -95,6 +96,7 @@ stdenv.mkDerivation rec { tests = { customTest = nixosTests.xterm; standardTest = nixosTests.terminal-emulators.xterm; + musl = pkgsCross.musl64.xterm; }; updateScript = gitUpdater {