Re: update mail/claws-mail

2021-07-31 Thread Benjamin Baier
On Wed, 21 Jul 2021 00:04:44 +0200
Solene Rapenne  wrote:

> new version fixing libcroco, some extra whitespaces and maybe other
> errors I forgot about.

4.0.0 Works for me.
As always I don't run plugins, but the basics do work.
 
> Index: Makefile
> ===
> RCS file: /home/reposync/ports/mail/claws-mail/Makefile,v
> retrieving revision 1.131
> diff -u -p -r1.131 Makefile
> --- Makefile  9 Jun 2021 19:50:08 -   1.131
> +++ Makefile  20 Jul 2021 17:34:01 -
> @@ -6,9 +6,8 @@ COMMENT-spamassassin= spamassassin plugi
>  COMMENT-pdfviewer=   pdfviewer plugin
>  COMMENT-gdata=   gdata plugin
>  
> -V=   3.17.8
> +V=   4.0.0
>  DISTNAME=claws-mail-${V}
> -REVISION=0
>  PKGNAME-main=${DISTNAME}
>  PKGNAME-bogofilter=  claws-mail-bogofilter-${V}
>  PKGNAME-spamassassin=claws-mail-spamassassin-${V}
> @@ -22,7 +21,7 @@ HOMEPAGE=   https://www.claws-mail.org/
>  # GPLv3+
>  PERMIT_PACKAGE=  Yes
>  
> -MASTER_SITES=http://www.claws-mail.org/releases/
> +MASTER_SITES=https://www.claws-mail.org/releases/
>  
>  DIST_SUBDIR= claws
>  
> @@ -41,33 +40,35 @@ RUN_DEPENDS-spamassassin=${BUILD_PKGPATH
>   mail/p5-Mail-SpamAssassin
>  
>  WANTLIB += X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama
> -WANTLIB += Xrandr Xrender atk-1.0 cairo crypto curl etpan execinfo
> -WANTLIB += expat ffi fontconfig freetype fribidi gdk-x11-2.0 gdk_pixbuf-2.0
> -WANTLIB += gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0 graphite2
> -WANTLIB += gtk-x11-2.0 harfbuzz iconv intl m nghttp2 pango-1.0
> +WANTLIB += Xrandr Xrender atk-1.0 atk-bridge-2.0 cairo cairo-gobject
> +WANTLIB += crypto curl etpan execinfo expat ffi fontconfig freetype
> +WANTLIB += fribidi gdk-3 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gmodule-2.0 
> gobject-2.0
> +WANTLIB += graphite2 gtk-3 harfbuzz iconv intl jpeg m nghttp2 pango-1.0
>  WANTLIB += pangocairo-1.0 pangoft2-1.0 pcre pixman-1 png pthread
> -WANTLIB += sasl2 ssl xcb xcb-render xcb-shm z
> +WANTLIB += sasl2 ssl xcb xcb-render xcb-shm z epoxy
> +WANTLIB += ${COMPILER_LIBCXX}
>  
>  WANTLIB-main =  ${WANTLIB}
> -WANTLIB-main += ICE SM X11-xcb archive assuan b2 bz2 c canberra canberra-gtk
> -WANTLIB-main += charset cairo-gobject db dbus-1 dbus-glib-1 enchant gmp 
> gnutls gpg-error
> -WANTLIB-main += gpgme gumbo hogweed ical icalss icalvcal icudata icui18n 
> icuuc idn2
> -WANTLIB-main += ltdl lz4 lzma nettle notify ogg p11-kit perl rsvg-2
> -WANTLIB-main += startup-notification-1 ${COMPILER_LIBCXX} tasn1 unistring 
> vorbis
> -WANTLIB-main += vorbisfile xcb-util xml2 zstd gthread-2.0
> +WANTLIB-main += ICE SM X11-xcb archive assuan b2 bz2 c
> +WANTLIB-main += charset db dbus-1 dbus-glib-1 enchant
> +WANTLIB-main += gmp gnutls gpg-error gpgme gthread-2.0 gumbo hogweed ical 
> icalss
> +WANTLIB-main += icalvcal icudata icui18n icuuc idn2 lz4 lzma nettle notify
> +WANTLIB-main += p11-kit perl rsvg-2 startup-notification-1 tasn1 unistring
> +WANTLIB-main += xcb-util xml2 zstd
>  
>  WANTLIB-gdata = ${WANTLIB}
> -WANTLIB-gdata += brotlicommon brotlidec gck-1 gcr-base-3 gcrypt gdata
> -WANTLIB-gdata += goa-1.0 gpg-error gthread-2.0 idn2 json-glib-1.0 lzma
> -WANTLIB-gdata += p11-kit psl soup-2.4 sqlite3 unistring xml2
> +WANTLIB-gdata += brotlicommon brotlidec gck-1 gcr-base-3
> +WANTLIB-gdata += gcrypt gdata goa-1.0 gpg-error idn2 json-glib-1.0
> +WANTLIB-gdata += lzma p11-kit psl soup-2.4 sqlite3 unistring xml2
>  
>  WANTLIB-pdfviewer =  ${WANTLIB}
> -WANTLIB-pdfviewer += jpeg lcms2 lzma openjp2 png poppler poppler-glib tiff 
> zstd
> -WANTLIB-pdfviewer += ${COMPILER_LIBCXX}
> +WANTLIB-pdfviewer += lcms2 lzma openjp2 png poppler poppler-glib tiff zstd
>  
> -LIB_DEPENDS= mail/libetpan \
> +
> +LIB_DEPENDS= devel/glib2 \
> + mail/libetpan \
>   security/cyrus-sasl2 \
> - x11/gtk+2
> + x11/gtk+3
>  
>  RUN_DEPENDS-main=${RUN_DEPENDS} \
>   devel/desktop-file-utils \
> @@ -77,7 +78,7 @@ LIB_DEPENDS-main=   ${LIB_DEPENDS} \
>   archivers/libarchive \
>   archivers/xz \
>   archivers/zstd \
> - audio/libcanberra,-gtk \
> + devel/glib2 \
>   devel/libnotify \
>   devel/startup-notification \
>   security/gnutls>=2.2 \
> @@ -87,26 +88,22 @@ LIB_DEPENDS-main= ${LIB_DEPENDS} \
>   textproc/enchant \
>   textproc/libical \
>   www/gumbo \
> - x11/dbus-glib
> + x11/dbus-glib \
> + x11/gnome/at-spi2-atk
>  
>  LIB_DEPENDS-pdfviewer=   ${LIB_DEPENDS} \
>   print/poppler
>  
>  

Re: audio/openal no longer works since 1.21.1 update

2021-07-31 Thread Benjamin Baier
On Sat, 31 Jul 2021 00:31:42 -0400
Brad Smith  wrote:

> On Thu, Jul 29, 2021 at 03:01:33PM -0400, Kurt Mosiejczuk wrote:
> > On Thu, Jul 29, 2021 at 02:46:57PM -0400, Bryan Steele wrote:
> > 
> > > > > It would be nice to commit his diff below, or perhaps backout the 
> > > > > 1.21.1
> > > > > update in ports until the bug can be fixed upstream..
> > 
> > > > It fixes audio for me. ok kmos on using this diff.
> > 
> > > ok brynet@ too.
> > 
> > To be clear, I _prefer_ keeping the update with the diff since it has cured
> > the clipping I experienced all the time with minecraft (and sometimes with
> > other things). I just played for a few minutes during work time because I so
> > enjoyed the clipping being gone. :D
> > 
> > --Kurt
> 
> Can you guys try out the following diff?
> 
> After bringing up the breakage upstream it looks like the author
> fixed whatever the root issue was.

Works for me. Sound is back in
 - Blender with OpenAL output module
 - Minecraft (1.12)
 - ClassiCube (not in ports, uses dlopen("libopenal.so", RTLD_NOW); )

> Index: Makefile
> ===
> RCS file: /home/cvs/ports/audio/openal/Makefile,v
> retrieving revision 1.56
> diff -u -p -u -p -r1.56 Makefile
> --- Makefile  30 Jul 2021 12:47:53 -  1.56
> +++ Makefile  31 Jul 2021 03:50:08 -
> @@ -6,7 +6,7 @@ V =   1.21.1
>  EPOCH =  0
>  DISTNAME =   openal-soft-$V
>  PKGNAME =openal-$V
> -REVISION =   0
> +REVISION =   1
>  CATEGORIES = audio
>  
>  SHARED_LIBS =openal  4.1
> Index: patches/patch-alc_backends_sndio_cpp
> ===
> RCS file: /home/cvs/ports/audio/openal/patches/patch-alc_backends_sndio_cpp,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 patch-alc_backends_sndio_cpp
> --- patches/patch-alc_backends_sndio_cpp  31 Jul 2021 00:27:59 -  
> 1.2
> +++ patches/patch-alc_backends_sndio_cpp  31 Jul 2021 04:02:08 -
> @@ -1,30 +1,45 @@
>  $OpenBSD: patch-alc_backends_sndio_cpp,v 1.2 2021/07/31 00:27:59 brynet Exp $
>  
> -Revert..
> +Simplify channel handling in the sndio backend
> +620836f173ae6fc4505d0634984e0f2c46166367
>  
> -sndio: Support more than 2 channels
> -5cffe7e50a2885d9b392c15f2cd3941cac49692c
> +Use non-block mode for sndio capture
> +1fd4c865fc084f134363db5155361d5483679235
>  
> -and
> -
> -Use a safer layout if sndio changes the channel count
> -b4a52321c4ad8e8bc0eb29d2cdae2c043fc405e1
> -
> -which break the backend.
>  
>  Index: alc/backends/sndio.cpp
>  --- alc/backends/sndio.cpp.orig
>  +++ alc/backends/sndio.cpp
> -@@ -57,7 +57,7 @@ struct SndioPlayback final : public BackendBase {
> +@@ -22,6 +22,7 @@
> + 
> + #include "backends/sndio.h"
> + 
> ++#include 
> + #include 
> + #include 
> + #include 
> +@@ -43,7 +44,12 @@ namespace {
> + 
> + static const char sndio_device[] = "SndIO Default";
> + 
> ++struct SioPar : public sio_par {
> ++SioPar() { sio_initpar(this); }
> + 
> ++void clear() { sio_initpar(this); }
> ++};
> ++
> + struct SndioPlayback final : public BackendBase {
> + SndioPlayback(ALCdevice *device) noexcept : BackendBase{device} { }
> + ~SndioPlayback() override;
> +@@ -56,6 +62,7 @@ struct SndioPlayback final : public BackendBase {
> + void stop() override;
>   
>   sio_hdl *mSndHandle{nullptr};
> ++uint mFrameStep{};
>   
> --al::vector mBuffer;
> -+al::vector mBuffer;
> + al::vector mBuffer;
>   
> - std::atomic mKillNow{true};
> - std::thread mThread;
> -@@ -74,24 +74,16 @@ SndioPlayback::~SndioPlayback()
> +@@ -74,39 +81,29 @@ SndioPlayback::~SndioPlayback()
>   
>   int SndioPlayback::mixerProc()
>   {
> @@ -35,106 +50,133 @@ Index: alc/backends/sndio.cpp
>  -mDevice->handleDisconnect("Failed to get device parameters");
>  -return 1;
>  -}
> --
> ++const size_t frameStep{mFrameStep};
> ++const size_t frameSize{frameStep * mDevice->bytesFromFmt()};
> + 
>  -const size_t frameStep{par.pchan};
>  -const size_t frameSize{frameStep * par.bps};
>  -
>   SetRTPriority();
>   althrd_setname(MIXER_THREAD_NAME);
>   
> --while(!mKillNow.load(std::memory_order_acquire)
> --&& mDevice->Connected.load(std::memory_order_acquire))
> -+const size_t frameStep{mDevice->channelsFromFmt()};
> -+const uint frameSize{mDevice->frameSizeFromFmt()};
> -+
> -+while(!mKillNow.load(std::memory_order_acquire) &&
> -+  mDevice->Connected.load(std::memory_order_acquire))
> + while(!mKillNow.load(std::memory_order_acquire)
> + && mDevice->Connected.load(std::memory_order_acquire))
>   {
>  -al::byte *WritePtr{mBuffer.data()};
> -+ALubyte *WritePtr{mBuffer.data()};
> - size_t len{mBuffer.size()};
> +-size_t len{mBuffer.size()};
> ++al::span buffer{mBuffer};
>   
> - mDevice->renderSamples(WritePtr, static_cast(len/frameSize), 
> frameStep);
> -@@ 

Re: [update/fix] graphics/glfw 3.3.2 -> 3.3.4 & fixes cursor hiding

2021-05-09 Thread Benjamin Baier
On Sun, 09 May 2021 07:31:39 +
octeep  wrote:

> On Sun, May 09, 2021 at 02:04:47PM +0800, Theo Buehler wrote:
> > > > +@@ -710,6 +710,8 @@ static GLFWbool initExtensions(void)
> > > > +
> > > > + #if defined(__CYGWIN__)
> > > > + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so");
> > > > ++#elif defined(__OpenBSD__)
> > > > ++_glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.5.0");
> > 
> > I think it would be better to avoid hardcoding the version. I would
> > expect that this also works:
> > 
> >   _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so");
> > 
> > This way you don't need to bump whenver libXcursor is bumped.
> 
> I don't think that will work since there is no libXcursor.so in
> /usr/X11R6/lib?
> 
I think this is using dlopen(3) internally,
so it will find the proper/newest installed version.



Re: Update games/love to 11.3

2021-02-20 Thread Benjamin Baier
On Sat, 20 Feb 2021 09:49:11 +
"Will Luckin"  wrote:

> > Have you tested love2d games that use pre-11.3 with this update? I have
> > looked at love2d updates previously and they were _not_ backwards
> > compatible. My impression was that this ports needs a multi-version
> > approach to not break applications that rely on the old version.
> > However, I haven't found an opportunity to implement this yet.
> 
> There are breaking changes with every love major release, I think, so
> games written for 0.8 would need updating to work with 0.11.3. I didn't
> realise this would be a problem because OpenBSD doesn't have any other
> but 0.8 packaged currently.
> 
> 0.8 is quite old, from 2012, and missing a lot of new additions to love
> so 0.11.3 is definitely preferable for new users.
> 
> Do you think it would be wise to create a seperate port?
> 

Hi, it compiles for me but haven't found a game that works with it.
I guess it's too new.

Multi version package (seperate port) seems the way to go,
but it's non-trivial. Must not clash with v0.8
See for example lang/lua/{5.1,5.2,5.3}

I'm the one who told you to test OBJCXX=c++
Seems the standard way would be to use
OBJCXX="${CXX}" in the Makefile

Greetings Ben



Re: minor update mail/claws-mail

2020-08-08 Thread Benjamin Baier
On Tue, 4 Aug 2020 17:42:35 +0200
Solene Rapenne  wrote:

> This is a minor update for claws-mail for fixing bugs.
> 
> I also backported a patch that was done from an initial diff of mine.
> Currently the spamassassin plugin can handle mails up to a size of
> 256MB but the configuration widget defining the maximum size was
> limited to 10MB. The extra patch allows the 256MB limit to be picked
> up in the GUI.
> 
> 
> Index: Makefile
> ===
> RCS file: /home/reposync/ports/mail/claws-mail/Makefile,v
> retrieving revision 1.127
> diff -u -p -r1.127 Makefile
> --- Makefile  28 May 2020 20:58:36 -  1.127
> +++ Makefile  4 Aug 2020 10:24:18 -
> @@ -6,7 +6,7 @@ COMMENT-spamassassin= spamassassin plugi
>  COMMENT-pdfviewer=   pdfviewer plugin
>  COMMENT-gdata=   gdata plugin
>  
> -V=   3.17.5
> +V=   3.17.6
>  DISTNAME=claws-mail-${V}
>  PKGNAME-main=${DISTNAME}
>  PKGNAME-bogofilter=  claws-mail-bogofilter-${V}
> Index: distinfo
> ===
> RCS file: /home/reposync/ports/mail/claws-mail/distinfo,v
> retrieving revision 1.38
> diff -u -p -r1.38 distinfo
> --- distinfo  28 May 2020 20:58:36 -  1.38
> +++ distinfo  4 Aug 2020 10:24:18 -
> @@ -1,2 +1,2 @@
> -SHA256 (claws/claws-mail-3.17.5.tar.gz) = 
> 955MfwidCOayszI6kLb0aZGhVM4Wi6SoKdWTt6V2jHs=
> -SIZE (claws/claws-mail-3.17.5.tar.gz) = 12186940
> +SHA256 (claws/claws-mail-3.17.6.tar.gz) = 
> hXdnOowjjcXESByisQNzkHmVo0DTuIJvd7WYYBr63HA=
> +SIZE (claws/claws-mail-3.17.6.tar.gz) = 12479765
> Index: patches/patch-src_plugins_spamassassin_spamassassin_gtk_c
> ===
> RCS file: patches/patch-src_plugins_spamassassin_spamassassin_gtk_c
> diff -N patches/patch-src_plugins_spamassassin_spamassassin_gtk_c
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ patches/patch-src_plugins_spamassassin_spamassassin_gtk_c 4 Aug 2020 
> 14:18:25 -
> @@ -0,0 +1,31 @@
> +$OpenBSD$
> +
> +Import commit 5cc88aae7217d6ea385a580a30dc79ea0c91c27f
> +
> +Spamassassin plugin can handle files up to 256 MB
> +but the configuration GUI widget only allowed 10 MB
> +maximum files.
> +
> +Index: src/plugins/spamassassin/spamassassin_gtk.c
> +--- src/plugins/spamassassin/spamassassin_gtk.c.orig
>  src/plugins/spamassassin/spamassassin_gtk.c
> +@@ -41,7 +41,10 @@
> + #include "menu.h"
> + #include "addressbook.h"
> + #include "combobox.h"
> ++#include "libspamc.h"
> + 
> ++#define SA_MAX_SIZE_KB (SPAMC_MAX_MESSAGE_LEN / 1024)
> ++
> + struct SpamAssassinPage
> + {
> + PrefsPage page;
> +@@ -375,7 +378,7 @@ static void spamassassin_create_widget_func(PrefsPage 
> + gtk_widget_show(max_size_label);
> + gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_label, FALSE, 
> FALSE, 0);
> + 
> +-max_size_spinbtn_adj = GTK_ADJUSTMENT(gtk_adjustment_new(250, 0, 1, 
> 10, 10, 0));
> ++max_size_spinbtn_adj = GTK_ADJUSTMENT(gtk_adjustment_new(250, 0, 
> SA_MAX_SIZE_KB, 10, 10, 0));
> + max_size_spinbtn = 
> gtk_spin_button_new(GTK_ADJUSTMENT(max_size_spinbtn_adj), 1, 0);
> + gtk_widget_show(max_size_spinbtn);
> + gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_spinbtn, FALSE, 
> FALSE, 0);
> Index: pkg/PLIST-main
> ===
> RCS file: /home/reposync/ports/mail/claws-mail/pkg/PLIST-main,v
> retrieving revision 1.43
> diff -u -p -r1.43 PLIST-main
> --- pkg/PLIST-main28 May 2020 20:58:36 -  1.43
> +++ pkg/PLIST-main4 Aug 2020 10:24:18 -
> @@ -346,6 +346,9 @@ share/locale/ca/LC_MESSAGES/claws-mail.m
>  share/locale/cs/LC_MESSAGES/claws-mail.mo
>  share/locale/da/LC_MESSAGES/claws-mail.mo
>  share/locale/de/LC_MESSAGES/claws-mail.mo
> +share/locale/el_GR/
> +share/locale/el_GR/LC_MESSAGES/
> +share/locale/el_GR/LC_MESSAGES/claws-mail.mo
>  share/locale/en_GB/LC_MESSAGES/claws-mail.mo
>  share/locale/es/LC_MESSAGES/claws-mail.mo
>  share/locale/fi/LC_MESSAGES/claws-mail.mo

The update works for me.
I don't use spamassassin, but looks ok.

Greetings Ben



Re: update mail/claws-mail

2020-05-24 Thread Benjamin Baier
On Thu, 14 May 2020 16:32:07 +0200
Solene Rapenne  wrote:

> This updates claws-mail to last version.
> 
> I also removed bsfilter module because it requires bsfilter and we
> don't have it in ports.
> 
> I enabled the crash dialog because I had a few crashes when using
> malloc options. And of course, I never had a crash since I enabled that
> option.
> 
> Some patches have been merged upstream.
Works for me (TM).

Greetings Ben



mail/claws-mail update

2020-01-07 Thread Benjamin Baier
On Mon, 7 Oct 2019 18:12:05 +0100
Stuart Henderson  wrote:

> On 2019/10/07 18:56, Robert Klein wrote:
> > claws-mail 3.17.4 breaks copy-pasting from emacs-gtk3.
> > 
> > When I copy from Emacs (both mouse and M-y) and try to insert in a
> > compose window of claws-mail 3.17.4 (both mouse and CTRL-v), I get an
> > error message in Emacs “Selection owner couldn't convert: MULTIPLE”
> > 
> > 
> > Copy-pasting works when I revert this commit to claws-mail:
> > 
> > 
> > Compose: handle pasted images and text/uri-list (files) and attach them
> > author  Colin Leroy   
> > Sun, 7 Jul 2019 10:43:45 +0200 (10:43 +0200)
> > committer   Colin Leroy   
> > Sun, 7 Jul 2019 10:43:45 +0200 (10:43 +0200)
> > commit  66fccde959a1b4addee971412b35d4b51d8272b1
> > tree0ab62e3d16d12bd4b9aceecc9c200493bc44d76d
> > parent  42eaffb250b3f53712e2be0eb7a5b8d26cfc7c10
> 
> Also mentioned in 
> https://lists.claws-mail.org/pipermail/users/2019-August/024590.html
> 
> I suggest reporting it to upstream bugzilla:
> https://www.thewildbeast.co.uk/claws-mail/bugzilla/
> 

Hi.

there was a commit that adressed the copy from Emacs issue
https://git.claws-mail.org/?p=claws.git;a=commit;h=b910146ff51f32e9501fb4ad5537a47ceb06f154

But even better 7 days ago they reverted the main culprit
https://git.claws-mail.org/?p=claws.git;a=commit;h=6759b5272b412a467098d7699c767b8611cde1fd
>revert pasting images as attachments 66fccde959a1b4addee971412b35d4b51d8272b1
>
>it breaks too many basic and previously working paste actions

I have backported that commit and lightly tested with my limited use cases.
Works for me and also masks the problem I had with copy
https://marc.info/?l=openbsd-bugs=157842725819911=2


Index: Makefile
===
RCS file: /cvs/ports/mail/claws-mail/Makefile,v
retrieving revision 1.124
diff -u -p -r1.124 Makefile
--- Makefile15 Dec 2019 18:36:18 -  1.124
+++ Makefile7 Jan 2020 21:24:42 -
@@ -14,7 +14,7 @@ PKGNAME-spamassassin= claws-mail-spamass
 PKGNAME-pdfviewer= claws-mail-pdfviewer-${V}
 PKGNAME-gdata= claws-mail-gdata-${V}
 
-REVISION-main= 1
+REVISION-main= 2
 REVISION-pdfviewer=0
 REVISION-gdata=0
 
Index: patches/patch-src_compose_c
===
RCS file: patches/patch-src_compose_c
diff -N patches/patch-src_compose_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-src_compose_c 7 Jan 2020 21:22:26 -
@@ -0,0 +1,276 @@
+$OpenBSD$
+
+Index: src/compose.c
+--- src/compose.c.orig
 src/compose.c
+@@ -10897,196 +10897,58 @@ static void entry_copy_clipboard(GtkWidget *entry)
+   gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
+ }
+ 
+-static void paste_text(Compose *compose, GtkWidget *entry,
+- gboolean wrap, GdkAtom clip, GtkTextIter *insert_place,
+- const gchar *contents)
+-{
+-  GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(entry));
+-  GtkTextMark *mark_start = gtk_text_buffer_get_insert(buffer);
+-  GtkTextIter start_iter, end_iter;
+-  gint start, end;
+-
+-  if (contents == NULL)
+-  return;
+-
+-  /* we shouldn't delete the selection when middle-click-pasting, or we
+-   * can't mid-click-paste our own selection */
+-  if (clip != GDK_SELECTION_PRIMARY) {
+-  undo_paste_clipboard(GTK_TEXT_VIEW(compose->text), 
compose->undostruct);
+-  gtk_text_buffer_delete_selection(buffer, FALSE, TRUE);
+-  }
+-
+-  if (insert_place == NULL) {
+-  /* if insert_place isn't specified, insert at the cursor.
+-   * used for Ctrl-V pasting */
+-  gtk_text_buffer_get_iter_at_mark(buffer, _iter, 
mark_start);
+-  start = gtk_text_iter_get_offset(_iter);
+-  gtk_text_buffer_insert(buffer, _iter, contents, 
strlen(contents));
+-  } else {
+-  /* if insert_place is specified, paste here.
+-   * used for mid-click-pasting */
+-  start = gtk_text_iter_get_offset(insert_place);
+-  gtk_text_buffer_insert(buffer, insert_place, contents, 
strlen(contents));
+-  if (prefs_common.primary_paste_unselects)
+-  gtk_text_buffer_select_range(buffer, insert_place, 
insert_place);
+-  }
+-
+-  if (!wrap) {
+-  /* paste unwrapped: mark the paste so it's not wrapped later */
+-  end = start + strlen(contents);
+-  gtk_text_buffer_get_iter_at_offset(buffer, _iter, start);
+-  gtk_text_buffer_get_iter_at_offset(buffer, _iter, end);
+-  gtk_text_buffer_apply_tag_by_name(buffer, "no_wrap", 
_iter, _iter);
+-  } else if (wrap && clip == GDK_SELECTION_PRIMARY) {
+-  /* rewrap paragraph now (after a mid-click-paste) */
+-  mark_start = 

Re: print/scribus: properties dialog broken under CWM

2019-04-12 Thread Benjamin Baier
On Thu, 11 Apr 2019 22:04:07 -0400
Charles  wrote:

> Hello list,
Hello
 
> There seems to be an issue with the Scribus port when combined with CWM.
> Namely, the "properties" window/dialog can only be opened once. After
> being closed, it cannot be opened again. Restarting the application does
> not fix the problem.
> 
> This issue is specific to CWM, I am not able to reproduce under FVWM.
> 
> I have reproduced this issue under OpenBSD current on AMD64, and on
> OpenBSD 6.4 on macppc (iBook G4). In both cases, using Scribus 1.4.6
> installed via pkg_add.
> 
> I found a previous issue that affected the way CWM and Qt interact, which was
> posted[1] under the subject line "calmwm mouse stuck inside of window" over on
> misc@. Okan and I synced up off list and determined it was due to CWM's
> implementation of EWMH interacting improperly with Qt.
Seen this one before, too.

> I am reporting this issue separately, as this particular failure seems 
> specific
> to Scribus, as I've not seen this behavior under any other program.
VLC also does this. Running VLC in CWM and opening the "Show extended settings" 
dialog
also has the described behaviour.

> I believe this could reasonably be an issue with Scribus, Qt, and/or CWM.
> 
> I have a hunch that this may be related in some way to Scribus issue 9293[2],
> as deleting the entire '' section from
> "~/.scribus/prefs140.xml" allows the properties window to be opened. But
> closing and re-opening it will fail (presumably since this context has been
> re-created).
> 
> It may be worth contacting upstream, but since this issue only happens under
> CWM, it might be on us, so I wanted to do the due diligence of getting some
> more opinions before going upstream with it.
> 
> Steps to reproduce:
> 
> 1. Install Scribus from ports
> 2. Log in to X with CWM
> 3. Open Scribus, create a new document
> 4. Press "t" to create a new text box, place it on the canvas
> 5. Enter some text in the box.
> 6. Do any of the following:
>   a. Right click on the text box and select "properties"
>   b. Press F2
>   c. Select Windows->Properties
> 7. Interact in some way with the properties dialog, maybe change the font, 
> then
>close it.
> 8. Attempt to repeat step 6. The properties dialog will not appear.
> 
> I am happy to try out patches, gather further information, or otherwise assist
> any debugging effort to the best of my abilities.
> 
> ~ Charles
> 
> 1 - https://marc.info/?l=openbsd-misc=154524602418343=2
> 2 - https://bugs.scribus.net/view.php?id=9293
> 



Re: Chromium crashed on amd64

2017-05-11 Thread Benjamin Baier
On Thu, 11 May 2017 17:09:13 +0430
Mohammad Badie Zadegan  wrote:

> Thanks for your hints.
> I have backed to release 5.9 and now it good for me.
The bug is also in older versions. It just triggers more often now.
I guess because threading performance in OpenBSD has increased in the
last year. Running chrome under ktrace(1) reliably hides this bug.

My workaround is to start it a second, sometimes a third time until it comes up.
Most of the time it comes up on the first try, though... 
hope we are talking about the same bug.

$ chrome
chrome(57938) in free(): use after free 0x59c03aeb8c0
[65844:-793378240:0511/164136.572208:ERROR:broker_posix.cc(41)] Invalid node 
channel message
Abort trap 
[59795:775828032:0511/164136.733660:ERROR:broker_posix.cc(41)] Invalid node 
channel message


> Sent from my iPhone
> 
> > On May 11, 2017, at 4:29 AM, m.r...@excitingdomainname.com wrote:
> >   
> >> On 2017-05-10 16:58, Mohammad BadieZadegan wrote:
> >> Hi everybody,
> >> I have installed OpenBSD 6.1 (amd64) and then installed chromium by 
> >> pkg_add.
> >> Now, When I run chromium it open 1 second and then closed immediately!
> >> How can I resolve my issue?  
> > 
> > Hi Mohammad,
> > 
> > I think others would be able to help you out if you included some more
> > information about the crash. At a minimum, try running chromium in a 
> > terminal,
> > so that when it crashes you can get an error message.
> > 
> > 
> > Michael Reed  

Greetings Ben



Fix building sysutils/conky with clang

2017-04-19 Thread Benjamin Baier
Make "inline void proc_find_top" static to fix building with clang.


Index: patches/patch-src_openbsd_c
===
RCS file: /cvs/ports/sysutils/conky/patches/patch-src_openbsd_c,v
retrieving revision 1.16
diff -u -p -r1.16 patch-src_openbsd_c
--- patches/patch-src_openbsd_c 16 Sep 2014 07:28:09 -  1.16
+++ patches/patch-src_openbsd_c 19 Apr 2017 20:15:48 -
@@ -10,7 +10,7 @@ Protect kvm_getprocs and global vars wit
 dkstat.h is going away on OpenBSD, so use sys/sched.h instead for CP_*
 
 --- src/openbsd.c.orig Thu May  3 23:08:27 2012
-+++ src/openbsd.c  Tue Sep 16 08:40:12 2014
 src/openbsd.c  Wed Apr 19 22:14:41 2017
 @@ -28,10 +28,11 @@
   *
   */
@@ -32,7 +32,16 @@ dkstat.h is going away on OpenBSD, so us
  #include 
  
  #include 
-@@ -81,6 +83,8 @@
+@@ -70,7 +72,7 @@
+ #define LOG1024   10
+ #define pagetok(size) ((size) << pageshift)
+ 
+-inline void proc_find_top(struct process **cpu, struct process **mem);
++static inline void proc_find_top(struct process **cpu, struct process **mem);
+ 
+ static short cpu_setup = 0;
+ static kvm_t *kd = 0;
+@@ -81,6 +83,8 @@ size_t len = 0;
  int init_kvm = 0;
  int init_sensors = 0;
  
@@ -41,7 +50,7 @@ dkstat.h is going away on OpenBSD, so us
  static int kvm_init()
  {
if (init_kvm) {
-@@ -140,7 +144,7 @@
+@@ -140,7 +144,7 @@ int check_mount(char *s)
return 0;
  }
  
@@ -50,7 +59,7 @@ dkstat.h is going away on OpenBSD, so us
  {
int mib[2] = { CTL_KERN, KERN_BOOTTIME };
struct timeval boottime;
-@@ -155,9 +159,10 @@
+@@ -155,9 +159,10 @@ void update_uptime()
NORM_ERR("Could not get uptime");
info.uptime = 0;
}
@@ -62,7 +71,7 @@ dkstat.h is going away on OpenBSD, so us
  {
static int mib[2] = { CTL_VM, VM_METER };
struct vmtotal vmtotal;
-@@ -194,9 +199,10 @@
+@@ -194,9 +199,10 @@ void update_meminfo()
info.swap = 0;
info.swapfree = 0;
}
@@ -74,7 +83,7 @@ dkstat.h is going away on OpenBSD, so us
  {
struct net_stat *ns;
double delta;
-@@ -207,11 +213,11 @@
+@@ -207,11 +213,11 @@ void update_net_stats()
/* get delta */
delta = current_update_time - last_update_time;
if (delta <= 0.0001) {
@@ -88,7 +97,7 @@ dkstat.h is going away on OpenBSD, so us
}
  
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
-@@ -266,28 +272,36 @@
+@@ -266,28 +272,36 @@ void update_net_stats()
}
  
freeifaddrs(ifap);
@@ -133,7 +142,7 @@ dkstat.h is going away on OpenBSD, so us
for (i = 0; i < n_processes; i++) {
if (p[i].p_stat == SRUN) {
cnt++;
-@@ -295,96 +309,64 @@
+@@ -295,96 +309,64 @@ void update_running_processes()
}
  
info.run_procs = cnt;
@@ -248,7 +257,7 @@ dkstat.h is going away on OpenBSD, so us
if (info.cpu_count > 1) {
size = CPUSTATES * sizeof(int64_t);
for (i = 0; i < info.cpu_count; i++) {
-@@ -426,10 +408,11 @@
+@@ -426,10 +408,11 @@ void update_cpu_usage()
oldused[i] = used;
oldtotal[i] = total;
}
@@ -262,7 +271,7 @@ dkstat.h is going away on OpenBSD, so us
  {
double v[3];
  
-@@ -438,6 +421,7 @@
+@@ -438,6 +421,7 @@ void update_load_average()
info.loadavg[0] = (float) v[0];
info.loadavg[1] = (float) v[1];
info.loadavg[2] = (float) v[2];
@@ -270,7 +279,7 @@ dkstat.h is going away on OpenBSD, so us
  }
  
  #define OBSD_MAX_SENSORS 256
-@@ -606,10 +590,11 @@
+@@ -606,10 +590,11 @@ char get_freq(char *p_client_buffer, size_t client_buf
return 1;
  }
  
@@ -283,7 +292,7 @@ dkstat.h is going away on OpenBSD, so us
  }
  
  #if 0
-@@ -665,19 +650,11 @@
+@@ -665,19 +650,11 @@ cleanup:
  }
  #endif
  
@@ -305,9 +314,12 @@ dkstat.h is going away on OpenBSD, so us
  /* While topless is obviously better, top is also not bad. */
  
  int comparecpu(const void *a, const void *b)
-@@ -708,8 +685,8 @@
+@@ -706,10 +683,10 @@ int comparemem(const void *a, const void *b)
+   return 0;
+ }
  
- inline void proc_find_top(struct process **cpu, struct process **mem)
+-inline void proc_find_top(struct process **cpu, struct process **mem)
++static inline void proc_find_top(struct process **cpu, struct process **mem)
  {
 -  struct kinfo_proc2 *p;
 -  int n_processes;
@@ -316,7 +328,7 @@ dkstat.h is going away on OpenBSD, so us
int i, j = 0;
struct process *processes;
int mib[2];
-@@ -730,9 +707,11 @@
+@@ -730,9 +707,11 @@ inline void proc_find_top(struct process **cpu, struct
/* translate bytes into page count */
total_pages = usermem / pagesize;
  
@@ -330,7 +342,7 @@ dkstat.h is going away on OpenBSD, so us
processes = malloc(n_processes * sizeof(struct process));
  
for (i = 0; i < n_processes; i++) {
-@@ -740,9 +719,12 @@
+@@ -740,9 +719,12 @@ 

editors/ht: add openbsd specific elf header types

2017-04-18 Thread Benjamin Baier
Add openbsd elf program header types to hte(1).
Patch already accepted upstream.

Mon Apr 17 14:30:33 CEST 2017
/usr/ports/editors/ht
Index: Makefile
===
RCS file: /cvs/ports/editors/ht/Makefile,v
retrieving revision 1.25
diff -u -p -r1.25 Makefile
--- Makefile10 Apr 2017 11:45:27 -  1.25
+++ Makefile17 Apr 2017 12:29:32 -
@@ -3,6 +3,7 @@
 COMMENT =  file editor/viewer/analyzer for executables
 
 DISTNAME = ht-2.1.0
+REVISION=  0
 CATEGORIES =   editors
 
 HOMEPAGE = http://hte.sourceforge.net/
Index: patches/patch-elfstruc_h
===
RCS file: patches/patch-elfstruc_h
diff -N patches/patch-elfstruc_h
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-elfstruc_h17 Apr 2017 12:17:54 -
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- elfstruc.h.origSun Sep 14 17:55:26 2014
 elfstruc.h Mon Apr 17 14:17:39 2017
+@@ -374,6 +374,9 @@ struct ELF_SECTION_HEADER64 {
+ #define ELF_PT_GNU_STACK  0x6474e551 /* Indicates stack executability */
+ #define ELF_PT_GNU_RELRO  0x6474e552 /* Read-only after relocation*/ 
+ #define ELF_PT_PAX_FLAGS  0x65041580 /* Indicates PaX flag markings */
++#define ELF_PT_OPENBSD_RANDOMIZE  0x65a3dbe6 /* Fill with random data. */
++#define ELF_PT_OPENBSD_WXNEEDED   0x65a3dbe7 /* Program does W^X 
violations */
++#define ELF_PT_OPENBSD_BOOTDATA   0x65a41be6 /* Section for boot 
arguments */
+ 
+ struct ELF_PROGRAM_HEADER32 {
+   elf32_word p_type;
Index: patches/patch-htelfphs_cc
===
RCS file: patches/patch-htelfphs_cc
diff -N patches/patch-htelfphs_cc
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-htelfphs_cc   17 Apr 2017 12:18:21 -
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- htelfphs.cc.orig   Sun Sep 14 17:55:26 2014
 htelfphs.ccMon Apr 17 14:17:39 2017
+@@ -67,6 +67,9 @@ static int_hash elf_ph_type[] =
+   {ELF_PT_GNU_STACK,  "gnu stack"},
+   {ELF_PT_GNU_RELRO,  "gnu relro"},
+   {ELF_PT_PAX_FLAGS,  "pax flags"},
++  {ELF_PT_OPENBSD_RANDOMIZE,  "openbsd randomize"},
++  {ELF_PT_OPENBSD_WXNEEDED,   "openbsd wxneeded"},
++  {ELF_PT_OPENBSD_BOOTDATA,   "openbsd bootdata"},
+   {0, 0}
+ };
+ 



Re: wxneeded for dosbox

2017-03-28 Thread Benjamin Baier
On Tue, 28 Mar 2017 11:42:00 +0100
Stuart Henderson <s...@spacehopper.org> wrote:

> On 2017/03/26 16:50, Giannis Tsaraias wrote:
> > On Sun, Mar 26, 2017 at 11:37:21AM +1100, Jonathan Gray wrote:  
> > > On Sat, Mar 25, 2017 at 06:51:32PM +0100, Hiltjo Posthuma wrote:  
> > > > On Sat, Mar 25, 2017 at 05:43:27PM +0200, Giannis Tsaraias wrote:  
> > > > > On Sat, Mar 25, 2017 at 03:24:26PM +0100, Benjamin Baier wrote:  
> > > > > > Patch to add wxneeded to dosbox. I got a application that otherwise
> > > > > > crashes with the following dosbox error message.
> > > > > >   
> > > > > > >Setting excute permission on the code cache has failed
> > > > > > >Exit to error: DRC64:Unhandled memory reference  
> > > > > >   
> > > > > 
> > > > > I saw the W^X violation too and had to do this, but forgot to send 
> > > > > the diff.
> > > > > FWIW, OK tsg@ if someone wants to commit.
> > > > >   
> > > > 
> > > > Hey,
> > > > 
> > > > I noticed it too while playing Mortal Kombat 1 :)
> > > > 
> > > > Some other games (skiordi, stunts) don't crash.  
> > > 
> > > Instead of blindly setting USE_WXNEEDED, I'd prefer if someone who has
> > > a case that triggers this can try disabling the various cpu core options
> > > in configure.  
> > 
> > As Hiltjo mentioned, there are calls to mprotect asking for both write and
> > execute in ./src/cpu/core_dynrec/cache.h and ./src/cpu/core_dyn_x86/cache.h.
> > 
> > Compiling with '--disable-dynamic-core', I tested a few executables on i386
> > and amd64 without managing to trigger a violation. Didn't notice any 
> > performance
> > loss either. No need for wxneeded this way.
> > 
> > '--disable-dynrec' is not enough, as I got a violation on i386 using it.
> >   
> 
> So..
>
> Index: Makefile
> ===
> RCS file: /cvs/ports/emulators/dosbox/Makefile,v
> retrieving revision 1.32
> diff -u -p -r1.32 Makefile
> --- Makefile  25 Mar 2017 15:53:56 -  1.32
> +++ Makefile  28 Mar 2017 10:41:21 -
> @@ -1,12 +1,11 @@
>  # $OpenBSD: Makefile,v 1.32 2017/03/25 15:53:56 landry Exp $
>  
>  ONLY_FOR_ARCHS=  ${GCC4_ARCHS}
> -USE_WXNEEDED=Yes
>  
>  COMMENT= x86 with DOS emulator targeted at playing games
>  
>  DISTNAME=dosbox-0.74
> -REVISION=7
> +REVISION=8
>  CATEGORIES=  games x11 emulators
>  MASTER_SITES=${MASTER_SITE_SOURCEFORGE:=dosbox/}
>  
> @@ -34,6 +33,9 @@ CONFIGURE_STYLE= gnu
>  CONFIGURE_ENV=CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include"
>  CONFIGURE_ENV+=LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
>  CONFIGURE_ARGS+= --disable-alsatest
> +
> +# needs W+X memory
> +CONFIGURE_ARGS+= --disable-dynamic-core
>  
>  pre-configure:
>   cp ${FILESDIR}/midi_sndio.h ${WRKSRC}/src/gui
> 

I have the same in my tree for 2 days. Works for me so far.
No objections.



wxneeded for dosbox

2017-03-25 Thread Benjamin Baier
Patch to add wxneeded to dosbox. I got a application that otherwise
crashes with the following dosbox error message.

>Setting excute permission on the code cache has failed
>Exit to error: DRC64:Unhandled memory reference

Sat Mar 25 14:59:35 CET 2017
/usr/ports/emulators/dosbox
Index: Makefile
===
RCS file: /cvs/ports/emulators/dosbox/Makefile,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile
--- Makefile24 Dec 2015 13:08:12 -  1.31
+++ Makefile25 Mar 2017 13:59:32 -
@@ -1,11 +1,12 @@
 # $OpenBSD: Makefile,v 1.31 2015/12/24 13:08:12 bentley Exp $
 
 ONLY_FOR_ARCHS=${GCC4_ARCHS}
+USE_WXNEEDED=  Yes
 
 COMMENT=   x86 with DOS emulator targeted at playing games
 
 DISTNAME=  dosbox-0.74
-REVISION=  6
+REVISION=  7
 CATEGORIES=games x11 emulators
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=dosbox/}
 



Re: maintainer update mail/claws-mail

2015-12-24 Thread Benjamin Baier
On Mon, 21 Dec 2015 22:02:05 +0100
Daniel Jakots  wrote:

> Hi,
> 
> Yesterday 3.13.1 was released. There's a few time_t fixes and also a
> sscanf(confstr, "%c%c %ms [...] fix (which might explained a crash with
> the manage sieve plugin) in this release.
> 
> You can see the whole changelog at the usual place [1].
> 
> [1]: http://claws-mail.org/news.php
> 
> Cheers,
> Daniel
> 

Using this since Dec 22. Builds and works fine for me on amd64.

Thank you,
Ben



Re: claws-mail 3.11.1

2015-01-14 Thread Benjamin Baier
Hi, works for me.
(sending, receiving, filtering, changing some configurations, all OK so far...)

On Mon, 12 Jan 2015 23:43:52 +0100
Landry Breuil lan...@rhaalovely.net wrote:
 since it seems there are still some ppl using claws-mail, and we're
 lagging behind, here's an update.. starts here, didnt actually try to do
 much more, .claws-mail profile on my desktop dates from 2007 or so..
 
 See http://claws-mail.org/news.php for the recent changes.



Re: claws-mail: stop using encrypt()

2015-01-12 Thread Benjamin Baier


On Sun, 11 Jan 2015 23:00:15 +0100
j...@wxcvbn.org (Jérémie Courrèges-Anglas) wrote:

 Your diff does not apply cleanly, I guess that's why nobody replied
 (boo!).  Did you test that the resulting format is actually backwards
 compatible?

Sorry for that.
And yes I'm running claws with this diff and it reads and writes my old config
file just fine, since Jan 4 now.

 I guess this is the way to go, if the diff actually is correct.  I'd
 like to point out that the claws-mail port is lagging behind upstream;
 it seems that no one has talked to the claws-mail developers about this
 issue either.

It's on my list to send a patch upstream, but seeing them swap out openssl
code in favour of gnutls, it's just luck that it still links against openssl.
So this is not the final solution.

 Here's a diff that applies.
 
 Index: patches/patch-configure_ac
 ===
 RCS file: /cvs/ports/mail/claws-mail/patches/patch-configure_ac,v
 retrieving revision 1.9
 diff -u -p -r1.9 patch-configure_ac
 --- patches/patch-configure_ac21 Apr 2014 17:40:19 -  1.9
 +++ patches/patch-configure_ac11 Jan 2015 21:43:05 -
 @@ -1,6 +1,6 @@
  $OpenBSD: patch-configure_ac,v 1.9 2014/04/21 17:40:19 sthen Exp $
  configure.ac.origSat Dec 14 10:14:50 2013
 -+++ configure.ac Mon Apr 21 18:40:04 2014
 +--- configure.ac.origSat Dec 14 11:14:50 2013
  configure.ac Sun Jan 11 22:42:57 2015
  @@ -152,7 +152,7 @@ AM_CONDITIONAL(CYGWIN, test x$env_cygwin = xyes)
   
   if test $GCC = yes
 @@ -10,7 +10,16 @@ $OpenBSD: patch-configure_ac,v 1.9 2014/
   #CFLAGS=-g -Wall -Wno-unused-function
   fi
   
 -@@ -737,6 +737,7 @@ if test x$enable_new_addrbook = xno; then
 +@@ -494,6 +494,8 @@ dnl password encryption
 + OLDLIBS=$LIBS
 + LIBS=
 + case $host_os in
 ++*openbsd*)
 ++;;
 + *dragonfly*)
 + AC_SEARCH_LIBS(encrypt, cipher, [],
 AC_MSG_ERROR(['encrypt'-function not found.]))
 + ;;
 +@@ -737,6 +739,7 @@ if test x$enable_new_addrbook = xno; then
   AC_CHECK_LIB(resolv, res_query, LDAP_LIBS=$LDAP_LIBS
 -lresolv) AC_CHECK_LIB(socket, bind, LDAP_LIBS=$LDAP_LIBS -lsocket)
   AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS=$LDAP_LIBS
 -lnsl) @@ -18,7 +27,7 @@ $OpenBSD: patch-configure_ac,v 1.9 2014/
   AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS=$LDAP_LIBS
 -llber,, $LDAP_LIBS)
   
 -@@ -809,7 +810,7 @@ if test x$enable_new_addrbook = xno; then
 +@@ -809,7 +812,7 @@ if test x$enable_new_addrbook = xno; then
  AC_DEFINE(USE_JPILOT, 1, Define
 if you want JPilot support in addressbook.) ]) fi
   
 Index: patches/patch-src_common_passcrypt_c
 ===
 RCS file: patches/patch-src_common_passcrypt_c
 diff -N patches/patch-src_common_passcrypt_c
 --- /dev/null 1 Jan 1970 00:00:00 -
 +++ patches/patch-src_common_passcrypt_c  11 Jan 2015 21:58:57 -
 @@ -0,0 +1,131 @@
 +$OpenBSD$
 +--- src/common/passcrypt.c.orig  Sat Dec 14 11:15:06 2013
  src/common/passcrypt.c   Sun Jan 11 22:32:43 2015
 +@@ -35,6 +35,7 @@
 + #endif
 + 
 + #include glib.h
 ++#include openssl/des.h
 + 
 + #include passcrypt.h
 + 
 +@@ -72,100 +73,30 @@ crypt_cfb_buf(const char key[8], unsigned char *buf, u
 + ecb_crypt(des_key, buf, len, DES_ENCRYPT);
 + }
 + #else
 +-static void crypt_cfb_shift(unsigned char *to,
 +-const unsigned char *from, unsigned len);
 +-static void crypt_cfb_xor(unsigned char *to, const unsigned char *from,
 +-  unsigned len);
 +-static void crypt_unpack(unsigned char *a);
 +-
 + static void
 + crypt_cfb_buf(const char key[8], unsigned char *buf, unsigned len,
 +   unsigned chunksize, int decrypt)
 + {
 +-unsigned char temp[64];
 ++unsigned char *out;
 ++char des_key[8];
 ++DES_key_schedule keysched;
 + 
 +-memcpy(temp, key, 8);
 +-crypt_unpack(temp);
 +-setkey((const char *) temp);
 +-memset(temp, 0, sizeof(temp));
 ++out = malloc(len);
 ++if(out == NULL)
 ++return;
 ++strncpy(des_key, PASSCRYPT_KEY, 8);
 ++memset(crypt_cfb_iv, 0, sizeof(crypt_cfb_iv));
 ++
 ++DES_set_odd_parity(des_key);
 ++DES_set_key_unchecked(des_key, keysched);
 ++if (decrypt)
 ++DES_cfb_encrypt(buf, out, crypt_cfb_blocksize,\
 ++len, keysched, crypt_cfb_iv, DES_DECRYPT);
 ++else
 ++DES_cfb_encrypt(buf, out, crypt_cfb_blocksize,\
 ++len, keysched, crypt_cfb_iv, DES_ENCRYPT);
 + 
 +-memset(crypt_cfb_iv, 0, sizeof(crypt_cfb_iv));
 +-
 +-if (chunksize  crypt_cfb_blocksize)
 +-chunksize = crypt_cfb_blocksize;
 +-
 +-while (len) {
 +-memcpy(temp, crypt_cfb_iv, sizeof(temp));
 +-encrypt((char *) temp, 0);
 +-if (chunksize  len)
 +-chunksize 

Re: claws-mail: stop using encrypt()

2015-01-04 Thread Benjamin Baier
On Tue, 30 Dec 2014 21:35:06 +0100
Daniel Jakots vigdis+o...@chown.me wrote:

 On Wed, 17 Dec 2014 13:56:18 +, Stuart Henderson
 st...@openbsd.org wrote:
 
  So an alternative diff below. It isn't particularly nice but does
  unbreak the port... Does anyone have a better idea?
 
 Hi,
 
 I'm a claws-mail user. Would the test of the diff help?
 (looking for a way to unblock the situation :))
 
 Cheers,
 Daniel
 

Hi, this replaces the self-rolled code with LibreSSL DES.
This was done in a hurry, but then this could just use rot13,
which would be equally secure, but not backwards compatible.

Greetings ben

Index: patch-configure_ac
===
RCS file: /cvs/ports/mail/claws-mail/patches/patch-configure_ac,v
retrieving revision 1.9
diff -u -p -r1.9 patch-configure_ac
--- patch-configure_ac  21 Apr 2014 17:40:19 -  1.9
+++ patch-configure_ac  4 Jan 2015 17:50:33 -
@@ -1,6 +1,6 @@
 $OpenBSD: patch-configure_ac,v 1.9 2014/04/21 17:40:19 sthen Exp $
 --- configure.ac.orig  Sat Dec 14 10:14:50 2013
-+++ configure.ac   Mon Apr 21 18:40:04 2014
 configure.ac   Wed Dec 17 12:00:37 2014
 @@ -152,7 +152,7 @@ AM_CONDITIONAL(CYGWIN, test x$env_cygwin = xyes)
  
  if test $GCC = yes
@@ -10,7 +10,16 @@ $OpenBSD: patch-configure_ac,v 1.9 2014/
#CFLAGS=-g -Wall -Wno-unused-function
  fi
  
-@@ -737,6 +737,7 @@ if test x$enable_new_addrbook = xno; then
+@@ -494,6 +494,8 @@ dnl password encryption
+ OLDLIBS=$LIBS
+ LIBS=
+ case $host_os in
++  *openbsd*)
++  ;;
+   *dragonfly*)
+   AC_SEARCH_LIBS(encrypt, cipher, [],
AC_MSG_ERROR(['encrypt'-function not found.]))
+   ;;
+@@ -737,6 +739,7 @@ if test x$enable_new_addrbook = xno; then
AC_CHECK_LIB(resolv, res_query, LDAP_LIBS=$LDAP_LIBS
-lresolv) AC_CHECK_LIB(socket, bind, LDAP_LIBS=$LDAP_LIBS -lsocket)
AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS=$LDAP_LIBS -lnsl)
@@ -18,7 +27,7 @@ $OpenBSD: patch-configure_ac,v 1.9 2014/
AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS=$LDAP_LIBS
-llber,, $LDAP_LIBS)
  
-@@ -809,7 +810,7 @@ if test x$enable_new_addrbook = xno; then
+@@ -809,7 +812,7 @@ if test x$enable_new_addrbook = xno; then
   AC_DEFINE(USE_JPILOT, 1, Define if
you want JPilot support in addressbook.) ]) fi
  
Index: patch-src_common_passcrypt_c
===
RCS file: patch-src_common_passcrypt_c
diff -N patch-src_common_passcrypt_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patch-src_common_passcrypt_c4 Jan 2015 17:53:56 -
@@ -0,0 +1,131 @@
+--- src/common/passcrypt.c.origSat Dec 14 11:15:06 2013
 src/common/passcrypt.c Sun Jan  4 17:47:05 2015
+@@ -35,6 +35,7 @@
+ #endif
+ 
+ #include glib.h
++#include openssl/des.h
+ 
+ #include passcrypt.h
+ 
+@@ -72,100 +73,30 @@ crypt_cfb_buf(const char key[8], unsigned char *buf, u
+   ecb_crypt(des_key, buf, len, DES_ENCRYPT);
+ }
+ #else
+-static void crypt_cfb_shift(unsigned char *to,
+-  const unsigned char *from, unsigned len);
+-static void crypt_cfb_xor(unsigned char *to, const unsigned char *from,
+-unsigned len);
+-static void crypt_unpack(unsigned char *a);
+-
+ static void
+ crypt_cfb_buf(const char key[8], unsigned char *buf, unsigned len,
+ unsigned chunksize, int decrypt)
+ {
+-  unsigned char temp[64];
++  unsigned char *out;
++  char des_key[8];
++  DES_key_schedule keysched;
++
++  out = malloc(len);
++  if(out == NULL)
++  return;
++  strncpy(des_key, PASSCRYPT_KEY, 8);
++  memset(crypt_cfb_iv, 0, sizeof(crypt_cfb_iv));
++  
++  DES_set_odd_parity(des_key);
++  DES_set_key_unchecked(des_key, keysched);
++  if (decrypt)
++  DES_cfb_encrypt(buf, out, crypt_cfb_blocksize,\
++  len, keysched, crypt_cfb_iv, DES_DECRYPT);
++  else
++  DES_cfb_encrypt(buf, out, crypt_cfb_blocksize,\
++  len, keysched, crypt_cfb_iv, DES_ENCRYPT);
+ 
+-  memcpy(temp, key, 8);
+-  crypt_unpack(temp);
+-  setkey((const char *) temp);
+-  memset(temp, 0, sizeof(temp));
+-
+-  memset(crypt_cfb_iv, 0, sizeof(crypt_cfb_iv));
+-
+-  if (chunksize  crypt_cfb_blocksize)
+-  chunksize = crypt_cfb_blocksize;
+-
+-  while (len) {
+-  memcpy(temp, crypt_cfb_iv, sizeof(temp));
+-  encrypt((char *) temp, 0);
+-  if (chunksize  len)
+-  chunksize = len;
+-  if (decrypt)
+-  crypt_cfb_shift(crypt_cfb_iv, buf, chunksize);
+-  crypt_cfb_xor((unsigned char *) buf, temp, chunksize);
+-  if (!decrypt)
+-  crypt_cfb_shift(crypt_cfb_iv, buf, chunksize);
+-  len -= chunksize;
+-  buf += chunksize;
+-  

Re: exist a port for jdownloader?

2014-09-10 Thread Benjamin Baier

For what i use it, it works fine with OpenJDK 1.7 from ports.
Get the installer (jd_unix_X_X.sh) or the MULTIOS ZIP.

On 09/10/14 17:48, Francesco Cardi wrote:

hallo everyone, exist a port for download jdownloader ?
cheers :)