io.github.WallpaperEngineLover.we_manager.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. cleanup:
  50. - /include
  51. - /lib/pkgconfig
  52. - /lib/cmake
  53. - /share/man
  54. - /share/doc
  55. - '*.a'
  56. - '*.la'
  57. modules:
  58. - name: glu
  59. buildsystem: meson
  60. config-opts:
  61. - -Dgl_provider=glvnd
  62. sources:
  63. - type: archive
  64. url: https://archive.mesa3d.org/glu/glu-9.0.3.tar.xz
  65. sha256: bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f
  66. - name: glew
  67. no-autogen: true
  68. make-args:
  69. - GLEW_PREFIX=${FLATPAK_DEST}
  70. - GLEW_DEST=${FLATPAK_DEST}
  71. - LIBDIR=${FLATPAK_DEST}/lib
  72. - CFLAGS.EXTRA:=${CFLAGS} -fPIC
  73. - LDFLAGS.EXTRA=${LDFLAGS}
  74. make-install-args:
  75. - GLEW_PREFIX=${FLATPAK_DEST}
  76. - GLEW_DEST=${FLATPAK_DEST}
  77. - LIBDIR=${FLATPAK_DEST}/lib
  78. cleanup:
  79. - /bin
  80. sources:
  81. - type: archive
  82. url: https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz
  83. sha256: d4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1
  84. - name: freeglut
  85. buildsystem: cmake-ninja
  86. build-options:
  87. # its old style empty parameter lists mean (void) in C23, GCC 15's default
  88. cflags: -std=gnu17
  89. config-opts:
  90. - -DCMAKE_BUILD_TYPE=Release
  91. - -DFREEGLUT_BUILD_DEMOS=OFF
  92. - -DFREEGLUT_BUILD_STATIC_LIBS=OFF
  93. - -DFREEGLUT_WAYLAND=OFF
  94. # 3.6.0 still asks for CMake 2.8
  95. - -DCMAKE_POLICY_VERSION_MINIMUM=3.5
  96. sources:
  97. - type: archive
  98. url: https://github.com/freeglut/freeglut/releases/download/v3.6.0/freeglut-3.6.0.tar.gz
  99. sha256: 9c3d4d6516fbfa0280edc93c77698fb7303e443c1aaaf37d269e3288a6c3ea52
  100. - name: glfw
  101. buildsystem: cmake-ninja
  102. config-opts:
  103. - -DCMAKE_BUILD_TYPE=Release
  104. - -DBUILD_SHARED_LIBS=ON
  105. - -DGLFW_BUILD_EXAMPLES=OFF
  106. - -DGLFW_BUILD_TESTS=OFF
  107. - -DGLFW_BUILD_DOCS=OFF
  108. sources:
  109. - type: archive
  110. url: https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip
  111. sha256: b5ec004b2712fd08e8861dc271428f048775200a2df719ccf575143ba749a3e9
  112. # headers only
  113. - name: glm
  114. buildsystem: simple
  115. build-commands:
  116. - cp -r glm ${FLATPAK_DEST}/include/
  117. sources:
  118. - type: archive
  119. url: https://github.com/g-truc/glm/archive/refs/tags/1.0.1.tar.gz
  120. sha256: 9f3174561fd26904b23f0db5e560971cbf9b3cbda0b280f04d5c379d03bf234c
  121. - name: libass
  122. config-opts:
  123. - --disable-static
  124. sources:
  125. - type: archive
  126. url: https://github.com/libass/libass/releases/download/0.17.4/libass-0.17.4.tar.xz
  127. sha256: 78f1179b838d025e9c26e8fef33f8092f65611444ffa1bfc0cfac6a33511a05a
  128. - name: libplacebo
  129. buildsystem: meson
  130. config-opts:
  131. - -Ddemos=false
  132. - -Dtests=false
  133. # GL rendering only; this tag's utils_gen.py fails on Python 3.13
  134. - -Dvulkan=disabled
  135. sources:
  136. - type: git
  137. url: https://code.videolan.org/videolan/libplacebo.git
  138. tag: v7.351.0
  139. commit: 3188549fba13bbdf3a5a98de2a38c2e71f04e21e
  140. # libmpv only
  141. - name: mpv
  142. buildsystem: meson
  143. config-opts:
  144. - -Dlibmpv=true
  145. - -Dcplayer=false
  146. - -Dlua=disabled
  147. - -Djavascript=disabled
  148. - -Dmanpage-build=disabled
  149. sources:
  150. - type: archive
  151. url: https://github.com/mpv-player/mpv/archive/refs/tags/v0.40.0.tar.gz
  152. sha256: 10a0f4654f62140a6dd4d380dcf0bbdbdcf6e697556863dc499c296182f081a3
  153. # V8 for wallpaper scripts
  154. - name: libnode
  155. buildsystem: simple
  156. build-commands:
  157. - ./configure --prefix=${FLATPAK_DEST} --shared --shared-zlib --shared-openssl --without-npm --without-corepack
  158. # some of V8's compiler units take over 3 GB each
  159. - make -j$(( (FLATPAK_BUILDER_N_JOBS + 3) / 4 ))
  160. - make install
  161. cleanup:
  162. - /bin/node
  163. - /share
  164. sources:
  165. - type: archive
  166. url: https://nodejs.org/dist/v24.18.0/node-v24.18.0.tar.xz
  167. sha256: e94afde24db08e0c564ee7110a2d5aab51ee0059382c9fd8233c54eec47b28f9
  168. - name: linux-wallpaperengine
  169. buildsystem: simple
  170. build-commands:
  171. # where DownloadCEF looks for the pinned archive
  172. - mkdir -p build/cef && mv cef-archive/*.tar.bz2 build/cef/
  173. # the SDK's _FORTIFY_SOURCE=3 collides with CEF's under -Werror
  174. - CFLAGS="${CFLAGS//-Wp,-D_FORTIFY_SOURCE=3/}" CXXFLAGS="${CXXFLAGS//-Wp,-D_FORTIFY_SOURCE=3/}"
  175. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/app/lib/linux-wallpaperengine-kde -DCMAKE_PREFIX_PATH=/app
  176. -DV8_INCLUDE_DIR=/app/include/node -DV8_LIBRARY=/app/lib/libnode.so.137
  177. - ninja -C build
  178. - ninja -C build install
  179. - ln -s ../lib/linux-wallpaperengine-kde/linux-wallpaperengine ${FLATPAK_DEST}/bin/linux-wallpaperengine
  180. cleanup:
  181. # drop kissfft and glslang tools
  182. - /lib/linux-wallpaperengine-kde/*-float
  183. - /lib/linux-wallpaperengine-kde/glslang*
  184. - /lib/linux-wallpaperengine-kde/spirv-*
  185. - /lib/linux-wallpaperengine-kde/chrome-sandbox
  186. - /lib/linux-wallpaperengine-kde/bin
  187. - /lib/linux-wallpaperengine-kde/include
  188. - /lib/linux-wallpaperengine-kde/share
  189. - /lib/linux-wallpaperengine-kde/lib64/cmake
  190. - /lib/linux-wallpaperengine-kde/lib64/pkgconfig
  191. sources:
  192. - type: git
  193. url: https://github.com/WallpaperEngineLover/linux-wallpaperengine-kde.git
  194. commit: 85ebc97f0114a9a248b5c8ef8eec9d4aab5b31a5
  195. - type: file
  196. url: https://cef-builds.spotifycdn.com/cef_binary_135.0.17%2Bgcbc1c5b%2Bchromium-135.0.7049.52_linux64_minimal.tar.bz2
  197. sha256: 24ac1980e62be7b1aea2c337d6bd4bc770dccd8b37e47c6db94b397f13ec4dc6
  198. dest: cef-archive
  199. dest-filename: cef_binary_135.0.17+gcbc1c5b+chromium-135.0.7049.52_linux64_minimal.tar.bz2
  200. - name: we-manager
  201. buildsystem: simple
  202. build-options:
  203. append-path: /usr/lib/sdk/node24/bin:/usr/lib/sdk/rust-stable/bin
  204. env:
  205. XDG_CACHE_HOME: /run/build/we-manager/flatpak-node/cache
  206. npm_config_cache: /run/build/we-manager/flatpak-node/npm-cache
  207. npm_config_offline: 'true'
  208. CARGO_HOME: /run/build/we-manager/cargo
  209. build-commands:
  210. - npm ci --offline
  211. # steamworks.js with patches/steamworks-vote, like the release build
  212. - printf '\n[patch."https://github.com/Noxime/steamworks-rs/"]\nsteamworks = { path = "../steamworks-rs" }\n' >> steamworksjs/Cargo.toml
  213. - cp steamworks-Cargo.lock steamworksjs/Cargo.lock
  214. - cargo --offline build --release --manifest-path steamworksjs/Cargo.toml
  215. - install -m644 steamworksjs/target/release/libsteamworksjs.so node_modules/steamworks.js/dist/linux64/steamworksjs.linux-x64-gnu.node
  216. - install -m644 steamworksjs/client.d.ts node_modules/steamworks.js/client.d.ts
  217. - npm run build
  218. # use the fetched Electron zip instead of a download
  219. - mkdir electron-dist && unzip -q "$(find flatpak-node/cache/electron -name 'electron-v*-linux-x64.zip' | head -1)" -d electron-dist
  220. - . flatpak-node/electron-builder-arch-args.sh; npx electron-builder $ELECTRON_BUILDER_ARCH_ARGS --linux --dir
  221. -c.npmRebuild=false -c.electronDist=electron-dist
  222. - cp -a dist/linux-unpacked ${FLATPAK_DEST}/we-manager
  223. - install -Dm755 we-manager.sh ${FLATPAK_DEST}/bin/we-manager
  224. - install -Dm644 packaging/flathub/${FLATPAK_ID}.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
  225. - install -Dm644 packaging/flatpak/${FLATPAK_ID}.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml
  226. - for size in 16 22 24 32 48 64 128 256 512; do install -Dm644 resources/icons/linux/${size}x${size}.png
  227. ${FLATPAK_DEST}/share/icons/hicolor/${size}x${size}/apps/${FLATPAK_ID}.png; done
  228. sources:
  229. - type: git
  230. url: https://github.com/WallpaperEngineLover/we_manager.git
  231. commit: 33dd52c33472d89f12636b3cef5ba9c22bfac407
  232. - generated-sources.json
  233. - type: git
  234. url: https://github.com/Noxime/steamworks-rs.git
  235. commit: fbb79635b06b4feea8261e5ca3e8ea3ef42facf9
  236. dest: steamworks-rs
  237. - type: patch
  238. path: ../../patches/steamworks-vote/steamworks-rs-ugc.patch
  239. use-git: true
  240. dest: steamworks-rs
  241. - type: git
  242. url: https://github.com/ceifa/steamworks.js.git
  243. commit: 80c5fd7c4958ba90cf87403c3f967b8a6d748473
  244. dest: steamworksjs
  245. - type: patch
  246. paths:
  247. - ../../patches/steamworks-vote/steamworks-js-workshop.patch
  248. - ../../patches/steamworks-vote/steamworks-js-client-d-ts.patch
  249. use-git: true
  250. dest: steamworksjs
  251. - type: file
  252. path: steamworks-Cargo.lock
  253. - cargo-sources.json
  254. - type: file
  255. path: ../flatpak/we-manager.sh