From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9B3BB13877A for ; Wed, 27 Aug 2014 00:24:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 08DB7E08F6; Wed, 27 Aug 2014 00:24:49 +0000 (UTC) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 18C46E0879 for ; Wed, 27 Aug 2014 00:24:47 +0000 (UTC) Received: by mail-qc0-f182.google.com with SMTP id i8so16187363qcq.41 for ; Tue, 26 Aug 2014 17:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=FsDwyKboUjV+M/OYMnHDZjL5Szbz7FlgsLn+n0qbeKQ=; b=LmV89LIjncWBj/Oo4Z2Xqn60oHIWHT9LXSDqYXJyMmP+624ZfPnUCgPZ/p8P6JkZ7K mpANOxijN6i/lr2IoS9T1tm4fLoSxCEt0Q1OPU+iATzBQbfP81zUtaz24olmnLy+faAA xezvv6mb2mE2aQjYFf0x+D2Rz5M3HydiH3po1Q3Byg7u2Z7f1PNmgS/P+jGZQy/7q4SS pGuk9anpNYKYM7YNIHO8R84R+//LGLqbGWIVslKmKTn3Vu/cJ3Fnd3vQCDuSSFjd0/31 /yh0X40gBgnxIsa5QmHBn+Nj+vK6XJVDVir8cnFZ359QbAbwf57XtAK1uvoQnTUa1CQe U2VA== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.140.41.133 with SMTP id z5mr47797119qgz.99.1409099087184; Tue, 26 Aug 2014 17:24:47 -0700 (PDT) Sender: davidepesa@gmail.com Received: by 10.224.193.201 with HTTP; Tue, 26 Aug 2014 17:24:47 -0700 (PDT) In-Reply-To: <20140820100727.07f25b3c@pomiot.lan> References: <20140820100727.07f25b3c@pomiot.lan> Date: Wed, 27 Aug 2014 02:24:47 +0200 X-Google-Sender-Auth: HKiZOR4ZYOtifFr8ncosb8GWw0I Message-ID: Subject: Re: [gentoo-dev] [RFC] qt5-build.eclass From: Davide Pesavento To: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Cc: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 43cbe837-2b27-4ca4-8cec-302760c5e61a X-Archives-Hash: e27c1f2edec3a714b0def49ce0caf32d On Wed, Aug 20, 2014 at 10:07 AM, Micha=C5=82 G=C3=B3rny wrote: > Dnia 2014-08-17, o godz. 20:38:18 > Davide Pesavento napisa=C5=82(a): > >> # @FUNCTION: qt5-build_src_unpack >> # @DESCRIPTION: >> # Unpacks the sources. >> qt5-build_src_unpack() { >> if [[ $(gcc-major-version) -lt 4 ]] || [[ $(gcc-major-version) -eq= 4 && $(gcc-minor-version) -lt 5 ]]; then >> ewarn >> ewarn "Using a GCC version lower than 4.5 is not supported= ." >> ewarn >> fi >> >> if [[ ${PN} =3D=3D qtwebkit ]]; then >> eshopts_push -s extglob >> if is-flagq '-g?(gdb)?([1-9])'; then > > Wouldn't that be equivalent to '-g[^0]'? And I think this would > actually work without extglob. That doesn't match '-g' though, does it? > >> ewarn >> ewarn "You have enabled debug info (probably have = -g or -ggdb in your CFLAGS/CXXFLAGS)." >> ewarn "You may experience really long compilation = times and/or increased memory usage." >> ewarn "If compilation fails, please try removing -= g/-ggdb before reporting a bug." >> ewarn "For more info check out https://bugs.gentoo= .org/307861" >> ewarn >> fi >> eshopts_pop >> fi >> >> case ${QT5_BUILD_TYPE} in >> live) git-r3_src_unpack ;; >> release) default ;; >> esac >> } >> >> # @FUNCTION: qt5-build_src_prepare >> # @DESCRIPTION: >> # Prepares the sources before the configure phase. >> qt5-build_src_prepare() { >> qt5_prepare_env >> >> if [[ ${QT5_MODULE} =3D=3D qtbase ]]; then >> # Avoid unnecessary qmake recompilations >> sed -i -re "s|^if true;.*(\[ '\!').*(\"\\\$outpath/bin/qma= ke\".*)|if \1 -e \2 then|" \ >> configure || die "sed failed (skip qmake bootstrap= )" > > Any chance for something more readable? :) Like a inline patch. I think it's a fairly straightforward substitution, not pretty maybe but... heh ;) Also, it's not something that you have to look at all the time since the configure line doesn't change often, and the intent is clear from the comment, so I'm not going to change it. > >> # Respect CC, CXX, *FLAGS, MAKEOPTS and EXTRA_EMAKE when b= ootstrapping qmake >> sed -i -e "/outpath\/qmake\".*\"\$MAKE\")/ s:): \ >> ${MAKEOPTS} ${EXTRA_EMAKE} 'CC=3D$(tc-getCC)' 'CXX= =3D$(tc-getCXX)' \ >> 'QMAKE_CFLAGS=3D${CFLAGS}' 'QMAKE_CXXFLAGS=3D${CXX= FLAGS}' 'QMAKE_LFLAGS=3D${LDFLAGS}'&:" \ >> -e '/"$CFG_RELEASE_QMAKE"/,/^\s\+fi$/ d' \ >> configure || die "sed failed (respect env for qmak= e build)" > > Ditto ;). ditto ;) > >> sed -i -e '/^CPPFLAGS\s*=3D/ s/-g //' \ >> qmake/Makefile.unix || die "sed failed (CPPFLAGS f= or qmake build)" >> >> # Respect CXX in {bsymbolic_functions,fvisibility,precomp}= .test >> sed -i -e "/^QMAKE_CONF_COMPILER=3D/ s:=3D.*:=3D\"$(tc-get= CXX)\":" \ >> configure || die "sed failed (QMAKE_CONF_COMPILER)= " >> >> # Respect toolchain and flags in config.tests >> find config.tests/unix -name '*.test' -type f -print0 \ >> | xargs -0 sed -i -e '/bin\/qmake/ s/-nocache //' = \ >> || die "sed failed (config.tests)" > > find ... -exec sed ... {} + > >> fi >> >> if [[ ${PN} !=3D qtcore ]]; then >> qt5_symlink_tools_to_build_dir >> fi >> >> # apply patches >> [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" >> epatch_user >> } > > [...] > >> # @FUNCTION: qt5-build_src_install >> # @DESCRIPTION: >> # Performs the actual installation of target directories. >> qt5-build_src_install() { >> qt5_foreach_target_subdir emake INSTALL_ROOT=3D"${D}" install >> >> if [[ ${PN} =3D=3D qtcore ]]; then >> pushd "${QT5_BUILD_DIR}" >/dev/null || die >> einfo "Running emake INSTALL_ROOT=3D${D} install_{mkspecs,= qmake,syncqt}" > > You can put that command-line in an array or set to argv. > >> emake INSTALL_ROOT=3D"${D}" install_{mkspecs,qmake,syncqt} >> popd >/dev/null || die >> >> # install an empty Gentoo/gentoo-qconfig.h in ${D} >> # so that it's placed under package manager control >> > "${T}"/gentoo-qconfig.h >> ( >> insinto "${QT5_HEADERDIR#${EPREFIX}}"/Gentoo >> doins "${T}"/gentoo-qconfig.h >> ) >> >> # include gentoo-qconfig.h at the beginning of QtCore/qcon= fig.h >> sed -i -e '1a#include \n' \ >> "${D}${QT5_HEADERDIR}"/QtCore/qconfig.h \ >> || die "sed failed (qconfig.h)" >> fi >> >> qt5_install_module_qconfigs >> prune_libtool_files >> } > > [...] > >> # @FUNCTION: qt5_base_configure >> # @INTERNAL >> # @DESCRIPTION: >> # Runs ./configure for modules belonging to qtbase. >> qt5_base_configure() { >> # setup toolchain variables used by configure >> tc-export CC CXX RANLIB STRIP >> export LD=3D"$(tc-getCXX)" >> >> # configure arguments >> local conf=3D( >> # installation paths >> -prefix "${QT5_PREFIX}" >> -bindir "${QT5_BINDIR}" >> -headerdir "${QT5_HEADERDIR}" >> -libdir "${QT5_LIBDIR}" >> -archdatadir "${QT5_ARCHDATADIR}" >> -plugindir "${QT5_PLUGINDIR}" >> -libexecdir "${QT5_LIBEXECDIR}" >> -importdir "${QT5_IMPORTDIR}" >> -qmldir "${QT5_QMLDIR}" >> -datadir "${QT5_DATADIR}" >> -docdir "${QT5_DOCDIR}" >> -translationdir "${QT5_TRANSLATIONDIR}" >> -sysconfdir "${QT5_SYSCONFDIR}" >> -examplesdir "${QT5_EXAMPLESDIR}" >> -testsdir "${QT5_TESTSDIR}" >> >> # debug/release >> $(use debug && echo -debug || echo -release) >> -no-separate-debug-info >> >> # licensing stuff >> -opensource -confirm-license >> >> # let configure automatically figure out if C++11 is suppo= rted >> #-c++11 > > Doesn't switching C++11 support involve changing ABI? I suspect Qt may > be actually free of that. No, the ABI doesn't change. I asked upstream some time ago. > >> # build shared libraries >> -shared >> >> # always enable large file support >> -largefile >> >> # disabling accessibility is not recommended by upstream, = as >> # it will break QStyle and may break other internal parts = of Qt >> -accessibility >> >> # disable all SQL drivers by default, override in qtsql >> -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sq= l-odbc >> -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-sql-tds >> >> # obsolete flag, does nothing >> #-qml-debug >> >> # use pkg-config to detect include and library paths >> -pkg-config >> >> # prefer system libraries (only common deps here) >> -system-zlib >> -system-pcre >> >> # don't specify -no-gif because there is no way to overrid= e it later >> #-no-gif >> >> # disable everything to prevent automagic deps (part 1) >> -no-mtdev >> -no-journald >> -no-libpng -no-libjpeg >> -no-freetype -no-harfbuzz >> -no-openssl >> -no-xinput2 -no-xcb-xlib >> >> # always enable glib event loop support >> -glib >> >> # disable everything to prevent automagic deps (part 2) >> -no-pulseaudio -no-alsa >> >> # disable gtkstyle because it adds qt4 include paths to th= e compiler >> # command line if x11-libs/cairo is built with USE=3Dqt4 (= bug 433826) >> -no-gtkstyle >> >> # exclude examples and tests from default build >> -nomake examples >> -nomake tests >> -no-compile-examples >> >> # disable rpath on non-prefix (bugs 380415 and 417169) >> $(use prefix || echo -no-rpath) >> >> # print verbose information about each configure test >> -verbose >> >> # doesn't actually matter since we override CXXFLAGS >> #-no-optimized-qmake >> >> # obsolete flag, does nothing >> #-nis >> >> # always enable iconv support >> -iconv >> >> # disable everything to prevent automagic deps (part 3) >> -no-cups -no-evdev -no-icu -no-fontconfig -no-dbus >> >> # don't strip >> -no-strip >> >> # precompiled headers are not that useful for us >> # and cause problems on hardened, so turn them off >> -no-pch >> >> # reduced relocations cause major breakage on at least arm= and ppc, so we >> # don't specify anything and let configure figure out if t= hey are supported, >> # see also https://bugreports.qt-project.org/browse/QTBUG-= 36129 >> #-reduce-relocations >> >> # let configure automatically detect if GNU gold is availa= ble >> #-use-gold-linker >> >> # disable all platform plugins by default, override in qtg= ui >> -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms >> >> # disable undocumented X11-related flags, override in qtgu= i >> # (not shown in ./configure -help output) >> -no-xkb -no-xrender >> >> # disable obsolete/unused X11-related flags >> # (not shown in ./configure -help output) >> -no-mitshm -no-xcursor -no-xfixes -no-xinerama -no-xinput >> -no-xrandr -no-xshape -no-xsync -no-xvideo >> >> # always enable session management support: it doesn't nee= d extra deps >> # at configure time and turning it off is dangerous, see b= ug 518262 >> -sm >> >> # typedef qreal to double (warning: changing this flag bre= aks the ABI) >> -qreal double >> >> # disable opengl and egl by default, override in qtgui and= qtopengl >> -no-opengl -no-egl >> >> # use upstream default >> #-no-system-proxies >> >> # do not build with -Werror >> -no-warnings-are-errors >> >> # module-specific options >> "${myconf[@]}" >> ) >> >> mkdir -p "${QT5_BUILD_DIR}" || die >> pushd "${QT5_BUILD_DIR}" >/dev/null || die >> >> einfo "Configuring with: ${conf[@]}" >> "${S}"/configure "${conf[@]}" || die "configure failed" >> >> popd >/dev/null || die >> } > > -- > Best regards, > Micha=C5=82 G=C3=B3rny