vifm: 0.13 -> 0.14 (#380559)
[NixPkgs.git] / pkgs / by-name / ow / owntracks-recorder / package.nix
blob7f11113a5a2c35f13d2eae9b59ed3d0233f0c2fd
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   pkg-config,
6   mosquitto,
7   curl,
8   openssl,
9   lmdb,
10   lua,
11   libsodium,
12   libuuid,
13   libconfig,
14   testers,
15   owntracks-recorder,
18 stdenv.mkDerivation (finalAttrs: {
19   pname = "owntracks-recorder";
20   version = "0.9.9";
22   src = fetchFromGitHub {
23     owner = "owntracks";
24     repo = "recorder";
25     rev = finalAttrs.version;
26     hash = "sha256-6oCWzTiQgpp75xojd2ZFsrg+Kd5/gex1BPQVOWHfMuk=";
27   };
29   nativeBuildInputs = [
30     pkg-config
31   ];
33   buildInputs = [
34     (lib.getDev curl)
35     (lib.getLib libconfig)
36     (lib.getDev openssl)
37     (lib.getDev lmdb)
38     (lib.getDev mosquitto)
39     (lib.getDev libuuid)
40     (lib.getDev lua)
41     (lib.getDev libsodium)
42   ];
44   configurePhase = ''
45     runHook preConfigure
47     cp config.mk.in config.mk
49     substituteInPlace config.mk \
50       --replace "INSTALLDIR = /usr/local" "INSTALLDIR = $out" \
51       --replace "DOCROOT = /var/spool/owntracks/recorder/htdocs" "DOCROOT = $out/htdocs" \
52       --replace "WITH_LUA ?= no" "WITH_LUA ?= yes" \
53       --replace "WITH_ENCRYPT ?= no" "WITH_ENCRYPT ?= yes"
55     runHook postConfigure
56   '';
58   installPhase = ''
59     runHook preInstall
61     mkdir -p $out/bin
63     install -m 0755 ot-recorder $out/bin
64     install -m 0755 ocat $out/bin
66     cp -r docroot $out/htdocs
68     runHook postInstall
69   '';
71   passthru.tests.version = testers.testVersion {
72     package = owntracks-recorder;
73     command = "ocat --version";
74     version = finalAttrs.version;
75   };
77   meta = with lib; {
78     description = "Store and access data published by OwnTracks apps";
79     homepage = "https://github.com/owntracks/recorder";
80     changelog = "https://github.com/owntracks/recorder/blob/master/Changelog";
81     license = licenses.gpl2Plus;
82     platforms = platforms.linux;
83     maintainers = with maintainers; [ gaelreyrol ];
84     mainProgram = "ot-recorder";
85   };