fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ lib, stdenv
2, fetchurl
3, autoreconfHook
4, docbook_xml_dtd_45
5, docbook-xsl-nons
6, which
7, libxml2
8, gobject-introspection
9, gtk-doc
10, intltool
11, libxslt
12, pkg-config
13, xmlto
14, substituteAll
15, runCommand
16, bison
17, xdg-dbus-proxy
18, p11-kit
19, appstream
20, bubblewrap
21, bzip2
22, curl
23, dbus
24, glib
25, gpgme
26, json-glib
27, libarchive
28, libcap
29, libseccomp
30, coreutils
31, socat
32, gettext
33, hicolor-icon-theme
34, shared-mime-info
35, desktop-file-utils
36, gtk3
37, fuse3
38, nixosTests
39, xz
40, zstd
41, ostree
42, polkit
43, python3
44, systemd
45, xorg
46, valgrind
47, glib-networking
48, wrapGAppsNoGuiHook
49, dconf
50, gsettings-desktop-schemas
51, librsvg
52, makeWrapper
53}:
54
55stdenv.mkDerivation (finalAttrs: {
56 pname = "flatpak";
57 version = "1.14.6";
58
59 # TODO: split out lib once we figure out what to do with triggerdir
60 outputs = [ "out" "dev" "man" "doc" "devdoc" "installedTests" ];
61
62 src = fetchurl {
63 url = "https://github.com/flatpak/flatpak/releases/download/${finalAttrs.version}/flatpak-${finalAttrs.version}.tar.xz";
64 sha256 = "sha256-U482ssb4xw7v0S0TrVsa2DCCAQaovTqfa45NnegeSUY="; # Taken from https://github.com/flatpak/flatpak/releases/
65 };
66
67 patches = [
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
70 (substituteAll {
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;
76 })
77
78 # Hardcode paths used by Flatpak itself.
79 (substituteAll {
80 src = ./fix-paths.patch;
81 p11kit = "${p11-kit.bin}/bin/p11-kit";
82 })
83
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
87
88 # Nix environment hacks should not leak into the apps.
89 # https://github.com/NixOS/nixpkgs/issues/53441
90 ./unset-env-vars.patch
91
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
95 ./binary-path.patch
96
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
100
101 # Try mounting fonts and icons from NixOS locations if FHS locations don't exist.
102 # https://github.com/NixOS/nixpkgs/issues/119433
103 ./fix-fonts-icons.patch
104 ];
105
106 nativeBuildInputs = [
107 autoreconfHook
108 libxml2
109 docbook_xml_dtd_45
110 docbook-xsl-nons
111 which
112 gobject-introspection
113 gtk-doc
114 intltool
115 libxslt
116 pkg-config
117 xmlto
118 bison
119 wrapGAppsNoGuiHook
120 ];
121
122 buildInputs = [
123 appstream
124 bubblewrap
125 bzip2
126 curl
127 dbus
128 dconf
129 gpgme
130 json-glib
131 libarchive
132 libcap
133 libseccomp
134 xz
135 zstd
136 polkit
137 python3
138 systemd
139 xorg.libXau
140 fuse3
141 gsettings-desktop-schemas
142 glib-networking
143 librsvg # for flatpak-validate-icon
144 ];
145
146 # Required by flatpak.pc
147 propagatedBuildInputs = [
148 glib
149 ostree
150 ];
151
152 nativeCheckInputs = [
153 valgrind
154 ];
155
156 # TODO: some issues with temporary files
157 doCheck = false;
158
159 NIX_LDFLAGS = "-lpthread";
160
161 enableParallelBuilding = true;
162
163 configureFlags = [
164 "--with-curl"
165 "--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
166 "--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy"
167 "--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"
168 "--localstatedir=/var"
169 "--enable-gtk-doc"
170 "--enable-installed-tests"
171 ];
172
173 makeFlags = [
174 "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
175 "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
176 ];
177
178 postPatch = let
179 vsc-py = python3.withPackages (pp: [
180 pp.pyparsing
181 ]);
182 in ''
183 patchShebangs buildutil
184 patchShebangs tests
185 PATH=${lib.makeBinPath [vsc-py]}:$PATH patchShebangs --build subprojects/variant-schema-compiler/variant-schema-compiler
186 '';
187
188 passthru = {
189 icon-validator-patch = substituteAll {
190 src = ./fix-icon-validation.patch;
191 inherit (builtins) storeDir;
192 };
193
194 tests = {
195 installedTests = nixosTests.installed-tests.flatpak;
196
197 validate-icon = runCommand "test-icon-validation" { } ''
198 ${finalAttrs.finalPackage}/libexec/flatpak-validate-icon --sandbox 512 512 ${../../../applications/audio/zynaddsubfx/ZynLogo.svg} > "$out"
199 grep format=svg "$out"
200 '';
201 };
202 };
203
204 meta = with lib; {
205 description = "Linux application sandboxing and distribution framework";
206 homepage = "https://flatpak.org/";
207 license = licenses.lgpl21Plus;
208 maintainers = with maintainers; [ ];
209 platforms = platforms.linux;
210 };
211})