bmake: 20240722 -> 20240808; bozohttpd: refactor (#338834)

This commit is contained in:
Peder Bergebakken Sundt 2024-09-14 20:08:04 +02:00 committed by GitHub
commit d56bce1f04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 122 additions and 94 deletions

View File

@ -11,11 +11,11 @@
stdenv.mkDerivation (finalAttrs: {
pname = "bmake";
version = "20240722";
version = "20240808";
src = fetchurl {
url = "https://www.crufty.net/ftp/pub/sjg/bmake-${finalAttrs.version}.tar.gz";
hash = "sha256-FlS9DK0oQ2CElmmh6amTGB/tE3iWqsJpS4LqmjX3CeQ=";
hash = "sha256-tZGJJRtIPezUSS8fdDh7KlhMA9WqRjfNSLOOxiucCEg=";
};
patches = [
@ -29,7 +29,9 @@ stdenv.mkDerivation (finalAttrs: {
outputs = [ "out" "man" ];
nativeBuildInputs = [ getopt ];
nativeBuildInputs = [
getopt
];
nativeCheckInputs = [
bc

View File

@ -17,7 +17,7 @@ bmakeBuildPhase() {
)
concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray
echoCmd 'build flags' "${flagsArray[@]}"
nixInfoLog "${FUNCNAME[0]}: flagsArray: ${flagsArray[@]}"
bmake ${makefile:+-f $makefile} "${flagsArray[@]}"
runHook postBuild
@ -36,7 +36,7 @@ bmakeCheckPhase() {
fi
if [ -z "${checkTarget:-}" ]; then
echo "no test target found in bmake, doing nothing"
nixInfoLog "${FUNCNAME[0]}: no test target found in bmake, doing nothing"
else
local flagsArray=(
${enableParallelChecking:+-j${NIX_BUILD_CORES}}
@ -44,7 +44,7 @@ bmakeCheckPhase() {
)
concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget
echoCmd 'check flags' "${flagsArray[@]}"
nixInfoLog "${FUNCNAME[0]}: flagsArray: ${flagsArray[@]}"
bmake ${makefile:+-f $makefile} "${flagsArray[@]}"
fi
@ -64,7 +64,7 @@ bmakeInstallPhase() {
)
concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install
echoCmd 'install flags' "${flagsArray[@]}"
nixInfoLog "${FUNCNAME[0]}: flagsArray: ${flagsArray[@]}"
bmake ${makefile:+-f $makefile} "${flagsArray[@]}"
runHook postInstall
@ -80,7 +80,7 @@ bmakeDistPhase() {
local flagsArray=()
concatTo flagsArray distFlags distFlagsArray distTarget=dist
echo 'dist flags: %q' "${flagsArray[@]}"
nixInfoLog "${FUNCNAME[0]}: flagsArray: ${flagsArray[@]}"
bmake ${makefile:+-f $makefile} "${flagsArray[@]}"
if [ "${dontCopyDist:-0}" != 1 ]; then
@ -98,16 +98,20 @@ preConfigureHooks+=(addMakeFlags)
if [ -z "${dontUseBmakeBuild-}" ] && [ -z "${buildPhase-}" ]; then
buildPhase=bmakeBuildPhase
nixInfoLog "${FUNCNAME[0]}: set buildPhase to bmakeBuildPhase"
fi
if [ -z "${dontUseBmakeCheck-}" ] && [ -z "${checkPhase-}" ]; then
checkPhase=bmakeCheckPhase
nixInfoLog "${FUNCNAME[0]}: set checkPhase to bmakeCheckPhase"
fi
if [ -z "${dontUseBmakeInstall-}" ] && [ -z "${installPhase-}" ]; then
installPhase=bmakeInstallPhase
nixInfoLog "${FUNCNAME[0]}: set installPhase to bmakeInstallPhase"
fi
if [ -z "${dontUseBmakeDist-}" ] && [ -z "${distPhase-}" ]; then
distPhase=bmakeDistPhase
nixInfoLog "${FUNCNAME[0]}: set distPhase to bmakeDistPhase"
fi

View File

@ -0,0 +1,107 @@
{
lib,
bmake,
fetchurl,
groff,
inetutils,
libxcrypt,
lua,
openssl,
stdenv,
wget,
# Boolean flags
minimal ? false,
userSupport ? !minimal,
cgiSupport ? !minimal,
dirIndexSupport ? !minimal,
dynamicContentSupport ? !minimal,
sslSupport ? !minimal,
luaSupport ? !minimal,
htpasswdSupport ? !minimal,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "bozohttpd";
version = "20240126";
# bozohttpd is developed in-tree in pkgsrc, canonical hashes can be found at:
# http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/www/bozohttpd/distinfo
src = fetchurl {
url = "http://eterna23.net/bozohttpd/bozohttpd-${finalAttrs.version}.tar.bz2";
hash = "sha512-fr1PnyYAS3wkpmj/npRC3A87UL9LIXw4thlM4GfrtlJbuX5EkWGVJnHJW/EmYp7z+N91dcdRJgdO79l6WJsKpg==";
};
buildInputs = [
libxcrypt
openssl
] ++ lib.optionals (luaSupport) [ lua ];
nativeBuildInputs = [
bmake
groff
];
nativeCheckInputs = [
inetutils
wget
];
env = {
COPTS = lib.concatStringsSep " " (
[
"-D_DEFAULT_SOURCE"
"-D_GNU_SOURCE"
# ensure that we can serve >2GB files even on 32-bit systems.
"-D_LARGEFILE_SOURCE"
"-D_FILE_OFFSET_BITS=64"
# unpackaged dependency: https://man.netbsd.org/blocklist.3
"-DNO_BLOCKLIST_SUPPORT"
]
++ lib.optionals (htpasswdSupport) [ "-DDO_HTPASSWD" ]
++ lib.optionals (!cgiSupport) [ "-DNO_CGIBIN_SUPPORT" ]
++ lib.optionals (!dirIndexSupport) [ "-DNO_DIRINDEX_SUPPORT" ]
++ lib.optionals (!dynamicContentSupport) [ "-DNO_DYNAMIC_CONTENT" ]
++ lib.optionals (!luaSupport) [ "-DNO_LUA_SUPPORT" ]
++ lib.optionals (!sslSupport) [ "-DNO_SSL_SUPPORT" ]
++ lib.optionals (!userSupport) [ "-DNO_USER_SUPPORT" ]
);
_LDADD = lib.concatStringsSep " " (
[ "-lm" ]
++ lib.optionals (stdenv.hostPlatform.libc != "libSystem") [ "-lcrypt" ]
++ lib.optionals (luaSupport) [ "-llua" ]
++ lib.optionals (sslSupport) [
"-lcrypto"
"-lssl"
]
);
};
makeFlags = [ "LDADD=$(_LDADD)" ];
checkFlags = lib.optionals (!cgiSupport) [ "CGITESTS=" ];
doCheck = true;
meta = {
homepage = "http://www.eterna23.net/bozohttpd/";
description = "Bozotic HTTP server; small and secure";
longDescription = ''
bozohttpd is a small and secure HTTP version 1.1 server. Its main
feature is the lack of features, reducing the code size and improving
verifiability.
It supports CGI/1.1, HTTP/1.1, HTTP/1.0, HTTP/0.9, ~user translations,
virtual hosting support, as well as multiple IP-based servers on a
single machine. It is capable of servicing pages via the IPv6 protocol.
It has SSL support. It has no configuration file by design.
'';
changelog = "http://www.eterna23.net/bozohttpd/CHANGES";
license = lib.licenses.bsd2;
mainProgram = "bozohttpd";
maintainers = [ lib.maintainers.embr ];
platforms = lib.platforms.all;
};
})

View File

@ -1,84 +0,0 @@
{ lib
, stdenv
, fetchurl
, bmake
, groff
, inetutils
, wget
, openssl
, libxcrypt
, minimal ? false
, userSupport ? !minimal
, cgiSupport ? !minimal
, dirIndexSupport ? !minimal
, dynamicContentSupport ? !minimal
, sslSupport ? !minimal
, luaSupport ? !minimal
, lua
, htpasswdSupport ? !minimal
}:
let inherit (lib) optional optionals;
in
stdenv.mkDerivation rec {
pname = "bozohttpd";
version = "20240126";
# bozohttpd is developed in-tree in pkgsrc, canonical hashes can be found at:
# http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/www/bozohttpd/distinfo
src = fetchurl {
url = "http://eterna23.net/${pname}/${pname}-${version}.tar.bz2";
hash = "sha512-fr1PnyYAS3wkpmj/npRC3A87UL9LIXw4thlM4GfrtlJbuX5EkWGVJnHJW/EmYp7z+N91dcdRJgdO79l6WJsKpg==";
};
buildInputs = [ openssl libxcrypt ] ++ optional (luaSupport) lua;
nativeBuildInputs = [ bmake groff ];
COPTS = [
"-D_DEFAULT_SOURCE"
"-D_GNU_SOURCE"
# ensure that we can serve >2GB files even on 32-bit systems.
"-D_LARGEFILE_SOURCE"
"-D_FILE_OFFSET_BITS=64"
# unpackaged dependency: https://man.netbsd.org/blocklist.3
"-DNO_BLOCKLIST_SUPPORT"
]
++ optional (!userSupport) "-DNO_USER_SUPPORT"
++ optional (!dirIndexSupport) "-DNO_DIRINDEX_SUPPORT"
++ optional (!dynamicContentSupport) "-DNO_DYNAMIC_CONTENT"
++ optional (!luaSupport) "-DNO_LUA_SUPPORT"
++ optional (!sslSupport) "-DNO_SSL_SUPPORT"
++ optional (!cgiSupport) "-DNO_CGIBIN_SUPPORT"
++ optional (htpasswdSupport) "-DDO_HTPASSWD";
_LDADD = [ "-lm" ]
++ optional (stdenv.hostPlatform.libc != "libSystem") "-lcrypt"
++ optional (luaSupport) "-llua"
++ optionals (sslSupport) [ "-lssl" "-lcrypto" ];
makeFlags = [ "LDADD=$(_LDADD)" ];
doCheck = true;
nativeCheckInputs = [ inetutils wget ];
checkFlags = optional (!cgiSupport) "CGITESTS=";
meta = with lib; {
description = "Bozotic HTTP server; small and secure";
longDescription = ''
bozohttpd is a small and secure HTTP version 1.1 server. Its main
feature is the lack of features, reducing the code size and improving
verifiability.
It supports CGI/1.1, HTTP/1.1, HTTP/1.0, HTTP/0.9, ~user translations,
virtual hosting support, as well as multiple IP-based servers on a
single machine. It is capable of servicing pages via the IPv6 protocol.
It has SSL support. It has no configuration file by design.
'';
homepage = "http://www.eterna.com.au/bozohttpd/";
changelog = "http://www.eterna.com.au/bozohttpd/CHANGES";
license = licenses.bsd2;
maintainers = [ maintainers.embr ];
platforms = platforms.all;
};
}

View File

@ -4226,8 +4226,7 @@ with pkgs;
boxfs = callPackage ../tools/filesystems/boxfs { };
bozohttpd = callPackage ../servers/http/bozohttpd { };
bozohttpd-minimal = callPackage ../servers/http/bozohttpd { minimal = true; };
bozohttpd-minimal = bozohttpd.override { minimal = true; };
brasero-original = lowPrio (callPackage ../tools/cd-dvd/brasero { });