mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-17 03:03:37 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
39 lines
1.1 KiB
Nix
39 lines
1.1 KiB
Nix
{ lib, stdenv, fetchurl, autoreconfHook, makeWrapper
|
|
, gnugrep, openssl }:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "easyrsa-2.2.0";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/OpenVPN/easy-rsa/archive/v2.2.0.tar.gz";
|
|
sha256 = "1xq4by5frb6ikn53ss3y8v7ss639dccxfq8jfrbk07ynkmk668qk";
|
|
};
|
|
|
|
preBuild = ''
|
|
mkdir -p $out/share/easy-rsa
|
|
'';
|
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
|
buildInputs = [ gnugrep openssl ];
|
|
|
|
# Make sane defaults and patch default config vars
|
|
postInstall = ''
|
|
cp $out/share/easy-rsa/openssl-1.0.0.cnf $out/share/easy-rsa/openssl.cnf
|
|
for prog in $(find "$out/share/easy-rsa" -executable -type f); do
|
|
makeWrapper "$prog" "$out/bin/$(basename $prog)" \
|
|
--set EASY_RSA "$out/share/easy-rsa" \
|
|
--set OPENSSL "${openssl.bin}/bin/openssl" \
|
|
--set GREP "${gnugrep}/bin/grep"
|
|
done
|
|
sed -i "/EASY_RSA=\|OPENSSL=\|GREP=/d" $out/share/easy-rsa/vars
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Simple shell based CA utility";
|
|
homepage = "https://openvpn.net/";
|
|
license = licenses.gpl2;
|
|
maintainers = [ maintainers.offline ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|