Fil-C on Nix

Filnix wiki

mbrock/filnix

ports/openssl.nix

λlib, fetchurl, path, perl, stdenv, zlib, withSafeAssembly?, …
lib
fetchurl
path
perl
stdenv
zlib
withSafeAssemblydefault false
stdenv.mkDerivation
rec
13pname=
"openssl"
14version=
"3.5.7"
16src=
17url=
"https://www.openssl.org/source/openssl-${version}.tar.gz"
18hash=
"sha256-qMDSilKcpID582z1eS4s0hmEVSo8jkqhGiSqMa6smOg="

NIX_SSL_CERT_FILE overrides the default CA file, as in Nixpkgs.

22patches=
./patch/openssl-3.5.7.patch "${path}/pkgs/development/libraries/openssl/3.0/nix-ssl-cert-file.patch"
27outputs=
"out"
"dev"
"bin"

"man"

33setOutputFlags=
false
Don't let stdenv add --bindir/--libdir flags
35nativeBuildInputs=
36buildInputs=
38postPatch=
patchShebangs Configure config
42configurePlatforms=
[ ]
43dontAddStaticConfigureFlags=
true
44configureScript=
"./config"

The older port uses runtime forwarders into ordinary assembly. They cover the x86_64 assembly only, so aarch64 builds the C implementations.

48configureFlags=
lib.optional¬withSafeAssembly ∧ ¬stdenv.hostPlatform.isAarch64 "-yolo-assembler" ++ lib.optionalstdenv.hostPlatform.isAarch64 "no-asm" ++ "shared" "zlib" "--prefix=${placeholder"out"}" "--openssldir=etc/ssl" "--libdir=lib" "--with-zlib-lib=${zlib}/lib" "--with-zlib-include=${zlib}/include"

makeFlags = [

"MANDIR=$(man)/share/man"
"MANSUFFIX=ssl"

];

68enableParallelBuilding=
true
70doCheck=
false

skip man pages, takes a long time and you already have them

73installTargets=
"install_sw" "install_ssldirs"
78postInstall=
mkdir -p $bin
mv $out/bin $bin/bin
mkdir -p $dev
mv $out/include $dev/
rm -rf $out/etc/ssl/misc
rmdir $out/etc/ssl/{certs,private}
# OPENSSLDIR is this store path. Its default CA file is the system's,
# as Nixpkgs' use-etc-ssl-certs.patch makes it; a relocated tree such
# as optfil puts its own bundle here instead.
ln -s /etc/ssl/certs/ca-certificates.crt $out/etc/ssl/cert.pem
rm -rf $dev/lib/cmake
94meta=
with lib
95description=

Cryptographic library (SSL/TLS) - Fil-C build

96homepage=
"https://www.openssl.org/"
97license=
licenses.asl20
98mainProgram=
"openssl"
99platforms=
platforms.unix