[OT] Makefile magic [was: Re: linux-fonconfig-2.2.3_6 not X11BASE clean]

Karol Kwiatkowski karol.kwiat at gmail.com
Wed Mar 21 14:32:15 UTC 2007


Alexander Leidinger wrote:
> Quoting Karol Kwiatkowski <karol.kwiat at gmail.com> (from Wed, 21 Mar 2007
> 13:14:19 +0100):
> 
>> Hello all,
>>
>> environment:
>>     X11BASE=/usr/local
>>
>> problem:
>>     new version of linux-fonconfig (2.2.3_6) installs fonts.conf into
>> ${PREFIX}/etc/fonts/fonts.conf. In that file there is a hardcoded path
>> to /usr/X11R6/lib/X11/fonts which doesn't exist in my environment.
>>
>> solution:
>>     patch to x11-fonts/linux-config attached, I'm sending it here
>> cause I'm
>> not sure if that's a proper solution.
> 
> You don't need to patch fonts.conf. Just replace /usr/X11R6 globally
> with $X11BASE.

Well, true. Fixed. I just thought it's strange to have our (FreeBSD's)
file with hardcoded path :)

> You also added the backup file to the plist, just do an
> inplace replacement without the backup (-i option).

I'm probably missing something but I can't see how to do that. sed(1)
mentions -i with zero-length extension. Then there are those lines in
/usr/ports/Mk/bsd.port.mk:

# Macro for doing in-place file editing using regexps
REINPLACE_ARGS?=	-i.bak
REINPLACE_CMD?=	${SED} ${REINPLACE_ARGS}

and whatever I put in ${REINPLACE_CMD} line after -i option I get errors
or different extensions.

However, how about replacing ${INSTALL_DATA} with ${SED}? Patch attached.

Cheers,

Karol


-- 
Karol Kwiatkowski   <karol.kwiat at gmail dot com>
OpenPGP 0x06E09309
-------------- next part --------------
diff -ru linux-fontconfig.orig/Makefile linux-fontconfig/Makefile
--- linux-fontconfig.orig/Makefile	Mon Mar 19 06:13:58 2007
+++ linux-fontconfig/Makefile	Wed Mar 21 15:07:08 2007
@@ -28,6 +28,6 @@
 	${RM} ${WRKSRC}/etc/fonts/fonts.conf
 
 post-install:
-	${INSTALL_DATA} ${FILESDIR}/fonts.conf ${PREFIX}/etc/fonts/fonts.conf
+	${SED} -e "s|/usr/X11R6|${X11BASE}|g" ${FILESDIR}/fonts.conf > ${PREFIX}/etc/fonts/fonts.conf
 
 .include <bsd.port.mk>


More information about the freebsd-emulation mailing list