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 -0000
> +++ x11/ahwm/distinfo 30 Apr 2012 17:27:22 -0000
> @@ -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 -0000
> +++ x11/ahwm/patches/patch-move-resize_c 30 Apr 2012 18:05:14 -0000
> @@ -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
it's often good to add a comment after $OpenBSD$ with the source of a
patch if it came from upstream etc.