| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- {
- lib,
- stdenv,
- fetchurl,
- cmake,
- pkg-config,
- python3,
- autoPatchelfHook,
- wayland-scanner,
- binutils,
- glm,
- glfw,
- glew,
- freeglut,
- libGLU,
- libGL,
- libglvnd,
- SDL2,
- lz4,
- zlib,
- ffmpeg,
- mpv-unwrapped,
- libpulseaudio,
- freetype,
- harfbuzz,
- dbus,
- wayland,
- wayland-protocols,
- libxkbcommon,
- xorg,
- gmp,
- nodejs-slim_24,
- nss,
- nspr,
- cups,
- at-spi2-atk,
- at-spi2-core,
- atk,
- libdrm,
- mesa,
- libgbm,
- systemdLibs,
- alsa-lib,
- pango,
- cairo,
- glib,
- expat,
- libva,
- vulkan-loader,
- pipewire,
- src,
- version,
- disableKdeFeatures ? false,
- }:
- let
- # V8 comes from Node.js's shared library like on the distributions (Arch's AUR libnode is the same build).
- # nixpkgs only has a static libv8, whose local-exec TLS can't go into our shared library
- libnode = nodejs-slim_24.overrideAttrs (old: {
- pname = "libnode";
- configureFlags = (old.configureFlags or [ ]) ++ [ "--shared" ];
- doCheck = false;
- doInstallCheck = false;
- });
- # the web helper links nothing but libcef.so, and ld finds the libraries libcef.so needs only through -rpath-link
- cefLibraries = lib.makeLibraryPath (
- [
- glib
- nss
- nspr
- dbus
- atk
- at-spi2-atk
- at-spi2-core
- cups
- libgbm
- expat
- libxkbcommon
- pango
- cairo
- alsa-lib
- systemdLibs
- ]
- ++ (with xorg; [
- libX11
- libXcomposite
- libXdamage
- libXext
- libXfixes
- libXrandr
- libxcb
- ])
- );
- # the version CMakeLists.txt pins, CMake's DownloadCEF finds the archive already in its folder
- cefVersion = "135.0.17+gcbc1c5b+chromium-135.0.7049.52";
- cefArchive = "cef_binary_${cefVersion}_linux64_minimal.tar.bz2";
- cef = fetchurl {
- url = "https://cef-builds.spotifycdn.com/${lib.replaceStrings [ "+" ] [ "%2B" ] cefArchive}";
- hash = "sha256-JKwZgOYr57GuosM31r1Lx3DczYs35HxtuUs5fxPsTcY=";
- };
- in
- stdenv.mkDerivation {
- pname = "linux-wallpaperengine-kde";
- inherit version src;
- nativeBuildInputs = [
- cmake
- pkg-config
- python3
- autoPatchelfHook
- wayland-scanner
- binutils
- ];
- buildInputs = [
- glm
- glfw
- glew
- freeglut
- libGLU
- libGL
- SDL2
- lz4
- zlib
- ffmpeg
- mpv-unwrapped
- libpulseaudio
- freetype
- harfbuzz
- dbus
- wayland
- wayland-protocols
- libxkbcommon
- gmp
- libnode
- # CEF's own libraries
- nss
- nspr
- cups
- at-spi2-atk
- at-spi2-core
- atk
- libdrm
- mesa
- libgbm
- systemdLibs
- alsa-lib
- pango
- cairo
- glib
- expat
- ]
- ++ (with xorg; [
- libX11
- libXrandr
- libXinerama
- libXcursor
- libXi
- libXxf86vm
- libXcomposite
- libXdamage
- libXext
- libXfixes
- libxshmfence
- libxcb
- ]);
- # loaded at runtime with dlopen (GL dispatch, Vulkan for CEF, VA-API, the audio backends SDL picks)
- runtimeDependencies = map lib.getLib [
- libglvnd
- vulkan-loader
- libva
- libpulseaudio
- pipewire
- alsa-lib
- wayland
- libxkbcommon
- ];
- cmakeFlags = [
- (lib.cmakeBool "DISABLE_KDE_FEATURES" disableKdeFeatures)
- (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release")
- (lib.cmakeFeature "V8_INCLUDE_DIR" "${libnode}/include/node")
- # relative, package_release.sh installs into a prefix of its own
- (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib")
- (lib.cmakeFeature "CMAKE_EXE_LINKER_FLAGS" "-Wl,-rpath-link,${cefLibraries}")
- ];
- # the CEF wrapper library builds with -Werror and defines its own _FORTIFY_SOURCE
- hardeningDisable = [ "fortify" "fortify3" ];
- preConfigure = ''
- # node installs only the versioned libnode.so.<abi>
- cmakeFlagsArray+=("-DV8_LIBRARY=$(echo ${libnode}/lib/libnode.so.*)")
- mkdir -p build/cef
- ln -s ${cef} build/cef/${cefArchive}
- '';
- # the same file set as the release tarballs, the install tree also carries the vendored libraries' tools
- installPhase = ''
- runHook preInstall
- bash ../tools/package_release.sh . linux-wallpaperengine-kde "$TMPDIR/dist"
- mkdir -p $out/opt $out/bin
- tar -xzf "$TMPDIR/dist/linux-wallpaperengine-kde.tar.gz" -C $out/opt
- ln -s $out/opt/linux-wallpaperengine-kde/linux-wallpaperengine $out/bin/linux-wallpaperengine
- cp -r $out/opt/linux-wallpaperengine-kde/share $out/share
- runHook postInstall
- '';
- dontStrip = true;
- meta = {
- description = "Wallpaper Engine live wallpapers on Linux, fork of linux-wallpaperengine (started with KDE, now supports most desktops)";
- homepage = "https://github.com/WallpaperEngineLover/linux-wallpaperengine-kde";
- license = lib.licenses.gpl3Only;
- platforms = [ "x86_64-linux" ];
- mainProgram = "linux-wallpaperengine";
- };
- }
|