Skip to content

Commit

Permalink
dotnet: add dotnet 6.0 runtime
Browse files Browse the repository at this point in the history
- fix use of PLIST.auto with spksrc.install-resources.mk
- allow multiple files in digests with different urls (dist names)
  • Loading branch information
hgy59 committed Nov 22, 2021
1 parent fa22178 commit 052b24f
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 18 deletions.
42 changes: 42 additions & 0 deletions cross/dotnet-runtime/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
PKG_NAME = aspnetcore-runtime
PKG_VERS = 6.0.0
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS)-$(PKG_DIST_ARCH).$(PKG_EXT)
PKG_DIST_SITE = https://download.visualstudio.microsoft.com/download/pr/$(PKG_DIST_FOLDER)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)
EXTRACT_PATH = $(INSTALL_DIR)/$(INSTALL_PREFIX)/share/dotnet

include ../../mk/spksrc.archs.mk

# use digests with multiple files and individual dist names
# both lists must have the same order
PKG_DIST_ARCH_LIST = linux-x64 linux-arm linux-arm64
PKG_DIST_SITE_LIST = https://download.visualstudio.microsoft.com/download/pr/a8dd1c9d-1a47-4135-8ad8-7091ff6bbe1e/6af53c3eee71038248937daf4599f06a/$(PKG_NAME)-$(PKG_VERS)-linux-x64.$(PKG_EXT)
PKG_DIST_SITE_LIST += https://download.visualstudio.microsoft.com/download/pr/b86e414a-929a-42a5-ba18-45ad2ebe292f/3617879c51e87fe70073006bf2d60386/$(PKG_NAME)-$(PKG_VERS)-linux-arm.$(PKG_EXT)
PKG_DIST_SITE_LIST += https://download.visualstudio.microsoft.com/download/pr/3d49ea48-675e-4da9-87be-18efaa99d7f6/37807ed5012ba5e0511e08ad64d6a9a4/$(PKG_NAME)-$(PKG_VERS)-linux-arm64.$(PKG_EXT)

ifeq ($(findstring $(ARCH), $(x64_ARCHS)),$(ARCH))
PKG_DIST_ARCH = $(word 1,$(PKG_DIST_ARCH_LIST))
PKG_DIST_FOLDER = $(shell echo $(word 1,$(PKG_DIST_SITE_LIST)) | grep -o1P ".*/download/pr/\K([^/]*/[^/]*)")
endif
ifeq ($(findstring $(ARCH), $(ARMv7_ARCHS)),$(ARCH))
PKG_DIST_ARCH = $(word 2,$(PKG_DIST_ARCH_LIST))
PKG_DIST_FOLDER = $(shell echo $(word 2,$(PKG_DIST_SITE_LIST)) | grep -o1P ".*/download/pr/\K([^/]*/[^/]*)")
endif
ifeq ($(findstring $(ARCH), $(ARMv8_ARCHS)),$(ARCH))
PKG_DIST_ARCH = $(word 3,$(PKG_DIST_ARCH_LIST))
PKG_DIST_FOLDER = $(shell echo $(word 3,$(PKG_DIST_SITE_LIST)) | grep -o1P ".*/download/pr/\K([^/]*/[^/]*)")
endif

ifeq ($(PKG_DIST_ARCH),)
$(error Unsupported ARCH $(ARCH))
endif

HOMEPAGE = https://dotnet.microsoft.com/
COMMENT = Free. Cross-platform. Open source. A developer platform for building all apps.
LICENSE = MIT

# source is extracted directly to the install folder
INSTALL_TARGET = nop

include ../../mk/spksrc.install-resources.mk
Empty file added cross/dotnet-runtime/PLIST.auto
Empty file.
9 changes: 9 additions & 0 deletions cross/dotnet-runtime/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
aspnetcore-runtime-6.0.0-linux-x64.tar.gz SHA1 d241234ff8a50bae00ea4368434b8d0fcf5e8dfe
aspnetcore-runtime-6.0.0-linux-x64.tar.gz SHA256 e30fcd2106c0703b8beef57c3af3447310d25865e5ebbb21cfcaca51d6ac17e0
aspnetcore-runtime-6.0.0-linux-x64.tar.gz MD5 8a1872969546c838cfca33da33532f87
aspnetcore-runtime-6.0.0-linux-arm.tar.gz SHA1 b31a773c109516d1e9f7eb8eeb9bf3cd83965622
aspnetcore-runtime-6.0.0-linux-arm.tar.gz SHA256 a053004fd57b7e92fb971845a88e05054489028e98ca093a9f5ebae382a13958
aspnetcore-runtime-6.0.0-linux-arm.tar.gz MD5 6c2b230119b308236382e117eeba4128
aspnetcore-runtime-6.0.0-linux-arm64.tar.gz SHA1 b77af28af323040cc71c8448ac50d6cb73c106aa
aspnetcore-runtime-6.0.0-linux-arm64.tar.gz SHA256 07dd14194e37c839a9580a212f9fd47131d443058f399177c3747b56fad35948
aspnetcore-runtime-6.0.0-linux-arm64.tar.gz MD5 3ffccdd3b2a63b328b2e9bde07d0228b
19 changes: 19 additions & 0 deletions mk/spksrc.generate-digests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ digests-%:
echo "$(LOCAL_FILE) $$type `$$tool $(DIST_FILE) | cut -d\" \" -f1`" >> $(DIGESTS_FILE) ; \
done


ifeq ($(strip $(PKG_DIST_SITE_LIST)),)

# download with individual dist archs
$(DIGESTS_FILE): download
@for pkg_arch in $(PKG_DIST_ARCH_LIST); do \
rm $(DOWNLOAD_COOKIE) ; \
Expand All @@ -42,4 +46,19 @@ $(DIGESTS_FILE): download
$(MAKE) -s PKG_DIST_ARCH=$${pkg_arch} digests-$${pkg_arch} ; \
done ; \

else

# download with individual dist sites
$(DIGESTS_FILE): download
@for pkg_dist_url in $(PKG_DIST_SITE_LIST); do \
rm $(DOWNLOAD_COOKIE) ; \
$(MAKE) -s URLS=$${pkg_dist_url} download ; \
done ; \
rm -f $(DIGESTS_FILE) && touch -f $(DIGESTS_FILE) ; \
for pkg_arch in $(PKG_DIST_ARCH_LIST); do \
$(MAKE) -s PKG_DIST_ARCH=$${pkg_arch} digests-$${pkg_arch} ; \
done ; \

endif

endif
22 changes: 4 additions & 18 deletions mk/spksrc.install-resources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,19 @@ include ../../mk/spksrc.patch.mk
install: patch
include ../../mk/spksrc.install.mk

ifeq ($(strip $(PLIST_TRANSFORM)),)
PLIST_TRANSFORM= cat
endif
plist: install
include ../../mk/spksrc.plist.mk

.PHONY: cat_PLIST
cat_PLIST:
@for depend in $(DEPENDS) ; \
do \
$(MAKE) WORK_DIR=$(WORK_DIR) --no-print-directory -C ../../$$depend cat_PLIST ; \
done
@if [ -f PLIST ] ; \
then \
$(PLIST_TRANSFORM) PLIST ; \
else \
$(MSG) "No PLIST for $(NAME)" >&2; \
fi

### Clean rules
smart-clean:
rm -rf $(WORK_DIR)/$(PKG_DIR)
rm -f $(WORK_DIR)/.$(COOKIE_PREFIX)*

clean:
rm -fr work work-*

rm -fr work work-* build-*.log

all: install
all: install plist

### For make digests
include ../../mk/spksrc.generate-digests.mk
Expand Down
40 changes: 40 additions & 0 deletions spk/dotnet-runtime/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
SPK_NAME = dotnet-runtime
SPK_VERS = 6.0.0
SPK_REV = 1
SPK_ICON = src/dotnet.png

UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) $(ARMv7L_ARCHS)

MAINTAINER = hgy59
DESCRIPTION = Free. Cross-platform. Open source. A developer platform for building all apps. This package installs the dotnet runtime and the asp.net.core runtime.
CHANGELOG = "Initial package release."

STARTABLE = no
DISPLAY_NAME = .NET 6.0 runtime

HOMEPAGE = https://dotnet.microsoft.com/
LICENSE = MIT

OPTIONAL_DEPENDS = cross/libstdc++
DEPENDS = cross/libicu cross/dotnet-runtime

include ../../mk/spksrc.common.mk

ifeq ($(call version_lt, ${TCVERSION}, 7.0),1)
# we do not only need the updated libstdc++ library, we also need to
# adjust the library search path for dotnet to use this version.
DEPENDS += cross/libstdc++
POST_STRIP_TARGET = dotnet_patch_target
endif

SPK_COMMANDS = share/dotnet/dotnet

include ../../mk/spksrc.spk.mk

.PHONY: dotnet_patch_target
# Set library path to use bundled libstdc++
dotnet_patch_target:
@$(MSG) "Set library runpath in dotnet executable."
@sudo apt-get update
@sudo apt-get install -y patchelf
@patchelf --set-rpath /var/packages/$(SPK_NAME)/target/lib $(STAGING_DIR)/share/dotnet/dotnet
Empty file added spk/dotnet-runtime/PLIST
Empty file.
Binary file added spk/dotnet-runtime/src/dotnet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 052b24f

Please sign in to comment.