nixpkgs/pkgs/by-name/ow/owntracks-recorder/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

83 lines
1.7 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, mosquitto
, curl
, openssl
, lmdb
, lua
, libsodium
, libuuid
, libconfig
, testers
, owntracks-recorder
}:
stdenv.mkDerivation (finalAttrs: {
pname = "owntracks-recorder";
version = "0.9.9";
src = fetchFromGitHub {
owner = "owntracks";
repo = "recorder";
rev = finalAttrs.version;
hash = "sha256-6oCWzTiQgpp75xojd2ZFsrg+Kd5/gex1BPQVOWHfMuk=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
(lib.getDev curl)
(lib.getLib libconfig)
(lib.getDev openssl)
(lib.getDev lmdb)
(lib.getDev mosquitto)
(lib.getDev libuuid)
(lib.getDev lua)
(lib.getDev libsodium)
];
configurePhase = ''
runHook preConfigure
cp config.mk.in config.mk
substituteInPlace config.mk \
--replace "INSTALLDIR = /usr/local" "INSTALLDIR = $out" \
--replace "WITH_LUA ?= no" "WITH_LUA ?= yes" \
--replace "WITH_ENCRYPT ?= no" "WITH_ENCRYPT ?= yes"
runHook postConfigure
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -m 0755 ot-recorder $out/bin
install -m 0755 ocat $out/bin
runHook postInstall
'';
passthru.tests.version = testers.testVersion {
package = owntracks-recorder;
command = "ocat --version";
version = finalAttrs.version;
};
meta = with lib; {
description = "Store and access data published by OwnTracks apps";
homepage = "https://github.com/owntracks/recorder";
changelog = "https://github.com/owntracks/recorder/blob/master/Changelog";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ gaelreyrol ];
mainProgram = "ot-recorder";
};
})