diff options
author | makefu <github@syntax-fehler.de> | 2020-07-21 12:27:18 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2020-07-23 17:29:58 +0200 |
commit | 282c558084330e08fb20e2b150c677d1658fcd3a (patch) | |
tree | 6e6af1d8b34bf1f022e12c28805c9660b604bb59 | |
parent | 55079328c219fb53f3120a34fdba3a80d3be601b (diff) |
udpt: 2017-09-27 -> 3.1.1
udpt did a complete rewrite from cpp to rust.
This Commit uses rust with cargo to build the package.
The Configuration format changed form .conf to .toml and
the binary changed from udpt to udpt-rs
-rw-r--r-- | pkgs/servers/udpt/default.nix | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/pkgs/servers/udpt/default.nix b/pkgs/servers/udpt/default.nix index 2849f8c7e743..b807d1f0d267 100644 --- a/pkgs/servers/udpt/default.nix +++ b/pkgs/servers/udpt/default.nix @@ -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 = { |