On Fri, 8 Jun 2018 22:58:36 +0200 Helmut Grohne <hel...@subdivi.de> wrote:
Source: dwm
Version: 6.1-4
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

dwm fails to cross build from source, because it does not pass cross
tools to make and thus uses the build architecture compiler. The easiest
way of passing them is letting dh_auto_build do it and then dwm cross
builds successfully. Please consider applying the attached patch.

Helmut

I am sponsoring a NMU that fixes this issue and imports he current upstream 
version.
debdiff is attached.

Thanks,
Bastian
diff -Nru dwm-6.2/config.def.h dwm-6.3/config.def.h
--- dwm-6.2/config.def.h        2019-02-02 13:55:28.000000000 +0100
+++ dwm-6.3/config.def.h        2022-01-07 12:42:18.000000000 +0100
@@ -35,6 +35,7 @@
 static const float mfact     = 0.55; /* factor of master area size 
[0.05..0.95] */
 static const int nmaster     = 1;    /* number of clients in master area */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled 
resizals */
+static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen 
window */
 
 static const Layout layouts[] = {
        /* symbol     arrange function */
diff -Nru dwm-6.2/config.mk dwm-6.3/config.mk
--- dwm-6.2/config.mk   2019-02-02 13:55:28.000000000 +0100
+++ dwm-6.3/config.mk   2022-01-07 12:42:18.000000000 +0100
@@ -1,5 +1,5 @@
 # dwm version
-VERSION = 6.2
+VERSION = 6.3
 
 # Customize below to fit your system
 
@@ -25,7 +25,7 @@
 LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
 
 # flags
-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 
-DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L 
-DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
 #CFLAGS   = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
 CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} 
${CPPFLAGS}
 LDFLAGS  = ${LIBS}
diff -Nru dwm-6.2/debian/changelog dwm-6.3/debian/changelog
--- dwm-6.2/debian/changelog    2021-12-11 23:46:42.000000000 +0100
+++ dwm-6.3/debian/changelog    2022-01-16 21:20:21.000000000 +0100
@@ -1,3 +1,17 @@
+dwm (6.3-0.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * New upstream release.
+  * debian/local/*:
+    - Refresh config files for new upstream release.
+  * debian/patches/*:
+    - Refresh patches for new upstream release.
+  * debian/rules:
+    - Fix FTCBFS by letting dh_auto_build pass cross tools to make, thanks to
+      Helmut Grohne for the patch (Closes: #901091).
+
+ -- Matteo Bini <matteo...@protonmail.com>  Sun, 16 Jan 2022 21:20:21 +0100
+
 dwm (6.2-0.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Nru dwm-6.2/debian/dwm.postinst dwm-6.3/debian/dwm.postinst
--- dwm-6.2/debian/dwm.postinst 1970-01-01 01:00:00.000000000 +0100
+++ dwm-6.3/debian/dwm.postinst 2022-01-16 21:18:49.000000000 +0100
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -e
+
+ALTERNATIVES="maintainer web winkey "
+
+case "${1}" in
+       configure)
+               update-alternatives --quiet --install /usr/bin/dwm dwm 
/usr/bin/dwm.default 100
+
+               for ALTERNATIVE in ${ALTERNATIVES}
+               do
+                       update-alternatives --quiet --install /usr/bin/dwm dwm 
/usr/bin/dwm.${ALTERNATIVE} 50
+               done
+               ;;
+
+       abort-upgrade|abort-remove|abort-deconfigure)
+
+               ;;
+
+       *)
+               echo "postinst called with unknown argument \`${1}'" >&2
+               exit 1
+               ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Nru dwm-6.2/debian/dwm.prerm dwm-6.3/debian/dwm.prerm
--- dwm-6.2/debian/dwm.prerm    1970-01-01 01:00:00.000000000 +0100
+++ dwm-6.3/debian/dwm.prerm    2022-01-16 21:18:49.000000000 +0100
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -e
+
+ALTERNATIVES="maintainer web winkey "
+
+case "${1}" in
+       remove|deconfigure)
+               update-alternatives --quiet --remove dwm /usr/bin/dwm.default
+
+               for ALTERNATIVE in ${ALTERNATIVES}
+               do
+                       update-alternatives --quiet --remove dwm 
/usr/bin/dwm.${ALTERNATIVE}
+               done
+               ;;
+
+       upgrade|failed-upgrade)
+
+               ;;
+
+       *)
+               echo "prerm called with unknown argument \`${1}'" >&2
+               exit 1
+               ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Nru dwm-6.2/debian/local/config.maintainer.h 
dwm-6.3/debian/local/config.maintainer.h
--- dwm-6.2/debian/local/config.maintainer.h    2021-12-10 19:32:02.000000000 
+0100
+++ dwm-6.3/debian/local/config.maintainer.h    2022-01-16 21:18:34.000000000 
+0100
@@ -41,6 +41,7 @@
 static const float mfact     = 0.55; /* factor of master area size 
[0.05..0.95] */
 static const int nmaster     = 1;    /* number of clients in master area */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled 
resizals */
+static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen 
window */
 
 static const Layout layouts[] = {
        /* symbol     arrange function */
diff -Nru dwm-6.2/debian/local/config.web.h dwm-6.3/debian/local/config.web.h
--- dwm-6.2/debian/local/config.web.h   2021-12-10 19:32:02.000000000 +0100
+++ dwm-6.3/debian/local/config.web.h   2022-01-16 21:18:33.000000000 +0100
@@ -29,6 +29,7 @@
 static const float mfact     = 0.55; /* factor of master area size 
[0.05..0.95] */
 static const int nmaster     = 1;    /* number of clients in master area */
 static const int resizehints = 0;    /* 1 means respect size hints in tiled 
resizals */
+static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen 
window */
 
 static const Layout layouts[] = {
        /* symbol     arrange function */
diff -Nru dwm-6.2/debian/local/config.winkey.h 
dwm-6.3/debian/local/config.winkey.h
--- dwm-6.2/debian/local/config.winkey.h        2021-12-10 19:32:02.000000000 
+0100
+++ dwm-6.3/debian/local/config.winkey.h        2022-01-16 21:18:32.000000000 
+0100
@@ -35,6 +35,7 @@
 static const float mfact     = 0.55; /* factor of master area size 
[0.05..0.95] */
 static const int nmaster     = 1;    /* number of clients in master area */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled 
resizals */
+static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen 
window */
 
 static const Layout layouts[] = {
        /* symbol     arrange function */
diff -Nru dwm-6.2/debian/patches/2002_inject_hardening_flags.patch 
dwm-6.3/debian/patches/2002_inject_hardening_flags.patch
--- dwm-6.2/debian/patches/2002_inject_hardening_flags.patch    2021-12-10 
19:32:02.000000000 +0100
+++ dwm-6.3/debian/patches/2002_inject_hardening_flags.patch    2022-01-16 
20:45:40.000000000 +0100
@@ -4,20 +4,20 @@
  -Os from upstream allowing use DEB_BUILD_OPTIONS=noopt
 Author: Vasudev Kamath <kamathvasu...@gmail.com>
 Forwarded: not-needed
-Last-Update: 2021-10-26
---- a/config.mk        2019-02-02 13:55:28.000000000 +0100
-+++ b/config.mk        2021-10-26 08:42:19.398947937 +0200
+Last-Update: 2022-01-16
+--- a/config.mk 2022-01-07 12:42:18.000000000 +0100
++++ b/config.mk 2022-01-16 20:33:02.005772998 +0100
 @@ -25,10 +25,10 @@ INCS = -I${X11INC} -I${FREETYPEINC}
  LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
- 
+
  # flags
--CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 
-DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
-+CPPFLAGS += -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 
-DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L 
-DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
++CPPFLAGS += -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L 
-DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
  #CFLAGS   = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
 -CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} 
${CPPFLAGS}
 -LDFLAGS  = ${LIBS}
-+CFLAGS   += -std=c99 -pedantic -Wall -Wno-deprecated-declarations ${INCS} 
${CPPFLAGS}
++CFLAGS   += -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} 
${CPPFLAGS}
 +LDFLAGS  += ${LIBS}
- 
+
  # Solaris
  #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
diff -Nru dwm-6.2/debian/patches/2004_use_system_searchpaths.patch 
dwm-6.3/debian/patches/2004_use_system_searchpaths.patch
--- dwm-6.2/debian/patches/2004_use_system_searchpaths.patch    2021-12-11 
23:05:28.000000000 +0100
+++ dwm-6.3/debian/patches/2004_use_system_searchpaths.patch    2022-01-16 
21:02:59.000000000 +0100
@@ -6,11 +6,11 @@
  mips* it causes FTBFS. Thanks to YunQiang Su for bringing this up.
 Author: Vasudev Kamath <kamathvasu...@gmail.com>
 Forwarded: not-needed
-Last-Updated: 2021-10-26
+Last-Updated: 2022-01-16
 Bug-Debian: https://bugs.debian.org/722765
 
 --- a/config.mk        2019-02-02 13:55:28.000000000 +0100
-+++ b/config.mk        2021-10-26 08:54:15.071976076 +0200
++++ b/config.mk        2022-01-16 20:33:02.005772998 +0100
 @@ -7,9 +7,6 @@ VERSION = 6.2
  PREFIX = /usr/local
  MANPREFIX = ${PREFIX}/share/man
@@ -31,4 +31,4 @@
 +LIBS = -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
  
  # flags
- CPPFLAGS += -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 
-DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+ CPPFLAGS += -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L 
-DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
diff -Nru dwm-6.2/debian/rules dwm-6.3/debian/rules
--- dwm-6.2/debian/rules        2021-12-10 15:30:28.000000000 +0100
+++ dwm-6.3/debian/rules        2022-01-16 20:25:05.000000000 +0100
@@ -22,7 +22,7 @@
        do \
                $(MAKE) clean; \
                cp $${ALTERNATIVE} config.h; \
-               CFLAGS="$(CFLAGS)" $(MAKE) PREFIX=/usr; \
+               CFLAGS="$(CFLAGS)" dh_auto_build -- PREFIX=/usr; \
                install -m 0755 dwm debian/dwm/usr/bin/dwm.`basename 
$${ALTERNATIVE} | cut -d'.' -f 2`; \
                ln -s dwm.1.gz debian/dwm/usr/share/man/man1/dwm.`basename 
$${ALTERNATIVE} | cut -d'.' -f 2`.1.gz; \
        done
diff -Nru dwm-6.2/drw.c dwm-6.3/drw.c
--- dwm-6.2/drw.c       2019-02-02 13:55:28.000000000 +0100
+++ dwm-6.3/drw.c       2022-01-07 12:42:18.000000000 +0100
@@ -95,6 +95,7 @@
 {
        XFreePixmap(drw->dpy, drw->drawable);
        XFreeGC(drw->dpy, drw->gc);
+       drw_fontset_free(drw->fonts);
        free(drw);
 }
 
diff -Nru dwm-6.2/dwm.1 dwm-6.3/dwm.1
--- dwm-6.2/dwm.1       2019-02-02 13:55:28.000000000 +0100
+++ dwm-6.3/dwm.1       2022-01-07 12:42:18.000000000 +0100
@@ -33,7 +33,7 @@
 .SH OPTIONS
 .TP
 .B \-v
-prints version information to standard output, then exits.
+prints version information to stderr, then exits.
 .SH USAGE
 .SS Status bar
 .TP
diff -Nru dwm-6.2/dwm.c dwm-6.3/dwm.c
--- dwm-6.2/dwm.c       2019-02-02 13:55:28.000000000 +0100
+++ dwm-6.3/dwm.c       2022-01-07 12:42:18.000000000 +0100
@@ -169,6 +169,7 @@
 static void focusin(XEvent *e);
 static void focusmon(const Arg *arg);
 static void focusstack(const Arg *arg);
+static Atom getatomprop(Client *c, Atom prop);
 static int getrootptr(int *x, int *y);
 static long getstate(Window w);
 static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
@@ -439,7 +440,7 @@
                        arg.ui = 1 << i;
                } else if (ev->x < x + blw)
                        click = ClkLtSymbol;
-               else if (ev->x > selmon->ww - TEXTW(stext))
+               else if (ev->x > selmon->ww - (int)TEXTW(stext))
                        click = ClkStatusText;
                else
                        click = ClkWinTitle;
@@ -695,17 +696,20 @@
 void
 drawbar(Monitor *m)
 {
-       int x, w, sw = 0;
+       int x, w, tw = 0;
        int boxs = drw->fonts->h / 9;
        int boxw = drw->fonts->h / 6 + 2;
        unsigned int i, occ = 0, urg = 0;
        Client *c;
 
+       if (!m->showbar)
+               return;
+
        /* draw status first so it can be overdrawn by tags later */
        if (m == selmon) { /* status is only drawn on selected monitor */
                drw_setscheme(drw, scheme[SchemeNorm]);
-               sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
-               drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
+               tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
+               drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
        }
 
        for (c = m->clients; c; c = c->next) {
@@ -728,7 +732,7 @@
        drw_setscheme(drw, scheme[SchemeNorm]);
        x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
 
-       if ((w = m->ww - sw - x) > bh) {
+       if ((w = m->ww - tw - x) > bh) {
                if (m->sel) {
                        drw_setscheme(drw, scheme[m == selmon ? SchemeSel : 
SchemeNorm]);
                        drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
@@ -834,7 +838,7 @@
 {
        Client *c = NULL, *i;
 
-       if (!selmon->sel)
+       if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
                return;
        if (arg->i > 0) {
                for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
@@ -1520,7 +1524,7 @@
        if (!arg || !selmon->lt[selmon->sellt]->arrange)
                return;
        f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
-       if (f < 0.1 || f > 0.9)
+       if (f < 0.05 || f > 0.95)
                return;
        selmon->mfact = f;
        arrange(selmon);
@@ -1688,11 +1692,13 @@
                if (i < m->nmaster) {
                        h = (m->wh - my) / (MIN(n, m->nmaster) - i);
                        resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - 
(2*c->bw), 0);
-                       my += HEIGHT(c);
+                       if (my + HEIGHT(c) < m->wh)
+                               my += HEIGHT(c);
                } else {
                        h = (m->wh - ty) / (n - i);
                        resize(c, m->wx + mw, m->wy + ty, m->ww - mw - 
(2*c->bw), h - (2*c->bw), 0);
-                       ty += HEIGHT(c);
+                       if (ty + HEIGHT(c) < m->wh)
+                               ty += HEIGHT(c);
                }
 }
 

Reply via email to