8 , gobject-introspection
50 , gsettings-desktop-schemas
55 stdenv.mkDerivation (finalAttrs: {
59 # TODO: split out lib once we figure out what to do with triggerdir
60 outputs = [ "out" "dev" "man" "doc" "devdoc" "installedTests" ];
63 url = "https://github.com/flatpak/flatpak/releases/download/${finalAttrs.version}/flatpak-${finalAttrs.version}.tar.xz";
64 sha256 = "sha256-jidpc3cOok3fJZetSuzTa5g5PmvekeSOF0OqymfyeBU="; # Taken from https://github.com/flatpak/flatpak/releases/
68 # Hardcode paths used by tests and change test runtime generation to use files from Nix store.
69 # https://github.com/flatpak/flatpak/issues/1460
71 src = ./fix-test-paths.patch;
72 inherit coreutils gettext socat gtk3;
73 smi = shared-mime-info;
74 dfu = desktop-file-utils;
75 hicolorIconTheme = hicolor-icon-theme;
78 # Hardcode paths used by Flatpak itself.
80 src = ./fix-paths.patch;
81 p11kit = "${p11-kit.bin}/bin/p11-kit";
84 # Allow gtk-doc to find schemas using XML_CATALOG_FILES environment variable.
85 # Patch taken from gtk-doc expression.
86 ./respect-xml-catalog-files-var.patch
88 # Nix environment hacks should not leak into the apps.
89 # https://github.com/NixOS/nixpkgs/issues/53441
90 ./unset-env-vars.patch
92 # Do not clear XDG_DATA_DIRS in fish shell
93 # https://github.com/flatpak/flatpak/pull/5123
94 ./no-breaking-fish.patch
96 # The icon validator needs to access the gdk-pixbuf loaders in the Nix store
97 # and cannot bind FHS paths since those are not available on NixOS.
98 finalAttrs.passthru.icon-validator-patch
101 nativeBuildInputs = [
107 gobject-introspection
136 gsettings-desktop-schemas
138 librsvg # for flatpak-validate-icon
141 # Required by flatpak.pc
142 propagatedBuildInputs = [
151 # TODO: some issues with temporary files
154 NIX_LDFLAGS = "-lpthread";
156 enableParallelBuilding = true;
160 "--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
161 "--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy"
162 "--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"
163 "--localstatedir=/var"
165 "--enable-installed-tests"
169 "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
170 "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
174 vsc-py = python3.withPackages (pp: [
178 patchShebangs buildutil
180 PATH=${lib.makeBinPath [vsc-py]}:$PATH patchShebangs --build subprojects/variant-schema-compiler/variant-schema-compiler
185 # Use flatpak from PATH in exported assets (e.g. desktop files).
186 --set FLATPAK_BINARY flatpak
191 icon-validator-patch = substituteAll {
192 src = ./fix-icon-validation.patch;
193 inherit (builtins) storeDir;
197 installedTests = nixosTests.installed-tests.flatpak;
199 validate-icon = runCommand "test-icon-validation" { } ''
200 ${finalAttrs.finalPackage}/libexec/flatpak-validate-icon --sandbox 512 512 ${../../../applications/audio/zynaddsubfx/ZynLogo.svg} > "$out"
201 grep format=svg "$out"
207 description = "Linux application sandboxing and distribution framework";
208 homepage = "https://flatpak.org/";
209 license = licenses.lgpl21Plus;
210 maintainers = with maintainers; [ jtojnar ];
211 platforms = platforms.linux;