Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] gtk+-3.9999.ebuild help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Fri Apr 30, 2021 11:45 pm    Post subject: [solved] gtk+-3.9999.ebuild help Reply with quote

Im trying to make an ebuild for gtk2-9999, and im encountering alot of issues because of eclass options. Eclass options make it alot harder to make 9999 packages, in all sorts of different ways. Anyway, the source code will download, but it keeps it in the "gtk+-2.9999" directory instead of splitting it to the "gtk+-2.9999-abi_x86_64.amd64" and "gtk+-2.9999-abi_x86_32.x86" respectively.

Here is the ebuild I have so far.
Code:

# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
GNOME2_EAUTORECONF="yes"

inherit flag-o-matic multilib multilib-minimal readme.gentoo-r1 virtualx

DESCRIPTION="Gimp ToolKit +"
HOMEPAGE="https://www.gtk.org/"

if [[ ${PV} == 2.9999 ]]; then
        inherit git-r3
        EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/gtk.git"
        EGIT_BRANCH="gtk-2-24"
fi

LICENSE="LGPL-2+"
SLOT="2"
IUSE="aqua cups examples +introspection test vim-syntax xinerama"
REQUIRED_USE="
   xinerama? ( !aqua )
"

KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"

# Upstream wants us to do their job:
# https://bugzilla.gnome.org/show_bug.cgi?id=768663#c1
RESTRICT="test"

COMMON_DEPEND="
   >=dev-libs/atk-2.10.0[introspection?,${MULTILIB_USEDEP}]
   >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}]
   >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}]
   virtual/libintl[${MULTILIB_USEDEP}]
   >=x11-libs/cairo-1.12.14-r4:=[aqua?,svg,${MULTILIB_USEDEP}]
   >=x11-libs/gdk-pixbuf-2.30.7:2[introspection?,${MULTILIB_USEDEP}]
   >=x11-libs/pango-1.36.3[introspection?,${MULTILIB_USEDEP}]
   x11-misc/shared-mime-info

   cups? ( >=net-print/cups-1.7.1-r2:=[${MULTILIB_USEDEP}] )
   introspection? ( >=dev-libs/gobject-introspection-0.9.3:= )
   !aqua? (
      >=x11-libs/cairo-1.12.14-r4:=[aqua?,svg,X,${MULTILIB_USEDEP}]
      >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
      >=x11-libs/libXcomposite-0.4.4-r1[${MULTILIB_USEDEP}]
      >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
      >=x11-libs/libXdamage-1.1.4-r1[${MULTILIB_USEDEP}]
      >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
      >=x11-libs/libXfixes-5.0.1[${MULTILIB_USEDEP}]
      >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
      >=x11-libs/libXrandr-1.5[${MULTILIB_USEDEP}]
      >=x11-libs/libXrender-0.9.8[${MULTILIB_USEDEP}]
      xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
   )
"
DEPEND="${COMMON_DEPEND}
   !aqua? ( x11-base/xorg-proto )
   test? (
      media-fonts/font-cursor-misc
      media-fonts/font-misc-misc
      x11-themes/hicolor-icon-theme
   )
"

# gtk+-2.24.8 breaks Alt key handling in <=x11-libs/vte-0.28.2:0
# Add blocker against old gtk-builder-convert to be sure we maintain both
# in sync.
RDEPEND="${COMMON_DEPEND}
   >=dev-util/gtk-update-icon-cache-2
   >=x11-themes/adwaita-icon-theme-3.14
   x11-themes/gnome-themes-standard
   !<dev-util/gtk-builder-convert-${PV}
"
# librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
PDEPEND="
   gnome-base/librsvg[${MULTILIB_USEDEP}]
   x11-themes/gtk-engines-adwaita
   vim-syntax? ( app-vim/gtk-syntax )
"
# docbook-4.1.2 and xsl required for man pages
# docbook-4.3 required for gtk-doc
BDEPEND="
   app-text/docbook-xml-dtd:4.1.2
   app-text/docbook-xml-dtd:4.3
   app-text/docbook-xsl-stylesheets
   dev-libs/gobject-introspection-common
   dev-libs/libxslt
   dev-util/glib-utils
   >=dev-util/gtk-doc-am-1.20
   >=sys-devel/gettext-0.18.3
   virtual/pkgconfig
   examples? ( x11-libs/gdk-pixbuf )
"

DISABLE_AUTOFORMATTING="yes"
DOC_CONTENTS="To make the gtk2 file chooser use 'current directory' mode by default,
edit ~/.config/gtk-2.0/gtkfilechooser.ini to contain the following:
[Filechooser Settings]
StartupMode=cwd"

#MULTILIB_CHOST_TOOLS=(
#   /usr/bin/gtk-query-immodules-2.0$(get_exeext)
#)

PATCHES=(
   # Fix tests running when building out of sources, bug #510596, upstream bug #730319
   "${FILESDIR}"/${PN}-2.24.24-out-of-source.patch
   # Rely on split gtk-update-icon-cache package, bug #528810
   "${FILESDIR}"/${PN}-2.24.31-update-icon-cache.patch # requires eautoreconf
   # Upstream gtk-2-24 branch up to 2018-09-08 state, bug #650536 safety
#   "${WORKDIR}"/patches/ # requires eautoreconf
)

strip_builddir() {
   local rule=$1
   shift
   local directory=$1
   shift
#   sed -e "s/^\(${rule} =.*\)${directory}\(.*\)$/\1\2/" -i $@ \
#      || die "Could not strip director ${directory} from build."
}

set_gtk2_confdir() {
   # An arch specific config directory is used on multilib systems
   GTK2_CONFDIR="/etc/gtk-2.0/${CHOST}"
}

src_prepare() {
   # Various glib marshaller churn could break build against a different glib version, force regeneration
#   rm -v gdk/gdkmarshalers.{c,h} gtk/gtkmarshal.{c,h} gtk/gtkmarshalers.{c,h} \
#      perf/marshalers.{c,h} gtk/gtkaliasdef.c gtk/gtkalias.h || die

   # Stop trying to build unmaintained docs, bug #349754, upstream bug #623150
   strip_builddir SUBDIRS tutorial docs/Makefile.{am,in}
   strip_builddir SUBDIRS faq docs/Makefile.{am,in}

   # -O3 and company cause random crashes in applications, bug #133469
#   replace-flags -O3 -O2
#   strip-flags

   if ! use test ; then
      # don't waste time building tests
      strip_builddir SRC_SUBDIRS tests Makefile.{am,in}
      strip_builddir SUBDIRS tests gdk/Makefile.{am,in} gtk/Makefile.{am,in}
   else
      # Non-working test in gentoo's env
      sed 's:\(g_test_add_func ("/ui-tests/keys-events.*\):/*\1*/:g' \
         -i gtk/tests/testing.c || die "sed 1 failed"

      # Cannot work because glib is too clever to find real user's home
      # gentoo bug #285687, upstream bug #639832
      # XXX: /!\ Pay extra attention to second sed when bumping /!\
      sed '/TEST_PROGS.*recentmanager/d' -i gtk/tests/Makefile.am \
         || die "failed to disable recentmanager test (1)"
      sed '/^TEST_PROGS =/,+3 s/recentmanager//' -i gtk/tests/Makefile.in \
         || die "failed to disable recentmanager test (2)"
      sed 's:\({ "GtkFileChooserButton".*},\):/*\1*/:g' -i gtk/tests/object.c \
         || die "failed to disable recentmanager test (3)"

      # https://bugzilla.gnome.org/show_bug.cgi?id=617473
      sed -i -e 's:pltcheck.sh:$(NULL):g' \
         gtk/Makefile.am || die

      # UI tests require immodules already installed; bug #413185
      if ! has_version 'x11-libs/gtk+:2'; then
         ewarn "Disabling UI tests because this is the first install of"
         ewarn "gtk+:2 on this machine. Please re-run the tests after ${P}"
         ewarn "has been installed."
         sed '/g_test_add_func.*ui-tests/ d' \
            -i gtk/tests/testing.c || die "sed 2 failed"
      fi
   fi

   if ! use examples; then
      # don't waste time building demos
      strip_builddir SRC_SUBDIRS demos Makefile.{am,in}
   fi
       
        default
   gnome2_src_prepare
}

multilib_src_configure() {
   [[ ${ABI} == ppc64 ]] && append-flags -mminimal-toc

   ECONF_SOURCE=${S} \
   gnome2_src_configure \
      $(usex aqua --with-gdktarget=quartz --with-gdktarget=x11) \
      $(usex aqua "" --with-xinput) \
      $(use_enable cups cups auto) \
      $(multilib_native_use_enable introspection) \
      $(use_enable xinerama) \
      --disable-papi \
      --enable-man \
      --with-xml-catalog="${EPREFIX}"/etc/xml/catalog \
      CUPS_CONFIG="${EPREFIX}/usr/bin/${CHOST}-cups-config"

   # work-around gtk-doc out-of-source brokedness
#   if multilib_is_native_abi; then
#      local d
#      for d in gdk gtk libgail-util; do
#         ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
#      done
#   fi
}

multilib_src_test() {
   virtx emake check
}

multilib_src_install() {
   default
}

multilib_src_install_all() {
   # see bug #133241
   # Also set more default variables in sync with gtk3 and other distributions
   insinto /usr/share/gtk-2.0
   newins - gtkrc <<- 'EOF'
   gtk-fallback-icon-theme = "gnome"
   gtk-theme-name = "Adwaita"
   gtk-icon-theme-name = "Adwaita"
   gtk-cursor-theme-name = "Adwaita"
   EOF

   einstalldocs

   # dev-util/gtk-builder-convert split off into a separate package, #402905
#   rm "${ED}"/usr/bin/gtk-builder-convert || die
#   rm "${ED}"/usr/share/man/man1/gtk-builder-convert.* || die

   readme.gentoo_create_doc
}

pkg_preinst() {
#   gnome2_pkg_preinst

   multilib_pkg_preinst() {
      # Make immodules.cache belongs to gtk+ alone
#      local cache="/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache"

      if [[ -e "${EROOT}${cache}" ]]; then
         cp "${EROOT}${cache}" "${ED}${cache}" || die
      else
         touch "${ED}${cache}" || die
      fi
   }
   multilib_parallel_foreach_abi multilib_pkg_preinst
}

pkg_postinst() {
#   gnome2_pkg_postinst

#   multilib_pkg_postinst() {
#      gnome2_query_immodules_gtk2 \
#         || die "Update immodules cache failed (for ${ABI})"
#   }
   multilib_parallel_foreach_abi multilib_pkg_postinst

   set_gtk2_confdir

   if [ -e "${EROOT}/etc/gtk-2.0/gtk.immodules" ]; then
      elog "File /etc/gtk-2.0/gtk.immodules has been moved to \$CHOST"
      elog "aware location. Removing deprecated file."
      rm -f "${EROOT}/etc/gtk-2.0/gtk.immodules"
   fi

   if [ -e "${EROOT}${GTK2_CONFDIR}/gtk.immodules" ]; then
      elog "File /etc/gtk-2.0/gtk.immodules has been moved to"
      elog "${EROOT}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache"
      elog "Removing deprecated file."
      rm -f "${EROOT}${GTK2_CONFDIR}/gtk.immodules"
   fi

   # pixbufs are now handled by x11-libs/gdk-pixbuf
   if [ -e "${EROOT}${GTK2_CONFDIR}/gdk-pixbuf.loaders" ]; then
      elog "File ${EROOT}${GTK2_CONFDIR}/gdk-pixbuf.loaders is now handled by x11-libs/gdk-pixbuf"
      elog "Removing deprecated file."
      rm -f "${EROOT}${GTK2_CONFDIR}/gdk-pixbuf.loaders"
   fi

   # two checks needed since we dropped multilib conditional
   if [ -e "${EROOT}/etc/gtk-2.0/gdk-pixbuf.loaders" ]; then
      elog "File ${EROOT}/etc/gtk-2.0/gdk-pixbuf.loaders is now handled by x11-libs/gdk-pixbuf"
      elog "Removing deprecated file."
      rm -f "${EROOT}/etc/gtk-2.0/gdk-pixbuf.loaders"
   fi

   if [ -e "${EROOT}"/usr/lib/gtk-2.0/2.[^1]* ]; then
      elog "You need to rebuild ebuilds that installed into" "${EROOT}"/usr/lib/gtk-2.0/2.[^1]*
      elog "to do that you can use qfile from portage-utils:"
      elog "emerge -va1 \$(qfile -qC ${EPREFIX}/usr/lib/gtk-2.0/2.[^1]*)"
   fi

   if ! has_version "app-text/evince"; then
      elog "Please install app-text/evince for print preview functionality."
      elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
      elog "add it to your gtkrc."
   fi

   readme.gentoo_print_elog
}

pkg_postrm() {
#   gnome2_pkg_postrm

   if [[ -z ${REPLACED_BY_VERSION} ]]; then
      multilib_pkg_postrm() {
         rm -f "${EROOT}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache"
      }
      multilib_foreach_abi multilib_pkg_postrm
   fi
}


Here is the build log.
Code:

$ doas emerge -av --autounmask =x11-libs/gtk+-2.9999

These are the packages that would be merged, in order:

Calculating dependencies 
 * IMPORTANT: 8 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

... done!
[ebuild   R    ] x11-libs/gtk+-2.9999:2::localrepo  USE="introspection (-aqua) -cups -examples -test -vim-syntax -xinerama" ABI_X86="32 (64) (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]
>>> Verifying ebuild manifests

>>> Emerging (1 of 1) x11-libs/gtk+-2.9999::localrepo
>>> Unpacking source...
 * Repository id: GNOME_gtk.git
 * To override fetched repository properties, use:
 *   EGIT_OVERRIDE_REPO_GNOME_GTK
 *   EGIT_OVERRIDE_BRANCH_GNOME_GTK
 *   EGIT_OVERRIDE_COMMIT_GNOME_GTK
 *   EGIT_OVERRIDE_COMMIT_DATE_GNOME_GTK
 *
 * Fetching https://gitlab.gnome.org/GNOME/gtk.git ...
git fetch https://gitlab.gnome.org/GNOME/gtk.git +refs/heads/gtk-2-24:refs/heads/gtk-2-24
git symbolic-ref refs/git-r3/x11-libs/gtk+/2/__main__ refs/heads/gtk-2-24
 * Checking out https://gitlab.gnome.org/GNOME/gtk.git to /var/tmp/portage/x11-libs/gtk+-2.9999/work/gtk+-2.9999 ...
git checkout --quiet gtk-2-24
GIT update -->
   repository:               https://gitlab.gnome.org/GNOME/gtk.git
   at the commit:            68631945733158f164427db84f01301d7e875763
>>> Source unpacked in /var/tmp/portage/x11-libs/gtk+-2.9999/work
>>> Preparing source in /var/tmp/portage/x11-libs/gtk+-2.9999/work/gtk+-2.9999 ...
 * Applying gtk+-2.24.24-out-of-source.patch ...
 [ ok ]
 * Applying gtk+-2.24.31-update-icon-cache.patch ...
 [ ok ]
/var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 2949: gnome2_src_prepare: command not found
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/x11-libs/gtk+-2.9999/work/gtk+-2.9999 ...
 * abi_x86_32.x86: running multilib-minimal_abi_src_configure
/var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 2631: gnome2_src_configure: command not found
 * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
/var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 2631: gnome2_src_configure: command not found
>>> Source configured.
>>> Compiling source in /var/tmp/portage/x11-libs/gtk+-2.9999/work/gtk+-2.9999 ...
 * abi_x86_32.x86: running multilib-minimal_abi_src_compile
 * abi_x86_64.amd64: running multilib-minimal_abi_src_compile
>>> Source compiled.
 * Skipping make test/check due to ebuild restriction.
>>> Test phase [disabled because of RESTRICT=test]: x11-libs/gtk+-2.9999

>>> Install x11-libs/gtk+-2.9999 into /var/tmp/portage/x11-libs/gtk+-2.9999/image
 * abi_x86_32.x86: running multilib-minimal_abi_src_install
 * abi_x86_64.amd64: running multilib-minimal_abi_src_install
>>> Completed installing x11-libs/gtk+-2.9999 into /var/tmp/portage/x11-libs/gtk+-2.9999/image

 * Final size of build directory: 90724 KiB (88.5 MiB)
 * Final size of installed tree:    348 KiB

 * QA Notice: command not found:
 *
 *    /var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 2949: gnome2_src_prepare: command not found
 *    /var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 2631: gnome2_src_configure: command not found
 *    /var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 2631: gnome2_src_configure: command not found

>>> Installing (1 of 1) x11-libs/gtk+-2.9999::localrepo
 * checking 7 files for package collisions
>>> Merging x11-libs/gtk+-2.9999 to /
 * abi_x86_32.x86: running multilib_pkg_preinst
 * abi_x86_64.amd64: running multilib_pkg_preinst
--- /usr/
--- /usr/share/
--- /usr/share/gtk-2.0/
>>> /usr/share/gtk-2.0/gtkrc
--- /usr/share/doc/
--- /usr/share/doc/gtk+-2.9999/
>>> /usr/share/doc/gtk+-2.9999/README.win32.bz2
>>> /usr/share/doc/gtk+-2.9999/README.commits.bz2
>>> /usr/share/doc/gtk+-2.9999/README.in.bz2
>>> /usr/share/doc/gtk+-2.9999/AUTHORS.bz2
>>> /usr/share/doc/gtk+-2.9999/NEWS.bz2
>>> /usr/share/doc/gtk+-2.9999/README.gentoo.bz2
>>> needed    sym /usr/lib64/libgdk-x11-2.0.so.0
>>> needed    obj /usr/lib64/libgdk-x11-2.0.so.0.2400.32
>>> needed    sym /usr/lib64/libgtk-x11-2.0.so.0
>>> needed    obj /usr/lib64/libgtk-x11-2.0.so.0.2400.32
>>> Safely unmerging already-installed instance...
No package files given... Grabbing a set.
--- replaced obj /usr/share/gtk-2.0/gtkrc
--- replaced dir /usr/share/gtk-2.0
--- replaced obj /usr/share/doc/gtk+-2.9999/README.win32.bz2
--- replaced obj /usr/share/doc/gtk+-2.9999/README.in.bz2
--- replaced obj /usr/share/doc/gtk+-2.9999/README.gentoo.bz2
--- replaced obj /usr/share/doc/gtk+-2.9999/README.commits.bz2
--- replaced obj /usr/share/doc/gtk+-2.9999/NEWS.bz2
--- replaced obj /usr/share/doc/gtk+-2.9999/AUTHORS.bz2
--- replaced dir /usr/share/doc/gtk+-2.9999
--- replaced dir /usr/share/doc
--- replaced dir /usr/share
--- replaced obj /usr/lib64/libgtk-x11-2.0.so.0.2400.32
--- replaced sym /usr/lib64/libgtk-x11-2.0.so.0
--- replaced obj /usr/lib64/libgdk-x11-2.0.so.0.2400.32
--- replaced sym /usr/lib64/libgdk-x11-2.0.so.0
--- replaced dir /usr/lib64
--- replaced dir /usr
>>> Regenerating /etc/ld.so.cache...
>>> Original instance of package unmerged safely.
 * abi_x86_32.x86: running multilib_pkg_postinst
/var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 763: multilib_pkg_postinst: command not found
 * abi_x86_64.amd64: running multilib_pkg_postinst
/var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 763: multilib_pkg_postinst: command not found
 * Please install app-text/evince for print preview functionality.
 * Alternatively, check "gtk-print-preview-command" documentation and
 * add it to your gtkrc.
>>> x11-libs/gtk+-2.9999 merged.
>>> Regenerating /etc/ld.so.cache...
 * Messages for package x11-libs/gtk+-2.9999:
 * Please install app-text/evince for print preview functionality.
 * Alternatively, check "gtk-print-preview-command" documentation and
 * add it to your gtkrc.


>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

!!! existing preserved libs:
>>> package: x11-libs/gtk+-2.9999
 *  - /usr/lib64/libgdk-x11-2.0.so.0
 *  - /usr/lib64/libgdk-x11-2.0.so.0.2400.32
 *      used by /usr/lib64/gtk-2.0/2.10.0/engines/libadwaita.so (x11-themes/gtk-engines-adwaita-3.28)
 *  - /usr/lib64/libgtk-x11-2.0.so.0
 *  - /usr/lib64/libgtk-x11-2.0.so.0.2400.32
 *      used by /usr/lib64/gtk-2.0/2.10.0/engines/libadwaita.so (x11-themes/gtk-engines-adwaita-3.28)
Use emerge @preserved-rebuild to rebuild packages using these libraries

 * IMPORTANT: 8 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


Last edited by shoober420 on Fri May 07, 2021 11:58 am; edited 2 times in total
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2716

PostPosted: Fri Apr 30, 2021 11:51 pm    Post subject: Reply with quote

What's the point of a live ebuild for a dead project? Last commit is saying "final release for this branch", and end of support was already announced.
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Sat May 01, 2021 12:00 am    Post subject: Reply with quote

Its just so it pulls from git. The main package is out of date. I just made a bug report for it, but this is just a warm up for gtk+-3.9999.ebuild.

I may be able to do gtk+-3.9999 if i know how to do gtk+-2.9999.ebuild.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21601

PostPosted: Sat May 01, 2021 12:56 am    Post subject: Re: gtk+-2.9999.ebuild help Reply with quote

shoober420 wrote:
Anyway, the source code will download, but it keeps it in the "gtk+-2.9999" directory instead of splitting it to the "gtk+-2.9999-abi_x86_64.amd64" and "gtk+-2.9999-abi_x86_32.x86" respectively.
This is expected and proper. Why do you want two source directories with the same sources?
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Sat May 01, 2021 1:15 am    Post subject: Reply with quote

I dont know how else it can build both sources. I literally, just started tweaking ebuilds. I need someone to just show me an example of how to build this so i can make the gtk+-3.9999.

Can someone please just show me what to do and what to put in the multilib_src_install section?
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Sat May 01, 2021 3:21 am    Post subject: Reply with quote

EDIT:

We are going to say this is for gtk+-3.9999 actually, since it also uses gnome2 eclass THINGS, which make it 10x for me to try to do what im doing. I've been editing this ebuild and encountering the same exact issues, because of these eclasses, so we are not going to mention gtk2 anymore at all.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21601

PostPosted: Sat May 01, 2021 3:38 am    Post subject: Reply with quote

For quite some years, it has been standard that a build system should support out-of-source-tree builds. The method for invoking it varies, but the practical effect is that you have one source tree and N object trees. This can be used in the multilib case to build the 32-bit and 64-bit objects into separate trees, drawing from the same sources, without copying.
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Sat May 01, 2021 4:30 am    Post subject: Reply with quote

Yes, im sure gentoo has some one liner that does all that magic im looking for, with some eclass wizardry. At least i would hope so. I'm just asking what command that would be. This ebuild is a pretty difficult one...
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21601

PostPosted: Sat May 01, 2021 3:48 pm    Post subject: Reply with quote

As I said, the method depends on the upstream build system, and varies by build system. You should look at their documentation for how to do an "out-of-source" build, or perhaps "objects separate from sources." If you're determined to copy the sources instead of working with the upstream build system, then, to quote the eclass:
multilib-minimal.eclass:
# If you want to use in-source builds, then you must run
# multilib_copy_sources at the end of src_prepare!
# Also make sure to set correct variables such as
# ECONF_SOURCE=${S}
You will find that function in multilib-build.eclass.
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Sun May 02, 2021 1:42 am    Post subject: Reply with quote

I really appreciate all your help, but eclasses make writing a 9999 ebuild a hair loosing task. I honestly dont use gtk3 apps anyway, so if anyone else wants to pick up on this be my guest. Its really not worth it. I keep running into errors and i dont want to work around eclasses anymore. the gnome2 eclass is going to drive m crazy.
Back to top
View user's profile Send private message
redfish
n00b
n00b


Joined: 27 Apr 2021
Posts: 22

PostPosted: Sun May 02, 2021 2:24 am    Post subject: Reply with quote

You have to inherit the gnome2 eclass if you are going to call functions from it:

Code:

/var/tmp/portage/x11-libs/gtk+-2.9999/temp/environment: line 2949: gnome2_src_prepare: command not found


Add, at the top to your inherit line:

Code:

inherit gnome2


You have one more such command not found, inherit that respective eclass too.
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Sun May 02, 2021 2:35 pm    Post subject: Reply with quote

Yes, but once i use the gnome2 eclass, it auto downloads the source from another place, overidding my EGIT settings. I've had to remove it from other core packages like dbus, but working around it for gtk is too daunting. Im not a programmer, and I dont know bash shell code well enough to figure this one out. I did make a whole lot more other ebuilds though (https://github.com/shoober420/shoober420-overlay). I also dont even want to learn about eclasses because I already hate them and how they work.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21601

PostPosted: Sun May 02, 2021 4:19 pm    Post subject: Reply with quote

eclasses are just libraries of bash functionality, so that you don't need to redundantly copy all that code into every ebuild file. Your problem is that you are trying to inherit one or more eclasses that are not designed to be used the way you are trying to use them. This could be because you're using them incorrectly, or because they are not meant to support your use case at all. It looks like eclass/gnome.org.eclass does indeed unconditionally set SRC_URI to a mirror. I don't see a way to avoid that being pulled in, so you may need to override that variable. I recall that inherit has some special rules that some variables are concatenated, rather than overwritten. Looking at the implementation of inherit, I don't think that rule applies to SRC_URI, so you might be able to just reset SRC_URI after the inherit call.
Back to top
View user's profile Send private message
redfish
n00b
n00b


Joined: 27 Apr 2021
Posts: 22

PostPosted: Sun May 02, 2021 5:34 pm    Post subject: Reply with quote

Create an overlay repo named myoverlay, copy gentoo/eclass/gnome2.eclass (or whichever needs to be changed) into myoverlay/eclass/gnome2.eclass, edit the code in the copy to do what you want. Place your .ebuild into myoverlay/category/foo.ebuild so that when it inherits, it will pickup your overriden eclass from myoverlay/ instead of from gentoo/.

This is step one, to get full control over the build process (which you now lack and is frustrating you). Later once you know what exactly needs to be changed, you might figure out a way to make the existing eclass more configurable and re-use it or an entirely other approach might become evident.
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Thu May 06, 2021 9:33 pm    Post subject: Reply with quote

I decided to come to this, and have stumbled upon an idea. I've edited the "gnome.org.eclass" file with the following changes starting at line 57.

https://gist.github.com/shoober420/d8da2caae020c35c25890c81f0bf50e0

This is similar to a 9999 ebuild if/else statement. Can this work in an eclass file? Is there a way to have the eclass ignore SRC_URI if it detects 9999 like in the bash statement there?
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Fri May 07, 2021 12:00 pm    Post subject: Reply with quote

This actually works. I’ve tested with three packages, libgudev-9999, glib-9999, and librsvg-9999. I cannot get it to see gtk3 still though, probably because of its different package versioning style.
Back to top
View user's profile Send private message
redfish
n00b
n00b


Joined: 27 Apr 2021
Posts: 22

PostPosted: Sun May 16, 2021 12:49 am    Post subject: Reply with quote

shoober420 wrote:

https://gist.github.com/shoober420/d8da2caae020c35c25890c81f0bf50e0


Dead link.
Back to top
View user's profile Send private message
shoober420
Apprentice
Apprentice


Joined: 22 May 2017
Posts: 223

PostPosted: Wed May 19, 2021 8:42 pm    Post subject: Reply with quote

Hey sorry about that. Im currently organizing my gists and repos.

https://github.com/shoober420/shoober420-overlay/blob/main/eclass/gnome.org.eclass
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum