Home | News | Download | Packages | Forum | Wiki | Github

My first package


#1

Hello everyone,

trying to install yandex browser I looked into google-chrome template to get some tips.

As in such working template I created a do_extract and a do_install stage, but they are not enough.

Indeed my build stops at do_configure stage (and at do_build as well), while il looks like google-chrome silently skip them,

I worked around putting empty do_configure and do_build into my template, but I think it’s not the more stylish way.

Where am I wrong?
or…
How google-chrome build avoids these stages?

My best regards


#2

Hello @trebestie,

For Google Chrome and Yandex Browser, the do_extract phase is needed because the source distfiles are .deb packages, not regular .tar.gz / .tar.xz tarballs, so we must tell Xbps-src how to extract the .deb package with “ar x ...

The do_configure phase is only needed if there’s a configure script… This is obviously not the case for Yandex and Chrome.

The same for the do_build phase, it’s only needed if you have something to build…

Chrome and Yandex are not source code, you compile nothing, you just extract the data from the .deb package and you put it in a new xbps package.


I see there’s a Yandex package in AUR, did you look at the PKGBUILD ?

Intrigued by your question, I tried to create a template:

# Template file for 'yandex-browser-beta'
pkgname=yandex-browser-beta
version=17.4.1.906
revision=1
only_for_archs="x86_64"
maintainer="local <root@localhost>"
short_desc="The web browser from Yandex"
homepage="https://browser.yandex.com/desktop/main"
license="yandex-browser"
distfiles="https://repo.yandex.ru/yandex-browser/deb/pool/main/y/${pkgname}/${pkgname}_${version}-1_amd64.deb"
checksum=79a7edd352647220cc2bc92645809a3e3a46b6b716596e3dceaa3bf76e293aec
nostrip=yes

do_extract() {
ar x ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${pkgname}_${version}-1_amd64.deb
tar -xf data.tar.xz
}

do_install() {
# Install Yandex in /opt/yandex/browser-beta
vmkdir opt/yandex
vcopy opt/yandex/browser-beta opt/yandex

# Remove the Debian/Ubuntu crontab
rm -Rf ${DESTDIR}/opt/yandex/browser-beta/cron
}

Not sure if it’s 100% correct however… :neutral_face:
Maybe:
repository=nonfree
restricted=yes
Are necessary too, like Chrome ?


#3

Hi cr6,
thank you for the reply.
I looked at AUR template to get a list of dependencies, but put them in or not it makes no difference.

Unfortunately your template, which is very similar to mine, does not change the game.


=> yandex-browser-beta-17.4.1.906_1: verifying checksum for distfile 'yandex-browser-beta_17.4.1.906-1_amd64.deb'... OK.
=> yandex-browser-beta-17.4.1.906_1: running do_extract ...
/host/sources/yandex-browser-beta-17.4.1.906
yandex-browser-beta_17.4.1.906-1_amd64.deb
/builddir/yandex-browser-beta-17.4.1.906
=> yandex-browser-beta-17.4.1.906_1: running post-extract hook: 00-patches ...
=> yandex-browser-beta-17.4.1.906_1: running pre-configure hook: 00-gnu-configure-asneeded ...
=> yandex-browser-beta-17.4.1.906_1: running pre-configure hook: 01-override-config ...
=> yandex-browser-beta-17.4.1.906_1: running pre-configure hook: 02-script-wrapper ...
=> yandex-browser-beta-17.4.1.906_1: running do_configure ...
/void-packages/common/build-style/gnu-configure.sh: line 7: ./configure: No such file or directory
=> ERROR: yandex-browser-beta-17.4.1.906_1: failed to run do_configure() at line 7.

I have to study more

My best regards


#4

I forgot to tell you, you should not use build_style=gnu-configure , this is not necessary, there’s nothing to configure…
Look at the Manual.

No, with my template it’s not the same game:

$ ./xbps-src pkg yandex-browser-beta
=> yandex-browser-beta-17.4.1.906_1: removing autodeps, please wait...
=> yandex-browser-beta-17.4.1.906_1: building ...
=> yandex-browser-beta-17.4.1.906_1: running do-fetch hook: 00-distfiles ...
=> yandex-browser-beta-17.4.1.906_1: fetching distfile 'yandex-browser-beta_17.4.1.906-1_amd64.deb'...
=> yandex-browser-beta-17.4.1.906_1: verifying checksum for distfile 'yandex-browser-beta_17.4.1.906-1_amd64.deb'... OK.
=> yandex-browser-beta-17.4.1.906_1: running do_extract ...
=> yandex-browser-beta-17.4.1.906_1: running post-extract hook: 00-patches ...
=> yandex-browser-beta-17.4.1.906_1: running pre-configure hook: 00-gnu-configure-asneeded ...
=> yandex-browser-beta-17.4.1.906_1: running pre-configure hook: 01-override-config ...
=> yandex-browser-beta-17.4.1.906_1: running pre-configure hook: 02-script-wrapper ...
=> yandex-browser-beta-17.4.1.906_1: running pre-build hook: 02-script-wrapper ...
=> yandex-browser-beta-17.4.1.906_1: skipping check (XBPS_CHECK_PKGS is disabled) ...
=> yandex-browser-beta-17.4.1.906_1: running pre-install hook: 00-lib32 ...
=> yandex-browser-beta-17.4.1.906_1: running pre-install hook: 02-script-wrapper ...
=> yandex-browser-beta-17.4.1.906_1: running do_install ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 00-compress-info-files ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 00-uncompress-manpages ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 01-remove-localized-manpages ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 01-remove-misc ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 02-remove-libtool-archives ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 02-remove-perl-files ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 02-remove-python-bytecode-files ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 03-remove-empty-dirs ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 04-create-xbps-metadata-scripts ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 05-generate-gitrevs ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 06-strip-and-debug-pkgs ...
=> yandex-browser-beta-17.4.1.906_1: running post-install hook: 98-lib32 ...
=> yandex-browser-beta-17.4.1.906_1: running pre-pkg hook: 03-rewrite-python-shebang ...
=> yandex-browser-beta-17.4.1.906_1: running pre-pkg hook: 04-generate-runtime-deps ...
   SONAME: libpthread.so.0 <-> glibc>=2.25_1
   SONAME: libdl.so.2 <-> glibc>=2.25_1
   SONAME: libstdc++.so.6 <-> libstdc++>=4.4.0_1
   SONAME: libm.so.6 <-> glibc>=2.25_1
   SONAME: libc.so.6 <-> glibc>=2.25_1
   SONAME: ld-linux-x86-64.so.2 <-> glibc>=2.25_1
   SONAME: librt.so.1 <-> glibc>=2.25_1
   SONAME: libglib-2.0.so.0 <-> glib>=2.18.0_1
   SONAME: libnssutil3.so <-> nss>=3.12.4_1
   SONAME: libfontconfig.so.1 <-> fontconfig>=2.6.0_1
   SONAME: libfreetype.so.6 <-> freetype>=2.3.9_1
   SONAME: libgcc_s.so.1 <-> libgcc>=4.4.0_1
   SONAME: libffmpeg.so <-> yandex-browser-beta (ignored)
   SONAME: libpangocairo-1.0.so.0 <-> pango>=1.24.0_1
   SONAME: libpango-1.0.so.0 <-> pango>=1.24.0_1
   SONAME: libcairo.so.2 <-> cairo>=1.8.6_1
   SONAME: libgobject-2.0.so.0 <-> glib>=2.18.0_1
   SONAME: libX11.so.6 <-> libX11>=1.2_1
   SONAME: libX11-xcb.so.1 <-> libX11>=1.2_1
   SONAME: libxcb.so.1 <-> libxcb>=1.2_1
   SONAME: libXcomposite.so.1 <-> libXcomposite>=0.4.0_1
   SONAME: libXcursor.so.1 <-> libXcursor>=1.1.9_1
   SONAME: libXdamage.so.1 <-> libXdamage>=1.1.1_1
   SONAME: libXext.so.6 <-> libXext>=1.0.5_1
   SONAME: libXfixes.so.3 <-> libXfixes>=4.0.3_1
   SONAME: libXi.so.6 <-> libXi>=1.2.1_1
   SONAME: libXrender.so.1 <-> libXrender>=0.9.4_1
   SONAME: libXtst.so.6 <-> libXtst>=1.0.3_1
   SONAME: libgmodule-2.0.so.0 <-> glib>=2.18.0_1
   SONAME: libnss3.so <-> nss>=3.12.4_1
   SONAME: libsmime3.so <-> nss>=3.12.4_1
   SONAME: libnspr4.so <-> nspr>=4.8_1
   SONAME: libcups.so.2 <-> libcups>=1.5.3_1
   SONAME: libexpat.so.1 <-> expat>=2.0.0_1
   SONAME: libdbus-1.so.3 <-> dbus-libs>=1.2.10_1
   SONAME: libgconf-2.so.4 <-> GConf>=2.32.0_1
   SONAME: libgio-2.0.so.0 <-> glib>=2.18.0_1
   SONAME: libXss.so.1 <-> libXScrnSaver>=1.1.3_1
   SONAME: libXrandr.so.2 <-> libXrandr>=1.3.0_1
   SONAME: libasound.so.2 <-> alsa-lib>=1.0.20_1
   SONAME: libatk-1.0.so.0 <-> atk>=1.26.0_1
   SONAME: libxkbfile.so.1 <-> libxkbfile>=1.0.5_1
   SONAME: libgtk-x11-2.0.so.0 <-> gtk+>=2.16.0_1
   SONAME: libgdk-x11-2.0.so.0 <-> gtk+>=2.16.0_1
   SONAME: libgdk_pixbuf-2.0.so.0 <-> gdk-pixbuf>=2.22.0_1
=> yandex-browser-beta-17.4.1.906_1: running pre-pkg hook: 05-prepare-32bit ...
=> yandex-browser-beta-17.4.1.906_1: running pre-pkg hook: 06-shlib-provides ...
=> yandex-browser-beta-17.4.1.906_1: running pre-pkg hook: 90-set-timestamps ...
=> yandex-browser-beta-17.4.1.906_1: setting mtimes to Tue Jun 20 00:58:00 CEST 2017
=> yandex-browser-beta-17.4.1.906_1: running pre-pkg hook: 99-pkglint ...
=> yandex-browser-beta-17.4.1.906_1: running do-pkg hook: 00-gen-pkg ...
=> Creating yandex-browser-beta-17.4.1.906_1.x86_64.xbps for repository /host/binpkgs ...
=> yandex-browser-beta-17.4.1.906_1: running post-pkg hook: 00-register-pkg ...
=> Registering yandex-browser-beta-17.4.1.906_1.x86_64.xbps into /host/binpkgs ...
index: added `yandex-browser-beta-17.4.1.906_1' (x86_64).
index: 3 packages registered.
=> yandex-browser-beta-17.4.1.906_1: removing autodeps, please wait...
=> yandex-browser-beta-17.4.1.906_1: cleaning build directory...
=> yandex-browser-beta: removing files from destdir...

#5

I deleted the whole void-packages directory, then started again and your template worked as expected.
So I reread your messages and found the issue

I had that line in my template.
Once deleted it worked.

Many thanks