nixos-config/pkgs/lwp/default.nix

48 lines
932 B
Nix
Raw Normal View History

2022-09-26 06:34:19 +00:00
{ stdenv
, lib
, fetchFromGitHub
, SDL2
, xorg
2022-10-24 04:04:08 +00:00
, libconfig
2022-09-26 06:34:19 +00:00
}:
stdenv.mkDerivation rec {
pname = "lwp";
2022-10-24 04:04:08 +00:00
version = "1.2";
2022-09-26 06:34:19 +00:00
src = fetchFromGitHub {
owner = "jszczerbinsky";
repo = pname;
rev = version;
2022-10-24 04:04:08 +00:00
sha256 = "sha256-5/wnPXIfC8jiyjC0/2x/PoBZ1lONcoQ3NWL6uEuqPv8=";
2022-09-26 06:34:19 +00:00
};
2022-10-24 04:04:08 +00:00
postPatch = ''
substituteInPlace default.cfg --replace "/usr/share" "${placeholder "out"}/share"
'';
buildPhase = ''
gcc main.c window.c parser.c debug.c -lSDL2 -lX11
'';
2022-09-26 06:34:19 +00:00
installPhase = ''
install -Dm0755 a.out $out/bin/lwp
2022-10-24 04:04:08 +00:00
install -Dm0644 default.cfg -t $out/etc
2022-09-26 06:34:19 +00:00
mkdir -p $out/share/lwp
cp -R ./wallpapers $out/share/lwp
'';
buildInputs = [
SDL2
xorg.libX11
2022-10-24 04:04:08 +00:00
libconfig
2022-09-26 06:34:19 +00:00
];
meta = with lib; {
homepage = "https://github.com/jszczerbinsky/lwp";
description = "Parallax wallpaper engine for Linux and Windows";
license = licenses.mit;
platforms = platforms.unix;
};
}