mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 01:43:15 +00:00
Merge pull request #231599 from NickCao/udp2raw
udp2raw: build with cmake
This commit is contained in:
commit
4d00ddf9c4
@ -1,6 +1,8 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, cmake
|
||||
, makeWrapper
|
||||
, iptables
|
||||
}:
|
||||
@ -16,18 +18,26 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-mchSaqw6sOJ7+dydCM8juP7QMOVUrPL4MFA79Rvyjdo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
patches = [
|
||||
# Add install target to CMakeLists.txt
|
||||
# https://github.com/wangyu-/udp2raw/pull/469
|
||||
(fetchpatch {
|
||||
url = "https://github.com/wangyu-/udp2raw/commit/4559e6d47bb69fda0fbd3fb4b7d04ddb1cf5e2ae.patch";
|
||||
hash = "sha256-2csZdXmMW89tjXhN5QIK0rnMSXlFjLvwGnmieeKRX90=";
|
||||
})
|
||||
];
|
||||
|
||||
makeFlags = [ "dynamic" ];
|
||||
postPatch = ''
|
||||
echo 'const char *gitversion = "${version}";' > git_version.h
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
mkdir -p $out/bin
|
||||
cp udp2raw_dynamic $out/bin/udp2raw
|
||||
wrapProgram $out/bin/udp2raw --prefix PATH : "${lib.makeBinPath [ iptables ]}"
|
||||
|
||||
runHook postInstall
|
||||
postInstall = ''
|
||||
wrapProgram "$out/bin/udp2raw" --prefix PATH : "${lib.makeBinPath [ iptables ]}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
Loading…
Reference in New Issue
Block a user