nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 gtest,
8 boost,
9 wt,
10 taglib,
11 libconfig,
12 libarchive,
13 graphicsmagick,
14 ffmpeg,
15 zlib,
16 libSM,
17 libICE,
18 stb,
19 openssl,
20 xxHash,
21 pugixml,
22}:
23
24stdenv.mkDerivation (finalAttrs: {
25 pname = "lms";
26 version = "3.74.0";
27
28 src = fetchFromGitHub {
29 owner = "epoupon";
30 repo = "lms";
31 rev = "v${finalAttrs.version}";
32 hash = "sha256-D1Sg6XzZ8t/dFKrVh7k+KGLg2r6LeLGJk4FweVb4L1A=";
33 };
34
35 strictDeps = true;
36 nativeBuildInputs = [
37 cmake
38 pkg-config
39 ];
40 buildInputs = [
41 gtest
42 boost
43 wt
44 taglib
45 libconfig
46 libarchive
47 graphicsmagick
48 ffmpeg
49 zlib
50 libSM
51 libICE
52 stb
53 openssl
54 xxHash
55 pugixml
56 ];
57
58 postPatch = ''
59 substituteInPlace src/libs/core/include/core/SystemPaths.hpp --replace-fail "/etc" "$out/share/lms"
60 '';
61
62 postInstall = ''
63 substituteInPlace $out/share/lms/lms.conf --replace-fail "/usr/bin/ffmpeg" "${lib.getExe ffmpeg}"
64 substituteInPlace $out/share/lms/lms.conf --replace-fail "/usr/share/Wt/resources" "${wt}/share/Wt/resources"
65 substituteInPlace $out/share/lms/lms.conf --replace-fail "/usr/share/lms/docroot" "$out/share/lms/docroot"
66 substituteInPlace $out/share/lms/lms.conf --replace-fail "/usr/share/lms/approot" "$out/share/lms/approot"
67 substituteInPlace $out/share/lms/default.service --replace-fail "/usr/bin/lms" "$out/bin/lms"
68 install -Dm444 $out/share/lms/default.service -T $out/lib/systemd/system/lmsd.service
69 '';
70
71 meta = {
72 homepage = "https://github.com/epoupon/lms";
73 changelog = "https://github.com/epoupon/lms/releases/tag/${finalAttrs.src.rev}";
74 description = "Lightweight Music Server - Access your self-hosted music using a web interface";
75 license = lib.licenses.gpl3Plus;
76 platforms = lib.platforms.linux;
77 mainProgram = "lms";
78 maintainers = with lib.maintainers; [ mksafavi ];
79 };
80})