Index: ports-mgmt/pkg/Makefile =================================================================== --- ports-mgmt/pkg/Makefile +++ ports-mgmt/pkg/Makefile @@ -71,6 +71,13 @@ .endif .endif +.if !exists(/usr/libdata/pkgconfig/liblzma.pc) +LIBLZMA_LIBS= -llzma +.else +LIBLZMA_PC!= ${EGREP} ^Libs /usr/libdata/pkgconfig/liblzma.pc +LIBLZMA_LIBS= ${LIBLZMA_PC:M-l*} +.endif + #define PKG_DEPENDS to nothing to avoid infinite loop looking for pkg :) PKG_DEPENDS= .undef INSTALLS_DEPENDS @@ -81,6 +88,10 @@ PKG_BIN= ${WRKSRC}/src/pkg-static .endif +post-patch: + ${REINPLACE_CMD} -e "s|-llzma|${LIBLZMA_LIBS}|g" ${WRKSRC}/auto.def \ + ${WRKSRC}/src/Makefile.autosetup ${WRKSRC}/tests/Makefile.autosetup + post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/lib/compat/pkg