hash-slinger: 2.7 -> 3.1

This commit is contained in:
Fabian Affolter 2021-10-22 17:23:48 +02:00 committed by Artturin
parent 1326545a4e
commit 750f9aaac9

View file

@ -1,45 +1,63 @@
{ lib, stdenv, fetchFromGitHub, python2Packages, unbound, libreswan }: { lib
, stdenv
, fetchFromGitHub
, python3
, unbound
, libreswan
}:
let stdenv.mkDerivation rec {
pythonPackages = python2Packages; pname = "hash-slinger";
in stdenv.mkDerivation rec { version = "3.1";
pname = "hash-slinger";
version = "2.7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "letoams"; owner = "letoams";
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "05wn744ydclpnpyah6yfjqlfjlasrrhzj48lqmm5a91nyps5yqyn"; sha256 = "sha256-mhMUdZt846QjwRIh2m/4EE+93fUcCKc2FFeoFpzKYvk=";
}; };
pythonPath = with pythonPackages; [ dnspython m2crypto ipaddr python-gnupg pythonPath = with python3.pkgs; [
pyunbound ]; dnspython
m2crypto
python-gnupg
pyunbound
];
buildInputs = [ pythonPackages.wrapPython ]; buildInputs = [
propagatedBuildInputs = [ unbound libreswan ] ++ pythonPath; python3.pkgs.wrapPython
propagatedUserEnvPkgs = [ unbound libreswan ]; ];
patchPhase = '' propagatedBuildInputs = [
unbound
libreswan
] ++ pythonPath;
propagatedUserEnvPkgs = [
unbound
libreswan
];
postPatch = ''
substituteInPlace Makefile \ substituteInPlace Makefile \
--replace "$(DESTDIR)/usr" "$out" --replace "$(DESTDIR)/usr" "$out"
substituteInPlace ipseckey \ substituteInPlace ipseckey \
--replace "/usr/sbin/ipsec" "${libreswan}/sbin/ipsec" --replace "/usr/sbin/ipsec" "${libreswan}/sbin/ipsec"
substituteInPlace tlsa \ substituteInPlace tlsa \
--replace "/var/lib/unbound/root" "${pythonPackages.pyunbound}/etc/pyunbound/root" --replace "/var/lib/unbound/root" "${python3.pkgs.pyunbound}/etc/pyunbound/root"
patchShebangs * patchShebangs *
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/man $out/${pythonPackages.python.sitePackages}/ mkdir -p $out/bin $out/man $out/lib/${python3.libPrefix}/site-packages
make install make install
wrapPythonPrograms wrapPythonPrograms
''; '';
meta = { meta = with lib; {
description = "Various tools to generate special DNS records"; description = "Various tools to generate special DNS records";
homepage = "https://github.com/letoams/hash-slinger"; homepage = "https://github.com/letoams/hash-slinger";
license = lib.licenses.gpl2Plus; license = licenses.gpl2Plus;
maintainers = [ lib.maintainers.leenaars ]; maintainers = with maintainers; [ leenaars ];
}; };
} }