io.github.WallpaperEngineLover.we_manager.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. # WE Manager + linux-wallpaperengine built from source for Flathub (CEF is the binary the engine's CMake pins).
  2. # build-local.sh builds from the working trees instead of the pinned commits.
  3. # Generated sources, refreshed when package-lock.json or steamworks.js change:
  4. # flatpak-node-generator npm package-lock.json --electron-node-headers \
  5. # --node-sdk-extension org.freedesktop.Sdk.Extension.node24//25.08 -> generated-sources.json
  6. # flatpak-cargo-generator.py Cargo.lock -> cargo-sources.json
  7. # the latter in a patched steamworks.js checkout, whose Cargo.lock is also steamworks-Cargo.lock
  8. id: io.github.WallpaperEngineLover.we_manager
  9. runtime: org.freedesktop.Platform
  10. runtime-version: '25.08'
  11. sdk: org.freedesktop.Sdk
  12. base: org.electronjs.Electron2.BaseApp
  13. base-version: '25.08'
  14. sdk-extensions:
  15. - org.freedesktop.Sdk.Extension.node24
  16. - org.freedesktop.Sdk.Extension.rust-stable
  17. command: we-manager
  18. separate-locales: false
  19. finish-args:
  20. - --share=ipc
  21. - --share=network
  22. - --socket=wayland
  23. - --socket=fallback-x11
  24. # wallpaper sounds, and the sink monitor the visualizers react to
  25. - --socket=pulseaudio
  26. - --device=dri
  27. # the Steam client's IPC (steamworks.js) uses shared memory
  28. - --device=shm
  29. # Steam libraries, workshop folders, WE assets, user wallpaper folders
  30. - --filesystem=home
  31. - --filesystem=~/.var/app/com.valvesoftware.Steam
  32. # library folders on other disks
  33. - --filesystem=/mnt
  34. - --filesystem=/media
  35. - --filesystem=/run/media
  36. # display tools, wallpaper setters, desktop icons overlay, user shortcuts, and the engine's Wayland connection
  37. # where Flatpak's socket hides the layer shell (Hyprland)
  38. - --talk-name=org.freedesktop.Flatpak
  39. # KWin scripts for cursor and fullscreen detection call back into the engine
  40. - --talk-name=org.kde.KWin
  41. - --talk-name=org.kde.plasmashell
  42. - --own-name=org.linuxwallpaperengine.*
  43. # Hyprland IPC for the cursor position
  44. - --filesystem=xdg-run/hypr:ro
  45. # media info for wallpapers that show the playing song
  46. - --talk-name=org.mpris.MediaPlayer2.*
  47. - --talk-name=org.kde.StatusNotifierWatcher
  48. - --talk-name=org.freedesktop.Notifications
  49. # lock and blanked display pause: logind's LockedHint, the screen savers' GetActive, Mutter's PowerSaveMode
  50. - --system-talk-name=org.freedesktop.login1
  51. - --talk-name=org.freedesktop.ScreenSaver
  52. - --talk-name=org.gnome.ScreenSaver
  53. - --talk-name=org.cinnamon.ScreenSaver
  54. - --talk-name=org.mate.ScreenSaver
  55. - --talk-name=org.gnome.Mutter.DisplayConfig
  56. cleanup:
  57. - /include
  58. - /lib/pkgconfig
  59. - /lib/cmake
  60. - /share/man
  61. - /share/doc
  62. - '*.a'
  63. - '*.la'
  64. modules:
  65. - name: glu
  66. buildsystem: meson
  67. config-opts:
  68. - -Dgl_provider=glvnd
  69. sources:
  70. - type: archive
  71. url: https://archive.mesa3d.org/glu/glu-9.0.3.tar.xz
  72. sha256: bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f
  73. - name: glew
  74. no-autogen: true
  75. make-args:
  76. - GLEW_PREFIX=${FLATPAK_DEST}
  77. - GLEW_DEST=${FLATPAK_DEST}
  78. - LIBDIR=${FLATPAK_DEST}/lib
  79. - CFLAGS.EXTRA:=${CFLAGS} -fPIC
  80. - LDFLAGS.EXTRA=${LDFLAGS}
  81. make-install-args:
  82. - GLEW_PREFIX=${FLATPAK_DEST}
  83. - GLEW_DEST=${FLATPAK_DEST}
  84. - LIBDIR=${FLATPAK_DEST}/lib
  85. cleanup:
  86. - /bin
  87. sources:
  88. - type: archive
  89. url: https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz
  90. sha256: d4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1
  91. - name: freeglut
  92. buildsystem: cmake-ninja
  93. build-options:
  94. # its old style empty parameter lists mean (void) in C23, GCC 15's default
  95. cflags: -std=gnu17
  96. config-opts:
  97. - -DCMAKE_BUILD_TYPE=Release
  98. - -DFREEGLUT_BUILD_DEMOS=OFF
  99. - -DFREEGLUT_BUILD_STATIC_LIBS=OFF
  100. - -DFREEGLUT_WAYLAND=OFF
  101. # 3.6.0 still asks for CMake 2.8
  102. - -DCMAKE_POLICY_VERSION_MINIMUM=3.5
  103. sources:
  104. - type: archive
  105. url: https://github.com/freeglut/freeglut/releases/download/v3.6.0/freeglut-3.6.0.tar.gz
  106. sha256: 9c3d4d6516fbfa0280edc93c77698fb7303e443c1aaaf37d269e3288a6c3ea52
  107. - name: glfw
  108. buildsystem: cmake-ninja
  109. config-opts:
  110. - -DCMAKE_BUILD_TYPE=Release
  111. - -DBUILD_SHARED_LIBS=ON
  112. - -DGLFW_BUILD_EXAMPLES=OFF
  113. - -DGLFW_BUILD_TESTS=OFF
  114. - -DGLFW_BUILD_DOCS=OFF
  115. sources:
  116. - type: archive
  117. url: https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip
  118. sha256: b5ec004b2712fd08e8861dc271428f048775200a2df719ccf575143ba749a3e9
  119. # headers only
  120. - name: glm
  121. buildsystem: simple
  122. build-commands:
  123. - cp -r glm ${FLATPAK_DEST}/include/
  124. sources:
  125. - type: archive
  126. url: https://github.com/g-truc/glm/archive/refs/tags/1.0.1.tar.gz
  127. sha256: 9f3174561fd26904b23f0db5e560971cbf9b3cbda0b280f04d5c379d03bf234c
  128. - name: libass
  129. config-opts:
  130. - --disable-static
  131. sources:
  132. - type: archive
  133. url: https://github.com/libass/libass/releases/download/0.17.4/libass-0.17.4.tar.xz
  134. sha256: 78f1179b838d025e9c26e8fef33f8092f65611444ffa1bfc0cfac6a33511a05a
  135. - name: libplacebo
  136. buildsystem: meson
  137. config-opts:
  138. - -Ddemos=false
  139. - -Dtests=false
  140. # GL rendering only; this tag's utils_gen.py fails on Python 3.13
  141. - -Dvulkan=disabled
  142. sources:
  143. - type: git
  144. url: https://code.videolan.org/videolan/libplacebo.git
  145. tag: v7.351.0
  146. commit: 3188549fba13bbdf3a5a98de2a38c2e71f04e21e
  147. # libmpv only
  148. - name: mpv
  149. buildsystem: meson
  150. config-opts:
  151. - -Dlibmpv=true
  152. - -Dcplayer=false
  153. - -Dlua=disabled
  154. - -Djavascript=disabled
  155. - -Dmanpage-build=disabled
  156. sources:
  157. - type: archive
  158. url: https://github.com/mpv-player/mpv/archive/refs/tags/v0.40.0.tar.gz
  159. sha256: 10a0f4654f62140a6dd4d380dcf0bbdbdcf6e697556863dc499c296182f081a3
  160. # V8 for wallpaper scripts
  161. - name: libnode
  162. buildsystem: simple
  163. build-commands:
  164. - ./configure --prefix=${FLATPAK_DEST} --shared --shared-zlib --shared-openssl --without-npm --without-corepack
  165. # some of V8's compiler units take over 3 GB each
  166. - make -j$(( (FLATPAK_BUILDER_N_JOBS + 3) / 4 ))
  167. - make install
  168. cleanup:
  169. - /bin/node
  170. - /share
  171. sources:
  172. - type: archive
  173. url: https://nodejs.org/dist/v24.18.0/node-v24.18.0.tar.xz
  174. sha256: e94afde24db08e0c564ee7110a2d5aab51ee0059382c9fd8233c54eec47b28f9
  175. - name: linux-wallpaperengine
  176. buildsystem: simple
  177. build-commands:
  178. # where DownloadCEF looks for the pinned archive
  179. - mkdir -p build/cef && mv cef-archive/*.tar.bz2 build/cef/
  180. # the SDK's _FORTIFY_SOURCE=3 collides with CEF's under -Werror
  181. - CFLAGS="${CFLAGS//-Wp,-D_FORTIFY_SOURCE=3/}" CXXFLAGS="${CXXFLAGS//-Wp,-D_FORTIFY_SOURCE=3/}"
  182. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/app/lib/linux-wallpaperengine-kde -DCMAKE_PREFIX_PATH=/app
  183. -DV8_INCLUDE_DIR=/app/include/node -DV8_LIBRARY=/app/lib/libnode.so.137
  184. - ninja -C build
  185. - ninja -C build install
  186. - ln -s ../lib/linux-wallpaperengine-kde/linux-wallpaperengine ${FLATPAK_DEST}/bin/linux-wallpaperengine
  187. cleanup:
  188. # drop kissfft and glslang tools
  189. - /lib/linux-wallpaperengine-kde/*-float
  190. - /lib/linux-wallpaperengine-kde/glslang*
  191. - /lib/linux-wallpaperengine-kde/spirv-*
  192. - /lib/linux-wallpaperengine-kde/chrome-sandbox
  193. - /lib/linux-wallpaperengine-kde/bin
  194. - /lib/linux-wallpaperengine-kde/include
  195. - /lib/linux-wallpaperengine-kde/share
  196. - /lib/linux-wallpaperengine-kde/lib64/cmake
  197. - /lib/linux-wallpaperengine-kde/lib64/pkgconfig
  198. sources:
  199. - type: git
  200. url: https://github.com/WallpaperEngineLover/linux-wallpaperengine-kde.git
  201. tag: v0.9.9
  202. commit: 4ccdfaf3cf11e18c01c23522089d0d9993c33506
  203. - type: file
  204. url: https://cef-builds.spotifycdn.com/cef_binary_156.0.14%2Bg4fa4ab5%2Bchromium-156.0.8078.48_linux64_minimal.tar.bz2
  205. sha256: 4191ac920a91a052eba04afb6ed830d47aed46a3e246c434a2f062c23588dc8a
  206. dest: cef-archive
  207. dest-filename: cef_binary_156.0.14+g4fa4ab5+chromium-156.0.8078.48_linux64_minimal.tar.bz2
  208. - name: we-manager
  209. buildsystem: simple
  210. build-options:
  211. append-path: /usr/lib/sdk/node24/bin:/usr/lib/sdk/rust-stable/bin
  212. env:
  213. XDG_CACHE_HOME: /run/build/we-manager/flatpak-node/cache
  214. npm_config_cache: /run/build/we-manager/flatpak-node/npm-cache
  215. npm_config_offline: 'true'
  216. CARGO_HOME: /run/build/we-manager/cargo
  217. build-commands:
  218. - npm ci --offline
  219. # steamworks.js with patches/steamworks-vote, like the release build
  220. - printf '\n[patch."https://github.com/Noxime/steamworks-rs/"]\nsteamworks = { path = "../steamworks-rs" }\n' >> steamworksjs/Cargo.toml
  221. - cp steamworks-Cargo.lock steamworksjs/Cargo.lock
  222. - cargo --offline build --release --manifest-path steamworksjs/Cargo.toml
  223. - install -m644 steamworksjs/target/release/libsteamworksjs.so node_modules/steamworks.js/dist/linux64/steamworksjs.linux-x64-gnu.node
  224. - install -m644 steamworksjs/client.d.ts node_modules/steamworks.js/client.d.ts
  225. - npm run build
  226. # use the fetched Electron zip instead of a download
  227. - mkdir electron-dist && unzip -q "$(find flatpak-node/cache/electron -name 'electron-v*-linux-x64.zip' | head -1)" -d electron-dist
  228. - . flatpak-node/electron-builder-arch-args.sh; npx electron-builder $ELECTRON_BUILDER_ARCH_ARGS --linux --dir
  229. -c.npmRebuild=false -c.electronDist=electron-dist
  230. - cp -a dist/linux-unpacked ${FLATPAK_DEST}/we-manager
  231. - install -Dm755 we-manager.sh ${FLATPAK_DEST}/bin/we-manager
  232. - install -Dm644 packaging/flathub/${FLATPAK_ID}.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
  233. - install -Dm644 packaging/flatpak/${FLATPAK_ID}.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml
  234. - for size in 16 22 24 32 48 64 128 256 512; do install -Dm644 resources/icons/linux/${size}x${size}.png
  235. ${FLATPAK_DEST}/share/icons/hicolor/${size}x${size}/apps/${FLATPAK_ID}.png; done
  236. sources:
  237. - type: git
  238. url: https://github.com/WallpaperEngineLover/we_manager.git
  239. tag: v0.9.9
  240. commit: e2f20e91f601b0b09e7583ea9a18314d372d776a
  241. - generated-sources.json
  242. - type: git
  243. url: https://github.com/Noxime/steamworks-rs.git
  244. commit: fbb79635b06b4feea8261e5ca3e8ea3ef42facf9
  245. dest: steamworks-rs
  246. - type: patch
  247. path: ../../patches/steamworks-vote/steamworks-rs-ugc.patch
  248. use-git: true
  249. dest: steamworks-rs
  250. - type: git
  251. url: https://github.com/ceifa/steamworks.js.git
  252. commit: 80c5fd7c4958ba90cf87403c3f967b8a6d748473
  253. dest: steamworksjs
  254. - type: patch
  255. paths:
  256. - ../../patches/steamworks-vote/steamworks-js-workshop.patch
  257. - ../../patches/steamworks-vote/steamworks-js-client-d-ts.patch
  258. use-git: true
  259. dest: steamworksjs
  260. - type: file
  261. path: steamworks-Cargo.lock
  262. - cargo-sources.json
  263. - type: file
  264. path: ../flatpak/we-manager.sh