diff options
-rw-r--r-- | app-alternatives/ninja/metadata.xml | 16 | ||||
-rw-r--r-- | app-alternatives/ninja/ninja-1.ebuild | 27 |
2 files changed, 43 insertions, 0 deletions
diff --git a/app-alternatives/ninja/metadata.xml b/app-alternatives/ninja/metadata.xml new file mode 100644 index 000000000000..20bceb308997 --- /dev/null +++ b/app-alternatives/ninja/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> + </maintainer> + <maintainer type="person"> + <email>vimproved@inventati.org</email> + <name>Violet Purcell</name> + </maintainer> + <use> + <flag name="reference">Symlink to dev-util/ninja.</flag> + <flag name="samurai">Symlink to dev-util/samurai.</flag> + </use> +</pkgmetadata> diff --git a/app-alternatives/ninja/ninja-1.ebuild b/app-alternatives/ninja/ninja-1.ebuild new file mode 100644 index 000000000000..bcb516b5373f --- /dev/null +++ b/app-alternatives/ninja/ninja-1.ebuild @@ -0,0 +1,27 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ALTERNATIVES=( + "reference:>=dev-util/ninja-1.11.1-r3" + samurai:dev-util/samurai +) + +inherit app-alternatives + +DESCRIPTION="ninja symlinks" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" + +RDEPEND="!<dev-util/ninja-1.11.1-r3" + +src_install() { + local alt=$(get_alternative) + + case ${alt} in + reference) alt=ninja-reference;; + samurai) alt=samu;; + esac + + dosym "${alt}" /usr/bin/ninja +} |