···
gsettings-desktop-schemas,
···
59
+
withAutoSideloading ? false,
60
+
withDocbookDocs ? true,
withGtkDoc ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
63
+
withSELinuxModule ? false,
stdenv.mkDerivation (finalAttrs: {
65
-
version = "1.14.10";
# TODO: split out lib once we figure out what to do with triggerdir
77
-
separateDebugInfo = true;
77
+
++ lib.optionals (withDocbookDocs || withGtkDoc) [
81
+
++ lib.optional finalAttrs.doCheck "installedTests"
82
+
++ lib.optional withMan "man";
url = "https://github.com/flatpak/flatpak/releases/download/${finalAttrs.version}/flatpak-${finalAttrs.version}.tar.xz";
81
-
hash = "sha256-a73HkIEnNQrYWkpH1wKSyi9MRul3sysf0jHCpxnYIc0=";
86
+
hash = "sha256-ywrFZa3LYhJ8bRHtUO5wRNaoNvppw1Sy9LZAoiv6Syo=";
···
95
-
smi = shared-mime-info;
dfu = desktop-file-utils;
hicolorIconTheme = hicolor-icon-theme;
102
+
smi = shared-mime-info;
# Hardcode paths used by Flatpak itself.
103
-
p11kit = "${p11-kit.bin}/bin/p11-kit";
108
+
p11kit = lib.getExe p11-kit;
106
-
# Allow gtk-doc to find schemas using XML_CATALOG_FILES environment variable.
107
-
# Patch taken from gtk-doc expression.
108
-
./respect-xml-catalog-files-var.patch
110
-
# Nix environment hacks should not leak into the apps.
111
-
# https://github.com/NixOS/nixpkgs/issues/53441
112
-
./unset-env-vars.patch
# Use flatpak from PATH to avoid references to `/nix/store` in `/desktop` files.
# Applications containing `DBusActivatable` entries should be able to find the flatpak binary.
# https://github.com/NixOS/nixpkgs/issues/138956
119
-
# The icon validator needs to access the gdk-pixbuf loaders in the Nix store
120
-
# and cannot bind FHS paths since those are not available on NixOS.
121
-
finalAttrs.passthru.icon-validator-patch
# Try mounting fonts and icons from NixOS locations if FHS locations don't exist.
# https://github.com/NixOS/nixpkgs/issues/119433
127
-
# TODO: Remove when updating to 1.16
128
-
# Ensure flatpak uses the system's zoneinfo from $TZDIR
129
-
# https://github.com/NixOS/nixpkgs/issues/238386
131
-
url = "https://github.com/flatpak/flatpak/pull/5850/commits/a8a35bf4d9fc3d76e1a5049a6a591faec04a42fd.patch";
132
-
hash = "sha256-JqkPbnzgZNZq/mplZqohhHFdjRrvYFjE4C02pI3feBo=";
135
-
url = "https://github.com/flatpak/flatpak/pull/5850/commits/5ea13b09612215559081c27b60df4fb720cb08d5.patch";
136
-
hash = "sha256-BWbyQ2en3RtN4Ec5n62CULAhvywlQLhcl3Fmd4fsR1s=";
139
-
url = "https://github.com/flatpak/flatpak/pull/5850/commits/7c8a81f08908019bbf69358de199748a9bcb29e3.patch";
140
-
hash = "sha256-RiG2jPmG+Igskxv8oQquOUYsG4srgdMXWe34ojMXslo=";
120
+
# Nix environment hacks should not leak into the apps.
121
+
# https://github.com/NixOS/nixpkgs/issues/53441
122
+
./unset-env-vars.patch
144
-
nativeBuildInputs = [
150
-
gobject-introspection
124
+
# The icon validator needs to access the gdk-pixbuf loaders in the Nix store
125
+
# and cannot bind FHS paths since those are not available on NixOS.
126
+
finalAttrs.passthru.icon-validator-patch
180
-
gsettings-desktop-schemas
182
-
librsvg # for flatpak-validate-icon
183
-
] ++ lib.optionals withGtkDoc [ gtk-doc ];
129
+
# Fixup shebangs in some scripts
131
+
# Don't prefix the already absolute `man` directory with the install prefix
133
+
patchShebangs buildutil/ tests/
134
+
patchShebangs --build subprojects/variant-schema-compiler/variant-schema-compiler
136
+
substituteInPlace doc/meson.build \
137
+
--replace-fail '$MESON_INSTALL_DESTDIR_PREFIX/@1@/@2@' '@1@/@2@'
142
+
nativeBuildInputs =
144
+
(python3.pythonOnBuildForHost.withPackages (p: [ p.pyparsing ]))
146
+
gobject-introspection
153
+
++ lib.optional withGtkDoc gtk-doc
154
+
++ lib.optional withMan libxslt
155
+
++ lib.optional withSELinuxModule bzip2
156
+
++ lib.optionals withDocbookDocs [
171
+
gsettings-desktop-schemas
175
+
librsvg # for flatpak-validate-icon
187
+
++ lib.optional withGtkDoc gtk-doc
188
+
++ lib.optional withSystemd systemd;
propagatedBuildInputs = [
···
191
-
nativeCheckInputs = [ valgrind ];
193
-
# TODO: some issues with temporary files
197
-
NIX_LDFLAGS = "-lpthread";
199
-
enableParallelBuilding = true;
203
-
"--with-system-bubblewrap=${lib.getExe bubblewrap}"
204
-
"--with-system-dbus-proxy=${lib.getExe xdg-dbus-proxy}"
205
-
"--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"
206
-
"--with-profile-dir=${placeholder "out"}/etc/profile.d"
207
-
"--localstatedir=/var"
208
-
"--sysconfdir=/etc"
209
-
"--enable-gtk-doc=${if withGtkDoc then "yes" else "no"}"
210
-
"--enable-installed-tests"
211
-
"--enable-selinux-module=no"
197
+
(lib.mesonBool "auto_sideloading" withAutoSideloading)
198
+
(lib.mesonBool "installed_tests" finalAttrs.finalPackage.doCheck)
199
+
(lib.mesonBool "tests" finalAttrs.finalPackage.doCheck)
200
+
(lib.mesonEnable "selinux_module" withSELinuxModule)
201
+
(lib.mesonOption "dbus_config_dir" (placeholder "out" + "/share/dbus-1/system.d"))
202
+
(lib.mesonOption "profile_dir" (placeholder "out" + "/etc/profile.d"))
203
+
(lib.mesonOption "system_bubblewrap" (lib.getExe bubblewrap))
204
+
(lib.mesonOption "system_dbus_proxy" (lib.getExe xdg-dbus-proxy))
205
+
(lib.mesonOption "system_fusermount" "/run/wrappers/bin/fusermount3")
206
+
(lib.mesonOption "system_install_dir" "/var/lib/flatpak")
215
-
"installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
216
-
"installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
209
+
nativeCheckInputs = [
221
-
vsc-py = python3.pythonOnBuildForHost.withPackages (pp: [ pp.pyparsing ]);
224
-
patchShebangs buildutil
225
-
patchShebangs tests
226
-
PATH=${lib.makeBinPath [ vsc-py ]}:$PATH patchShebangs --build subprojects/variant-schema-compiler/variant-schema-compiler
215
+
# TODO: Many issues with temporary files, FHS environments, timeouts, and our current patches
228
-
substituteInPlace configure.ac \
229
-
--replace-fail '$BWRAP --' ${
230
-
lib.escapeShellArg (stdenv.hostPlatform.emulator buildPackages + " $BWRAP --")
232
-
--replace-fail '$DBUS_PROXY --' ${
233
-
lib.escapeShellArg (stdenv.hostPlatform.emulator buildPackages + " $DBUS_PROXY --")
218
+
separateDebugInfo = true;
icon-validator-patch = substituteAll {
···
inherit (builtins) storeDir;
243
-
updateScript = nix-update-script { };
246
-
cross = pkgsCross.aarch64-multiplatform.flatpak;
248
-
installedTests = nixosTests.installed-tests.flatpak;
227
+
pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; };
validate-icon = runCommand "test-icon-validation" { } ''
${finalAttrs.finalPackage}/libexec/flatpak-validate-icon \
···
version = testers.testVersion { package = finalAttrs.finalPackage; };
240
+
updateScript = nix-update-script { };
···
maintainers = with lib.maintainers; [ getchoo ];
platforms = lib.platforms.linux;
251
+
pkgConfigModules = [ "flatpak" ];