nixpkgs/pkgs/by-name/xs/xscreensaver/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

132 lines
2.9 KiB
Nix
Raw Normal View History

2023-04-22 15:57:26 +00:00
{ lib
, stdenv
, fetchurl
, coreutils
, gdk-pixbuf
, gdk-pixbuf-xlib
, gettext
, gle
, gtk3
, intltool
, libGL
, libGLU
, libX11
, libXext
, libXft
, libXi
, libXinerama
, libXrandr
, libXt
, libXxf86vm
, libxml2
, makeWrapper
, pam
, perlPackages
Add appres to the path for xscreensaver Fixes the xscreensaver-text based screensavers, namely: Apple ][ Flip Text Font Glide GL Text Nose Guy Phosphor Split-Flap Star Wars Windup Robot XMatrix Symptom of breakage was: Can't exec "appres": No such file or directory at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 139. Use of uninitialized value $body in substitution (s///) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 161. Use of uninitialized value $body in substitution (s///) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 162. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 164. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 168. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 171. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 174. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 177.
2024-02-01 04:00:14 +00:00
, xorg
2023-04-22 15:57:26 +00:00
, pkg-config
, systemd
2023-11-16 03:15:43 +00:00
, forceInstallAllHacks ? true
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, nixosTests
, substituteAll
, wrapperPrefix ? "/run/wrappers/bin"
}:
2023-04-22 15:57:26 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "xscreensaver";
2023-11-16 03:15:43 +00:00
version = "6.08";
src = fetchurl {
2023-04-22 15:57:26 +00:00
url = "https://www.jwz.org/xscreensaver/xscreensaver-${finalAttrs.version}.tar.gz";
2023-11-16 03:15:43 +00:00
hash = "sha256-XPUrpSXO7PlLLyvWNIXr3zGOEvzA8q2tfUwQbYVedqM=";
};
2023-11-16 03:15:43 +00:00
outputs = [ "out" "man" ];
2021-04-11 20:05:23 +00:00
nativeBuildInputs = [
2023-04-22 15:57:26 +00:00
intltool
makeWrapper
pkg-config
2021-04-11 20:05:23 +00:00
];
buildInputs = [
2023-04-22 15:57:26 +00:00
gdk-pixbuf
gdk-pixbuf-xlib
gettext
gle
gtk3
libGL
libGLU
libX11
libXext
libXft
libXi
libXinerama
libXrandr
libXt
libXxf86vm
libxml2
pam
perlPackages.LWPProtocolHttps
perlPackages.MozillaCA
perlPackages.perl
]
2023-11-16 03:15:43 +00:00
++ lib.optionals withSystemd [ systemd ];
postPatch = ''
pushd hacks
patchShebangs check-configs.pl munge-ad.pl xml2man.pl
popd
'';
2021-04-11 20:05:23 +00:00
patches = [
(substituteAll {
src = ./xscreensaver-wrapper-prefix.patch;
inherit wrapperPrefix;
})
];
2021-04-11 20:05:23 +00:00
preConfigure = ''
# Fix installation paths for GTK resources.
sed -e 's%@GTK_DATADIR@%@datadir@% ; s%@PO_DATADIR@%@datadir@%' \
-i driver/Makefile.in po/Makefile.in.in
'';
configureFlags = [
"--with-app-defaults=${placeholder "out"}/share/xscreensaver/app-defaults"
];
2021-11-12 00:02:36 +00:00
# "marbling" has NEON code that mixes signed and unsigned vector types
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch "-flax-vector-conversions";
2021-04-11 20:05:23 +00:00
postInstall = ''
for bin in $out/bin/*; do
wrapProgram "$bin" \
--prefix PATH : "$out/libexec/xscreensaver" \
Add appres to the path for xscreensaver Fixes the xscreensaver-text based screensavers, namely: Apple ][ Flip Text Font Glide GL Text Nose Guy Phosphor Split-Flap Star Wars Windup Robot XMatrix Symptom of breakage was: Can't exec "appres": No such file or directory at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 139. Use of uninitialized value $body in substitution (s///) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 161. Use of uninitialized value $body in substitution (s///) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 162. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 164. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 168. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 171. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 174. Use of uninitialized value $body in pattern match (m//) at /nix/store/cm6kipfjrgj17pwdj5si39njzfrrvw8k-xscreensaver-6.08/libexec/xscreensaver/xscreensaver-text line 177.
2024-02-01 04:00:14 +00:00
--prefix PATH : "${lib.makeBinPath [ coreutils perlPackages.perl xorg.appres ]}" \
2022-06-06 03:02:46 +00:00
--prefix PERL5LIB ':' $PERL5LIB
done
2023-04-22 15:57:26 +00:00
''
+ lib.optionalString forceInstallAllHacks ''
2021-04-11 20:05:23 +00:00
make -j$NIX_BUILD_CORES -C hacks/glx dnalogo
cat hacks/Makefile.in \
| grep -E '([a-z0-9]+):[[:space:]]*\1[.]o' | cut -d : -f 1 | xargs make -j$NIX_BUILD_CORES -C hacks
cat hacks/glx/Makefile.in \
| grep -E '([a-z0-9]+):[[:space:]]*\1[.]o' | cut -d : -f 1 | xargs make -j$NIX_BUILD_CORES -C hacks/glx
cp -f $(find hacks -type f -perm -111 "!" -name "*.*" ) "$out/libexec/xscreensaver"
'';
passthru.tests = {
xscreensaver = nixosTests.xscreensaver;
};
meta = {
2020-03-26 06:13:34 +00:00
homepage = "https://www.jwz.org/xscreensaver/";
description = "A set of screensavers";
downloadPage = "https://www.jwz.org/xscreensaver/download.html";
2023-04-22 15:57:26 +00:00
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ raskin AndersonTorres ];
platforms = lib.platforms.unix;
};
2023-04-22 15:57:26 +00:00
})