public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Joonas Niilola" <juippis@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/
Date: Wed,  7 Aug 2019 18:28:38 +0000 (UTC)	[thread overview]
Message-ID: <1565202446.d71767d8b9454f990c4f220aacc316e2914b7af6.juippis@gentoo> (raw)

commit:     d71767d8b9454f990c4f220aacc316e2914b7af6
Author:     Nick Erdmann <n <AT> nirf <DOT> de>
AuthorDate: Sat Aug  3 15:05:42 2019 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Aug  7 18:27:26 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d71767d8

dev-lang/zig: switch to EAPI=6, use patch files

Signed-off-by: Nick Erdmann <n <AT> nirf.de>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../zig/files/zig-0.4.0-r1-build-artifacts.patch   | 61 ++++++++++++++++++++++
 .../zig/files/zig-0.4.0-r1-suppress-warnings.patch | 31 +++++++++++
 dev-lang/zig/zig-0.4.0-r1.ebuild                   | 47 +++++++++++++++++
 3 files changed, 139 insertions(+)

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 00000000000..11868e93a8a
--- /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 00000000000..1dc92f88ecb
--- /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 00000000000..de7dd259a3d
--- /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
+}


             reply	other threads:[~2019-08-07 18:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 18:28 Joonas Niilola [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-30 22:11 [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/ Michał Górny
2022-04-30  8:13 Joonas Niilola
2022-10-18 15:00 Michał Górny
2023-01-14 19:17 Sam James
2023-07-09  2:02 Sam James
2024-08-23  2:08 Eli Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1565202446.d71767d8b9454f990c4f220aacc316e2914b7af6.juippis@gentoo \
    --to=juippis@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox