From 22f9a591163a890fc7c73b749bd1df347a98e766 Mon Sep 17 00:00:00 2001 From: Martin Joerg Date: Mon, 14 Oct 2024 12:51:54 +0000 Subject: [PATCH 1/3] nunicode: init at 1.11 --- pkgs/by-name/nu/nunicode/package.nix | 76 ++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 pkgs/by-name/nu/nunicode/package.nix diff --git a/pkgs/by-name/nu/nunicode/package.nix b/pkgs/by-name/nu/nunicode/package.nix new file mode 100644 index 000000000000..0025372fb2eb --- /dev/null +++ b/pkgs/by-name/nu/nunicode/package.nix @@ -0,0 +1,76 @@ +{ + lib, + stdenv, + fetchFromBitbucket, + cmake, + sqlite, + nix-update-script, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "nunicode"; + version = "1.11"; + + outputs = [ + "out" + "sqlite" + ]; + + src = fetchFromBitbucket { + owner = "alekseyt"; + repo = "nunicode"; + rev = "refs/tags/${finalAttrs.version}"; + hash = "sha256-6255YdX7eYSAj0EAE4RgX1m4XDNIF/Nc4ZCvXzTxpag="; + }; + + postPatch = '' + # load correct SQLite extension on all platforms + substituteInPlace sqlite3/testsuite --replace-fail \ + "NU='./libnusqlite3.so'" \ + "NU='./libnusqlite3'" + + # fix expressions using like .. escape (https://sqlite.org/lang_expr.html#like) + substituteInPlace sqlite3/tests.sql --replace-fail '\\' '\' + + # install SQLite extension in a separate output + echo >>sqlite3/CMakeLists.txt \ + 'install(TARGETS nusqlite3 DESTINATION "${placeholder "sqlite"}/lib")' + ''; + + nativeBuildInputs = [ + cmake + sqlite + ]; + + # avoid name-clash on case-insensitive filesystems + cmakeBuildDir = "build-dir"; + + doCheck = true; + + checkPhase = '' + runHook preCheck + + ( + echo running SQLite testsuite + + cd sqlite3 + RESULT=$(../../sqlite3/testsuite < ../../sqlite3/tests.sql | sqlite3) + grep <<<$RESULT FAILED && echo SQLite testsuite failed && false + + echo SQLite testsuite succeeded + ) + + runHook postCheck + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Fast, small and portable Unicode library with SQLite extension"; + homepage = "https://bitbucket.org/alekseyt/nunicode"; + changelog = "https://bitbucket.org/alekseyt/nunicode/src/${finalAttrs.version}/CHANGELOG"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.mjoerg ]; + platforms = lib.platforms.unix; + }; +}) From 6e69d789877ed301b3acf6661e3f6429f78c41be Mon Sep 17 00:00:00 2001 From: Martin Joerg Date: Mon, 14 Oct 2024 12:51:55 +0000 Subject: [PATCH 2/3] audiobookshelf: 2.14.0 -> 2.15.0 https://github.com/advplyr/audiobookshelf/releases/tag/v2.15.0 https://github.com/advplyr/audiobookshelf/compare/refs/tags/v2.14.0...refs/tags/v2.15.0 --- pkgs/by-name/au/audiobookshelf/source.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/au/audiobookshelf/source.json b/pkgs/by-name/au/audiobookshelf/source.json index 87811d028730..4320f1380e02 100644 --- a/pkgs/by-name/au/audiobookshelf/source.json +++ b/pkgs/by-name/au/audiobookshelf/source.json @@ -1,9 +1,9 @@ { "owner": "advplyr", "repo": "audiobookshelf", - "rev": "cf5598aeb9b086a28e853d6a89b82a7467fd6969", - "hash": "sha256-tObC7QbdwpAlt97eXB9QzZEaQcquuST+8nC6lYEXTUM=", - "version": "2.14.0", - "depsHash": "sha256-nVsmV3Vms2S9oM7duFfgt+go1+wM2JniI8B3UFmv/TE=", - "clientDepsHash": "sha256-oaoGxcMs8XQVaRx8UO9NSThqbHuZsA4fm8OGlSiaKO0=" + "rev": "80e0cac4747e61d1fbb5374ec4ac41d3499042e2", + "hash": "sha256-gwu9AvxrfW1QSgUy3Q4di1xa964ZMZpRkgdFQlit9+4=", + "version": "2.15.0", + "depsHash": "sha256-TDZUrzVcmKn4izRn8E+uf6Mh22fRsHeVm5h+wRZAX8o=", + "clientDepsHash": "sha256-7R5+Yam9Y4+bj/8wrAE25g4sivg/sw5G0pAZFGPRpMI=" } From f7d8c85ec2031bbebfd3044203cd7c43e917c8e5 Mon Sep 17 00:00:00 2001 From: Martin Joerg Date: Mon, 14 Oct 2024 12:51:55 +0000 Subject: [PATCH 3/3] audiobookshelf: enable nusqlite3 extension --- pkgs/by-name/au/audiobookshelf/package.nix | 4 ++-- pkgs/by-name/au/audiobookshelf/wrapper.nix | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/au/audiobookshelf/package.nix b/pkgs/by-name/au/audiobookshelf/package.nix index efa34166f093..e5b2e8b5b17e 100644 --- a/pkgs/by-name/au/audiobookshelf/package.nix +++ b/pkgs/by-name/au/audiobookshelf/package.nix @@ -6,6 +6,7 @@ buildNpmPackage, nodejs_18, ffmpeg-full, + nunicode, util-linux, python3, getopt, @@ -45,8 +46,7 @@ let inherit stdenv ffmpeg-full - pname - nodejs + nunicode getopt ; }; diff --git a/pkgs/by-name/au/audiobookshelf/wrapper.nix b/pkgs/by-name/au/audiobookshelf/wrapper.nix index 87d3358a425c..4dabeae303b1 100644 --- a/pkgs/by-name/au/audiobookshelf/wrapper.nix +++ b/pkgs/by-name/au/audiobookshelf/wrapper.nix @@ -1,4 +1,9 @@ -{ stdenv, ffmpeg-full, pname, nodejs, getopt }: '' +{ + stdenv, + ffmpeg-full, + nunicode, + getopt, +}: '' #!${stdenv.shell} port=8000 @@ -55,6 +60,7 @@ SKIP_BINARIES_CHECK=1 \ FFMPEG_PATH=${ffmpeg-full}/bin/ffmpeg \ FFPROBE_PATH=${ffmpeg-full}/bin/ffprobe \ + NUSQLITE3_PATH=${nunicode.sqlite}/lib/libnusqlite3 \ CONFIG_PATH="$config" \ METADATA_PATH="$metadata" \ PORT="$port" \