nixpkgs/pkgs/servers/udpt/default.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

2017-09-27 11:23:37 +00:00
{ stdenv, fetchFromGitHub, boost, sqlite, cmake, gtest }:
2016-10-02 20:11:48 +00:00
stdenv.mkDerivation rec {
name = "udpt-${version}";
2017-09-27 11:23:37 +00:00
version = "2017-09-27";
2016-10-02 20:11:48 +00:00
enableParallelBuilding = true;
# Suitable for a network facing daemon.
hardeningEnable = [ "pie" ];
src = fetchFromGitHub {
owner = "naim94a";
repo = "udpt";
2017-09-27 11:23:37 +00:00
rev = "e0dffc83c8ce76b08a41a4abbd5f8065535d534f";
sha256 = "187dw96mzgcmh4k9pvfpb7ckbb8d4vlikamr2x8vkpwzgjs3xd6g";
2016-10-02 20:11:48 +00:00
};
2017-09-27 11:23:37 +00:00
doCheck = true;
checkPhase = ''
runHook preCheck
make test
runHook postCheck
'';
buildInputs = [ boost sqlite cmake gtest ];
2016-10-02 20:11:48 +00:00
postPatch = ''
# Enabling optimization (implied by fortify hardening) causes htons
# to be re-defined as a macro, turning this use of :: into a syntax error.
sed -i '104a#undef htons' src/udpTracker.cpp
'';
installPhase = ''
mkdir -p $out/bin $out/etc/
cp udpt $out/bin
2017-09-27 11:23:37 +00:00
cp ../udpt.conf $out/etc/
2016-10-02 20:11:48 +00:00
# without this, the resulting binary is unstripped.
runHook postInstall
'';
meta = {
description = "A lightweight UDP torrent tracker";
homepage = https://naim94a.github.io/udpt;
license = stdenv.lib.licenses.gpl3;
platforms = stdenv.lib.platforms.linux;
maintainers = with stdenv.lib.maintainers; [ makefu ];
};
}