Enhance flow-browser-bin package: add mesa dependency, improve libvips symlink handling, and stabilize launcher name in desktop entry.
Build and populate cache / tests (chiasson, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-25.05.tar.gz, chiasson) (push) Successful in 1m54s
Build and populate cache / tests (chiasson, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable.tar.gz, chiasson) (push) Successful in 1m49s
Build and populate cache / tests (chiasson, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz, chiasson) (push) Successful in 1m46s

This commit is contained in:
2026-01-11 20:53:38 -04:00
parent feff32f4c0
commit 41c3ebec4b
+27 -3
View File
@@ -3,6 +3,7 @@
, fetchurl
, runCommand
, stdenv
, mesa
, vips
}:
@@ -18,8 +19,17 @@ let
mkdir -p $out/lib
# Link to the SONAME symlinks provided by nixpkgs, so we don't hardcode the
# 42.x.y patchlevel.
ln -s ${vips.out}/lib/libvips-cpp.so.42 $out/lib/libvips-cpp.so.${vips.version}
ln -s ${vips.out}/lib/libvips.so.42 $out/lib/libvips.so.${vips.version}
ln -sf ${vips.out}/lib/libvips-cpp.so.42 $out/lib/libvips-cpp.so.8
ln -sf ${vips.out}/lib/libvips.so.42 $out/lib/libvips.so.8
# `sharp` wants an exact libvips filename including patchlevel (observed in
# Flow 0.8.6: libvips-cpp.so.8.17.3). Provide a small compatibility set:
# - the version bundled with Flow (`8.17.3`)
# - the current nixpkgs vips.version (helps when they match)
for v in 8.17.3 ${vips.version}; do
ln -sf ${vips.out}/lib/libvips-cpp.so.42 $out/lib/libvips-cpp.so.$v
ln -sf ${vips.out}/lib/libvips.so.42 $out/lib/libvips.so.$v
done
'';
src =
@@ -43,12 +53,19 @@ in
appimageTools.wrapType2 {
inherit pname version src;
extraPkgs = pkgs: [ vipsSharpCompat ];
extraPkgs = _pkgs: [
vipsSharpCompat
mesa
];
# Ensure `sharp` can find libvips in the bubblewrapped FHS env.
# (Relying on /usr/lib64 + ld.so cache can be flaky depending on the env.)
profile = ''
export LD_LIBRARY_PATH="${vipsSharpCompat}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
# Help Electron/ANGLE find GL/EGL drivers inside the FHS env.
export LIBGL_DRIVERS_PATH="${mesa}/lib/dri"
export __EGL_VENDOR_LIBRARY_DIRS="${mesa}/share/glvnd/egl_vendor.d''${__EGL_VENDOR_LIBRARY_DIRS:+:}$__EGL_VENDOR_LIBRARY_DIRS"
'';
extraInstallCommands = ''
@@ -59,6 +76,13 @@ appimageTools.wrapType2 {
substituteInPlace $out/share/applications/flow-browser.desktop \
--replace-fail 'Exec=AppRun' 'Exec=${pname}'
# Keep the launcher name stable (avoid showing version suffixes in menus).
if grep -q '^Name=' $out/share/applications/flow-browser.desktop; then
sed -i 's/^Name=.*/Name=Flow/' $out/share/applications/flow-browser.desktop
else
echo 'Name=Flow' >> $out/share/applications/flow-browser.desktop
fi
# Icon
install -D -m 444 ${appimageContents}/usr/share/icons/hicolor/512x512/apps/Flow.png \
$out/share/icons/hicolor/512x512/apps/flow-browser.png