George Koehler wrote (2023-08-27 00:12 CEST):
> On Thu, 24 Aug 2023 12:48:22 +0200
> Omar Polo <[email protected]> wrote:
> 
> > while I can't test on a !rust arch I did a few 'simulation' and it
> > seems to package correctly both with and without rsvg.
> > 
> > not super-familiar with plist fragments but it seems fine.  ok op@
> 
> semarie@ showed me how to conditionally comment a file in PLIST.
> This is easier than a plist fragment for a small number of files
> (here, only svg.so).
> 
> The diff now sets COMMENT_SVG to an empty string or "@comment ".
> I will commit it after I finish checking it.

Nice! I learned this too now. The port looks good here on amd64. I don't
have a non-rust arch available, so I changed ".if ${PROPERTIES:Mrust}"
to ".if 0" and build it that way.

Works as intended. I tested with nsxiv, which picks up .svg files when 
imlib2 is built with rsvg, and ignores these files when not.

OK sdk

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/graphics/imlib2/Makefile,v
> retrieving revision 1.49
> diff -u -p -r1.49 Makefile
> --- Makefile  7 May 2023 06:54:21 -0000       1.49
> +++ Makefile  26 Aug 2023 21:53:59 -0000
> @@ -1,6 +1,7 @@
>  COMMENT=     image manipulation library
>  
>  DISTNAME=    imlib2-1.11.0
> +REVISION=    0
>  SHARED_LIBS= Imlib2  8.0     # 12.0
>  CATEGORIES=  graphics
>  
> @@ -11,14 +12,11 @@ PERMIT_PACKAGE=   Yes
>  
>  MASTER_SITES=        ${MASTER_SITE_SOURCEFORGE:=enlightenment/}
>  
> -WANTLIB += ${COMPILER_LIBCXX} X11 X11-xcb Xau Xdmcp Xext Xrender
> -WANTLIB += aom brotlicommon brotlidec brotlienc bz2 c cairo cairo-gobject
> -WANTLIB += dav1d de265 expat ffi fontconfig freetype gdk_pixbuf-2.0
> -WANTLIB += gif gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0 harfbuzz
> -WANTLIB += heif hwy iconv id3tag intl jpeg jxl jxl_threads lcms2
> -WANTLIB += lzma m openjp2 pango-1.0 pangocairo-1.0 pangoft2-1.0
> -WANTLIB += pcre2-8 pixman-1 png rsvg-2 tiff webp webpdemux x265
> -WANTLIB += xcb xcb-render xcb-shm xml2 z zstd
> +WANTLIB += ${COMPILER_LIBCXX} X11 X11-xcb Xau Xdmcp Xext aom brotlicommon
> +WANTLIB += brotlidec brotlienc bz2 c dav1d de265 freetype gif
> +WANTLIB += heif hwy id3tag jpeg jxl jxl_threads lcms2 lzma m openjp2
> +WANTLIB += png sharpyuv tiff webp webpdemux x265 xcb xcb-shm z
> +WANTLIB += zstd
>  
>  COMPILER=    base-clang ports-gcc
>  
> @@ -31,14 +29,29 @@ LIB_DEPENDS+=     archivers/bzip2 \
>               graphics/openjp2 \
>               graphics/png \
>               graphics/tiff \
> -             multimedia/libheif \
> -             x11/gnome/librsvg
> +             multimedia/libheif
>  
>  SEPARATE_BUILD=      Yes
>  CONFIGURE_STYLE= gnu
>  .if ${MACHINE_ARCH} == "i386"
>  CONFIGURE_ARGS+= --disable-mmx
>  .endif
> +
> +.include <bsd.port.arch.mk>
> +.if ${PROPERTIES:Mrust}
> +# We have librsvg-2.0 >= 2.46 only for rust archs.
> +WANTLIB += Xrender cairo cairo-gobject expat ffi fontconfig gdk_pixbuf-2.0
> +WANTLIB += gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0 harfbuzz iconv
> +WANTLIB += intl pango-1.0 pangocairo-1.0 pangoft2-1.0 pcre2-8
> +WANTLIB += pixman-1 rsvg-2 xcb-render xml2
> +LIB_DEPENDS+=                x11/gnome/librsvg
> +COMMENT_SVG=
> +.else
> +CONFIGURE_ARGS+=     --without-svg
> +COMMENT_SVG=         "@comment "
> +.endif
> +SUBST_VARS+=         COMMENT_SVG
> +UPDATE_PLIST_ARGS+=  -c COMMENT_SVG
>  
>  CONFIGURE_ARGS+=     --without-ps
>  
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/graphics/imlib2/pkg/PLIST,v
> retrieving revision 1.12
> diff -u -p -r1.12 PLIST
> --- pkg/PLIST 29 Apr 2023 08:10:43 -0000      1.12
> +++ pkg/PLIST 26 Aug 2023 21:53:59 -0000
> @@ -33,7 +33,7 @@ lib/imlib2/loaders/
>  @so lib/imlib2/loaders/lzma.so
>  @so lib/imlib2/loaders/png.so
>  @so lib/imlib2/loaders/pnm.so
> -@so lib/imlib2/loaders/svg.so
> +${COMMENT_SVG}@so lib/imlib2/loaders/svg.so
>  @so lib/imlib2/loaders/tga.so
>  @so lib/imlib2/loaders/tiff.so
>  @so lib/imlib2/loaders/webp.so
> 

Reply via email to