From 0d5fd365fbee2cf71a451e2f02c2931d6e141b2f Mon Sep 17 00:00:00 2001 From: SupervisedThinking Date: Thu, 29 Sep 2022 14:51:33 +0200 Subject: [PATCH] mold: initial package 1.5.1 --- packages/devel/mold/package.mk | 23 ++++++++++++++++++ ...llow-custom-mold-binary-install-path.patch | 24 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 packages/devel/mold/package.mk create mode 100644 packages/devel/mold/patches/mold-999.01-PR740-allow-custom-mold-binary-install-path.patch diff --git a/packages/devel/mold/package.mk b/packages/devel/mold/package.mk new file mode 100644 index 0000000000..25b283088b --- /dev/null +++ b/packages/devel/mold/package.mk @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv) + +PKG_NAME="mold" +PKG_VERSION="1.5.1" +PKG_SHA256="ec94aa74758f1bc199a732af95c6304ec98292b87f2f4548ce8436a7c5b054a1" +PKG_LICENSE="AGPL-3.0-or-later" +PKG_SITE="https://github.com/rui314/mold" +PKG_URL="https://github.com/rui314/mold/archive/refs/tags/v${PKG_VERSION}.tar.gz" +PKG_DEPENDS_HOST="cmake:host zlib:host zstd:host openssl:host tbb:host mimalloc:host" +PKG_LONGDESC="mold is a faster drop-in replacement for existing Unix linkers" + +PKG_CMAKE_OPTS_HOST="-DCMAKE_INSTALL_LIBDIR="${TOOLCHAIN}/${TARGET_NAME}/lib" + -DCMAKE_INSTALL_BINDIR="${TARGET_NAME}/bin" \ + -DCMAKE_INSTALL_LIBEXECDIR="${TARGET_NAME}" \ + -DMOLD_LTO=ON \ + -DMOLD_MOSTLY_STATIC=ON \ + -DMOLD_USE_SYSTEM_MIMALLOC=ON \ + -DMOLD_USE_SYSTEM_TBB=ON" + +post_makeinstall_host() { + ln -sf ${TOOLCHAIN}/${TARGET_NAME}/bin/mold ${TARGET_PREFIX}ld.mold +} diff --git a/packages/devel/mold/patches/mold-999.01-PR740-allow-custom-mold-binary-install-path.patch b/packages/devel/mold/patches/mold-999.01-PR740-allow-custom-mold-binary-install-path.patch new file mode 100644 index 0000000000..0ecca3b06e --- /dev/null +++ b/packages/devel/mold/patches/mold-999.01-PR740-allow-custom-mold-binary-install-path.patch @@ -0,0 +1,24 @@ +From f7f2ef6182d058f7c58401d9278aa3136cb996f5 Mon Sep 17 00:00:00 2001 +From: SupervisedThinking +Date: Thu, 29 Sep 2022 11:49:57 +0200 +Subject: [PATCH] CMakeLists: allow custom mold binary install path + +- https://cmake.org/cmake/help/latest/command/install.html +- ${CMAKE_INSTALL_BINDIR} defaults to bin if not set +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7136cf2b..4542f915 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -287,7 +287,7 @@ if(BUILD_TESTING) + endif() + + if(NOT CMAKE_SKIP_INSTALL_RULES) +- install(TARGETS mold RUNTIME DESTINATION bin) ++ install(TARGETS mold RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) + install(FILES docs/mold.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/) + install(CODE "