Changes
4 changed files (+41/-3)
-
-
@@ -23,6 +23,14 @@const std = @import("std"); const CompileVala = @import("./build/CompileVala.zig"); const zon: struct { name: enum { plac_gtk }, version: []const u8, fingerprint: comptime_int, minimum_zig_version: []const u8, dependencies: []const u1, paths: []const []const u8, } = @import("./build.zig.zon"); const BuildError = error{ NonValaSourceInSourceListError,
-
@@ -42,6 +50,12 @@ pub fn build(b: *std.Build) !void {const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const version = b.option( []const u8, "version", "Application version. Defaults to `version` field in \"build.zig.zon\".", ) orelse zon.version; const compile_gschema = b.option(bool, "compile-gschema", "Compile gschema XML file for local run") orelse false; // System libraries to link.
-
@@ -74,6 +88,9 @@ compile.addPackage(lib);} compile.addPackage("posix"); compile.addPackage("Config"); compile.addVapi(b.path("src/Config.vapi")); compile.addGResourceXML(b.path("data/gresource.xml"));
-
@@ -128,6 +145,8 @@ .target = target,.optimize = optimize, }), }); exe.root_module.addCMacro("PLAC_APP_VERSION", b.fmt("\"{s}\"", .{version})); // Vala does not bundle system libraries (of course): we have to tell the // linker.
-
-
-
@@ -98,9 +98,8 @@private void on_about() { var dialog = new Adw.AboutDialog.from_appdata("/jp/pocka/plac/gtk-adwaita/metainfo.xml", null); // TODO: Inject these via build parameter (JSON or REUSE or whatever) dialog.copyright = "Copyright 2025 Shota FUJI"; dialog.version = "0.0.0"; dialog.version = Config.PLAC_APP_VERSION; dialog.present(this.active_window); }
-
-
src/Config.vapi (new)
-
@@ -0,0 +1,20 @@// Copyright 2025 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 namespace Config { [CCode (cname = "PLAC_APP_VERSION")] public const string PLAC_APP_VERSION; }
-
-
-
@@ -172,7 +172,7 @@ var req = new Roon.Registry.Register.Request();// TODO: Configure these via build parameters req.extension_id = "jp.pocka.plac.gtk-adwaita"; req.display_name = "Plac for GTK"; req.display_version = "0.0.0-dev"; req.display_version = Config.PLAC_APP_VERSION; req.publisher = "Shota FUJI"; req.email = "pockawoooh@gmail.com"; if (token != null && token != "") {
-