From patchwork Mon Jul 1 19:34:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 1954904 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WCbpL4RHJz1xpf for ; Tue, 2 Jul 2024 05:34:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D3E5360AD6; Mon, 1 Jul 2024 19:34:31 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ifRqgV9JkaxF; Mon, 1 Jul 2024 19:34:30 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org AEE6E60B00 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id AEE6E60B00; Mon, 1 Jul 2024 19:34:30 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AA0B71BF346 for ; Mon, 1 Jul 2024 19:34:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 97F0180D3C for ; Mon, 1 Jul 2024 19:34:28 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Jmh0ezTWMZx7 for ; Mon, 1 Jul 2024 19:34:27 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=62.149.155.164; helo=smtpdh20-1.aruba.it; envelope-from=giulio.benetti@benettiengineering.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org CDCC681F28 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CDCC681F28 Received: from smtpdh20-1.aruba.it (smtpdh20-1.aruba.it [62.149.155.164]) by smtp1.osuosl.org (Postfix) with ESMTPS id CDCC681F28 for ; Mon, 1 Jul 2024 19:34:24 +0000 (UTC) Received: from localhost.localdomain ([84.33.84.190]) by Aruba Outgoing Smtp with ESMTPSA id OMn7sForP9WDgOMn7sMC2f; Mon, 01 Jul 2024 21:34:22 +0200 From: Giulio Benetti To: buildroot@buildroot.org Date: Mon, 1 Jul 2024 21:34:20 +0200 Message-Id: <20240701193420.2119084-1-giulio.benetti@benettiengineering.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CMAE-Envelope: MS4xfDAxLiD4XdGOiS5+J9JDhD65Py5R46dbDrjR2GlxvzhGPPSBnLR80ra+8NsU+q4HgqxSC3VO7sjrqq0ghe5oxoUcJ1jRiTscqGDM/CjRNvlfmk4pAIvD PMFk86FZhO8PE+aFk0I+2/g0EtVYMkMqcbbIINEItUCk/Sove/9oVs6lXT4lMtOIrxnF4LbU5kxeu80NEexNlIfaNmMc2m5E+Yd6gv9dEvZfc+E74DtdPdl5 xiuPBf1QxP1hMCX3UrYvKAz/AxHvE1jB67cNqUDKKX7teDBV353UqsNKL0KdKu/VgR2hOFg4MkhlBOYnxuhoWzO2XAhYQpHFDcItx0s2LLbJgjAOmrvAgmbp IGkLkxSQOrPqWMRMnSxyK2YWKFP+EzuPSiXwuU80CEs/RQBk2Nqb0mX3+y5Q2MDBTnn0COq78SLVboiKtQzfSK9vMG9ex4SU4LDonEtFHQ/EjNmH7/g= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1719862462; bh=XShO8KFCiIjgHCkDMLAm0YPDLIX5SvVKqnMeK08ecZw=; h=From:To:Subject:Date:MIME-Version; b=BgbO23Rd1mYr5trQzGXUlOA/ERZ0k8cPKJK7AmrdP7s8MOD9iD+s1wCtovTaSLP+J Cbzx5tNps1THLPDI9s+npwql5WgFQ3b2SaTHQQ+GXPK+5AFlm7Ooy1m17Ih01jyDIn JhK8YTuR0y9dZp5UKBA76MOU3LaHHXDCUFXN8l95cnv1bt14MwGFQmgb8tV2GTlwW8 n9JpHo5O0458AUZnkLQ7SA7It/Oouis/3nqZOjq9VELkGLj9gytGKgOvA+numhI1Mk +zw3Yfkuc7UWs97CtMrZRagTk+eYF94KyMCUQlik1TRtfoYL9rouAEFg3GsWsrYG8i 8Ib57z9xbmyzA== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=benettiengineering.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=aruba.it header.i=@aruba.it header.a=rsa-sha256 header.s=a1 header.b=BgbO23Rd Subject: [Buildroot] [PATCH v3] package/dotnet-runtime-prebuilt: new package X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Giulio Benetti , James Autry , Matthew Maron , Thomas Petazzoni , Giulio Benetti , Jim Reinhart Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Giulio Benetti Add pre-built .NET Core Runtime Prebuilt 8.0.6 binaries to execute .NET executables on Linux. Version 8.0.6 is the latest LTS version. Let's simply download and extract specific tarball for aarch64, arm(eabihf) and x64 architectures and glibc/musl libc. Let's also: * add /etc/dotnet/install_location file to point where dotnet runtime is * add a script to export 'dotnet' to PATH and native libraries to LD_LIBRARY_PATH to avoid missing dependencies on runtime Cc: Jim Reinhart Cc: James Autry Cc: Matthew Maron Signed-off-by: Giulio Benetti --- V1->V2: * add depends on BR2_INSTALL_LIBSTDCPP and drop select BR2_PACKAGE_LTTNG_LIBUST V2->V3: * drop DOTNET_RUNTIME_PREBUILT_IDENTIFIER check since it breaks entire Buildroot building when architecture is supported but package is not selected. Basically it's a testing leftover --- DEVELOPERS | 1 + package/Config.in | 1 + package/dotnet-runtime-prebuilt/Config.in | 29 ++++++++++ .../dotnet-runtime-prebuilt.hash | 8 +++ .../dotnet-runtime-prebuilt.mk | 58 +++++++++++++++++++ .../dotnet-runtime-prebuilt.sh | 2 + 6 files changed, 99 insertions(+) create mode 100644 package/dotnet-runtime-prebuilt/Config.in create mode 100644 package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.hash create mode 100644 package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.mk create mode 100644 package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.sh diff --git a/DEVELOPERS b/DEVELOPERS index 551ff2dd0d..291a7e004e 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1243,6 +1243,7 @@ F: configs/rockpro64_defconfig F: package/at/ F: package/binutils/ F: package/cryptsetup/ +F: package/dotnet-runtime-prebuilt/ F: package/dotnet6-runtime/ F: package/erlang-jiffy/ F: package/esp-hosted/ diff --git a/package/Config.in b/package/Config.in index 59a4512b52..ec7b5ef1f5 100644 --- a/package/Config.in +++ b/package/Config.in @@ -662,6 +662,7 @@ menu "Interpreter languages and scripting" source "package/4th/Config.in" source "package/dotnet6-runtime/Config.in" source "package/dotnet8-runtime/Config.in" + source "package/dotnet-runtime-prebuilt/Config.in" source "package/enscript/Config.in" source "package/erlang/Config.in" if BR2_PACKAGE_ERLANG diff --git a/package/dotnet-runtime-prebuilt/Config.in b/package/dotnet-runtime-prebuilt/Config.in new file mode 100644 index 0000000000..2e2b54d0ac --- /dev/null +++ b/package/dotnet-runtime-prebuilt/Config.in @@ -0,0 +1,29 @@ +config BR2_PACKAGE_DOTNET_RUNTIME_PREBUILT_ARCH_SUPPORTS + bool + default y if BR2_aarch64 + default y if (BR2_arm && BR2_ARM_EABIHF) + default y if BR2_x86_64 + depends on BR2_USE_MMU # fork() + +config BR2_PACKAGE_DOTNET_RUNTIME_PREBUILT + bool "dotnet-runtime-prebuilt" + depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_INSTALL_LIBSTDCPP + depends on !BR2_STATIC_LIBS + depends on BR2_PACKAGE_DOTNET_RUNTIME_PREBUILT_ARCH_SUPPORTS + select BR2_PACKAGE_HOST_CMAKE + select BR2_PACKAGE_ICU + select BR2_PACKAGE_LIBCURL + select BR2_PACKAGE_LIBKRB5 + select BR2_PACKAGE_LIBZLIB + select BR2_PACKAGE_OPENSSL + help + .NET Core 8 Runtime Prebuilt + + https://dotnet.microsoft.com/download/dotnet-core/8.0 + +comment "dotnet-runtime needs a toolchain w/ glibc or musl and threads" + depends on BR2_PACKAGE_DOTNET8_RUNTIME_PREBUILT_ARCH_SUPPORTS + depends on !BR2_TOOLCHAIN_USES_GLIBC && !BR2_TOOLCHAIN_USES_MUSL + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.hash b/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.hash new file mode 100644 index 0000000000..6ff15ed121 --- /dev/null +++ b/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.hash @@ -0,0 +1,8 @@ +# Locally calculated +sha256 811b3d6d052e0d37c5cb2f6746cb950ae7c87a1c5082897a27bcd9258c94de66 dotnet-runtime-8.0.6-linux-arm.tar.gz +sha256 0c1355dfba7b0e354294fd202274e4fa1838b93afcc180ecf667e25e5d1b7df6 dotnet-runtime-8.0.6-linux-arm64.tar.gz +sha256 cfecba75d6497e14a06f04096c0be6bb57938ef23abd3c5ff6639bd999dbb9a1 dotnet-runtime-8.0.6-linux-musl-arm64.tar.gz +sha256 566c219fb59864c23333a254092c5b9644717164ad047050ccad06b79f710700 dotnet-runtime-8.0.6-linux-musl-arm.tar.gz +sha256 15c7219c2630d81131c0b47a7c6577f0f76f56ea0ed8dd337748d0b5929834d9 dotnet-runtime-8.0.6-linux-musl-x64.tar.gz +sha256 b29b4e02b622cf0ff4581b0a96824b74a6690e97b95158a2e3d8fb43342dadfd dotnet-runtime-8.0.6-linux-x64.tar.gz +sha256 cfc21f5e8bd655ae997eec916138b707b1d290b83272c02a95c9f821b8c87310 LICENSE.txt diff --git a/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.mk b/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.mk new file mode 100644 index 0000000000..13aa9a1741 --- /dev/null +++ b/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.mk @@ -0,0 +1,58 @@ +################################################################################ +# +# dotnet-runtime-prebuilt +# +################################################################################ + +DOTNET_RUNTIME_PREBUILT_VERSION = 8.0.6 +DOTNET_RUNTIME_PREBUILT_LICENSE = MIT +DOTNET_RUNTIME_PREBUILT_LICENSE_FILES = LICENSE.txt + +# Set download URL and runtime identifier +# See https://docs.microsoft.com/en-us/dotnet/core/rid-catalog +# for the list of supported runtimes +# download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" + +AZURE_FEED = https://dotnetcli.azureedge.net/dotnet +DOTNET_RUNTIME_PREBUILT_SITE = $(AZURE_FEED)/Runtime/$(DOTNET_RUNTIME_PREBUILT_VERSION) + +ifeq ($(BR2_aarch64),y) +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) +DOTNET_RUNTIME_PREBUILT_IDENTIFIER = linux-musl-arm64 +else +DOTNET_RUNTIME_PREBUILT_IDENTIFIER = linux-arm64 +endif +else ifeq ($(BR2_arm),y) +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) +DOTNET_RUNTIME_PREBUILT_IDENTIFIER = linux-musl-arm +else +DOTNET_RUNTIME_PREBUILT_IDENTIFIER = linux-arm +endif +else ifeq ($(BR2_x86_64),y) +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) +DOTNET_RUNTIME_PREBUILT_IDENTIFIER = linux-musl-x64 +else +DOTNET_RUNTIME_PREBUILT_IDENTIFIER = linux-x64 +endif +endif + +DOTNET_RUNTIME_PREBUILT_SOURCE = dotnet-runtime-$(DOTNET_RUNTIME_PREBUILT_VERSION)-$(DOTNET_RUNTIME_PREBUILT_IDENTIFIER).tar.gz + +# Runtime could be installed in the global location [/usr/share/dotnet] and +# will be picked up automatically. +# As alternative, it is possible to use the DOTNET_ROOT environment variable +# to specify the runtime location or register the runtime location in +# [/etc/dotnet/install_location] +# This script will install runtime to +# /usr/share/dotnet +define DOTNET_RUNTIME_PREBUILT_INSTALL_TARGET_CMDS + cp -Rf $(@D)/. $(TARGET_DIR)/usr/share/dotnet + mkdir -p $(TARGET_DIR)/etc/dotnet + echo "/usr/share/dotnet" > $(TARGET_DIR)/etc/dotnet/install_location + + # Export dotnet to PATH and libraries to LD_LIBRARY_PATH + $(INSTALL) -m 0755 -D $(DOTNET_RUNTIME_PREBUILT_PKGDIR)/dotnet-runtime-prebuilt.sh \ + $(TARGET_DIR)/etc/profile.d/dotnet-runtime-prebuilt.sh +endef + +$(eval $(generic-package)) diff --git a/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.sh b/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.sh new file mode 100644 index 0000000000..b059a9c593 --- /dev/null +++ b/package/dotnet-runtime-prebuilt/dotnet-runtime-prebuilt.sh @@ -0,0 +1,2 @@ +export PATH=$PATH:/usr/share/dotnet +export LD_LIBRARY_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.6