Skip to content

Commit

Permalink
Create native libe_sqlite3 library used in dotnet applications (#6348)
Browse files Browse the repository at this point in the history
* add cross\libe_sqlite3 for dotnet
- create native libe_sqlite3 library for SQLitePCLRaw to run on DSM 6.2.4 and DSM 7.1

* ombi: fix for DSM 6.2.4 and DSM 7.1.1
- use libe_sqlite3.so created with cross/libe_sqlite3

* jellyfin: add support for DSM 7.1 and DSM 6.2.4
  • Loading branch information
hgy59 authored Dec 9, 2024
1 parent a9141db commit a79cb60
Show file tree
Hide file tree
Showing 9 changed files with 303,062 additions and 6 deletions.
66 changes: 66 additions & 0 deletions cross/libe_sqlite3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
PKG_NAME = libe_sqlite3
PKG_VERS = 2.1.10

# dotnet core supported archs only:
DOTNET_CORE_ARCHS = 1

HOMEPAGE = https://github.com/ericsink/cb/
COMMENT = Makefile to build libe_sqlite3.so from sources in https://github.com/ericsink/cb/tree/master/sqlite3 and https://github.com/ericsink/cb/tree/master/stup
LICENSE = Apache 2.0

# libe_sqlite3.so is the native library for linux provided by SQLitePCLRaw nuget package.
# Since the (cross) toolchains used for creation in https://github.com/ericsink/cb provide newer libc versions,
# these libraries depend on GLIBC 2.28.
# Such toolchains are used since SQLitePCLRaw 2.0.5.
#
# As .NET 8 and .NET 9 do not have such restrictions and run well on DSM 7.1.1 with GLIBC 2.26
# and on DSM 6.2.4 with GLIBC 2.20, we create libe_sqlite3.so here with the toolchains from
# Synology for compatibility with DSM.


# history of source files in https://github.com/ericsink/cb
# Date Version Commit Hash Commit Message
# 11.09.2024 2.1.10 b3ad80b update sqlite3 and sqlite3mc to 3.46.1

DOWNLOAD_TARGET = libe_sqlite3_download
CHECKSUM_TARGET = nop
CONFIGURE_TARGET = nop
COMPILE_TARGET = libe_sqlite3_compile
INSTALL_TARGET = libe_sqlite3_install

# In original build system, the flags (and toolchains) are defined in blb/cb.cs
ADDITIONAL_CFLAGS = -shared -fPIC -O
ADDITIONAL_CFLAGS += -DSQLITE_ENABLE_COLUMN_METADATA
ADDITIONAL_CFLAGS += -DSQLITE_ENABLE_FTS3_PARENTHESIS
ADDITIONAL_CFLAGS += -DSQLITE_ENABLE_FTS4
ADDITIONAL_CFLAGS += -DSQLITE_ENABLE_FTS5
ADDITIONAL_CFLAGS += -DSQLITE_ENABLE_JSON1
ADDITIONAL_CFLAGS += -DSQLITE_ENABLE_MATH_FUNCTIONS
ADDITIONAL_CFLAGS += -DSQLITE_ENABLE_RTREE
ADDITIONAL_CFLAGS += -DSQLITE_ENABLE_SNAPSHOT
ADDITIONAL_CFLAGS += -DSQLITE_DEFAULT_FOREIGN_KEYS=1
ADDITIONAL_CFLAGS += -DSQLITE_OS_UNIX
ADDITIONAL_CFLAGS += -DNDEBUG
ADDITIONAL_CFLAGS += -o libe_sqlite3.so

include ../../mk/spksrc.cross-cc.mk

ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH))
ADDITIONAL_CFLAGS += -m64 -msse4.2 -maes
endif

.PHONY: libe_sqlite3_download
libe_sqlite3_download:
@$(MSG) "install sources into work folder"
@tar -cf - -C source . | tar -xf - -C $(WORK_DIR)/

.PHONY: libe_sqlite3_compile
libe_sqlite3_compile:
@$(MSG) "compile libe_sqlite3"
@cd $(WORK_DIR) ; $(ENV) ; $${CC} $${CFLAGS} sqlite3/sqlite3.c stubs/stubs.c

.PHONY: libe_sqlite3_install
libe_sqlite3_install:
@$(MSG) "install libe_sqlite3"
@install -d $(STAGING_INSTALL_PREFIX)/lib/
@install -m 744 $(WORK_DIR)/libe_sqlite3.so $(STAGING_INSTALL_PREFIX)/lib/
1 change: 1 addition & 0 deletions cross/libe_sqlite3/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib:lib/libe_sqlite3.so
Loading

0 comments on commit a79cb60

Please sign in to comment.