summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Erdmann <n@nirf.de>2019-09-27 08:05:26 +0200
committerJoonas Niilola <juippis@gentoo.org>2019-10-01 09:14:02 +0300
commitd9e4c6fa5bdc0c29bec7f02d47e51e5a782efa3e (patch)
tree6253e8dd494abfc27c077ac064ac7ee3ae9bf9f9
parentqmail.eclass: update documentation to install (diff)
downloadgentoo-d9e4c6fa5bdc0c29bec7f02d47e51e5a782efa3e.tar.gz
gentoo-d9e4c6fa5bdc0c29bec7f02d47e51e5a782efa3e.tar.bz2
gentoo-d9e4c6fa5bdc0c29bec7f02d47e51e5a782efa3e.zip
dev-lang/zig: bump to 0.5.0
Signed-off-by: Nick Erdmann <n@nirf.de> Closes: https://github.com/gentoo/gentoo/pull/13107 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
-rw-r--r--dev-lang/zig/Manifest1
-rw-r--r--dev-lang/zig/zig-0.5.0.ebuild61
2 files changed, 62 insertions, 0 deletions
diff --git a/dev-lang/zig/Manifest b/dev-lang/zig/Manifest
index d5a4c7c3d611..a3f8c62566bb 100644
--- a/dev-lang/zig/Manifest
+++ b/dev-lang/zig/Manifest
@@ -1 +1,2 @@
DIST zig-0.4.0.tar.gz 8924757 BLAKE2B 5ca3377f205694ff02360900b49eee7347cdf1cdaef90f1be071eff2610425ed453dfb35928fbe65b25f151b7153ab838c887d362ed3cd746f07833ae42510fd SHA512 423915730bc4ae9a67db3731a96471467826d16e59b87b3541f3e8ed2436f941939f22ccbebdb9a958a195b05360eb65f5be1658b32a01cc8db55c6e581eb039
+DIST zig-0.5.0.tar.gz 15743912 BLAKE2B 1a28dffebc24200cf51e1d94ff7203c8de5641e1a299eff58e808a5a8f3257fc8ff771699a0f90733702b90e5536990adc5bf41b973b4ea642081ef788f7a83d SHA512 9fc2ef827421e54e8db98ce3474ba3bbe9119b0b9aa30b4edd78d73277d2384067b5c78f4ebbca350a97ac230131e7f71e6d54c1e75fc74e1833ce6c51c402df
diff --git a/dev-lang/zig/zig-0.5.0.ebuild b/dev-lang/zig/zig-0.5.0.ebuild
new file mode 100644
index 000000000000..7189e4ddc62f
--- /dev/null
+++ b/dev-lang/zig/zig-0.5.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils llvm
+
+DESCRIPTION="A robust, optimal, and maintainable programming language"
+HOMEPAGE="https://ziglang.org/"
+LICENSE="MIT"
+SLOT="0"
+IUSE="+experimental"
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/ziglang/zig.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/ziglang/zig/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 NVPTX
+ PowerPC Sparc SystemZ WebAssembly X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+# According to zig's author, zig builds that do not support all targets are not
+# supported by the upstream project.
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]}
+
+RDEPEND="
+ sys-devel/llvm:9
+ !experimental? ( sys-devel/llvm:9[${LLVM_TARGET_USEDEPS// /,}] )
+ sys-devel/clang:9
+"
+
+DEPEND="${RDEPEND}"
+
+LLVM_MAX_SLOT=9
+
+llvm_check_deps() {
+ has_version "sys-devel/clang:${LLVM_SLOT}"
+}
+
+src_prepare() {
+ if use experimental; then
+ sed -i '/^NEED_TARGET(/d' cmake/Findllvm.cmake || die "unable to modify cmake/Findllvm.cmake"
+ fi
+
+ sed -i 's/--prefix "${CMAKE_INSTALL_PREFIX}"/--prefix ".\/${CMAKE_INSTALL_PREFIX}"/' CMakeLists.txt || \
+ die "unable to fix install path"
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCLANG_INCLUDE_DIRS="$(llvm-config --includedir)"
+ -DCLANG_LIBDIRS="$(llvm-config --libdir)"
+ )
+
+ cmake-utils_src_configure
+}