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-ijTb0LZ8Q051mLmOxpCVPQRvDbJuSArq+0bXKuxxZ5k="; # 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 # Use flatpak from PATH to avoid references to `/nix/store` in `/desktop` files.
93 # Applications containing `DBusActivatable` entries should be able to find the flatpak binary.
94 # https://github.com/NixOS/nixpkgs/issues/138956
97 # The icon validator needs to access the gdk-pixbuf loaders in the Nix store
98 # and cannot bind FHS paths since those are not available on NixOS.
99 finalAttrs.passthru.icon-validator-patch
102 nativeBuildInputs = [
108 gobject-introspection
137 gsettings-desktop-schemas
139 librsvg # for flatpak-validate-icon
142 # Required by flatpak.pc
143 propagatedBuildInputs = [
148 nativeCheckInputs = [
152 # TODO: some issues with temporary files
155 NIX_LDFLAGS = "-lpthread";
157 enableParallelBuilding = true;
161 "--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
162 "--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy"
163 "--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"
164 "--localstatedir=/var"
166 "--enable-installed-tests"
170 "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
171 "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
175 vsc-py = python3.withPackages (pp: [
179 patchShebangs buildutil
181 PATH=${lib.makeBinPath [vsc-py]}:$PATH patchShebangs --build subprojects/variant-schema-compiler/variant-schema-compiler
185 icon-validator-patch = substituteAll {
186 src = ./fix-icon-validation.patch;
187 inherit (builtins) storeDir;
191 installedTests = nixosTests.installed-tests.flatpak;
193 validate-icon = runCommand "test-icon-validation" { } ''
194 ${finalAttrs.finalPackage}/libexec/flatpak-validate-icon --sandbox 512 512 ${../../../applications/audio/zynaddsubfx/ZynLogo.svg} > "$out"
195 grep format=svg "$out"
201 description = "Linux application sandboxing and distribution framework";
202 homepage = "https://flatpak.org/";
203 license = licenses.lgpl21Plus;
204 maintainers = with maintainers; [ ];
205 platforms = platforms.linux;