88 ffmpeg-full ,
99 util-linux ,
1010 python3 ,
11- getopt
11+ getopt ,
12+ nixosTests ,
1213} :
1314
1415let
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
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