diff options
author | Nick Erdmann <n@nirf.de> | 2019-08-03 17:05:42 +0200 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2019-08-07 21:27:26 +0300 |
commit | d71767d8b9454f990c4f220aacc316e2914b7af6 (patch) | |
tree | d2fba83fce2da7b021621fef83e57d3beacf2d3c /dev-lang | |
parent | dev-lang/parrot: -r1 bump for EAPI7 (diff) | |
download | gentoo-d71767d8b9454f990c4f220aacc316e2914b7af6.tar.gz gentoo-d71767d8b9454f990c4f220aacc316e2914b7af6.tar.bz2 gentoo-d71767d8b9454f990c4f220aacc316e2914b7af6.zip |
dev-lang/zig: switch to EAPI=6, use patch files
Signed-off-by: Nick Erdmann <n@nirf.de>
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch | 61 | ||||
-rw-r--r-- | dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch | 31 | ||||
-rw-r--r-- | dev-lang/zig/zig-0.4.0-r1.ebuild | 47 |
3 files changed, 139 insertions, 0 deletions
diff --git a/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch b/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch new file mode 100644 index 000000000000..11868e93a8a4 --- /dev/null +++ b/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch @@ -0,0 +1,61 @@ +From 81767a658d07219a402384f98a7553abcbbd2e70 Mon Sep 17 00:00:00 2001 +From: Marc Tiehuis <marctiehuis@gmail.com> +Date: Thu, 18 Apr 2019 18:58:12 +1200 +Subject: [PATCH] Don't install stage2 artifacts + +Fixes #2220. +--- + CMakeLists.txt | 11 ++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1b017a881..047d538e8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,6 +58,16 @@ endif() + + set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp") + ++# Handle multi-config builds and place each into a common lib. The VS generator ++# for example will append a Debug folder by default if not explicitly specified. ++set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ZIG_CPP_LIB_DIR}) ++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ZIG_CPP_LIB_DIR}) ++foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES}) ++ string(TOUPPER ${CONFIG_TYPE} CONFIG_TYPE) ++ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${ZIG_CPP_LIB_DIR}) ++ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${ZIG_CPP_LIB_DIR}) ++endforeach(CONFIG_TYPE CMAKE_CONFIGURATION_TYPES) ++ + if(ZIG_FORCE_EXTERNAL_LLD) + find_package(lld) + include_directories(${LLVM_INCLUDE_DIRS}) +@@ -253,7 +263,6 @@ else() + embedded_lld_wasm + embedded_lld_lib + ) +- install(TARGETS embedded_lld_elf embedded_lld_coff embedded_lld_mingw embedded_lld_wasm embedded_lld_lib DESTINATION "${ZIG_CPP_LIB_DIR}") + endif() + + # No patches have been applied to SoftFloat-3e + +From 40fe6afdad1a8676b5d3a5dd23d6d50d6ea9f059 Mon Sep 17 00:00:00 2001 +From: Marc Tiehuis <marctiehuis@gmail.com> +Date: Wed, 1 May 2019 17:39:23 +1200 +Subject: [PATCH] Don't install zig_cpp lib for stage2 target + +Missed in last commit. See #2220. +--- + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 047d538e8..9881ce1de 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6671,6 +6681,5 @@ + endif() + install(TARGETS zig DESTINATION bin) +-install(TARGETS zig_cpp DESTINATION "${ZIG_CPP_LIB_DIR}") + + foreach(file ${ZIG_C_HEADER_FILES}) + get_filename_component(file_dir "${C_HEADERS_DEST}/${file}" DIRECTORY) diff --git a/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch b/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch new file mode 100644 index 000000000000..1dc92f88ecb2 --- /dev/null +++ b/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch @@ -0,0 +1,31 @@ +Don't attempt to look for static libraries that we're not going to use. +The warnings are only triggered when building with portage. + +--- a/cmake/Findllvm.cmake ++++ b/cmake/Findllvm.cmake +@@ -50,25 +50,6 @@ + endif() + endfunction(NEED_TARGET) + +-if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC) +- execute_process( +- COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static +- OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES +- OUTPUT_STRIP_TRAILING_WHITESPACE) +- string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}") +- +- execute_process( +- COMMAND ${LLVM_CONFIG_EXE} --system-libs --link-static +- OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES +- OUTPUT_STRIP_TRAILING_WHITESPACE) +- string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}") +- +- execute_process( +- COMMAND ${LLVM_CONFIG_EXE} --libdir --link-static +- OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES +- OUTPUT_STRIP_TRAILING_WHITESPACE) +- string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}") +-endif() + if(NOT LLVM_LIBRARIES) + execute_process( + COMMAND ${LLVM_CONFIG_EXE} --libs diff --git a/dev-lang/zig/zig-0.4.0-r1.ebuild b/dev-lang/zig/zig-0.4.0-r1.ebuild new file mode 100644 index 000000000000..de7dd259a3d4 --- /dev/null +++ b/dev-lang/zig/zig-0.4.0-r1.ebuild @@ -0,0 +1,47 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +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:8 + !experimental? ( sys-devel/llvm:8[${LLVM_TARGET_USEDEPS// /,}] ) +" + +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}/zig-0.4.0-r1-build-artifacts.patch" + "${FILESDIR}/zig-0.4.0-r1-suppress-warnings.patch" +) + +src_prepare() { + if use experimental; then + sed -i '/^NEED_TARGET(/d' cmake/Findllvm.cmake || die "unable to modify cmake/Findllvm.cmake" + fi + + cmake-utils_src_prepare +} |