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 B682E158042 for ; Thu, 24 Oct 2024 01:46:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 428D9E0949; Thu, 24 Oct 2024 01:46:30 +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 E88E0E0934 for ; Thu, 24 Oct 2024 01:46:29 +0000 (UTC) Received: from mail.landless-city.net (unknown [37.99.36.187]) by mail.landless-city.net (Postfix) with ESMTPSA id BAF0D7D605 for ; Thu, 24 Oct 2024 06:46:27 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landless-city.net; s=2024031301_rsa; t=1729734387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yXwOa+6AAcdTWRiaTBkxBp8ynhFbFUw+77U4VKiKuos=; b=Lnp7T/J/hsCgULKXT0yLLOtKQ70PHLiQO7PrUPQtuymp0ODgBFzK28vwE/M6eRwkgaUjXM pxfMjhUZbktFg/XrpE1KM2cSl5HOYaSTaZVnnYiER7K0VaOZV0gm8ChdmNT0kjZnvHs7EC 11Dx9Fe90y8dTaOnX4RQnwoNfiYOOJ61/Z/fymHRYaSeM7zA8ocJ9LvZHXgyn0QF4hkXe4 xtmND9+vTn+MEGl6yWBlLcTbgzRPVMS3pi5pRsuBBZWRdF3+zGUGBrZ2hgrdqCe+9WGQrm mPhwmyFfOML9Y8JhAvhtUD0Tm6DR2G08Vc2OUichHfrJauYa6cu+dwevlEC1hw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=landless-city.net; s=2024031301_ed25519; t=1729734387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yXwOa+6AAcdTWRiaTBkxBp8ynhFbFUw+77U4VKiKuos=; b=0EbQ6G7BKX245XgCyfwao7+6FSS+Ps7S0BGorukr2b3zuoUf5gv6RGtYvlyVZiYsFsZCeY 1qmiKLg7tm3KDECw== From: Eric Joldasov To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [PATCH 0/5] Ziglang eclasses for 0.13+ Date: Thu, 24 Oct 2024 06:46:13 +0500 Message-ID: <20241024014626.31175-1-bratishkaerik@landless-city.net> X-Mailer: git-send-email 2.47.0 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-Transfer-Encoding: 8bit X-Archives-Salt: d030d4f5-a264-40ba-9ce9-436eebfcd87d X-Archives-Hash: e949a511f9b89991db9194b7586f56f4 Hello everyone, This patch series adds new eclasses for packages that use Zig toolchain with varying level of integration. Since some projects or ebuilds use only Zig compiler directly, without touching Zig Build System, I have decided to split eclasses into 2: * zig-toolchain.eclass: handles dependency on Zig toolchain and finds appropriate versions/slots, converts C-style target tuples/triples to Zig format and sets environment variables to be used in other eclasses and ebuilds. This eclass is more low-level and intended to be used by programs and libraries that call "zig" commands directly, without having build.zig file and using "zig build" command. For example, authors could use "zig build-exe" and "zig test" directly in Makefile, or add "zig cc" and compile both C and Zig version of library etc. In this patchset it is also used by dev-lang/zig to convert targets during bootstrapping, and other logic is suppressed. * zig-build.eclass: handles working with "zig build" sub-command and build.zig files. This eclass is more high-level and for most ebuilds it's the only one which needs to be inherited. It sets default functions for ebuild phases, deals with dependencies in package manager, allows ebuilds and end users to configure used flags, respects multi-threading and verboseness preferences, has some small support for cross-compilation and so on. Github PR and discussion here: https://github.com/gentoo/gentoo/pull/37283 . I have also wrote small generator for Zig ebuild skeletons here: https://github.com/BratishkaErik/zig-ebuild . Example output in that PR. It requires dev-lang/zig:9999 to compile, but at runtime it works with any version supported by eclass (currently 0.13 and 9999). P.S.: I have not used "git format-patch" and "git send-email" for a long time, please forgive me and direct if I did something wrong with mail. Eric Joldasov (5): zig-toolchain.eclass: new eclass zig-build.eclass: new eclass dev-lang/zig: add 0.13.0-r1 dev-lang/zig: sync 9999 with 0.13.0-r1 sys-fs/ncdu: add 2.6-r1 .../zig-0.13.0-skip-test-stack_iterator.patch | 32 + dev-lang/zig/zig-0.13.0-r1.ebuild | 242 ++++++++ dev-lang/zig/zig-9999.ebuild | 239 ++++---- eclass/zig-build.eclass | 572 ++++++++++++++++++ eclass/zig-toolchain.eclass | 325 ++++++++++ sys-fs/ncdu/ncdu-2.6-r1.ebuild | 50 ++ 6 files changed, 1342 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-r1.ebuild create mode 100644 eclass/zig-build.eclass create mode 100644 eclass/zig-toolchain.eclass create mode 100644 sys-fs/ncdu/ncdu-2.6-r1.ebuild -- 2.47.0