Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jackett "Standalone" aka build using .NET #4207

Merged
merged 8 commits into from
Feb 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions cross/jackett-mono/Makefile
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions cross/jackett-mono/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rsc:share/
3 changes: 3 additions & 0 deletions cross/jackett-mono/digests
Original file line number Diff line number Diff line change
@@ -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
27 changes: 13 additions & 14 deletions cross/jackett/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
PKG_NAME = Jackett
PKG_VERS = 0.16.1340
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
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 =
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.
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
2 changes: 1 addition & 1 deletion cross/jackett/PLIST
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rsc:share/jackett
rsc:share/
6 changes: 3 additions & 3 deletions cross/jackett/digests
Original file line number Diff line number Diff line change
@@ -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.17.474.tar.gz SHA1 66e671ce97cae5b27129a0c2647cc6162bd813dc
Jackett-dotnet-0.17.474.tar.gz SHA256 24342dd12d21968da0514b53e68ad5720c7222bf9c69aae7f8cbebdf07199ac0
Jackett-dotnet-0.17.474.tar.gz MD5 61aa8d774851c3df2897cd1b77829f3c
97 changes: 97 additions & 0 deletions mk/spksrc.cross-dotnet-env.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# 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) $(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=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)

# 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
$(error Unsupported ARCH $(ARCH))
endif

ifeq ($(strip $(DOTNET_ROOT)),)
# dotnet sdk path
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-$(DOTNET_VERSION)/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
114 changes: 114 additions & 0 deletions mk/spksrc.cross-dotnet.mk
Original file line number Diff line number Diff line change
@@ -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 -,/,$*)))

####
24 changes: 24 additions & 0 deletions native/dotnet-sdk-3.1/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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)

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

.PHONY: dotnet-install
dotnet-install:
mkdir -p $(DOTNET_PACKAGES)
3 changes: 3 additions & 0 deletions native/dotnet-sdk-3.1/digests
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions native/dotnet-sdk-5.0/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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)

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

.PHONY: dotnet-install
dotnet-install:
mkdir -p $(DOTNET_PACKAGES)
3 changes: 3 additions & 0 deletions native/dotnet-sdk-5.0/digests
Original file line number Diff line number Diff line change
@@ -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
27 changes: 13 additions & 14 deletions spk/jackett/Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
SPK_NAME = jackett
SPK_VERS = 0.16.1340
SPK_VERS = 0.17.474
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
publicarray marked this conversation as resolved.
Show resolved Hide resolved
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 = "Update Jackett 17.474 and compile using .NET"
HOMEPAGE = https://github.com/Jackett/Jackett
LICENSE = GPLv2

Expand All @@ -28,14 +26,17 @@ 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)

BUSYBOX_CONFIG = usrmng daemon
ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)"
# Mono build for unsupported .NET archs
include ../../mk/spksrc.archs.mk
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

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

Expand All @@ -44,5 +45,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
Loading