From e7c03d36084c57931b3808855ba1d5e795fd0517 Mon Sep 17 00:00:00 2001 From: dupa dup <> Date: Tue, 6 Dec 2022 16:48:54 -0800 Subject: [PATCH] unfuck this on nix --- .gitignore | 5 ++++- GypsFulvus.cabal | 5 +++-- Setup.hs | 2 ++ src/Carrion/Plugin/IO/IRC/Client.hs | 2 +- src/Carrion/Plugin/TCL.hs | 8 ++++---- src/smeggdrop/smeggdrop.tcl | 1 + stack.yaml | 6 ++++++ 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 21a3a6c..a2979e9 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,7 @@ Thumbs.db dist-newstyle *.o *.hi -*.conf \ No newline at end of file +*.conf + +#this isn't needed but I can't delete it, thanks nixos +nixtclnonsense \ No newline at end of file diff --git a/GypsFulvus.cabal b/GypsFulvus.cabal index c5ccd07..7422628 100644 --- a/GypsFulvus.cabal +++ b/GypsFulvus.cabal @@ -40,7 +40,7 @@ library ini extra-libraries: tcl8.6 - Includes: /usr/include/tcl.h, + Includes: tcl.h, src/tclstubswrapper/tclstubs.h ghc-options: @@ -81,7 +81,8 @@ executable GypsFulvus other-modules: GypsFulvus.PluginStuff,GypsFulvus, Carrion.Plugin.IO.STDIO, Carrion.Plugin.TCL, Carrion.Plugin.IO.IRC.Client exposed-modules: GypsFulvus extra-libraries: tcl8.6 - Includes: /usr/include/tcl.h, +-- extra-include-dirs: /var/run/current-system/sw/include + Includes: tcl.h, src/tclstubswrapper/tclstubs.h C-Sources: src/tclstubswrapper/tclstubs.c main-is: Main.hs diff --git a/Setup.hs b/Setup.hs index 9a994af..31b4550 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,2 +1,4 @@ import Distribution.Simple main = defaultMain + + diff --git a/src/Carrion/Plugin/IO/IRC/Client.hs b/src/Carrion/Plugin/IO/IRC/Client.hs index 4319056..0a9ebdc 100644 --- a/src/Carrion/Plugin/IO/IRC/Client.hs +++ b/src/Carrion/Plugin/IO/IRC/Client.hs @@ -227,7 +227,7 @@ initPlugin mh = do -- First validate with the standard function res <- (onServerCertificate $ clientHooks cpara) cs vc sid cc -- Then strip out non-issues - return $ filter (`notElem` [UnknownCA, SelfSigned]) res + return $ filter (`notElem` [UnknownCA, SelfSigned, Expired]) res myClientConfig = (tlsClientConfig myPort (encodeUtf8 myHost)) { tlsClientTLSSettings = TLSSettings cpara { clientHooks = (clientHooks cpara) { onServerCertificate = validate } diff --git a/src/Carrion/Plugin/TCL.hs b/src/Carrion/Plugin/TCL.hs index b3802a3..bf2dcab 100644 --- a/src/Carrion/Plugin/TCL.hs +++ b/src/Carrion/Plugin/TCL.hs @@ -95,13 +95,13 @@ lEN_AUTO = -1 eVAL_FLAGS_CLEAR :: Int eVAL_FLAGS_CLEAR = 0 -dumpDebug :: Monad m => p -> m () -dumpDebug _ = return () - +--dumpDebug :: Monad m => p -> m () +--dumpDebug _ = return () +dumpDebug = putStrLn initPlugin :: Manhole -> IO InitStatus initPlugin manhole = do myFakeArg0 <- getExecutablePath >>= newCString - myTCLDl <- dlopen "/usr/lib/libtcl8.6.so" [RTLD_NOW] + myTCLDl <- dlopen "libtcl8.6.so" [RTLD_NOW] let bless name convf = dlsym myTCLDl name >>= \fp -> return $ convf $ fp tcl_CreateInterp <- bless "Tcl_CreateInterp" mkTcl_CreateInterp interp <- tcl_CreateInterp diff --git a/src/smeggdrop/smeggdrop.tcl b/src/smeggdrop/smeggdrop.tcl index d1be177..9cd5134 100644 --- a/src/smeggdrop/smeggdrop.tcl +++ b/src/smeggdrop/smeggdrop.tcl @@ -1,6 +1,7 @@ # smeggdrop.tcl encoding system utf-8 set SMEGGDROP_ROOT [file dirname [info script]] +lappend auto_path ./tclcurl-fa proc putlog args {} if [file exists smeggdrop.conf] {source smeggdrop.conf} source $SMEGGDROP_ROOT/smeggdrop/smeggdrop.tcl diff --git a/stack.yaml b/stack.yaml index f11ab99..88b6f6f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -28,6 +28,12 @@ resolver: lts-16.13 # subdirs: # - auto-update # - wai +nix: + enable: true + packages: + - "zlib" + - "tcl" + packages: - . # Dependency packages to be pulled from upstream that are not in the resolver.