From 7fb5baf1821e853a18cd6d4bda38fd02fa03bc6b Mon Sep 17 00:00:00 2001 From: Jason Elswick Date: Sun, 28 Jul 2024 13:41:04 -0500 Subject: [PATCH] New package: mepo-1.2.1. --- .../0001-zig-0.13-use-std.Build.path.patch | 40 +++++++++++++++++++ .../0002-zig-0.13-require-zig-0.13-now.patch | 24 +++++++++++ ...3-std.ChildProcess-std.process.Child.patch | 36 +++++++++++++++++ ...o-new-Dir.writeFile-API-aka-Dir.writ.patch | 22 ++++++++++ srcpkgs/mepo/template | 15 +++++++ 5 files changed, 137 insertions(+) create mode 100644 srcpkgs/mepo/patches/0001-zig-0.13-use-std.Build.path.patch create mode 100644 srcpkgs/mepo/patches/0002-zig-0.13-require-zig-0.13-now.patch create mode 100644 srcpkgs/mepo/patches/0003-zig-0.13-std.ChildProcess-std.process.Child.patch create mode 100644 srcpkgs/mepo/patches/0004-zig-0.13-adapt-to-new-Dir.writeFile-API-aka-Dir.writ.patch create mode 100644 srcpkgs/mepo/template diff --git a/srcpkgs/mepo/patches/0001-zig-0.13-use-std.Build.path.patch b/srcpkgs/mepo/patches/0001-zig-0.13-use-std.Build.path.patch new file mode 100644 index 00000000000000..f5581ab62793d4 --- /dev/null +++ b/srcpkgs/mepo/patches/0001-zig-0.13-use-std.Build.path.patch @@ -0,0 +1,40 @@ +From a5fb84751db02c4f913199fd28bce3751a9bc485 Mon Sep 17 00:00:00 2001 +From: "lauren n. liberda" +Date: Sat, 8 Jun 2024 02:38:48 +0200 +Subject: [PATCH] zig 0.13: use std.Build.path + +--- + build.zig | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/build.zig b/build.zig +index a61082e..923eca5 100644 +--- a/build.zig ++++ b/build.zig +@@ -11,7 +11,7 @@ fn setDependencies(step: *std.Build.Step.Compile) void { + + pub fn build(b: *std.Build) void { + b.installDirectory(.{ +- .source_dir = .{ .path = "scripts" }, ++ .source_dir = b.path("scripts"), + .install_dir = .{ .bin = {} }, + .install_subdir = "", + }); +@@ -24,7 +24,7 @@ pub fn build(b: *std.Build) void { + const optimize = b.standardOptimizeOption(.{}); + const exe = b.addExecutable(.{ + .name = "mepo", +- .root_source_file = .{ .path = "src/main.zig" }, ++ .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }); +@@ -42,7 +42,7 @@ pub fn build(b: *std.Build) void { + + // Setup test + const tests = b.addTest(.{ +- .root_source_file = .{ .path = "./src/test.zig" }, ++ .root_source_file = b.path("./src/test.zig"), + .target = target, + .optimize = optimize, + }); diff --git a/srcpkgs/mepo/patches/0002-zig-0.13-require-zig-0.13-now.patch b/srcpkgs/mepo/patches/0002-zig-0.13-require-zig-0.13-now.patch new file mode 100644 index 00000000000000..2ec9198a25a20f --- /dev/null +++ b/srcpkgs/mepo/patches/0002-zig-0.13-require-zig-0.13-now.patch @@ -0,0 +1,24 @@ +From aa43f762540d25acbdfbd218e5efde4c20851ce1 Mon Sep 17 00:00:00 2001 +From: "lauren n. liberda" +Date: Sat, 8 Jun 2024 02:39:04 +0200 +Subject: [PATCH] zig 0.13: require zig 0.13 now + +--- + src/main.zig | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/main.zig b/src/main.zig +index b477ad7..6ba77e2 100644 +--- a/src/main.zig ++++ b/src/main.zig +@@ -12,8 +12,8 @@ const utildbg = @import("./util/utildbg.zig"); + pub fn main() !void { + comptime { + const v = builtin.zig_version; +- if (v.major != 0 or v.minor != 12) +- @panic("Must be built against Zig 0.12.x"); ++ if (v.major != 0 or v.minor != 13) ++ @panic("Must be built against Zig 0.13.x"); + } + + const allocator = std.heap.c_allocator; diff --git a/srcpkgs/mepo/patches/0003-zig-0.13-std.ChildProcess-std.process.Child.patch b/srcpkgs/mepo/patches/0003-zig-0.13-std.ChildProcess-std.process.Child.patch new file mode 100644 index 00000000000000..cf83435622a3b6 --- /dev/null +++ b/srcpkgs/mepo/patches/0003-zig-0.13-std.ChildProcess-std.process.Child.patch @@ -0,0 +1,36 @@ +From 65113031c6b0ce63e46f8fba43df268a32a1bb65 Mon Sep 17 00:00:00 2001 +From: "lauren n. liberda" +Date: Sat, 8 Jun 2024 02:40:54 +0200 +Subject: [PATCH] zig 0.13: std.ChildProcess -> std.process.Child + +--- + src/api/shellpipe_async.zig | 2 +- + src/api/shellpipe_sync.zig | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/api/shellpipe_async.zig b/src/api/shellpipe_async.zig +index 9ebcfbf..e0f722e 100644 +--- a/src/api/shellpipe_async.zig ++++ b/src/api/shellpipe_async.zig +@@ -60,7 +60,7 @@ fn async_shellpipe_run_catch_errors(mepo: *Mepo, unique_handle_id: i8, cmd: []co + const max_output_bytes: usize = 50 * 1024; + var arena = std.heap.ArenaAllocator.init(mepo.allocator); + defer arena.deinit(); +- var child = std.ChildProcess.init(argv[0..], arena.allocator()); ++ var child = std.process.Child.init(argv[0..], arena.allocator()); + child.stdin_behavior = .Ignore; + child.stdout_behavior = .Pipe; + const env = try get_env_vars(mepo, mepo.allocator); +diff --git a/src/api/shellpipe_sync.zig b/src/api/shellpipe_sync.zig +index 133b8c7..d0f6186 100644 +--- a/src/api/shellpipe_sync.zig ++++ b/src/api/shellpipe_sync.zig +@@ -32,7 +32,7 @@ fn shellpipe_sync(mepo: *Mepo, cmd: []const u8) !void { + try mepo.blit(); + const env_vars = try get_env_vars(mepo, arena.allocator()); + const args = [_][]const u8{ "sh", "-c", cmd }; +- const process_result = try std.ChildProcess.run(.{ ++ const process_result = try std.process.Child.run(.{ + .allocator = arena.allocator(), + .argv = args[0..], + .env_map = &env_vars, diff --git a/srcpkgs/mepo/patches/0004-zig-0.13-adapt-to-new-Dir.writeFile-API-aka-Dir.writ.patch b/srcpkgs/mepo/patches/0004-zig-0.13-adapt-to-new-Dir.writeFile-API-aka-Dir.writ.patch new file mode 100644 index 00000000000000..8cec65a94330c9 --- /dev/null +++ b/srcpkgs/mepo/patches/0004-zig-0.13-adapt-to-new-Dir.writeFile-API-aka-Dir.writ.patch @@ -0,0 +1,22 @@ +From e370ef83141ac5caa41b65c665e86233020ff125 Mon Sep 17 00:00:00 2001 +From: "lauren n. liberda" +Date: Sat, 8 Jun 2024 02:51:12 +0200 +Subject: [PATCH] zig 0.13: adapt to new Dir.writeFile API (aka Dir.writeFile2) + +--- + src/TileCache.zig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/TileCache.zig b/src/TileCache.zig +index 0b1fa63..17e662c 100644 +--- a/src/TileCache.zig ++++ b/src/TileCache.zig +@@ -425,7 +425,7 @@ fn download_loop_transfer_complete(tile_cache: *@This(), msg: *curl.CURLMsg) !vo + // Save to FS + if (is_valid_png_data) { + const path = try png_path(tile_cache.allocator, p.get(p.pref.tile_cache_url).t.?, coords); +- try cache_dir.writeFile(path, datum_array); ++ try cache_dir.writeFile(.{ .sub_path = path, .data = datum_array }); + } + } + if (tile_cache.transfer_map.get(coords).?.load_to_texture) { diff --git a/srcpkgs/mepo/template b/srcpkgs/mepo/template new file mode 100644 index 00000000000000..8a27440f4b4d09 --- /dev/null +++ b/srcpkgs/mepo/template @@ -0,0 +1,15 @@ +# Template file for 'mepo' +pkgname=mepo +version=1.2.1 +revision=1 +build_style=zig-build +hostmakedepends="SDL2_image-devel SDL2_gfx-devel SDL2_ttf-devel SDL2-devel libcurl-devel glibc-devel" +#depends="${hostmakedepends} zig" +depends="zig" +short_desc="OSM map viewer for Linux - designed with mobile linux in mind" +maintainer="Jason Elswick " +license="GPL-3.0-or-later" +homepage="https://git.sr.ht/~mil/mepo" +distfiles="https://git.sr.ht/~mil/mepo/archive/${version}.tar.gz" +checksum=5032afa245398c90bbd608bea377814c5b6176741af05c880b31dc8908aebcbf +nopie=yes