Stuart Henderson <[email protected]> writes:

> On 2021/10/17 01:40, Omar Polo wrote:
>> [...]
>> +
>> +post-extract:
>> +.for f in maps/antarticum.map/terrain.png graphics/ui/ui_*.png \
>> +            units/radar/radar*.png units/tree*/tree*.png
>> +    optipng -force -fix ${WRKSRC}/${f}
>> +.endfor
>>  
>>  pre-configure:
>>      @${SUBST_CMD} ${WRKSRC}/SConstruct \
>
> For extract stages, please stick to just things which unpack files
> rather than doing any processsing (especially any which requires
> dependenxies beyond common archive tools), it makes it harder to unpack
> the ports tree (e.g. to search source, which is done with NO_DEPENDS
> set). Running it from pre-configure would be ok.

Sure, here's an updated patch that fixes the images in the pre-configure
step


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/games/boswars/Makefile,v
retrieving revision 1.26
diff -u -p -r1.26 Makefile
--- Makefile    12 Jul 2019 20:46:15 -0000      1.26
+++ Makefile    17 Oct 2021 08:40:54 -0000
@@ -7,7 +7,7 @@ DISTNAME=       boswars-${V}-src
 PKGNAME=       boswars-${V}
 CATEGORIES=    games x11
 MASTER_SITES=  http://www.boswars.org/dist/releases/
-REVISION=      1
+REVISION=      2
 
 HOMEPAGE=      http://www.boswars.org/
 
@@ -24,7 +24,8 @@ MODULES=      devel/scons \
 MODSCONS_FLAGS=        CPPPATH="${LOCALBASE}/include ${X11BASE}/include" \
                opengl=1
 
-BUILD_DEPENDS= devel/sdl-image
+BUILD_DEPENDS= devel/sdl-image \
+               graphics/optipng
 LIB_DEPENDS=   devel/sdl \
                multimedia/libtheora \
                audio/libvorbis \
@@ -38,6 +39,10 @@ DATA_DIR=    campaigns graphics intro langu
 pre-configure:
        @${SUBST_CMD} ${WRKSRC}/SConstruct \
                ${WRKSRC}/engine/include/stratagus.h
+.for f in maps/antarticum.map/terrain.png graphics/ui/ui_*.png \
+               units/radar/radar*.png units/tree*/tree*.png
+       optipng -force -fix ${WRKSRC}/${f}
+.endfor
 
 do-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/boswars

Reply via email to