lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

xdg-desktop-portal: fix icon validation

Validation requires bubblewrap, but the current build system does not enforce it being present.

Additionally, the validation itself needs to have thumbnailer Nix store paths available in sandbox. Let’s add a patch from Flatpak and introduce a test verifying it still works.

This was probably broken since https://github.com/NixOS/nixpkgs/commit/c3b07a052fadf19bfa6b7a26e1c12125da4ef71d

+22 -6
+22 -6
pkgs/development/libraries/xdg-desktop-portal/default.nix
··· 3 3 , autoreconfHook 4 4 , dbus 5 5 , fetchFromGitHub 6 - , fetchpatch 7 6 , flatpak 8 7 , fuse3 8 + , bubblewrap 9 9 , systemdMinimal 10 10 , geoclue2 11 11 , glib ··· 20 20 , python3 21 21 , pkg-config 22 22 , stdenv 23 - , substituteAll 23 + , runCommand 24 24 , wrapGAppsHook 25 25 , enableGeoLocation ? true 26 26 }: 27 27 28 - stdenv.mkDerivation rec { 28 + stdenv.mkDerivation (finalAttrs: { 29 29 pname = "xdg-desktop-portal"; 30 30 version = "1.15.0"; 31 31 ··· 33 33 34 34 src = fetchFromGitHub { 35 35 owner = "flatpak"; 36 - repo = pname; 37 - rev = version; 36 + repo = "xdg-desktop-portal"; 37 + rev = finalAttrs.version; 38 38 sha256 = "sha256-Kw3zJeGwPfw1fDo8HsgYmrpgCk/PUvWZPRloKJNAJVc="; 39 39 }; 40 40 41 + patches = [ 42 + # The icon validator copied from Flatpak needs to access the gdk-pixbuf loaders 43 + # in the Nix store and cannot bind FHS paths since those are not available on NixOS. 44 + (runCommand "icon-validator.patch" { } '' 45 + # Flatpak uses a different path 46 + substitute "${flatpak.icon-validator-patch}" "$out" \ 47 + --replace "/icon-validator/validate-icon.c" "/src/validate-icon.c" 48 + '') 49 + ]; 50 + 41 51 nativeBuildInputs = [ 42 52 autoreconfHook 43 53 libxml2 ··· 50 60 dbus 51 61 flatpak 52 62 fuse3 63 + bubblewrap 53 64 systemdMinimal # libsystemd 54 65 glib 55 66 gsettings-desktop-schemas ··· 83 94 passthru = { 84 95 tests = { 85 96 installedTests = nixosTests.installed-tests.xdg-desktop-portal; 97 + 98 + validate-icon = runCommand "test-icon-validation" { } '' 99 + ${finalAttrs.finalPackage}/libexec/xdg-desktop-portal-validate-icon --sandbox 512 512 ${../../../applications/audio/zynaddsubfx/ZynLogo.svg} > "$out" 100 + grep format=svg "$out" 101 + ''; 86 102 }; 87 103 }; 88 104 ··· 92 108 maintainers = with maintainers; [ jtojnar ]; 93 109 platforms = platforms.linux; 94 110 }; 95 - } 111 + })