Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udpt: 2017-09-27 -> 3.1.1 #93586

Merged
merged 2 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nixos/doc/manual/release-notes/rl-2009.xml
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,14 @@ systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www" ];
automatically if <literal>stateVersion</literal> is 20.09 or higher.
</para>
</listitem>
<listitem>
<para>
<literal>udpt</literal> experienced a complete rewrite from C++ to rust. The configuration format changed from ini to toml.
The new configuration documentation can be found at
<link xlink:href="https://naim94a.github.io/udpt/config.html">the official website</link> and example
configuration is packaged in <literal>${udpt}/share/udpt/udpt.toml</literal>.
</para>
</listitem>
<listitem>
<para>
We now have a unified <xref linkend="opt-services.xserver.displayManager.autoLogin"/> option interface
Expand Down
42 changes: 9 additions & 33 deletions pkgs/servers/udpt/default.nix
Original file line number Diff line number Diff line change
@@ -1,45 +1,21 @@
{ stdenv, fetchFromGitHub, boost, sqlite, cmake, gtest }:
{ stdenv, rustPlatform, fetchFromGitHub }:

stdenv.mkDerivation {
rustPlatform.buildRustPackage rec {
pname = "udpt";
version = "2017-09-27";

enableParallelBuilding = true;

# Suitable for a network facing daemon.
hardeningEnable = [ "pie" ];
version = "3.1.0";

src = fetchFromGitHub {
owner = "naim94a";
repo = "udpt";
rev = "e0dffc83c8ce76b08a41a4abbd5f8065535d534f";
sha256 = "187dw96mzgcmh4k9pvfpb7ckbb8d4vlikamr2x8vkpwzgjs3xd6g";
rev = "${pname}-${version}";
sha256 = "1g6l0y5x9pdra3i1npkm474glysicm4hf2m01700ack2rp43vldr";
};

doCheck = true;

checkPhase = ''
runHook preCheck

make test

runHook postCheck
'';

buildInputs = [ boost sqlite cmake gtest ];

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
'';
cargoSha256 = "1cmd80ndjxdmyfjpm1f04rwf64501nyi6wdsj7lxidgd1v92wy2c";
verifyCargoDeps = true;

installPhase = ''
mkdir -p $out/bin $out/etc/
cp udpt $out/bin
cp ../udpt.conf $out/etc/
# without this, the resulting binary is unstripped.
runHook postInstall
postInstall = ''
install -D udpt.toml $out/share/udpt/udpt.toml
'';

meta = {
Expand Down