diff --git a/pkgs/by-name/wr/wraith/configure.patch b/pkgs/by-name/wr/wraith/configure.patch index 2ecba77920eb..92e7e02b11eb 100644 --- a/pkgs/by-name/wr/wraith/configure.patch +++ b/pkgs/by-name/wr/wraith/configure.patch @@ -1,58 +1,81 @@ +diff --git a/configure b/configure +index 00d4c94..5a91c76 100755 --- a/configure +++ b/configure -@@ -6143,53 +6143,8 @@ rm -f confcache - #AC_CHECK_HEADERS(openssl/ssl.h openssl/crypto.h) - #AC_CHECK_HEADERS(zlib.h) +@@ -7146,74 +7146,8 @@ fi + + --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for path to OpenSSL" >&5 --$as_echo_n "checking for path to OpenSSL... " >&6; } -- -- --# Check whether --with-openssl was given. --if test "${with_openssl+set}" = set; then : -- withval=$with_openssl; with_openssl_path=$withval --else -- with_openssl_path=auto --fi -- -- -- -cf_openssl_basedir="" +-cf_openssl_libdir="" -if test "$with_openssl_path" != "auto"; then - cf_openssl_basedir="`echo ${with_openssl_path} | sed 's/\/$//'`" +- cf_openssl_libdir="${cf_openssl_basedir}/lib" -else +- if test -f "/usr/include/openssl/opensslv.h" && test -f "/usr/lib64/libssl.so"; then +- cf_openssl_libdir="/usr/lib64" +- cf_openssl_basedir="/usr" +- else - for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do -- if test -f "${dirs}/include/openssl/opensslv.h" && test -f "${dirs}/lib/libssl.so"; then -- cf_openssl_basedir="${dirs}" -- break -- fi -- done -- unset dirs +- if test -f "${dirs}/include/openssl/opensslv.h" && test -f "${dirs}/lib/libssl.so"; then +- cf_openssl_basedir="${dirs}" +- cf_openssl_libdir="${cf_openssl_basedir}/lib" +- break +- fi +- done +- unset dirs +- fi -fi -if test ! -z "$cf_openssl_basedir"; then -- if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" && test -f "${cf_openssl_basedir}/lib/libssl.so"; then +- if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" && test -f "${cf_openssl_libdir}/libssl.so"; then - SSL_INCLUDES="-I${cf_openssl_basedir}/include" -- SSL_LIBS="-L${cf_openssl_basedir}/lib" +- SSL_LIBS="-L${cf_openssl_libdir}" - else - cf_openssl_basedir="" +- cf_openssl_libdir="" - fi -else - if test -f "/usr/include/openssl/opensslv.h" ; then - cf_openssl_basedir="/usr" +- cf_openssl_libdir="/usr/lib" - fi -fi +-SSL_INCLUDES="${SSL_INCLUDES} -DOPENSSL_API_COMPAT=0x10000000L" - -if test ! -z "$cf_openssl_basedir"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cf_openssl_basedir" >&5 --$as_echo "$cf_openssl_basedir" >&6; } +- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cf_openssl_basedir" >&5 +-printf "%s\n" "$cf_openssl_basedir" >&6; } -else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 --$as_echo "not found" >&6; } +- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +-printf "%s\n" "not found" >&6; } - as_fn_error 1 "OpenSSL is required." "$LINENO" 5 -fi +-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for path to OpenSSL Lib" >&5 +-printf %s "checking for path to OpenSSL Lib... " >&6; } +- +- +-# Check whether --with-openssl was given. +-if test ${with_openssl+y} +-then : +- withval=$with_openssl; with_openssl_path=$withval +-else $as_nop +- with_openssl_path=auto +-fi +- +- +-if test ! -z "${cf_openssl_libdir}"; then +- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${cf_openssl_libdir}" >&5 +-printf "%s\n" "${cf_openssl_libdir}" >&6; } +-else +- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +-printf "%s\n" "not found" >&6; } +- as_fn_error 1 "OpenSSL is required." "$LINENO" 5 +-fi +-SSL_LIBDIR="${cf_openssl_libdir}" -unset cf_openssl_basedir -+SSL_INCLUDES="-I@openssl.dev@/include" -+SSL_LIBS="-L@openssl-lib@/lib" +-unset cf_openssl_libdir ++SSL_INCLUDES="-I@openssl-include@ -DOPENSSL_API_COMPAT=0x10000000L" ++SSL_LIBS="-L@openssl-lib@" save_CXX="$CXX" CXX="$CXX $SSL_INCLUDES" diff --git a/pkgs/by-name/wr/wraith/dlopen.patch b/pkgs/by-name/wr/wraith/dlopen.patch deleted file mode 100644 index 5bf11eb72692..000000000000 --- a/pkgs/by-name/wr/wraith/dlopen.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/src/libcrypto.cc b/src/libcrypto.cc -index 5139f66..517103f 100644 ---- a/src/libcrypto.cc -+++ b/src/libcrypto.cc -@@ -100,17 +100,9 @@ int load_libcrypto() { - } - - sdprintf("Loading libcrypto"); -+ dlerror(); // Clear Errors -+ libcrypto_handle = dlopen("@openssl@/lib/libcrypto.so", RTLD_LAZY|RTLD_GLOBAL); - -- bd::Array libs_list(bd::String("libcrypto.so." SHLIB_VERSION_NUMBER " libcrypto.so libcrypto.so.1.1 libcrypto.so.1.0.0 libcrypto.so.0.9.8 libcrypto.so.10 libcrypto.so.9 libcrypto.so.8 libcrypto.so.7 libcrypto.so.6").split(' ')); -- -- for (size_t i = 0; i < libs_list.length(); ++i) { -- dlerror(); // Clear Errors -- libcrypto_handle = dlopen(bd::String(libs_list[i]).c_str(), RTLD_LAZY|RTLD_GLOBAL); -- if (libcrypto_handle) { -- sdprintf("Found libcrypto: %s", bd::String(libs_list[i]).c_str()); -- break; -- } -- } - if (!libcrypto_handle) { - fprintf(stderr, STR("Unable to find libcrypto\n")); - return(1); -diff --git a/src/libssl.cc b/src/libssl.cc -index 6010abc..86e29fc 100644 ---- a/src/libssl.cc -+++ b/src/libssl.cc -@@ -78,17 +78,9 @@ int load_libssl() { - } - - sdprintf("Loading libssl"); -+ dlerror(); // Clear Errors -+ libssl_handle = dlopen("@openssl@/lib/libssl.so", RTLD_LAZY); - -- bd::Array libs_list(bd::String("libssl.so." SHLIB_VERSION_NUMBER " libssl.so libssl.so.1.1 libssl.so.1.0.0 libssl.so.0.9.8 libssl.so.10 libssl.so.9 libssl.so.8 libssl.so.7 libssl.so.6").split(' ')); -- -- for (size_t i = 0; i < libs_list.length(); ++i) { -- dlerror(); // Clear Errors -- libssl_handle = dlopen(bd::String(libs_list[i]).c_str(), RTLD_LAZY); -- if (libssl_handle) { -- sdprintf("Found libssl: %s", bd::String(libs_list[i]).c_str()); -- break; -- } -- } - if (!libssl_handle) { - fprintf(stderr, STR("Unable to find libssl\n")); - return(1); diff --git a/pkgs/by-name/wr/wraith/package.nix b/pkgs/by-name/wr/wraith/package.nix index 30f5d63e7a58..e8311a65c9d3 100644 --- a/pkgs/by-name/wr/wraith/package.nix +++ b/pkgs/by-name/wr/wraith/package.nix @@ -1,29 +1,38 @@ { lib, stdenv, - fetchurl, - openssl_1_1, + fetchFromGitHub, + openssl, + replaceVars, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "wraith"; - version = "1.4.10"; - src = fetchurl { - url = "mirror://sourceforge/wraithbotpack/wraith-v${version}.tar.gz"; - sha256 = "1h8159g6wh1hi69cnhqkgwwwa95fa6z1zrzjl219mynbf6vjjzkw"; + version = "1.4.10-unstable-2024-03-19"; + + src = fetchFromGitHub { + owner = "wraith"; + repo = "wraith"; + rev = "5e463847f86b5e72554bd895224a79a44091c59d"; + hash = "sha256-zKF8CVwj7LvkIgXIwQLC2vgBG7nL8RhoMov8YNdm9dc="; + fetchSubmodules = true; }; hardeningDisable = [ "format" ]; - buildInputs = [ openssl_1_1 ]; + buildInputs = [ openssl ]; patches = [ - ./configure.patch - ./dlopen.patch + (replaceVars ./configure.patch { + openssl-lib = "${lib.getLib openssl}/lib"; + openssl-include = "${lib.getDev openssl}/include"; + }) + (replaceVars ./remove-git-dep.patch { + rev = finalAttrs.src.rev; + rev-short = lib.sources.shortRev finalAttrs.src.rev; + version = finalAttrs.version; + }) + ]; + configureFlags = [ + "SSL_LIBDIR=${lib.getLib openssl}/lib" ]; - postPatch = '' - substituteInPlace configure --subst-var-by openssl.dev ${openssl_1_1.dev} \ - --subst-var-by openssl-lib ${lib.getLib openssl_1_1} - substituteInPlace src/libssl.cc --subst-var-by openssl ${lib.getLib openssl_1_1} - substituteInPlace src/libcrypto.cc --subst-var-by openssl ${lib.getLib openssl_1_1} - ''; installPhase = '' mkdir -p $out/bin cp -a wraith $out/bin/wraith @@ -51,4 +60,4 @@ stdenv.mkDerivation rec { maintainers = [ ]; platforms = lib.platforms.linux; }; -} +}) diff --git a/pkgs/by-name/wr/wraith/remove-git-dep.patch b/pkgs/by-name/wr/wraith/remove-git-dep.patch new file mode 100644 index 000000000000..77f668f285e7 --- /dev/null +++ b/pkgs/by-name/wr/wraith/remove-git-dep.patch @@ -0,0 +1,34 @@ +diff --git a/Makefile.in b/Makefile.in +index 7d8f0cf..b9e60c5 100755 +--- a/Makefile.in ++++ b/Makefile.in +@@ -18,11 +18,11 @@ CONFIGFILES = build/config.cache build/config.log build/config.status src/config + DISTROFILES = README.md LICENSE build doc scripts lib Makefile.in build.sh configure src BSDmakefile + EXCLUDES = $(CONFIGFILES) $(STATICMAKEFILES) + +-COMMIT_FULL := $(shell git log -1 --pretty=format:%H HEAD) +-COMMIT_SHORT := $(shell git log -1 --pretty=format:%h HEAD) +-BRANCH := $(shell git branch --no-color | grep "^*" | sed -e 's/^\* //') +-BUILDTS := $(shell git log -1 --pretty=format:%ct HEAD) +-VERSION := $(shell git describe --candidates=2) ++COMMIT_FULL := @rev@ ++COMMIT_SHORT := @rev-short@ ++BRANCH := none ++BUILDTS := $(SOURCE_DATE_EPOCH) ++VERSION := @version@ + DISTRIB = wraith-$(VERSION) + + HELPFILE = doc/help.txt +diff --git a/configure b/configure +index 0fb547e..7d605d8 100755 +--- a/configure ++++ b/configure +@@ -9987,7 +9987,7 @@ ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile src/buildin + + + +-GIT_REQUIRED=1 ++GIT_REQUIRED=0 + if [ "$GIT_REQUIRED" = "1" ]; then + if ! test -d .git; then + echo ""