diff options
author | truckman <truckman@FreeBSD.org> | 2015-09-10 08:26:28 +0800 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2015-09-10 08:26:28 +0800 |
commit | 3583ce5fdcfe2a09989b89b27963031fa120fcdd (patch) | |
tree | 8f642f0dcf6c0ef034e405f659d1d7c1113e202e | |
parent | ae916816d340e4630cc653a9762392a21ee83e98 (diff) | |
download | freebsd-ports-gnome-3583ce5fdcfe2a09989b89b27963031fa120fcdd.tar.gz freebsd-ports-gnome-3583ce5fdcfe2a09989b89b27963031fa120fcdd.tar.zst freebsd-ports-gnome-3583ce5fdcfe2a09989b89b27963031fa120fcdd.zip |
Unbreak wrapper script so that if a particular application is
specified but without specifying a document, that application is
started instead of presenting the user with the generic startup
window and requiring him to pick the document type (running
openoffice-*-scalc should open to a new spreadsheet, etc.)
Building with clang 3.7 is reported to have the same failure mode
as clang 3.6, so use the same optimization tweak as a workaround.
Various cleanups to do-install:
* The paths ${PREFIX}/${INSTALLATION_BASEDIR} and
${PREFIX}/${INSTALLATION_BASEDIR}/${AOODIR}, and
${PREFIX}/${INSTALLATION_BASEDIR}/${AOODIR}/share/xdg are
frequently used, so create a few variables to hold those paths
instead of repeating the same, long sequence in a number of places
* Tweak openoffice-wrapper to take advantage of the previous change
* Use INSTALLS_ICONS=yes instead of manually adding the @exec and
@unexec entries to the plist
* Edit bootstraprc only once with ${REINPLACE_CMD} instead of
running it twice to edit the same line
* Remove bootstraprc.bak so that it does not get installed
* With the advent of staging, it is not necessary to remove
${STAGEDIR}${DESKTOPDIR}/${EXECBASE}
* Simplify code for installing icons
Rename remaining OOO* variables to AOO*.
-rw-r--r-- | editors/openoffice-devel/Makefile | 101 | ||||
-rw-r--r-- | editors/openoffice-devel/files/openoffice-wrapper | 4 |
2 files changed, 53 insertions, 52 deletions
diff --git a/editors/openoffice-devel/Makefile b/editors/openoffice-devel/Makefile index b4c6150bc154..8da02626b3fd 100644 --- a/editors/openoffice-devel/Makefile +++ b/editors/openoffice-devel/Makefile @@ -3,7 +3,7 @@ PORTNAME= apache-openoffice PORTVERSION= ${AOOVERSION1}.${AOOVERSION2}.${SVNREVISION} -#PORTREVISION= 1 +PORTREVISION= 1 PORTEPOCH= 3 CATEGORIES= editors java MASTER_SITES= http://ci.apache.org/projects/openoffice/milestones/${AOOVERSION}-${AOORC}-r${SVNREVISION}/source/ \ @@ -16,9 +16,9 @@ PKGNAMEPREFIX= ${LANG_PKGNAME}- PKGNAMESUFFIX= -${LANG_SUFFIX} .endif PKGNAMESUFFIX= -devel -DISTFILES= ${OOOSRC}${AOODISTTAG} unowinreg.dll:unoreg ${EXTSRC}:extsrc +DISTFILES= ${AOOSRC}${AOODISTTAG} unowinreg.dll:unoreg ${EXTSRC}:extsrc DIST_SUBDIR= openoffice -EXTRACT_ONLY= ${OOOSRC} +EXTRACT_ONLY= ${AOOSRC} MAINTAINER= office@FreeBSD.org #de facto maintainer is truckman@FreeBSD.org @@ -108,19 +108,21 @@ AOOVERSION= ${AOOVERSION1}.${AOOVERSION2}.${AOOVERSION3} AOOXXX= ${AOOVERSION1}${AOOVERSION2}${AOOVERSION3} .if defined(AOORC) AOOSUFFIX= ${AOOVERSION}-${AOORC} -OOOSRC= apache-openoffice-${AOOVERSION}-r${SVNREVISION}-src${EXTRACT_SUFX} +AOOSRC= apache-openoffice-${AOOVERSION}-r${SVNREVISION}-src${EXTRACT_SUFX} AOODISTTAG= TARTYPE= bzip2 .else AOOSUFFIX= ${PORTVERSION} -OOOSRC= apache-openoffice-r${SVNREVISION}-src${EXTRACT_SUFX} +AOOSRC= apache-openoffice-r${SVNREVISION}-src${EXTRACT_SUFX} AOODISTTAG= :snap TARTYPE= xz .endif -OOODIR= openoffice${AOOVERSION1} AOOUDIR= .openoffice.org\/${AOOVERSION1} INSTALLATION_BASEDIR?= openoffice-${AOOSUFFIX} +PRINSTALLATION_BASEDIR= ${PREFIX}/${INSTALLATION_BASEDIR} +OOPATH= ${PRINSTALLATION_BASEDIR}/openoffice${AOOVERSION1} +XDGDIR= ${OOPATH}/share/xdg EXECBASE?= openoffice-${AOOSUFFIX} ONLY_FOR_ARCHS= i386 amd64 @@ -137,6 +139,7 @@ USE_XORG= ice x11 xau xaw xcomposite xcursor xdamage xext xfixes xi \ USES= autoreconf:autoconf bison compiler cpe desktop-file-utils \ gettext-runtime gmake iconv jpeg perl5 pkgconfig python \ tar:${TARTYPE} +INSTALLS_ICONS= yes WITHOUT_CPU_CFLAGS= true CPE_PRODUCT= ${PORTNAME:S|apache-||} CPE_VENDOR= apache @@ -187,14 +190,14 @@ LOCALIZED_LANG?= en-US .if ${PORT_OPTIONS:MCCACHE} || defined(WITH_CCACHE) BUILD_DEPENDS+= ccache:${PORTSDIR}/devel/ccache CCACHE_PREFIX= ccache -OOOCC= ${CCACHE_PREFIX} ${CC} -OOOCXX= ${CCACHE_PREFIX} ${CXX} +AOOCC= ${CCACHE_PREFIX} ${CC} +AOOCXX= ${CCACHE_PREFIX} ${CXX} .else -OOOCC= ${CC} -OOOCXX= ${CXX} +AOOCC= ${CC} +AOOCXX= ${CXX} .endif -CONFIGURE_ENV+= CC="${OOOCC}" CXX="${OOOCXX}" \ +CONFIGURE_ENV+= CC="${AOOCC}" CXX="${AOOCXX}" \ PATH=${WRKSRC}/solenv/bin:$$PATH GNU_CONFIGURE= yes @@ -263,10 +266,10 @@ CONFIGURE_ARGS+= \ --with-system-xrender \ --with-system-zlib -#OOOEXTENSIONS+= minimizer/presentation-minimizer.oxt -#OOOEXTENSIONS+= presenter/presenter-screen.oxt -#OOOEXTENSIONS+= pdfimport/pdfimport.oxt -OOOEXTENSIONS+= swext/wiki-publisher.oxt +#AOOEXTENSIONS+= minimizer/presentation-minimizer.oxt +#AOOEXTENSIONS+= presenter/presenter-screen.oxt +#AOOEXTENSIONS+= pdfimport/pdfimport.oxt +AOOEXTENSIONS+= swext/wiki-publisher.oxt ICONS= ${WRKSRC}/sysui/desktop/icons @@ -335,7 +338,7 @@ post-patch: ${REINPLACE_CMD} -e "s/ := -Os/ := -Os -fno-devirtualize -fno-devirtualize-speculatively/" ${WRKSRC}/solenv/gbuild/platform/freebsd.mk; \ ${REINPLACE_CMD} -e "s/=-Os /=-Os -fno-devirtualize -fno-devirtualize-speculatively /" ${WRKSRC}/solenv/inc/unxfbsdi.mk; \ fi -.elif ${ARCH} == i386 && ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} == 36 +.elif ${ARCH} == i386 && ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 36 # autodoc and uno (bridgetest) core dump when built with with -Os # on i386, affects file.cxx and bridgetest.cxx # Using -O2 optimiztion works, and -Os is essentially -O2 with out @@ -395,23 +398,21 @@ do-install: ${ECHO_CMD} "extracting $$i" ; \ cd ${WRKDIR}/tmp ; ${TAR} xfz ${WRKSRC}/instsetoo_native/unxfbsd?.pro/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/$$i ; \ done - ${MKDIR} ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR} - cd ${WRKDIR}/tmp/*/ ; ${TAR} cf - -C . . | ${TAR} xf - -C ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR} - ${REINPLACE_CMD} -e 's/^UserInstallation.*$$/USERINSTALLATION/' ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/program/bootstraprc - ${REINPLACE_CMD} -e 's/USERINSTALLATION/UserInstallation=$$SYSUSERCONFIG\/${AOOUDIR}/' ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/program/bootstraprc - ${MKDIR} ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/extensions/ - cd ${WRKSRC}/solver/${AOOXXX}/unxfbsd?.pro/bin/ ; ${INSTALL_DATA} ${OOOEXTENSIONS} ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/extensions/ - ${FIND} ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/program -type f \( -name '*.so*' -or -name '*.bin' \) -print0 | ${XARGS} -0 -n1 ${STRIP_CMD} + ${MKDIR} ${STAGEDIR}${PRINSTALLATION_BASEDIR} + cd ${WRKDIR}/tmp/*/ ; ${TAR} cf - -C . . | ${TAR} xf - -C ${STAGEDIR}${PRINSTALLATION_BASEDIR} + ${REINPLACE_CMD} -e '/^UserInstallation/s/=.*/=$$SYSUSERCONFIG\/${AOOUDIR}/' ${STAGEDIR}${OOPATH}/program/bootstraprc + ${RM} ${STAGEDIR}${OOPATH}/program/bootstraprc.bak + ${MKDIR} ${STAGEDIR}${PRINSTALLATION_BASEDIR}/extensions/ + cd ${WRKSRC}/solver/${AOOXXX}/unxfbsd?.pro/bin/ ; ${INSTALL_DATA} ${AOOEXTENSIONS} ${STAGEDIR}${PRINSTALLATION_BASEDIR}/extensions/ + ${FIND} ${STAGEDIR}${OOPATH}/program -type f \( -name '*.so*' -or -name '*.bin' \) -print0 | ${XARGS} -0 -n1 ${STRIP_CMD} for prog in crashrep pagein uri-encode javaldx regmerge regview; do \ - ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/program/$${prog}; \ + ${STRIP_CMD} ${STAGEDIR}${OOPATH}/program/$${prog}; \ done - ${FIND} ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR} -type d -exec ${CHMOD} 755 {} \; + ${FIND} ${STAGEDIR}${PRINSTALLATION_BASEDIR} -type d -exec ${CHMOD} 755 {} \; @${ECHO_MSG} "===> Add wrapper scripts"; ${CP} ${FILESDIR}/openoffice-wrapper ${WRKDIR}/ - ${REINPLACE_CMD} -e 's#%%PREFIX%%#${PREFIX}#g' \ - -e 's#%%SVNREVISION%%#${SVNREVISION}#g' \ - -e 's#%%OOODIR%%#${OOODIR}#g' \ - -e 's#%%INSTALLATION_BASEDIR%%#${INSTALLATION_BASEDIR}#g' \ + ${REINPLACE_CMD} -e 's#%%OOPATH%%#${OOPATH}#g' \ + -e 's#%%EXECBASE%%#${EXECBASE}#g' \ ${WRKDIR}/openoffice-wrapper ${INSTALL_SCRIPT} ${WRKDIR}/openoffice-wrapper \ ${STAGEDIR}${PREFIX}/bin/${EXECBASE} @@ -430,38 +431,38 @@ do-install: for app in base calc draw impress math writer; do \ ${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE} -$${app} %U/" \ -e "s/^Icon.*/Icon=${EXECBASE}-$${app}.png/" \ - ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/$${app}.desktop ; \ + ${STAGEDIR}${XDGDIR}/$${app}.desktop ; \ done ${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE}-spadmin %U/" \ -e "s/^Icon.*/Icon=${EXECBASE}-printeradmin.png/" \ - ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/printeradmin.desktop + ${STAGEDIR}${XDGDIR}/printeradmin.desktop ${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE} -quickstart -nologo -nodefault/" \ - ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/startcenter.desktop - ${RM} ${STAGEDIR}${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/*.desktop.bak - ${RM} -f ${STAGEDIR}${DESKTOPDIR}/${EXECBASE} + ${STAGEDIR}${XDGDIR}/startcenter.desktop + ${RM} ${STAGEDIR}${XDGDIR}/*.desktop.bak ${MKDIR} ${STAGEDIR}${DESKTOPDIR} - ${LN} -sf ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg \ - ${STAGEDIR}${DESKTOPDIR}/${EXECBASE} + ${LN} -sf ${XDGDIR} ${STAGEDIR}${DESKTOPDIR}/${EXECBASE} ${ECHO_CMD} "share/applications/${EXECBASE}" >> ${TMPPLIST} - for dir in `ls ${ICONS}/hicolor | ${GREP} -v CVS`; do \ + cd ${ICONS} ; for dir in hicolor/*/apps ; do \ + ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/$${dir} ; \ for app in base calc draw impress math printeradmin writer; do \ - if [ -r ${ICONS}/hicolor/$${dir}/apps/$${app}.png ]; then \ - ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/$${dir}/apps/ ; \ - ${INSTALL_DATA} ${ICONS}/hicolor/$${dir}/apps/$${app}.png \ - ${STAGEDIR}${PREFIX}/share/icons/hicolor/$${dir}/apps/${EXECBASE}-$${app}.png ; \ - ${ECHO_CMD} "share/icons/hicolor/$${dir}/apps/${EXECBASE}-$${app}.png" >> ${TMPPLIST} ; \ + icon_src=$${dir}/$${app}.png; \ + icon_dst=share/icons/$${dir}/${EXECBASE}-$${app}.png; \ + if [ -r $${icon_src} ]; then \ + ${INSTALL_DATA} $${icon_src} \ + ${STAGEDIR}${PREFIX}/$${icon_dst} ; \ + ${ECHO_CMD} "$${icon_dst}" >> ${TMPPLIST} ; \ fi \ done ; \ - for iconfile in `cd ${ICONS}/hicolor/$${dir}/mimetypes; ls *.png`; do \ - ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/$${dir}/mimetypes/ ; \ - ${INSTALL_DATA} ${ICONS}/hicolor/$${dir}/mimetypes/$${iconfile} \ - ${STAGEDIR}${PREFIX}/share/icons/hicolor/$${dir}/mimetypes/ ; \ - ${ECHO_CMD} "share/icons/hicolor/$${dir}/mimetypes/$${iconfile}" >> ${TMPPLIST} ; \ + done + cd ${ICONS} ; for dir in hicolor/*/mimetypes ; do \ + ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/$${dir} ; \ + for iconfile in `cd $${dir}; ls *.png`; do \ + icon_dst=share/icons/$${dir}/$${iconfile} ; \ + ${INSTALL_DATA} $${dir}/$${iconfile} \ + ${STAGEDIR}${PREFIX}/$${icon_dst}; \ + ${ECHO_CMD} "$${icon_dst}" >> ${TMPPLIST} ; \ done ; \ done - ${ECHO_CMD} "@unexec ${RM} %D/share/icons/hicolor/icon-theme.cache 2>/dev/null || ${TRUE}" >> ${TMPPLIST} - ${ECHO_CMD} "@exec ${PREFIX}/bin/gtk-update-icon-cache -q -f %D/share/icons/hicolor 2>/dev/null || ${TRUE}" >> ${TMPPLIST} - ${ECHO_CMD} "@unexec ${PREFIX}/bin/gtk-update-icon-cache -q -f %D/share/icons/hicolor 2>/dev/null || ${TRUE}" >> ${TMPPLIST} .include <${FILESDIR}/Makefile.others> diff --git a/editors/openoffice-devel/files/openoffice-wrapper b/editors/openoffice-devel/files/openoffice-wrapper index 958878c645b4..6af286a38b8d 100644 --- a/editors/openoffice-devel/files/openoffice-wrapper +++ b/editors/openoffice-devel/files/openoffice-wrapper @@ -2,8 +2,8 @@ # # $FreeBSD$ -oopath=%%PREFIX%%/%%INSTALLATION_BASEDIR%%/%%OOODIR%% -program=`echo $0 | sed -e 's|.*-%%SVNREVISION%%-||'` +oopath=%%OOPATH%% +program=`echo $0 | sed -e 's|.*%%EXECBASE%%-||'` case $program in $0) |