From 4a7c38c6e75dd9b8513256782abdbb79957db996 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 11 Jan 2021 18:30:19 +1100 Subject: [PATCH 1/8] Add dot-net framework The native build use pre-build binaries to speed up compile time. I don't see a reason to compile dotnet-sdk --- mk/spksrc.cross-dotnet-env.mk | 90 ++++++++++++++++++++++++++ mk/spksrc.cross-dotnet.mk | 114 +++++++++++++++++++++++++++++++++ native/dotnet-sdk-3.1/Makefile | 31 +++++++++ native/dotnet-sdk-3.1/digests | 3 + native/dotnet-sdk-5.0/Makefile | 28 ++++++++ native/dotnet-sdk-5.0/digests | 3 + 6 files changed, 269 insertions(+) create mode 100644 mk/spksrc.cross-dotnet-env.mk create mode 100644 mk/spksrc.cross-dotnet.mk create mode 100644 native/dotnet-sdk-3.1/Makefile create mode 100644 native/dotnet-sdk-3.1/digests create mode 100644 native/dotnet-sdk-5.0/Makefile create mode 100644 native/dotnet-sdk-5.0/digests diff --git a/mk/spksrc.cross-dotnet-env.mk b/mk/spksrc.cross-dotnet-env.mk new file mode 100644 index 00000000000..a11067d5f86 --- /dev/null +++ b/mk/spksrc.cross-dotnet-env.mk @@ -0,0 +1,90 @@ +# Configuration for dotnet build +# + +# NOTE: 32bit (x86) is not supported: +# https://github.com/dotnet/core/issues/5403 +# https://github.com/dotnet/core/issues/4595 +UNSUPPORTED_ARCHS += $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) + +DOTNET_OS = linux + + +ifeq ($(strip $(DOTNET_FRAMEWORK)),) + DOTNET_FRAMEWORK=netcoreapp3.1 +endif +DOTNET_BUILD_ARGS += -f $(DOTNET_FRAMEWORK) + +# Define DOTNET_ARCH for compiler +ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS)),$(ARCH)) + DOTNET_ARCH = arm +endif +ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) + DOTNET_ARCH = arm64 +endif +ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH)) + DOTNET_ARCH = x86 +endif +ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH)) + DOTNET_ARCH = x64 +endif +ifeq ($(DOTNET_ARCH),) + # don't report error to use regular UNSUPPORTED_ARCHS logging + $(warning Unsupported ARCH $(ARCH)) +endif + +ifeq ($(strip $(DOTNET_ROOT)),) + # dotnet sdk path + DOTNET_ROOT=$(WORK_DIR)/../../../native/dotnet-sdk-3.1/work-native +endif + +ifeq ($(strip $(DOTNET_ROOT_X86)),) + # dotnet sdk-32bit path + DOTNET_ROOT_X86="" + # DOTNET_ROOT_X86=$(WORK_DIR)/../../../native/dotnet-x86-sdk-3.1/work-native +endif + + +ifeq ($(strip $(NUGET_PACKAGES)),) + # cache nuget packages + # https://github.com/dotnet/sdk/commit/e5a9249418f8387602ee8a26fef0f1604acf5911 + NUGET_PACKAGES=$(DISTRIB_DIR)/nuget/packages +endif + +ifneq ($(strip $(DOTNET_NOT_RELEASE)),1) + DOTNET_BUILD_ARGS += --configuration Release +endif +ifneq ($(strip $(DOTNET_SHARED_FRAMEWORK)),1) + # Include .NET Core into package unless DOTNET_SHARED_FRAMEWORK is set to 1 + # https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained + DOTNET_BUILD_ARGS += --self-contained +endif + +ifeq ($(strip $(DOTNET_SINGLE_FILE)),1) + # package all dlls into a single binary + DOTNET_BUILD_PROPERTIES += "-p:PublishSingleFile=true" +endif + +DOTNET_BUILD_ARGS += --runtime $(DOTNET_OS)-$(DOTNET_ARCH) +DOTNET_BUILD_ARGS += --output="$(STAGING_INSTALL_PREFIX)/$(DOTNET_OUTPUT_PATH)" + +ifeq ($(strip $(DOTNET_OPTIMIZE)),1) +# PublishReadyToRun improve the startup time of your .NET Core application +# by compiling your application assemblies as ReadyToRun (R2R) format. +# R2R is a form of ahead-of-time (AOT) compilation. +# PublishTrimmed reduce the size of apps by analyzing IL and trimming unused assemblies. +# (not aware of reflection, needs testing, shaves ~10mb of binary) + DOTNET_BUILD_PROPERTIES += "-p:UseAppHost=true;PublishReadyToRun=true;PublishReadyToRunShowWarnings=true" +endif + +DOTNET_BUILD_ARGS += $(DOTNET_BUILD_PROPERTIES) + +# https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet#environment-variables +# https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet.md#environment-variables +ENV += DOTNET_PACKAGE_NAME=$(DOTNET_PACKAGE_NAME) +ENV += DOTNET_ROOT=$(DOTNET_ROOT) +ENV += DOTNET_ROOT\(x86\)=$(DOTNET_ROOT_X86) +ENV += NUGET_PACKAGES=$(NUGET_PACKAGES) +ENV += PATH=$(DOTNET_ROOT)/:$$PATH +ENV += DOTNET_ARCH=$(DOTNET_ARCH) +ENV += DOTNET_OS=$(DOTNET_OS) +ENV += DOTNET_CLI_TELEMETRY_OPTOUT=1 diff --git a/mk/spksrc.cross-dotnet.mk b/mk/spksrc.cross-dotnet.mk new file mode 100644 index 00000000000..d0e8953220d --- /dev/null +++ b/mk/spksrc.cross-dotnet.mk @@ -0,0 +1,114 @@ +# Build dotnet programs +# +# prerequisites: +# - cross/module depends on native/dotnet only +# - module does not require kernel (REQUIRE_KERNEL) +# +# remarks: +# - Restriction for minimal DSM version is not supported (toolchains are not used for dotnet builds) +# - CONFIGURE_TARGET is not supported/bypassed +# - most content is taken from spksrc.go.mk and modified for dotnet build and install +# +# NOTE: Don't strip the self-contained binary! +# aka don't use 'bin' for the PLIST use 'rsc' instead. +# It *will* break the program. + +# Common makefiles +include ../../mk/spksrc.common.mk +include ../../mk/spksrc.directories.mk + +# Configure the included makefiles +URLS = $(PKG_DIST_SITE)/$(PKG_DIST_NAME) +NAME = $(PKG_NAME) +COOKIE_PREFIX = $(PKG_NAME)- +ifneq ($(PKG_DIST_FILE),) +LOCAL_FILE = $(PKG_DIST_FILE) +else +LOCAL_FILE = $(PKG_DIST_NAME) +endif +DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE) +DIST_EXT = $(PKG_EXT) + +ifneq ($(ARCH),) +ARCH_SUFFIX = -$(ARCH)-$(TCVERSION) +TC = syno$(ARCH_SUFFIX) +endif + +##### dotnet specific configurations +include ../../mk/spksrc.cross-dotnet-env.mk + +# avoid run of make configure & make install +CONFIGURE_TARGET = nop + +ifeq ($(strip $(COMPILE_TARGET)),) +COMPILE_TARGET = dotnet_compile_target +endif + +ifeq ($(strip $(INSTALL_TARGET)),) +INSTALL_TARGET = nop +endif + +# default dotnet publish: +# https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish +dotnet_compile_target: + @$(MSG) - Compile with dotnet publish + $(RUN) dotnet publish $(DOTNET_PACKAGE_NAME) $(DOTNET_BUILD_ARGS) + +##### + +ifneq ($(REQUIRE_KERNEL),) + @$(error dotnet modules cannot build when REQUIRE_KERNEL is set) +endif + +include ../../mk/spksrc.pre-check.mk + +include ../../mk/spksrc.cross-env.mk + +include ../../mk/spksrc.download.mk + +include ../../mk/spksrc.depend.mk + +checksum: download +include ../../mk/spksrc.checksum.mk + +extract: checksum depend +include ../../mk/spksrc.extract.mk + +patch: extract +include ../../mk/spksrc.patch.mk + +configure: patch +include ../../mk/spksrc.configure.mk + +compile: configure +include ../../mk/spksrc.compile.mk + +install: compile +include ../../mk/spksrc.install.mk + +plist: install +include ../../mk/spksrc.plist.mk + + +clean: + rm -fr work work-* + + +all: install plist + +### For make digests +include ../../mk/spksrc.generate-digests.mk + +### For make dependency-tree +include ../../mk/spksrc.dependency-tree.mk + +.PHONY: all-archs +all-archs: $(addprefix arch-,$(AVAILABLE_ARCHS)) + +#### + +arch-%: + @$(MSG) Building package for arch $* + -@MAKEFLAGS= $(MAKE) ARCH=$(basename $(subst -,.,$(basename $(subst .,,$*)))) TCVERSION=$(if $(findstring $*,$(basename $(subst -,.,$(basename $(subst .,,$*))))),$(DEFAULT_TC),$(notdir $(subst -,/,$*))) + +#### diff --git a/native/dotnet-sdk-3.1/Makefile b/native/dotnet-sdk-3.1/Makefile new file mode 100644 index 00000000000..71620f138c4 --- /dev/null +++ b/native/dotnet-sdk-3.1/Makefile @@ -0,0 +1,31 @@ +PKG_NAME = dotnet-sdk-3.1 +# PKG_VERS = SDK 3.1.404 (v3.1.10 release) +# https://github.com/dotnet/core/blob/master/release-notes/3.1/3.1.9/3.1.9.md +PKG_VERS = 3.1.404 +PKG_EXT = tar.gz +# https://download.visualstudio.microsoft.com/download/pr/ec187f12-929e-4aa7-8abc-2f52e147af1d/56b0dbb5da1c191bff2c271fcd6e6394/dotnet-sdk-3.1.404-linux-x64.tar.gz +PKG_DIST_SITE = https://dotnetcli.azureedge.net/dotnet/Sdk/${PKG_VERS} +PKG_DIST_NAME = dotnet-sdk-$(PKG_VERS)-linux-x64.$(PKG_EXT) + +# https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?pivots=os-linux&tabs=netcore31 +DEPENDS = + +HOMEPAGE = https://dotnet.microsoft.com/ +COMMENT = A developer platform for building apps. +LICENSE = MIT + +CONFIGURE_TARGET = nop +COMPILE_TARGET = nop +INSTALL_TARGET = dotnet-install + +DOTNET_PACKAGES=$(DISTRIB_DIR)/nuget/packages + +include ../../mk/spksrc.native-cc.mk + +# Supported architectures: +# https://github.com/dotnet/core/blob/master/release-notes/3.1/3.1-supported-os.md#linux +## UNSUPPORTED_ARCHS = $(PPC_ARCHES) $(ARM5_ARCHES) $(x86_ARCHES) + +.PHONY: dotnet-install +dotnet-install: + mkdir -p $(DOTNET_PACKAGES) diff --git a/native/dotnet-sdk-3.1/digests b/native/dotnet-sdk-3.1/digests new file mode 100644 index 00000000000..b5ac7ecea2d --- /dev/null +++ b/native/dotnet-sdk-3.1/digests @@ -0,0 +1,3 @@ +dotnet-sdk-3.1.404-linux-x64.tar.gz SHA1 3aeee34359456c2ec303ecfde16e97a47da1196c +dotnet-sdk-3.1.404-linux-x64.tar.gz SHA256 6b8dd87de54bd855968325feec9cf57e2fb4b0dba745591d48d71eb2b8d7280d +dotnet-sdk-3.1.404-linux-x64.tar.gz MD5 2078ffff254a01597009c6f9b5e9df64 diff --git a/native/dotnet-sdk-5.0/Makefile b/native/dotnet-sdk-5.0/Makefile new file mode 100644 index 00000000000..37e5177c414 --- /dev/null +++ b/native/dotnet-sdk-5.0/Makefile @@ -0,0 +1,28 @@ +PKG_NAME = dotnet-sdk-5.0 +PKG_VERS = 5.0.100 +PKG_EXT = tar.gz +PKG_DIST_SITE = https://dotnetcli.azureedge.net/dotnet/Sdk/${PKG_VERS} +PKG_DIST_NAME = dotnet-sdk-$(PKG_VERS)-linux-x64.$(PKG_EXT) + +# https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?pivots=os-linux&tabs=netcore31 +DEPENDS = + +HOMEPAGE = https://dotnet.microsoft.com/ +COMMENT = A developer platform for building apps. +LICENSE = MIT + +CONFIGURE_TARGET = nop +COMPILE_TARGET = nop +INSTALL_TARGET = dotnet-install + +DOTNET_PACKAGES=$(DISTRIB_DIR)/nuget/packages + +include ../../mk/spksrc.native-cc.mk + +# Supported architectures: +# https://github.com/dotnet/core/blob/master/release-notes/3.1/3.1-supported-os.md#linux +## UNSUPPORTED_ARCHS = $(PPC_ARCHES) $(ARM5_ARCHES) $(x86_ARCHES) + +.PHONY: dotnet-install +dotnet-install: + mkdir -p $(DOTNET_PACKAGES) diff --git a/native/dotnet-sdk-5.0/digests b/native/dotnet-sdk-5.0/digests new file mode 100644 index 00000000000..2437f570230 --- /dev/null +++ b/native/dotnet-sdk-5.0/digests @@ -0,0 +1,3 @@ +dotnet-sdk-5.0.100-linux-x64.tar.gz SHA1 ab456308344dc6a18c9c8b0a394c29dfcc19553a +dotnet-sdk-5.0.100-linux-x64.tar.gz SHA256 b8278fd20a7242e711ee46910c23804babf9b38a4c1b97e2a4d9c5155d21cbd2 +dotnet-sdk-5.0.100-linux-x64.tar.gz MD5 8e69311010323e389456f1451458be45 From c4a5ae7caa44a3fad93f865bf1765f0138d3946d Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 11 Jan 2021 18:25:41 +1100 Subject: [PATCH 2/8] Update Jackett to use .NET Build This commit drops support for i686 and ARMv5 --- cross/jackett/Makefile | 26 ++++++++++++-------------- cross/jackett/PLIST | 2 +- cross/jackett/digests | 6 +++--- spk/jackett/Makefile | 21 ++++++--------------- spk/jackett/src/service-setup.sh | 26 ++++---------------------- 5 files changed, 26 insertions(+), 55 deletions(-) diff --git a/cross/jackett/Makefile b/cross/jackett/Makefile index c2980133304..f0ba76326c9 100644 --- a/cross/jackett/Makefile +++ b/cross/jackett/Makefile @@ -1,23 +1,21 @@ PKG_NAME = Jackett -PKG_VERS = 0.16.1340 +PKG_VERS = 0.16.2294 PKG_EXT = tar.gz -PKG_DIST_NAME = $(PKG_NAME).Binaries.Mono.$(PKG_EXT) -PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://github.com/Jackett/Jackett/releases/download/v$(PKG_VERS) -PKG_DIR = jackett +PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) +PKG_DIST_FILE = $(PKG_NAME)-dotnet-$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://github.com/Jackett/Jackett/archive +PKG_DIR = Jackett-$(PKG_VERS)/src -DEPENDS = +DEPENDS = native/dotnet-sdk-3.1 HOMEPAGE = https://github.com/Jackett/Jackett COMMENT = Jackett works as a proxy server: it translates queries from apps into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software. Jackett is a single repository of maintained indexer scraping & translation logic - removing the burden from other apps. LICENSE = GNU GPL v2 -CONFIGURE_TARGET = nop -COMPILE_TARGET = nop -INSTALL_TARGET = jackett_install +DOTNET_OPTIMIZE = 1 +DOTNET_PACKAGE_NAME = Jackett.Server +DOTNET_OUTPUT_PATH = share +SET_VERSION = /p:AssemblyVersion=$(PKG_VERS) /p:FileVersion=$(PKG_VERS) /p:InformationalVersion=$(PKG_VERS) /p:Version=$(PKG_VERS) +DOTNET_BUILD_PROPERTIES += $(SET_VERSION) -include ../../mk/spksrc.cross-cc.mk - -jackett_install: - mkdir -p $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR) - tar -cf - -C $(WORK_DIR)/$(PKG_NAME) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR) +include ../../mk/spksrc.cross-dotnet.mk diff --git a/cross/jackett/PLIST b/cross/jackett/PLIST index a701422790e..14f34d0c58e 100644 --- a/cross/jackett/PLIST +++ b/cross/jackett/PLIST @@ -1 +1 @@ -rsc:share/jackett +rsc:share/ diff --git a/cross/jackett/digests b/cross/jackett/digests index 8eadf1840d8..e9e941932b0 100644 --- a/cross/jackett/digests +++ b/cross/jackett/digests @@ -1,3 +1,3 @@ -Jackett-0.16.1340.tar.gz SHA1 ac3081fb01e86fe5074edf602eae76ce6bbfc229 -Jackett-0.16.1340.tar.gz SHA256 882c729bf2cfaa6b7b23a4f1029a4751a9ab11134bb98541b351307d48c1b318 -Jackett-0.16.1340.tar.gz MD5 aa0be138f04b1af6d37fc8fc266200e3 +Jackett-dotnet-0.16.2294.tar.gz SHA1 c7ca362b6bf3a46fda974a34a80c5e98b37004d1 +Jackett-dotnet-0.16.2294.tar.gz SHA256 e2e467e566e8ca9032b37497618f83bda39f32e3135ad06e930e83c810ab5f1d +Jackett-dotnet-0.16.2294.tar.gz MD5 5994281f147298e4e2b77f2ee4089259 diff --git a/spk/jackett/Makefile b/spk/jackett/Makefile index db1d79e0642..d12733ffadf 100644 --- a/spk/jackett/Makefile +++ b/spk/jackett/Makefile @@ -1,19 +1,17 @@ SPK_NAME = jackett -SPK_VERS = 0.16.1340 +SPK_VERS = 0.16.2294 SPK_REV = 12 SPK_ICON = src/jackett.png DSM_UI_DIR = app -DEPENDS = cross/busybox cross/curl cross/$(SPK_NAME) -# depend on mono 5.4 for BTLS HttpWebClient support -SPK_DEPENDS = "mono>=5.4" +DEPENDS = cross/$(SPK_NAME) -MAINTAINER = m4tt075 +MAINTAINER = SynoCommunity DESCRIPTION = "Jackett works as a proxy server. It translates queries from apps into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software. Jackett is a single repository of maintained indexer scraping and translation logic - removing the burden from other apps." RELOAD_UI = yes DISPLAY_NAME = Jackett STARTABLE = yes -CHANGELOG = "Add workaround for mono bug with armv5/88f6281" +CHANGELOG = "Compile using .NET Core" HOMEPAGE = https://github.com/Jackett/Jackett LICENSE = GPLv2 @@ -28,14 +26,9 @@ SERVICE_PORT_TITLE = Jackett(HTTP) # Admin link ADMIN_PORT = $(SERVICE_PORT) -POST_STRIP_TARGET = jackett_extra_install - -REQUIRED_DSM = 5.0 -# no PPC support for mono, see cross/mono/Makefile for details -UNSUPPORTED_ARCHS = $(PPC_ARCHS) +UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) -BUSYBOX_CONFIG = usrmng daemon -ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)" +POST_STRIP_TARGET = jackett_extra_install include ../../mk/spksrc.spk.mk @@ -44,5 +37,3 @@ jackett_extra_install: install -m 755 -d $(STAGING_DIR)/var install -m 755 -d $(STAGING_DIR)/var/.config install -m 755 -d $(STAGING_DIR)/var/.config/Jackett - install -m 755 -d $(STAGING_DIR)/app - install -m 644 src/app/config $(STAGING_DIR)/app/config diff --git a/spk/jackett/src/service-setup.sh b/spk/jackett/src/service-setup.sh index c1ac4baccc8..0fa5a1c10b1 100644 --- a/spk/jackett/src/service-setup.sh +++ b/spk/jackett/src/service-setup.sh @@ -1,23 +1,16 @@ -# Package specific behaviors +# Package specific behaviours # Sourced script by generic installer and start-stop-status scripts service_prestart () { # Replace generic service startup - MONO_PATH="/var/packages/mono/target/bin" - PATH="${SYNOPKG_PKGDEST}/bin:${MONO_PATH}:${PATH}" - MONO="${MONO_PATH}/mono" - JACKETT="${SYNOPKG_PKGDEST}/share/${SYNOPKG_PKGNAME}/JackettConsole.exe" + PATH="${SYNOPKG_PKGDEST}/bin:${PATH}" + JACKETT="${SYNOPKG_PKGDEST}/share/jackett" HOME_DIR="${SYNOPKG_PKGDEST}/var" - # workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537) - if [ "$SYNOPKG_DSM_ARCH" == "88f6281" -o "$SYNOPKG_DSM_ARCH" == "88f6282" ]; then - MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono" - fi - echo "Starting Jackett as user ${EFF_USER}" >> ${LOG_FILE} - COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${JACKETT} --PIDFile ${PID_FILE}" + COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${JACKETT} --PIDFile ${PID_FILE}" if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 6 ]; then su ${EFF_USER} -s /bin/sh -c "${COMMAND}" >> ${LOG_FILE} 2>&1 & @@ -25,14 +18,3 @@ service_prestart () ${COMMAND} >> ${LOG_FILE} 2>&1 & fi } - -service_postinst () -{ - # Discard legacy obsolete busybox user account - BIN=${SYNOPKG_PKGDEST}/bin - $BIN/busybox --install $BIN - $BIN/delgroup "${USER}" "users" >> ${INST_LOG} - $BIN/deluser "${USER}" >> ${INST_LOG} - - echo "service_postinst ${SYNOPKG_PKG_STATUS}" >> ${INST_LOG} -} From bdce3f60d8881d42dc047d37f75f14de2eff4399 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 11 Jan 2021 19:24:18 +1100 Subject: [PATCH 3/8] .NET add armv7l 32bit to unsupported archs --- mk/spksrc.cross-dotnet-env.mk | 4 ++-- spk/jackett/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mk/spksrc.cross-dotnet-env.mk b/mk/spksrc.cross-dotnet-env.mk index a11067d5f86..101f6afa768 100644 --- a/mk/spksrc.cross-dotnet-env.mk +++ b/mk/spksrc.cross-dotnet-env.mk @@ -4,7 +4,7 @@ # NOTE: 32bit (x86) is not supported: # https://github.com/dotnet/core/issues/5403 # https://github.com/dotnet/core/issues/4595 -UNSUPPORTED_ARCHS += $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) +UNSUPPORTED_ARCHS += $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) $(ARMv7L_ARCHS) DOTNET_OS = linux @@ -29,7 +29,7 @@ ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH)) endif ifeq ($(DOTNET_ARCH),) # don't report error to use regular UNSUPPORTED_ARCHS logging - $(warning Unsupported ARCH $(ARCH)) + $(error Unsupported ARCH $(ARCH)) endif ifeq ($(strip $(DOTNET_ROOT)),) diff --git a/spk/jackett/Makefile b/spk/jackett/Makefile index d12733ffadf..b60b908ff2e 100644 --- a/spk/jackett/Makefile +++ b/spk/jackett/Makefile @@ -26,7 +26,7 @@ SERVICE_PORT_TITLE = Jackett(HTTP) # Admin link ADMIN_PORT = $(SERVICE_PORT) -UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) +UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) $(ARMv7L_ARCHS) POST_STRIP_TARGET = jackett_extra_install From 3996d1606f4ffc6e0debc2822a861894fb9af7ca Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Sat, 16 Jan 2021 16:15:01 +1100 Subject: [PATCH 4/8] jackett simplify service script --- spk/jackett/src/service-setup.sh | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/spk/jackett/src/service-setup.sh b/spk/jackett/src/service-setup.sh index 0fa5a1c10b1..c6025d71d66 100644 --- a/spk/jackett/src/service-setup.sh +++ b/spk/jackett/src/service-setup.sh @@ -1,20 +1,7 @@ -# Package specific behaviours -# Sourced script by generic installer and start-stop-status scripts +PATH="${SYNOPKG_PKGDEST}/bin:${PATH}" +JACKETT="${SYNOPKG_PKGDEST}/share/jackett" +HOME_DIR="${SYNOPKG_PKGDEST}/var" -service_prestart () -{ - # Replace generic service startup - PATH="${SYNOPKG_PKGDEST}/bin:${PATH}" - JACKETT="${SYNOPKG_PKGDEST}/share/jackett" - HOME_DIR="${SYNOPKG_PKGDEST}/var" - - echo "Starting Jackett as user ${EFF_USER}" >> ${LOG_FILE} - COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${JACKETT} --PIDFile ${PID_FILE}" - - if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 6 ]; then - su ${EFF_USER} -s /bin/sh -c "${COMMAND}" >> ${LOG_FILE} 2>&1 & - else - ${COMMAND} >> ${LOG_FILE} 2>&1 & - fi -} +SERVICE_COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${JACKETT} --PIDFile ${PID_FILE}" +SVC_BACKGROUND=y From bdbb063776dd25e69c4659ef96b2ecc9ba560c50 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 8 Feb 2021 17:34:13 +1100 Subject: [PATCH 5/8] dotnet: cleanup --- native/dotnet-sdk-3.1/Makefile | 7 ------- native/dotnet-sdk-5.0/Makefile | 7 ------- 2 files changed, 14 deletions(-) diff --git a/native/dotnet-sdk-3.1/Makefile b/native/dotnet-sdk-3.1/Makefile index 71620f138c4..bbfedd25448 100644 --- a/native/dotnet-sdk-3.1/Makefile +++ b/native/dotnet-sdk-3.1/Makefile @@ -7,9 +7,6 @@ PKG_EXT = tar.gz PKG_DIST_SITE = https://dotnetcli.azureedge.net/dotnet/Sdk/${PKG_VERS} PKG_DIST_NAME = dotnet-sdk-$(PKG_VERS)-linux-x64.$(PKG_EXT) -# https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?pivots=os-linux&tabs=netcore31 -DEPENDS = - HOMEPAGE = https://dotnet.microsoft.com/ COMMENT = A developer platform for building apps. LICENSE = MIT @@ -22,10 +19,6 @@ DOTNET_PACKAGES=$(DISTRIB_DIR)/nuget/packages include ../../mk/spksrc.native-cc.mk -# Supported architectures: -# https://github.com/dotnet/core/blob/master/release-notes/3.1/3.1-supported-os.md#linux -## UNSUPPORTED_ARCHS = $(PPC_ARCHES) $(ARM5_ARCHES) $(x86_ARCHES) - .PHONY: dotnet-install dotnet-install: mkdir -p $(DOTNET_PACKAGES) diff --git a/native/dotnet-sdk-5.0/Makefile b/native/dotnet-sdk-5.0/Makefile index 37e5177c414..768fc2ac53d 100644 --- a/native/dotnet-sdk-5.0/Makefile +++ b/native/dotnet-sdk-5.0/Makefile @@ -4,9 +4,6 @@ PKG_EXT = tar.gz PKG_DIST_SITE = https://dotnetcli.azureedge.net/dotnet/Sdk/${PKG_VERS} PKG_DIST_NAME = dotnet-sdk-$(PKG_VERS)-linux-x64.$(PKG_EXT) -# https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?pivots=os-linux&tabs=netcore31 -DEPENDS = - HOMEPAGE = https://dotnet.microsoft.com/ COMMENT = A developer platform for building apps. LICENSE = MIT @@ -19,10 +16,6 @@ DOTNET_PACKAGES=$(DISTRIB_DIR)/nuget/packages include ../../mk/spksrc.native-cc.mk -# Supported architectures: -# https://github.com/dotnet/core/blob/master/release-notes/3.1/3.1-supported-os.md#linux -## UNSUPPORTED_ARCHS = $(PPC_ARCHES) $(ARM5_ARCHES) $(x86_ARCHES) - .PHONY: dotnet-install dotnet-install: mkdir -p $(DOTNET_PACKAGES) From 2a82e22f414736287553752ff8f3e05e98ce37ba Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 8 Feb 2021 18:16:56 +1100 Subject: [PATCH 6/8] Jackett: update to 0.17.x with .NET 5.0 new variable DOTNET_VERSION makes it easy to switch .NET versions --- cross/jackett/Makefile | 5 +++-- cross/jackett/digests | 6 +++--- mk/spksrc.cross-dotnet-env.mk | 13 ++++++++++--- spk/jackett/Makefile | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/cross/jackett/Makefile b/cross/jackett/Makefile index f0ba76326c9..ad9675f14a5 100644 --- a/cross/jackett/Makefile +++ b/cross/jackett/Makefile @@ -1,12 +1,13 @@ PKG_NAME = Jackett -PKG_VERS = 0.16.2294 +PKG_VERS = 0.17.474 PKG_EXT = tar.gz PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) PKG_DIST_FILE = $(PKG_NAME)-dotnet-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://github.com/Jackett/Jackett/archive PKG_DIR = Jackett-$(PKG_VERS)/src -DEPENDS = native/dotnet-sdk-3.1 +DOTNET_VERSION = 5.0 +DEPENDS = native/dotnet-sdk-$(DOTNET_VERSION) HOMEPAGE = https://github.com/Jackett/Jackett COMMENT = Jackett works as a proxy server: it translates queries from apps into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software. Jackett is a single repository of maintained indexer scraping & translation logic - removing the burden from other apps. diff --git a/cross/jackett/digests b/cross/jackett/digests index e9e941932b0..5bb16be6143 100644 --- a/cross/jackett/digests +++ b/cross/jackett/digests @@ -1,3 +1,3 @@ -Jackett-dotnet-0.16.2294.tar.gz SHA1 c7ca362b6bf3a46fda974a34a80c5e98b37004d1 -Jackett-dotnet-0.16.2294.tar.gz SHA256 e2e467e566e8ca9032b37497618f83bda39f32e3135ad06e930e83c810ab5f1d -Jackett-dotnet-0.16.2294.tar.gz MD5 5994281f147298e4e2b77f2ee4089259 +Jackett-dotnet-0.17.474.tar.gz SHA1 66e671ce97cae5b27129a0c2647cc6162bd813dc +Jackett-dotnet-0.17.474.tar.gz SHA256 24342dd12d21968da0514b53e68ad5720c7222bf9c69aae7f8cbebdf07199ac0 +Jackett-dotnet-0.17.474.tar.gz MD5 61aa8d774851c3df2897cd1b77829f3c diff --git a/mk/spksrc.cross-dotnet-env.mk b/mk/spksrc.cross-dotnet-env.mk index 101f6afa768..5a5890b1a82 100644 --- a/mk/spksrc.cross-dotnet-env.mk +++ b/mk/spksrc.cross-dotnet-env.mk @@ -7,10 +7,17 @@ UNSUPPORTED_ARCHS += $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) $(ARMv7L_ARCHS) DOTNET_OS = linux +DOTNET_DEFAULT_VERSION = 3.1 +ifeq ($(strip $(DOTNET_VERSION)),) + DOTNET_VERSION=$(DOTNET_DEFAULT_VERSION) +endif ifeq ($(strip $(DOTNET_FRAMEWORK)),) - DOTNET_FRAMEWORK=netcoreapp3.1 + DOTNET_FRAMEWORK=net$(DOTNET_VERSION) + ifeq ($(call version_lt, $(DOTNET_VERSION), 5.0),1) + DOTNET_FRAMEWORK=netcoreapp$(DOTNET_VERSION) + endif endif DOTNET_BUILD_ARGS += -f $(DOTNET_FRAMEWORK) @@ -34,13 +41,13 @@ endif ifeq ($(strip $(DOTNET_ROOT)),) # dotnet sdk path - DOTNET_ROOT=$(WORK_DIR)/../../../native/dotnet-sdk-3.1/work-native + DOTNET_ROOT=$(WORK_DIR)/../../../native/dotnet-sdk-$(DOTNET_VERSION)/work-native endif ifeq ($(strip $(DOTNET_ROOT_X86)),) # dotnet sdk-32bit path DOTNET_ROOT_X86="" - # DOTNET_ROOT_X86=$(WORK_DIR)/../../../native/dotnet-x86-sdk-3.1/work-native + # DOTNET_ROOT_X86=$(WORK_DIR)/../../../native/dotnet-x86-sdk-$(DOTNET_VERSION)/work-native endif diff --git a/spk/jackett/Makefile b/spk/jackett/Makefile index b60b908ff2e..a096664b0bf 100644 --- a/spk/jackett/Makefile +++ b/spk/jackett/Makefile @@ -1,5 +1,5 @@ SPK_NAME = jackett -SPK_VERS = 0.16.2294 +SPK_VERS = 0.17.474 SPK_REV = 12 SPK_ICON = src/jackett.png DSM_UI_DIR = app From 292360d6533ca55fe6949900378a536794b7781c Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 8 Feb 2021 18:36:26 +1100 Subject: [PATCH 7/8] Jackett: add mono build for backwards comparability --- cross/jackett-mono/Makefile | 23 +++++++++++++++++++++++ cross/jackett-mono/PLIST | 1 + cross/jackett-mono/digests | 3 +++ spk/jackett/Makefile | 17 ++++++++++++++++- spk/jackett/src/service-setup-mono.sh | 11 +++++++++++ 5 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 cross/jackett-mono/Makefile create mode 100644 cross/jackett-mono/PLIST create mode 100644 cross/jackett-mono/digests create mode 100644 spk/jackett/src/service-setup-mono.sh diff --git a/cross/jackett-mono/Makefile b/cross/jackett-mono/Makefile new file mode 100644 index 00000000000..a4dd60bb08c --- /dev/null +++ b/cross/jackett-mono/Makefile @@ -0,0 +1,23 @@ +PKG_NAME = Jackett +PKG_VERS = 0.17.474 +PKG_EXT = tar.gz +PKG_DIST_NAME = $(PKG_NAME).Binaries.Mono.$(PKG_EXT) +PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://github.com/Jackett/Jackett/releases/download/v$(PKG_VERS) +PKG_DIR = jackett + +DEPENDS = + +HOMEPAGE = https://github.com/Jackett/Jackett +COMMENT = Jackett works as a proxy server: it translates queries from apps into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software. Jackett is a single repository of maintained indexer scraping & translation logic - removing the burden from other apps. +LICENSE = GNU GPL v2 + +CONFIGURE_TARGET = nop +COMPILE_TARGET = nop +INSTALL_TARGET = jackett_install + +include ../../mk/spksrc.cross-cc.mk + +jackett_install: + mkdir -p $(STAGING_INSTALL_PREFIX)/share + tar -cf - -C $(WORK_DIR)/$(PKG_NAME) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share diff --git a/cross/jackett-mono/PLIST b/cross/jackett-mono/PLIST new file mode 100644 index 00000000000..14f34d0c58e --- /dev/null +++ b/cross/jackett-mono/PLIST @@ -0,0 +1 @@ +rsc:share/ diff --git a/cross/jackett-mono/digests b/cross/jackett-mono/digests new file mode 100644 index 00000000000..9990e9347c8 --- /dev/null +++ b/cross/jackett-mono/digests @@ -0,0 +1,3 @@ +Jackett-0.17.474.tar.gz SHA1 dcb3c385c0eec22c493b791d9cc95863044576dd +Jackett-0.17.474.tar.gz SHA256 c21ddc15df5785ebd986ffb94626c362083c51848f0a831b9b047e77d5fab98d +Jackett-0.17.474.tar.gz MD5 26b6ea4d6c78c6e361b94157c5e2deec diff --git a/spk/jackett/Makefile b/spk/jackett/Makefile index a096664b0bf..680cc52cfe7 100644 --- a/spk/jackett/Makefile +++ b/spk/jackett/Makefile @@ -26,7 +26,22 @@ SERVICE_PORT_TITLE = Jackett(HTTP) # Admin link ADMIN_PORT = $(SERVICE_PORT) -UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) $(ARMv7L_ARCHS) +UNSUPPORTED_ARCHS = $(PPC_ARCHS) + +# Mono build for unsupported .NET archs +include ../../mk/spksrc.archs.mk +ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) +DEPENDS = cross/$(SPK_NAME)-mono +SERVICE_SETUP = src/service-setup-mono.sh +endif +ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH)) +DEPENDS = cross/$(SPK_NAME)-mono +SERVICE_SETUP = src/service-setup-mono.sh +endif +ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH)) +DEPENDS = cross/$(SPK_NAME)-mono +SERVICE_SETUP = src/service-setup-mono.sh +endif POST_STRIP_TARGET = jackett_extra_install diff --git a/spk/jackett/src/service-setup-mono.sh b/spk/jackett/src/service-setup-mono.sh new file mode 100644 index 00000000000..e282fce8557 --- /dev/null +++ b/spk/jackett/src/service-setup-mono.sh @@ -0,0 +1,11 @@ +MONO_PATH="/var/packages/mono/target/bin" +PATH="${SYNOPKG_PKGDEST}/bin:${MONO_PATH}:${PATH}" +MONO="${MONO_PATH}/mono" +JACKETT="${SYNOPKG_PKGDEST}/share/JackettConsole.exe" + +# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537) +if [ "$SYNOPKG_DSM_ARCH" == "88f6281" -o "$SYNOPKG_DSM_ARCH" == "88f6282" ]; then + MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono" +fi + +COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${JACKETT} --PIDFile ${PID_FILE}" From 023088b73316ec229558275c55d253aa2210912d Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Tue, 9 Feb 2021 23:54:23 +1100 Subject: [PATCH 8/8] Jackett: Code Review --- spk/jackett/Makefile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/spk/jackett/Makefile b/spk/jackett/Makefile index 680cc52cfe7..2f69955dbb9 100644 --- a/spk/jackett/Makefile +++ b/spk/jackett/Makefile @@ -11,7 +11,7 @@ DESCRIPTION = "Jackett works as a proxy server. It translates queries from apps RELOAD_UI = yes DISPLAY_NAME = Jackett STARTABLE = yes -CHANGELOG = "Compile using .NET Core" +CHANGELOG = "Update Jackett 17.474 and compile using .NET" HOMEPAGE = https://github.com/Jackett/Jackett LICENSE = GPLv2 @@ -30,17 +30,10 @@ UNSUPPORTED_ARCHS = $(PPC_ARCHS) # Mono build for unsupported .NET archs include ../../mk/spksrc.archs.mk -ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) -DEPENDS = cross/$(SPK_NAME)-mono -SERVICE_SETUP = src/service-setup-mono.sh -endif -ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH)) -DEPENDS = cross/$(SPK_NAME)-mono -SERVICE_SETUP = src/service-setup-mono.sh -endif -ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH)) +ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(i686_ARCHS) $(ARMv7L_ARCHS)),$(ARCH)) DEPENDS = cross/$(SPK_NAME)-mono SERVICE_SETUP = src/service-setup-mono.sh +CHANGELOG = "Update Jackett 17.474 and fix mono build (88f6281 and 88f6282)" endif POST_STRIP_TARGET = jackett_extra_install