Changes
6 changed files (+136/-0)
-
-
@@ -30,3 +30,6 @@# What: Build artifacts. (executables, copied headers, etc.) zig-out # What: Temporary files emitted by flatpak-builder. .flatpak-builder
-
-
-
@@ -85,6 +85,17 @@ After installing required softwares, you can format source code by:treefmt ``` ### Build Flatpak bundle This project provides Zig build script for building Flatpak single-file bundle. Enter `nix develop .#flatpak` or install `flatpak` and `flatpak-builder`, then run: ``` zig build flatpak ``` This will produce `jp.pocka.plac.gtk-adwaita.flatpak` inside `zig-out` directory. ### License Checking This project adheres to [REUSE][reuse-license] framework.
-
-
-
@@ -327,4 +327,48 @@ pub fn build(b: *std.Build) !void {step.dependOn(&moo_test.step); step.dependOn(&sood_test.step); } // `zig build flatpak` { const repo = repo: { const cmd = b.addSystemCommand(&.{ "flatpak-builder", "--force-clean", "--user", "--install-deps-from=flathub", }); cmd.has_side_effects = true; const repo = cmd.addPrefixedOutputDirectoryArg("--repo=", "repo"); _ = cmd.addOutputDirectoryArg("builddir"); cmd.addFileArg(b.path("flatpak/jp.pocka.plac.gtk-adwaita.json")); break :repo repo; }; const bundle = bundle: { const cmd = b.addSystemCommand(&.{ "flatpak", "build-bundle", }); cmd.addDirectoryArg(repo); const bundle = cmd.addOutputFileArg("Plac.flatpak"); cmd.addArg(app_id); cmd.addArg("--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo"); break :bundle bundle; }; const install = b.addInstallFile(bundle, b.fmt("{s}.flatpak", .{app_id})); const step = b.step("flatpak", "Build Flatpak bundle"); step.dependOn(&install.step); } }
-
-
-
@@ -163,6 +163,27 @@unset ZIG_GLOBAL_CACHE_DIR ''; }; flatpak = pkgs.mkShell { packages = with pkgs; [ flatpak flatpak-builder zig # flatpak-builder requires librsvg but corresponding # Nix package misses the dependency. # https://github.com/NixOS/nixpkgs/issues/480303 librsvg ]; # "pkgs.zig" incorrectly sets $ZIG_GLOBAL_CACHE_DIR unconditionally. # This prevents running zig command due to permission error. # https://github.com/NixOS/nixpkgs/issues/270415 # https://github.com/NixOS/nixpkgs/pull/473413 shellHook = '' unset ZIG_GLOBAL_CACHE_DIR ''; }; } ); };
-
-
-
@@ -0,0 +1,42 @@{ "app-id": "jp.pocka.plac.gtk-adwaita", "runtime": "org.gnome.Platform", "runtime-version": "49", "sdk": "org.gnome.Sdk", "sdk-extensions": [ "org.freedesktop.Sdk.Extension.ziglang", "org.freedesktop.Sdk.Extension.vala" ], "build-options": { "append-path": "/usr/lib/sdk/ziglang/", "prepend-path": "/usr/lib/sdk/vala/bin/", "prepend-ld-library-path": "/usr/lib/sdk/vala/lib/" }, "finish-args": [ "--socket=wayland", "--device=dri", "--share=network" ], "cleanup": [".zig-cache"], "modules": [ { "name": "plac", "buildsystem": "simple", "build-commands": [ "zig build -Dcpu=baseline -Doptimize=ReleaseSafe -Dcompile-gschema --prefix /app" ], "sources": [ { "type": "dir", "path": "../", "skip": [".zig-cache", "zig-out"] } ] } ] }
-
-
-
@@ -0,0 +1,15 @@Copyright 2026 Shota FUJI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0
-