mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
zapret: add information about commit and version
This commit is contained in:
parent
41a901e46c
commit
b58ef718f9
1 changed files with 16 additions and 5 deletions
|
@ -21,8 +21,16 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
src = fetchFromGitHub {
|
||||
owner = "bol-van";
|
||||
repo = "zapret";
|
||||
|
||||
leaveDotGit = true;
|
||||
postFetch = ''
|
||||
cd "$out"
|
||||
git rev-parse --short HEAD > $out/COMMIT
|
||||
find "$out" -name .git -print0 | xargs -0 rm -rf
|
||||
'';
|
||||
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-OeOnzqYyRAQNRtjtPHwzDL/csuTAUgIRJKsPVr3iBac=";
|
||||
hash = "sha256-cwwj0xGEiR3sg2WheurtQo6Hy5JAARcZJNHEHMfAoOE=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
|
@ -31,12 +39,17 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
libnetfilter_queue
|
||||
libnfnetlink
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
iptables
|
||||
nftables
|
||||
gawk
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
makeFlagsArray+=("CFLAGS=-DZAPRET_GH_VER=${finalAttrs.src.tag} -DZAPRET_GH_HASH=`cat $src/COMMIT`")
|
||||
'';
|
||||
|
||||
makeFlags = [ "TGT=${placeholder "out"}/bin" ];
|
||||
|
||||
installPhase = ''
|
||||
|
@ -88,12 +101,10 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
meta = {
|
||||
description = "DPI bypass multi platform";
|
||||
homepage = "https://github.com/bol-van/zapret";
|
||||
changelog = "https://github.com/bol-van/zapret/releases/tag/v${finalAttrs.version}";
|
||||
changelog = "https://github.com/bol-van/zapret/releases/tag/${finalAttrs.src.tag}";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ nishimara ];
|
||||
mainProgram = "zapret";
|
||||
|
||||
# probably gonna work on darwin, but untested
|
||||
broken = stdenv.hostPlatform.isDarwin;
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue