Re: New port: x11/ahwm window manager

2012-05-02 Thread Steffen Daode Nurpmeso
Hello Stuart, thanks for responding so quickly and extensive.

Stuart Henderson wrote [2012-05-02 01:12+0200]:
 On 2012/05/02 00:03, Steffen Daode Nurpmeso wrote:
  appended is a diff which creates a new port x11/ahwm.
 
 prefer tar.gz for new ports

That's not documented in faq/ports yet.
I should have looked into marc.info, though.
Trying this time via attachment.

  Have not figured out SEPARATE_BUILD yet.
 
 set it to Yes if it works. not worth spending much time on trying to
 make it work unless SEPARATE_BUILD gives a clear advantage (mostly when
 a port is fairly large).

Ok, i have made no further efforts in this regard.

  I had to implement the do-install: rule for sane sanity.
[.]
  The patches included are actually his own from the website
  (ahwm-0.90.switch.patch).
 
 ahwm.c:174: warning: implicit declaration of function 'strcmp'
 ahwm.c:712: warning: implicit declaration of function 'strlen'

Ouch.  I have even missed to really notice

  ahwm.c:712: warning: incompatible implicit declaration of
  built-in function 'strlen'

So thanks for catching this.

 workspace.c:54: warning: cast from pointer to integer of different size
 workspace.c:106: warning: cast to pointer from integer of different size

These are harmless unless you create that many different
workspaces, but i've added explicit intermediate casts via
ptrdiff_t.

 implicit decl of string functions are rather likely to cause problems on
 LP64 arch. casts from pointer to/from int are sometimes OK but they can
 often cause trouble too. if you haven't tried it on 64-bit it needs
 testing (it's always a good idea to say what arch you've tested on).

i386 (blindly compiled from source).
amd64 not that long (dito).
The thing is - it simply *never* crashed and i have *never* used
that command line argument, so stack pushing never happened.

  +COMMENT =  plain X11 window manager
  +CATEGORIES =   x11 
^
 trailing whitespace

Fixed.
In fact the Makefile was copied over from icewm, which thus
includes the same slip.

  +V =0.90
  +DISTNAME = ahwm-$V
 
 just use DISTNAME=ahwm-0.90, setting this in a separate var is only useful
 if you reference it later

Ok.

  +#PKGNAME = ${DISTNAME}
  +#WRKDIST = ${WRKDIR}/${DISTNAME}
 
 zap

Ok.

  +MASTER_SITES = 
  ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/ \
  +   ${HOMEPAGE}
 
 not much point listing the FreeBSD mirror there unless the
 proper master site is very unreliable (and if that's the case
 I'd rather mirror it myself).

I don't know wether it's reliable or not.
But it's a private homepage now, no longer backed by the site of
an university?
I was kinda happy once i discovered the mirror yesterday.
I don't know how the storage problem is solved.
I've removed FreeBSD there.

  +# Since we override install: it's possible to use gnu-style
  +CONFIGURE_STYLE =  gnu
 
 generally it's better to use the upstream install target,
 CONFIGURE_STYLE=gnu dest sometimes helps.

Didn't.

 with hand-rolled do-install new files are often missed in version
 updates, but I guess this is not a big problem with this particular port.

Nah.
But you never know, the author is (or at least his forefathers
were) compatriot(s) of Dracula.

That's kind of frightening.

  +# These are redundant, but be explicit for now
  +CONFIGURE_ARGS =   --with-x --enable-shape
 
 leave those out, it's just the --disable / --without lines that you
 really need to list explicitly.

Did so.  (In fact i guess it was wrong since --enable-shape should
then include WANTLIB=Xext.)

  +do-install:
  +   ${INSTALL_PROGRAM_DIR} ${PREFIX}/bin
  +   ${INSTALL_MAN_DIR} ${PREFIX}/man/man5
 
 no point creating these, they're already created from the mtree

Hmmm, so i did.

  +   ${INSTALL_PROGRAM} ${WRKSRC}/ahwm ${PREFIX}/bin/
  +   ${INSTALL_MAN} ${WRKSRC}/ahwmrc.5 ${PREFIX}/man/man5/
 
 I'd rather have 'man ahwm' working, so I would either keep the link or
 if you're only going to install it under one name, make that ahwm.

Readded symbolic link ahwm.5.

  +$OpenBSD$
  +--- move-resize.c.orig Mon Apr 30 20:03:16 2012
   move-resize.c  Mon Apr 30 20:03:43 2012
 
 it's often good to add a comment after $OpenBSD$ with the source of a
 patch if it came from upstream etc.

And i also did that for the entire patch branch.

Thanks again, Stuart.

--steffen
Forza Figa!


ahwm.tar.gz
Description: application/tar-gz


New port: x11/ahwm window manager

2012-05-01 Thread Steffen Daode Nurpmeso
Hi,

appended is a diff which creates a new port x11/ahwm.
This is my first attempt to create a port, so please show a little
patience.
I've tested it locally and i can apply all the steps from
ports/testing.html, back and forth.

Except of fetching - i have always had the .tar.gz in distfiles/.
I guess MASTER_SITES needs some adjustments?
Maybe some experienced porter could give some hints on that.
Have not figured out SEPARATE_BUILD yet.

I had to implement the do-install: rule for sane sanity.
I.e., being able to use CONFIGURE_STYLE=gnu - otherwise i was
unable to create sane --mandir paths since the *amazing*
bsd.port.mk system appends the defaults and thus overrides any
CONFIGURE_ARGS.  Using =simple was terribly slow and doesn't
really help for the path-joining either.

Also a symlink from ahwmrc.5 to ahwm.5 can be avoided like that.
I'm not yet sure wether Alex Hioreanu really agrees with that,
though.  Also with omitting the HTML copy of it.
Great craftsmanship creations can not really be abused.

The patches included are actually his own from the website
(ahwm-0.90.switch.patch).

Thank you.

--steffen
Forza Figa!

Index: x11/ahwm/Makefile
===
RCS file: x11/ahwm/Makefile
diff -N x11/ahwm/Makefile
--- /dev/null   1 Jan 1970 00:00:00 -
+++ x11/ahwm/Makefile   30 Apr 2012 23:47:06 -
@@ -0,0 +1,40 @@
+# $OpenBSD$
+
+COMMENT =  plain X11 window manager
+CATEGORIES =   x11 
+
+HOMEPAGE = http://www.hioreanu.net/cs/ahwm/
+MAINTAINER =   Steffen Daode Nurpmeso sdao...@googlemail.com
+
+V =0.90
+DISTNAME = ahwm-$V
+#PKGNAME = ${DISTNAME}
+#WRKDIST = ${WRKDIR}/${DISTNAME}
+
+# BSD
+PERMIT_PACKAGE_CDROM = Yes
+PERMIT_PACKAGE_FTP =   Yes
+PERMIT_DISTFILES_CDROM =Yes
+PERMIT_DISTFILES_FTP = Yes
+
+WANTLIB =  X11 c
+
+MASTER_SITES = ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/ \
+   ${HOMEPAGE}
+
+# Since we override install: it's possible to use gnu-style
+CONFIGURE_STYLE =  gnu
+# These are redundant, but be explicit for now
+CONFIGURE_ARGS =   --with-x --enable-shape
+#SEPARATE_BUILD =  Yes
+
+NO_REGRESS =   Yes
+
+# 
+do-install:
+   ${INSTALL_PROGRAM_DIR} ${PREFIX}/bin
+   ${INSTALL_MAN_DIR} ${PREFIX}/man/man5
+   ${INSTALL_PROGRAM} ${WRKSRC}/ahwm ${PREFIX}/bin/
+   ${INSTALL_MAN} ${WRKSRC}/ahwmrc.5 ${PREFIX}/man/man5/
+
+.include bsd.port.mk
Index: x11/ahwm/distinfo
===
RCS file: x11/ahwm/distinfo
diff -N x11/ahwm/distinfo
--- /dev/null   1 Jan 1970 00:00:00 -
+++ x11/ahwm/distinfo   30 Apr 2012 17:27:22 -
@@ -0,0 +1,5 @@
+MD5 (ahwm-0.90.tar.gz) = mVNlu1f0cxU+aH0TzcKTbw==
+RMD160 (ahwm-0.90.tar.gz) = OT2QRTl6yuDa3aG33h5Y/V1AnWE=
+SHA1 (ahwm-0.90.tar.gz) = bAtF3vUBjx89dUS36xcxzX4dhys=
+SHA256 (ahwm-0.90.tar.gz) = PCW+Q8rtJXUI2tl1ugmrxhHBZlfkZ7Ollv8WFCAxPXs=
+SIZE (ahwm-0.90.tar.gz) = 238356
Index: x11/ahwm/patches/patch-move-resize_c
===
RCS file: x11/ahwm/patches/patch-move-resize_c
diff -N x11/ahwm/patches/patch-move-resize_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ x11/ahwm/patches/patch-move-resize_c30 Apr 2012 18:05:14 -
@@ -0,0 +1,41 @@
+$OpenBSD$
+--- move-resize.c.orig Mon Apr 30 20:03:16 2012
 move-resize.c  Mon Apr 30 20:03:43 2012
+@@ -794,7 +794,9 @@ void resize_client(XEvent *xevent, arglist *al)
+ x_start = client-x + client-width;
+ y_start = client-y + client-height;
+ break;
+-default: /* shuts up compiler warning */
++default:
++  /* nothing */
++  ;
+ }
+ }
+ xrefresh();
+@@ -1056,6 +1058,8 @@ static void cycle_resize_direction_mouse(resize_direct
+ *old = WEST;
+ break;
+ default:
++  /* nothing */
++  ;
+ }
+ }
+ 
+@@ -1200,6 +1204,8 @@ static void process_resize(client_t *client, int new_x
+ }
+ break;
+ default:
++  /* nothing */
++  ;
+ }
+ }
+ 
+@@ -1236,6 +1242,8 @@ static void process_resize(client_t *client, int new_x
+ }
+ break;
+ default:
++  /* nothing */
++  ;
+ }
+ }
+ 
Index: x11/ahwm/patches/patch-prefs_c
===
RCS file: x11/ahwm/patches/patch-prefs_c
diff -N 

Re: New port: x11/ahwm window manager

2012-05-01 Thread Stuart Henderson
On 2012/05/02 00:03, Steffen Daode Nurpmeso wrote:
 appended is a diff which creates a new port x11/ahwm.

prefer tar.gz for new ports

 Except of fetching - i have always had the .tar.gz in distfiles/.
 I guess MASTER_SITES needs some adjustments?
 Maybe some experienced porter could give some hints on that.

 Have not figured out SEPARATE_BUILD yet.

set it to Yes if it works. not worth spending much time on trying to
make it work unless SEPARATE_BUILD gives a clear advantage (mostly when
a port is fairly large).

 I had to implement the do-install: rule for sane sanity.
 I.e., being able to use CONFIGURE_STYLE=gnu - otherwise i was
 unable to create sane --mandir paths since the *amazing*
 bsd.port.mk system appends the defaults and thus overrides any
 CONFIGURE_ARGS.  Using =simple was terribly slow and doesn't
 really help for the path-joining either.
 
 Also a symlink from ahwmrc.5 to ahwm.5 can be avoided like that.
 I'm not yet sure wether Alex Hioreanu really agrees with that,
 though.  Also with omitting the HTML copy of it.
 Great craftsmanship creations can not really be abused.
 
 The patches included are actually his own from the website
 (ahwm-0.90.switch.patch).

ahwm.c:174: warning: implicit declaration of function 'strcmp'
ahwm.c:712: warning: implicit declaration of function 'strlen'
workspace.c:54: warning: cast from pointer to integer of different size
workspace.c:106: warning: cast to pointer from integer of different size

implicit decl of string functions are rather likely to cause problems on
LP64 arch. casts from pointer to/from int are sometimes OK but they can
often cause trouble too. if you haven't tried it on 64-bit it needs
testing (it's always a good idea to say what arch you've tested on).

 +COMMENT =plain X11 window manager
 +CATEGORIES = x11 
   ^
trailing whitespace

 +V =  0.90
 +DISTNAME =   ahwm-$V

just use DISTNAME=ahwm-0.90, setting this in a separate var is only useful
if you reference it later

 +#PKGNAME =   ${DISTNAME}
 +#WRKDIST =   ${WRKDIR}/${DISTNAME}

zap

 +MASTER_SITES =   
 ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/ \
 + ${HOMEPAGE}

not much point listing the FreeBSD mirror there unless the
proper master site is very unreliable (and if that's the case
I'd rather mirror it myself).

 +# Since we override install: it's possible to use gnu-style
 +CONFIGURE_STYLE =gnu

generally it's better to use the upstream install target,
CONFIGURE_STYLE=gnu dest sometimes helps.

with hand-rolled do-install new files are often missed in version
updates, but I guess this is not a big problem with this particular port.

 +# These are redundant, but be explicit for now
 +CONFIGURE_ARGS = --with-x --enable-shape

leave those out, it's just the --disable / --without lines that you
really need to list explicitly.

 +#SEPARATE_BUILD =Yes
 +
 +NO_REGRESS = Yes
 +
 +# 
 +do-install:
 + ${INSTALL_PROGRAM_DIR} ${PREFIX}/bin
 + ${INSTALL_MAN_DIR} ${PREFIX}/man/man5

no point creating these, they're already created from the mtree

 + ${INSTALL_PROGRAM} ${WRKSRC}/ahwm ${PREFIX}/bin/
 + ${INSTALL_MAN} ${WRKSRC}/ahwmrc.5 ${PREFIX}/man/man5/

I'd rather have 'man ahwm' working, so I would either keep the link or
if you're only going to install it under one name, make that ahwm.

 +.include bsd.port.mk
 Index: x11/ahwm/distinfo
 ===
 RCS file: x11/ahwm/distinfo
 diff -N x11/ahwm/distinfo
 --- /dev/null 1 Jan 1970 00:00:00 -
 +++ x11/ahwm/distinfo 30 Apr 2012 17:27:22 -
 @@ -0,0 +1,5 @@
 +MD5 (ahwm-0.90.tar.gz) = mVNlu1f0cxU+aH0TzcKTbw==
 +RMD160 (ahwm-0.90.tar.gz) = OT2QRTl6yuDa3aG33h5Y/V1AnWE=
 +SHA1 (ahwm-0.90.tar.gz) = bAtF3vUBjx89dUS36xcxzX4dhys=
 +SHA256 (ahwm-0.90.tar.gz) = PCW+Q8rtJXUI2tl1ugmrxhHBZlfkZ7Ollv8WFCAxPXs=
 +SIZE (ahwm-0.90.tar.gz) = 238356
 Index: x11/ahwm/patches/patch-move-resize_c
 ===
 RCS file: x11/ahwm/patches/patch-move-resize_c
 diff -N x11/ahwm/patches/patch-move-resize_c
 --- /dev/null 1 Jan 1970 00:00:00 -
 +++ x11/ahwm/patches/patch-move-resize_c  30 Apr 2012 18:05:14 -
 @@ -0,0 +1,41 @@
 +$OpenBSD$
 +--- move-resize.c.orig   Mon Apr 30 20:03:16 2012
  move-resize.cMon Apr 30 20:03:43 2012

it's often good to add a comment after $OpenBSD$ with the source of a
patch if it came from upstream etc.