push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
{
lib,
stdenv,
fetchurl,
fetchpatch2,
pcre,
pcre2,
jemalloc,
libunwind,
libxslt,
groff,
ncurses,
pkg-config,
readline,
libedit,
coreutils,
python3,
makeWrapper,
nixosTests,
}:
let
common =
{
version,
hash,
extraNativeBuildInputs ? [ ],
}:
stdenv.mkDerivation rec {
pname = "varnish";
inherit version;
src = fetchurl {
url = "https://varnish-cache.org/_downloads/${pname}-${version}.tgz";
inherit hash;
};
nativeBuildInputs = with python3.pkgs; [
pkg-config
docutils
sphinx
makeWrapper
];
buildInputs = [
libxslt
groff
ncurses
readline
libedit
python3
]
++ lib.optional (lib.versionOlder version "7") pcre
++ lib.optional (lib.versionAtLeast version "7") pcre2
++ lib.optional stdenv.hostPlatform.isDarwin libunwind
++ lib.optional stdenv.hostPlatform.isLinux jemalloc;
buildFlags = [ "localstatedir=/var/run" ];
patches =
lib.optionals (stdenv.isDarwin && lib.versionAtLeast version "7.7") [
# Fix VMOD section attribute on macOS
# Unreleased commit on master
(fetchpatch2 {
url = "https://github.com/varnishcache/varnish-cache/commit/a95399f5b9eda1bfdba6ee6406c30a1ed0720167.patch";
hash = "sha256-T7DIkmnq0O+Cr9DTJS4/rOtg3J6PloUo8jHMWoUZYYk=";
})
# Fix endian.h compatibility on macOS
# PR: https://github.com/varnishcache/varnish-cache/pull/4339
./patches/0001-fix-endian-h-compatibility-on-macos.patch
]
++ lib.optionals (stdenv.isDarwin && lib.versionOlder version "7.6") [
# Fix duplicate OS_CODE definitions on macOS
# PR: https://github.com/varnishcache/varnish-cache/pull/4347
./patches/0002-fix-duplicate-os-code-definitions-on-macos.patch
];
postPatch = ''
substituteInPlace bin/varnishtest/vtc_main.c --replace /bin/rm "${coreutils}/bin/rm"
'';
postInstall = ''
wrapProgram "$out/sbin/varnishd" --prefix PATH : "${lib.makeBinPath [ stdenv.cc ]}"
'';
# https://github.com/varnishcache/varnish-cache/issues/1875
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isi686 "-fexcess-precision=standard";
outputs = [
"out"
"dev"
"man"
];
passthru = {
python = python3;
tests =
nixosTests."varnish${builtins.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor version)}";
};
meta = with lib; {
description = "Web application accelerator also known as a caching HTTP reverse proxy";
homepage = "https://www.varnish-cache.org";
license = licenses.bsd2;
teams = [ lib.teams.flyingcircus ];
platforms = platforms.unix;
};
};
in
{
# EOL (LTS) TBA
varnish60 = common {
version = "6.0.16";
hash = "sha256-ZVJxDHp9LburwlJ1LCR5CKPRaSbNixiEch/l3ZP0QyQ=";
};
# EOL 2026-03-15
varnish77 = common {
version = "7.7.3";
hash = "sha256-6W7q/Ez+KlWO0vtU8eIr46PZlfRvjADaVF1YOq74AjY=";
};
}

View File

@@ -0,0 +1,52 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
varnish,
libmhash,
docutils,
coreutils,
version,
sha256,
}:
stdenv.mkDerivation rec {
pname = "${varnish.name}-digest";
inherit version;
src = fetchFromGitHub {
owner = "varnish";
repo = "libvmod-digest";
rev = version;
inherit sha256;
};
nativeBuildInputs = [
autoreconfHook
pkg-config
docutils
];
buildInputs = [
varnish
libmhash
];
postPatch = ''
substituteInPlace autogen.sh --replace "''${dataroot}/aclocal" "${varnish.dev}/share/aclocal"
substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
'';
configureFlags = [ "VMOD_DIR=$(out)/lib/varnish/vmods" ];
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=deprecated-declarations" ];
doCheck = true;
meta = {
description = "Digest and HMAC vmod";
homepage = "https://github.com/varnish/libvmod-digest";
inherit (varnish.meta) license platforms teams;
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
varnish,
docutils,
version,
sha256,
}:
stdenv.mkDerivation {
pname = "${varnish.name}-dynamic";
inherit version;
src = fetchFromGitHub {
owner = "nigoroll";
repo = "libvmod-dynamic";
rev = "v${version}";
inherit sha256;
};
nativeBuildInputs = [
pkg-config
docutils
autoreconfHook
varnish.python
];
buildInputs = [ varnish ];
postPatch = ''
substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
'';
configureFlags = [ "VMOD_DIR=$(out)/lib/varnish/vmods" ];
meta = {
description = "Dynamic director similar to the DNS director from Varnish 3";
homepage = "https://github.com/nigoroll/libvmod-dynamic";
inherit (varnish.meta) license platforms teams;
};
}

View File

@@ -0,0 +1,62 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
varnish,
docutils,
removeReferencesTo,
}:
let
common =
{
version,
hash,
extraNativeBuildInputs ? [ ],
}:
stdenv.mkDerivation rec {
pname = "${varnish.name}-modules";
inherit version;
src = fetchFromGitHub {
owner = "varnish";
repo = "varnish-modules";
rev = version;
inherit hash;
};
nativeBuildInputs = [
autoreconfHook
docutils
pkg-config
removeReferencesTo
varnish.python # use same python version as varnish server
];
buildInputs = [ varnish ];
postPatch = ''
substituteInPlace bootstrap --replace "''${dataroot}/aclocal" "${varnish.dev}/share/aclocal"
substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
'';
postInstall = "find $out -type f -exec remove-references-to -t ${varnish.dev} '{}' +"; # varnish.dev captured only as __FILE__ in assert messages
meta = {
description = "Collection of Varnish Cache modules (vmods) by Varnish Software";
homepage = "https://github.com/varnish/varnish-modules";
inherit (varnish.meta) license platforms teams;
};
};
in
{
modules15 = common {
version = "0.15.1";
hash = "sha256-Et/iWOk2FWJBDOpKjNXm4Nh5i1SU4zVPaID7kh+Uj9M=";
};
modules26 = common {
version = "0.26.0";
hash = "sha256-xKMOkqm6/GoBve0AhPqyVMQv/oh5Rtj6uCeg/yId7BU=";
};
}

View File

@@ -0,0 +1,26 @@
{
callPackages,
callPackage,
varnish60,
varnish77,
}:
{
varnish60Packages = rec {
varnish = varnish60;
modules = (callPackages ./modules.nix { inherit varnish; }).modules15;
digest = callPackage ./digest.nix {
inherit varnish;
version = "libvmod-digest-1.0.2";
sha256 = "0jwkqqalydn0pwfdhirl5zjhbc3hldvhh09hxrahibr72fgmgpbx";
};
dynamic = callPackage ./dynamic.nix {
inherit varnish;
version = "0.4";
sha256 = "1n94slrm6vn3hpymfkla03gw9603jajclg84bjhwb8kxsk3rxpmk";
};
};
varnish77Packages = rec {
varnish = varnish77;
modules = (callPackages ./modules.nix { inherit varnish; }).modules26;
};
}

View File

@@ -0,0 +1,43 @@
From 7a1c7020db85699e0693d637f6e31d49bf9ca3d0 Mon Sep 17 00:00:00 2001
From: Rui Chen <rui@chenrui.dev>
Date: Sun, 25 May 2025 23:54:29 -0400
Subject: [PATCH] libvarnish: Fix endian.h compatibility for macOS builds
Signed-off-by: Rui Chen <rui@chenrui.dev>
---
lib/libvarnish/vsha256.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/libvarnish/vsha256.c b/lib/libvarnish/vsha256.c
index 29f97fe40..541b6e612 100644
--- a/lib/libvarnish/vsha256.c
+++ b/lib/libvarnish/vsha256.c
@@ -31,7 +31,14 @@
#include "config.h"
-#ifndef __DARWIN_BYTE_ORDER
+#ifdef __APPLE__
+# include <machine/endian.h>
+# include <libkern/OSByteOrder.h>
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define VBYTE_ORDER __DARWIN_BYTE_ORDER
+# define VBIG_ENDIAN __DARWIN_BIG_ENDIAN
+#else
# include <endian.h>
# ifdef _BYTE_ORDER
# define VBYTE_ORDER _BYTE_ORDER
@@ -43,9 +50,6 @@
# else
# define VBIG_ENDIAN __BIG_ENDIAN
# endif
-#else
-# define VBYTE_ORDER __DARWIN_BYTE_ORDER
-# define VBIG_ENDIAN __DARWIN_BIG_ENDIAN
#endif
#ifndef VBYTE_ORDER
--
2.49.0

View File

@@ -0,0 +1,43 @@
From f56b314408d22252bf62d6cd2e098cf8139bd048 Mon Sep 17 00:00:00 2001
From: Sander <hey@sandydoo.me>
Date: Fri, 13 Jun 2025 01:12:59 +0200
Subject: [PATCH] build: fix duplicate OS_CODE definitions on macOS
`TARGET_OS_MAC` and `__APPLE__` are both true on macOS, which results in
duplicate definitions for `OS_CODE`.
Upstream removed the check for `TARGET_OS_MAC`, as well as the ancient
compat code, in
https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9.
This was fixed in varnish >= 7.6 as part of https://github.com/varnishcache/varnish-cache/commit/86df12b6c1ad8208899ea353fdcbea227356fcf8.
---
lib/libvgz/zutil.h | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/lib/libvgz/zutil.h b/lib/libvgz/zutil.h
index 1c80e3842..294ea2b2d 100644
--- a/lib/libvgz/zutil.h
+++ b/lib/libvgz/zutil.h
@@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
-#if defined(MACOS) || defined(TARGET_OS_MAC)
+#if defined(MACOS)
# define OS_CODE 7
-# ifndef Z_SOLO
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# endif
-# endif
-# endif
#endif
#ifdef __acorn
--
2.49.0