Skip to content

Commit 27e5ee9

Browse files
Merge pull request #333691 from mjoerg/audiobookshelf-2.12.3-fix
audiobookshelf: skip version checks
2 parents 1336338 + 4f3cf96 commit 27e5ee9

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

pkgs/by-name/au/audiobookshelf/package.nix

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
ffmpeg-full,
99
util-linux,
1010
python3,
11-
getopt
11+
getopt,
12+
nixosTests,
1213
}:
1314

1415
let
@@ -28,7 +29,7 @@ let
2829
pname = "${pname}-client";
2930
inherit (source) version;
3031

31-
src = runCommand "cp-source" {} ''
32+
src = runCommand "cp-source" { } ''
3233
cp -r ${src}/client $out
3334
'';
3435

@@ -41,13 +42,28 @@ let
4142
};
4243

4344
wrapper = import ./wrapper.nix {
44-
inherit stdenv ffmpeg-full pname nodejs getopt;
45+
inherit
46+
stdenv
47+
ffmpeg-full
48+
pname
49+
nodejs
50+
getopt
51+
;
4552
};
4653

47-
in buildNpmPackage {
54+
in
55+
buildNpmPackage {
4856
inherit pname src;
4957
inherit (source) version;
5058

59+
postPatch = ''
60+
# Always skip version checks of the binary manager.
61+
# We provide our own binaries, and don't want to trigger downloads.
62+
substituteInPlace server/managers/BinaryManager.js --replace-fail \
63+
'if (!this.validVersions.length) return true' \
64+
'return true'
65+
'';
66+
5167
buildInputs = [ util-linux ];
5268
nativeBuildInputs = [ python3 ];
5369

@@ -67,15 +83,21 @@ in buildNpmPackage {
6783
chmod +x $out/bin/${pname}
6884
'';
6985

70-
passthru.updateScript = ./update.nu;
86+
passthru = {
87+
tests.basic = nixosTests.audiobookshelf;
88+
updateScript = ./update.nu;
89+
};
7190

72-
meta = with lib; {
91+
meta = {
7392
homepage = "https://www.audiobookshelf.org/";
7493
description = "Self-hosted audiobook and podcast server";
7594
changelog = "https://github.com/advplyr/audiobookshelf/releases/tag/v${source.version}";
76-
license = licenses.gpl3;
77-
maintainers = [ maintainers.jvanbruegge maintainers.adamcstephens ];
78-
platforms = platforms.linux;
95+
license = lib.licenses.gpl3;
96+
maintainers = with lib.maintainers; [
97+
jvanbruegge
98+
adamcstephens
99+
];
100+
platforms = lib.platforms.linux;
79101
mainProgram = "audiobookshelf";
80102
};
81103
}

0 commit comments

Comments
 (0)