xsm: refactor and move to pkgs/by-name from xorg namespace

also add run time dependencies from the xsm README with makeWrapper
This commit is contained in:
quantenzitrone
2025-08-30 22:50:06 +02:00
parent f25482f3dc
commit 9c66bf85e8
5 changed files with 92 additions and 50 deletions
+88
View File
@@ -0,0 +1,88 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
wrapWithXFileSearchPathHook,
xorgproto,
libice,
libsm,
libx11,
libxaw,
libxt,
makeBinaryWrapper,
writeScript,
# run time dependencies
iceauth,
smproxy,
twm,
xterm,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "xsm";
version = "1.0.6";
src = fetchurl {
url = "mirror://xorg/individual/app/xsm-${finalAttrs.version}.tar.xz";
hash = "sha256-t0zHdMYGDDdZL2ipDb0xsPKmL7FOVidpQ095vihKY84=";
};
strictDeps = true;
nativeBuildInputs = [
pkg-config
wrapWithXFileSearchPathHook
makeBinaryWrapper
];
buildInputs = [
xorgproto
libice
libsm
libx11
libxaw
libxt
];
installFlags = [ "appdefaultdir=$(out)/share/X11/app-defaults" ];
postInstall = ''
wrapProgram $out/bin/xsm \
--prefix PATH : ${
lib.makeBinPath [
iceauth
smproxy
twm
xterm
]
}
'';
passthru = {
updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/app/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
};
meta = {
description = "X Session Manager";
longDescription = ''
A session is a group of X applications, each of which has a particular state. xsm allows you
to create arbitrary sessions - for example, you might have a "light" session, a "development"
session, or an "xterminal" session. Each session can have its own set of applications. Within
a session, you can perform a "checkpoint" to save application state, or a "shutdown" to save
state and exit the session. When you log back in to the system, you can load a specific
session, and you can delete sessions you no longer want to keep.
'';
homepage = "https://gitlab.freedesktop.org/xorg/app/xsm";
license = lib.licenses.mitOpenGroup;
mainProgram = "xsm";
maintainers = [ ];
platforms = lib.platforms.unix;
};
})
+2 -48
View File
@@ -84,6 +84,7 @@
xrefresh,
xset,
xsetroot,
xsm,
xtrans,
xvinfo,
xwininfo,
@@ -130,6 +131,7 @@ self: with self; {
xrefresh
xset
xsetroot
xsm
xtrans
xvinfo
xwininfo
@@ -5436,54 +5438,6 @@ self: with self; {
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
xsm = callPackage (
{
stdenv,
pkg-config,
fetchurl,
libICE,
libSM,
libX11,
libXaw,
xorgproto,
libXt,
wrapWithXFileSearchPathHook,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "xsm";
version = "1.0.6";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/app/xsm-1.0.6.tar.xz";
sha256 = "1kk398lbwyag8dljfmjfn4psdwmh66yhvab85xckf306qrscfk5p";
};
hardeningDisable = [
"bindnow"
"relro"
];
strictDeps = true;
nativeBuildInputs = [
pkg-config
wrapWithXFileSearchPathHook
];
buildInputs = [
libICE
libSM
libX11
libXaw
xorgproto
libXt
];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = {
pkgConfigModules = [ ];
platforms = lib.platforms.unix;
};
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
xstdcmap = callPackage (
{
@@ -400,6 +400,7 @@ print OUT <<EOF;
xrefresh,
xset,
xsetroot,
xsm,
xtrans,
xvinfo,
xwininfo,
@@ -446,6 +447,7 @@ self: with self; {
xrefresh
xset
xsetroot
xsm
xtrans
xvinfo
xwininfo
-1
View File
@@ -982,7 +982,6 @@ self: super:
};
});
xsm = addMainProgram super.xsm { };
xstdcmap = addMainProgram super.xstdcmap { };
xwd = addMainProgram super.xwd { };
-1
View File
@@ -33,7 +33,6 @@ mirror://xorg/individual/app/xmessage-1.0.7.tar.xz
mirror://xorg/individual/app/xmore-1.0.4.tar.xz
mirror://xorg/individual/app/xpr-1.2.0.tar.xz
mirror://xorg/individual/app/xrdb-1.2.2.tar.xz
mirror://xorg/individual/app/xsm-1.0.6.tar.xz
mirror://xorg/individual/app/xstdcmap-1.0.5.tar.xz
mirror://xorg/individual/app/xtrap-1.0.3.tar.bz2
mirror://xorg/individual/app/xwd-1.0.9.tar.xz