From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 385A31581F0 for ; Fri, 13 Dec 2024 20:08:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6AAD8E08B0; Fri, 13 Dec 2024 20:08:13 +0000 (UTC) Received: from mail.landless-city.net (mail.landless-city.net [IPv6:2a11:4c02:0:10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 319CFE07BA for ; Fri, 13 Dec 2024 20:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; s=2024112001_rsa; d=landless-city.net; c=relaxed/relaxed; r=y; h=Message-ID:Date:Subject:To:From; t=1734120486; bh=V68I91y6QzYGC7qejA+Vq83 49w6xVgOhtPUrpfdjet4=; b=CibLhmEBd1TkgrsC6pbMem3Xw6H8N+hozcpileNTR0+PqCxal5 IJxkFcw0WicqnyF91SjahNU+dTv5zyMFH3pDLT9mkzRtHfw395IsyZlqbCrOezFBN2Py4fwoHaw 6aOkQl74kLaLqchCkh9Ihves5XkoQ3CcZ+7xXwCkpRChhc/j87VcruAbO3jdCS2LqK4zMbo9eHJ qIoz190MfvN7mZsvNm9X4NdvVp0NgWRu9BLVTfE6uKJgSRTh1sRW2o2+b+1/IAtrQ+NV5icDdRa 67BMfkdxVAOVrbE+Pb+3pz3BIIiA8YddG81NY0CTTLlXJz3WW2F4ieSklrEsEC54i5w==; DKIM-Signature: v=1; a=ed25519-sha256; s=2024112001_ed25519; d=landless-city.net; c=relaxed/relaxed; r=y; h=Message-ID:Date:Subject:To:From; t=1734120486; bh=V68I91y6QzYGC7qejA+Vq83 49w6xVgOhtPUrpfdjet4=; b=wmiSpNno2WUg71BdBHHd9sg+aKSr3O68FNgKVxi7ZYP5FBfIlL RuDxhNXU8Ch/M0K0zBiAQsy0qLQYNQlfnTDw==; From: Eric Joldasov To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [PATCH v3 0/5] Zig: new eclasses, rewrite existing ebuilds to use them Date: Sat, 14 Dec 2024 01:07:37 +0500 Message-ID: <20241213200750.75574-1-bratishkaerik@landless-city.net> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241024014626.31175-1-bratishkaerik@landless-city.net> References: <20241024014626.31175-1-bratishkaerik@landless-city.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: f666e0a2-1607-49bb-8792-40ace4f66a4f X-Archives-Hash: 3654c5468ee2266cb89f37ee97fc2a7a Hello everyone, This patch series adds 2 new eclasses for better integration with the Zig toolchain and rewrites ebuilds in `::gentoo` repository to use them. The `zig-utils.eclass` is designed for other eclasses and ebuilds that directly call `zig` command (like `zig.eclass` which runs `zig build`, or some packages in wild that have `zig build-exe` in their Makefiles or something similar). It is fairly low-level compared to `zig.eclass`, so for most Zig projects ebuild authors shoud use latter instead. The `zig.eclass` works with `build.zig` system, called ZBS here to highlight distinction between it and `zig build-exe` command or other build systems with Zig support. It manages dependencies integration for official package manager and options configuration system (some basic options with sane defaults that can be combined with additional options from ebuild authors and users) and makes packaging more convenient by automatically exporting required dependencies and phase functions. This is 3-rd version, with changes requested on GitHub PR. Big thanks to Michał Górny and Sam James for their review comments there. I won't attach interdiff here (it's unreadable IMHO, mostly because of renamings), so instead I wrote small overview: * Eclasses renamed: `zig-toolchain` to `zig-utils`, `zig-build` to `zig`. Some functions are also renamed, for example `init_base_args` to `setup`. * Target and CPU convertion functions now accept 2-nd required argument with `CFLAGS`-like value, for more precise convertion and needed by new `ZIG_CPU` logic. CPU convertion logic was added for more arches. Both functions are now also covered by tests (can optionally compile and run Zig code with resulting target and CPU). * `ZIG_CPU` now defaults to "value converted from CHOST and CFLAGS rather" than `native`, to be more consistent with existing policies and other ecosystems. * `src_install` does not change CWD when using `einstalldocs` anymore. * Other functions were rewritten for simplicity or readability without significant changes in behaviour (maybe I forgot some changes). Eric Joldasov (5): zig-utils.eclass: new eclass zig.eclass: new eclass dev-lang/zig: add 0.13.0-r2 dev-lang/zig: sync 9999 with 0.13.0-r2 sys-fs/ncdu: add 2.7-r1 ....13.0-skip-test-stack_iterator.patch (new) | 32 + dev-lang/zig/zig-0.13.0-r2.ebuild (new) | 248 ++++++++ dev-lang/zig/zig-9999.ebuild | 243 ++++---- eclass/tests/zig-utils.sh (new +x) | 320 ++++++++++ eclass/zig-utils.eclass (new) | 538 +++++++++++++++++ eclass/zig.eclass (new) | 558 ++++++++++++++++++ sys-fs/ncdu/ncdu-2.7-r1.ebuild (new) | 52 ++ 7 files changed, 1873 insertions(+), 118 deletions(-) create mode 100644 dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch create mode 100644 dev-lang/zig/zig-0.13.0-r2.ebuild create mode 100755 eclass/tests/zig-utils.sh create mode 100644 eclass/zig-utils.eclass create mode 100644 eclass/zig.eclass create mode 100644 sys-fs/ncdu/ncdu-2.7-r1.ebuild -- 2.47.0