Changeset View
Changeset View
Standalone View
Standalone View
head/astro/google-earth/Makefile
Show All 22 Lines | |||||
OPTIONS_DEFINE= NVIDIA | OPTIONS_DEFINE= NVIDIA | ||||
USE_LINUX= yes | USE_LINUX= yes | ||||
USE_LINUX_APPS= xorglibs curl | USE_LINUX_APPS= xorglibs curl | ||||
USES= perl5 shared-mime-info desktop-file-utils | USES= perl5 shared-mime-info desktop-file-utils | ||||
USE_PERL5= patch build | USE_PERL5= patch build | ||||
#SUB_FILES= bin/googleearth | #SUB_FILES= bin/googleearth | ||||
.include <bsd.port.pre.mk> | |||||
.include <bsd.port.options.mk> | |||||
UNMAKESELF= ${LOCALBASE}/bin/unmakeself | UNMAKESELF= ${LOCALBASE}/bin/unmakeself | ||||
.if ${PORT_OPTIONS:MNVIDIA} | NVIDIA_RUN_DEPENDS= ${LINUXBASE}/usr/lib/libGL.so.1:${PORTSDIR}/x11/nvidia-driver | ||||
RUN_DEPENDS+= ${LINUXBASE}/usr/lib/libGL.so.1:${PORTSDIR}/x11/nvidia-driver | NVIDIA_USE_OFF= LINUX_APPS=dri,libpciaccess | ||||
.else | |||||
USE_LINUX_APPS+= dri libpciaccess | |||||
LIBGL_ALWAYS_SOFTWARE=LIBGL_ALWAYS_SOFTWARE=yes | |||||
.endif | |||||
# Fixed by the first post-patch target line? Also, linprocfs needs to be mounted. | # Fixed by the first post-patch target line? Also, linprocfs needs to be mounted. | ||||
#.if ${OSVERSION} >= 900000 && ${ARCH} == "amd64" | #.if ${OSVERSION} >= 900000 && ${ARCH} == "amd64" | ||||
#BROKEN= seems to crash on >= 9.x/amd64: http://www.freebsd.org/cgi/query-pr.cgi?pr=160422 | #BROKEN= seems to crash on >= 9.x/amd64: http://www.freebsd.org/cgi/query-pr.cgi?pr=160422 | ||||
#.endif | #.endif | ||||
do-extract: | do-extract: | ||||
@${MKDIR} ${WRKSRC} | @${MKDIR} ${WRKSRC} | ||||
@${CP} ${DISTDIR}/${DIST_SUBDIR}/${_DISTFILES} ${WRKSRC} | @${CP} ${DISTDIR}/${DIST_SUBDIR}/${_DISTFILES} ${WRKSRC} | ||||
@cd ${WRKSRC} && ${UNMAKESELF} ${_DISTFILES} && ${RM} -f ${_DISTFILES} | @cd ${WRKSRC} && ${UNMAKESELF} ${_DISTFILES} && ${RM} -f ${_DISTFILES} | ||||
@cd ${WRKSRC} && ${TAR} xf googleearth-data.tar && ${RM} -f googleearth-data.tar | @cd ${WRKSRC} && ${TAR} xf googleearth-data.tar && ${RM} -f googleearth-data.tar | ||||
@cd ${WRKSRC} && ${TAR} xf googleearth-linux-x86.tar && ${RM} -f googleearth-linux-x86.tar | @cd ${WRKSRC} && ${TAR} xf googleearth-linux-x86.tar && ${RM} -f googleearth-linux-x86.tar | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} -e '/OS.*=/s|linux|FreeBSD|' ${WRKSRC}/drivers.ini | @${REINPLACE_CMD} -e '/OS.*=/s|linux|FreeBSD|' ${WRKSRC}/drivers.ini | ||||
@${REINPLACE_CMD} -e 's|^# Set the home.*|GOOGLEEARTH_DATA_PATH=${DATADIR}|; \ | @${REINPLACE_CMD} -e 's|^# Set the home.*|GOOGLEEARTH_DATA_PATH=${DATADIR}|' ${WRKSRC}/bin/googleearth | ||||
s|%%LIBGL_ALWAYS_SOFTWARE%%|${LIBGL_ALWAYS_SOFTWARE}|' ${WRKSRC}/bin/googleearth | |||||
@${REINPLACE_CMD} -i "" -e "s|^# Let's boogie.*|rm -f ${LINUXBASE}\$${HOME}/.googleearth/instance-running-lock|" ${WRKSRC}/bin/googleearth | @${REINPLACE_CMD} -i "" -e "s|^# Let's boogie.*|rm -f ${LINUXBASE}\$${HOME}/.googleearth/instance-running-lock|" ${WRKSRC}/bin/googleearth | ||||
@${REINPLACE_CMD} -i "" -e 's/^TMPPATH.*/exit 0/' ${WRKSRC}/postinstall.sh | @${REINPLACE_CMD} -i "" -e 's/^TMPPATH.*/exit 0/' ${WRKSRC}/postinstall.sh | ||||
@${REINPLACE_CMD} -i "" -e 's|\"\$$SETUP_INSTALLPATH/|\"${WRKSRC}/|' ${WRKSRC}/postinstall.sh | @${REINPLACE_CMD} -i "" -e 's|\"\$$SETUP_INSTALLPATH/|\"${WRKSRC}/|' ${WRKSRC}/postinstall.sh | ||||
@${REINPLACE_CMD} -i "" -e 's|\$$SETUP_INSTALLPATH/googleearth |${PREFIX}/bin/googleearth |' ${WRKSRC}/postinstall.sh | @${REINPLACE_CMD} -i "" -e 's|\$$SETUP_INSTALLPATH/googleearth |${PREFIX}/bin/googleearth |' ${WRKSRC}/postinstall.sh | ||||
${RM} ${WRKSRC}/libcurl.so.4 | ${RM} ${WRKSRC}/libcurl.so.4 | ||||
${PERL} -i -pe 's|/lib/ld-lsb.so.3\0\0\0|/lib/ld-linux.so.2\0|' ${WRKSRC}/googleearth-bin | ${PERL} -i -pe 's|/lib/ld-lsb.so.3\0\0\0|/lib/ld-linux.so.2\0|' ${WRKSRC}/googleearth-bin | ||||
post-patch-NVIDIA-on: | |||||
@${REINPLACE_CMD} 's|%%LIBGL_ALWAYS_SOFTWARE%%||' ${WRKSRC}/bin/googleearth | |||||
post-patch-NVIDIA-off: | |||||
@${REINPLACE_CMD} 's|%%LIBGL_ALWAYS_SOFTWARE%%|LIBGL_ALWAYS_SOFTWARE=yes|' ${WRKSRC}/bin/googleearth | |||||
do-build: | do-build: | ||||
@${SETENV} SETUP_INSTALLPATH=${DATADIR} ${WRKSRC}/postinstall.sh | @${SETENV} SETUP_INSTALLPATH=${DATADIR} ${WRKSRC}/postinstall.sh | ||||
@cd ${WRKSRC} && ${RM} -rf setup.* preuninstall.sh postinstall.sh \ | @cd ${WRKSRC} && ${RM} -rf setup.* preuninstall.sh postinstall.sh \ | ||||
bin/googleearth.orig | bin/googleearth.orig | ||||
do-install: | do-install: | ||||
${MKDIR} ${STAGEDIR}${DATADIR} | ${MKDIR} ${STAGEDIR}${DATADIR} | ||||
${MKDIR} ${STAGEDIR}${PREFIX}/share/mime/packages | ${MKDIR} ${STAGEDIR}${PREFIX}/share/mime/packages | ||||
${INSTALL_DATA} ${WRKSRC}/googleearth-mimetypes.xml \ | ${INSTALL_DATA} ${WRKSRC}/googleearth-mimetypes.xml \ | ||||
${STAGEDIR}${PREFIX}/share/mime/packages/ | ${STAGEDIR}${PREFIX}/share/mime/packages/ | ||||
${INSTALL_DATA} ${WRKSRC}/Google-googleearth.desktop \ | ${INSTALL_DATA} ${WRKSRC}/Google-googleearth.desktop \ | ||||
${STAGEDIR}${PREFIX}/share/applications/googleearth.desktop | ${STAGEDIR}${PREFIX}/share/applications/googleearth.desktop | ||||
${CP} -rp ${WRKSRC}/* ${STAGEDIR}${DATADIR} | ${CP} -rp ${WRKSRC}/* ${STAGEDIR}${DATADIR} | ||||
${RM} -f ${STAGEDIR}${DATADIR}/googleearth-mimetypes.xml \ | ${RM} -f ${STAGEDIR}${DATADIR}/googleearth-mimetypes.xml \ | ||||
${STAGEDIR}${DATADIR}/googleearth.desktop | ${STAGEDIR}${DATADIR}/googleearth.desktop | ||||
${INSTALL_SCRIPT} ${FILESDIR}/browserwrapper \ | ${INSTALL_SCRIPT} ${FILESDIR}/browserwrapper \ | ||||
${STAGEDIR}${DATADIR}/bin/ | ${STAGEDIR}${DATADIR}/bin/ | ||||
${LN} -sf ${DATADIR}/bin/googleearth \ | ${LN} -sf ${DATADIR}/bin/googleearth \ | ||||
${STAGEDIR}${PREFIX}/bin/ | ${STAGEDIR}${PREFIX}/bin/ | ||||
.include <bsd.port.post.mk> | .include <bsd.port.mk> |