You are not logged in.

#1 2015-06-08 19:28:07

Frontier
Member
From: Chios, Greece
Registered: 2012-11-14
Posts: 11
Website

[SOLVED] Source Architectures Arrays not recognized by makepkg

Hello,

I am in the process of updating my PKGBUILD's in order to migrate them to AUR4.
As suggested here, one should rework a PKGBUILD in order to not use bash conditionals regarding source architecture selection.

On my system (x86_64 architecture) - after reworking my package PKGBUILD script - on issuing 'makepkg --source' the system does not take into account neither the source_x86_64 or md5sums_x86_64 arrays; the i686 source/md5sums arrays are always selected:

# Maintainer: Frontier (frontier314 at gmail dot com)

pkgname=jaspersoftstudio
_pkgname=JaspersoftStudio
_binname="Jaspersoft Studio"
pkgver=6.1.0
pkgrel=1
pkgdesc="Eclipse based Jasper Reports generator"
arch=('i686' 'x86_64')
url="http://community.jaspersoft.com/project/jaspersoft-studio"
license=('Eclipse')
depends=('java-runtime' 'gtk2')
source_x86_64=("http://sourceforge.net/projects/jasperstudio/files/JaspersoftStudio-${pkgver}/TIBCOJaspersoftStudio-${pkgver}.final-linux-x86_64.tgz")
source=("http://sourceforge.net/projects/jasperstudio/files/JaspersoftStudio-${pkgver}/TIBCOJaspersoftStudio-${pkgver}.final-linux-x86.tgz")
md5sums_x86_64=('01e1da5e396a07b82dbc0cd20be437de')
md5sums=('2e6710b79c96f2f21880640fe8176048')

package() {
install -d -m 0755 ${pkgdir}/opt/${pkgname}
cp -a ${srcdir}/TIBCOJaspersoftStudio-${pkgver}.final/* ${pkgdir}/opt/${pkgname}
install -d -m 0755 ${pkgdir}/usr/bin
ln -sf "/opt/${_pkgname}/${_binname}" ${pkgdir}/usr/bin/${_pkgname}
ln -sf "/opt/${_pkgname}/${_binname}" ${pkgdir}/usr/bin/${pkgname}

cat > ${_pkgname}.desktop << EoF
[Desktop Entry]
Version=${pkgver}
Encoding=UTF-8
Name=Jaspersoft Studio
Comment=${pkgdesc}
Exec=GTK2_RC_FILES=/usr/share/themes/Raleigh/gtk-2.0/gtkrc /opt/${_pkgname}/${_binname}
Icon=/opt/${_pkgname}/icon.xpm
Terminal=false
Type=Application
Categories=Java;Development;
EoF

install -D -m 0644 ${srcdir}/${_pkgname}.desktop ${pkgdir}/usr/share/applications/${_pkgname}.desktop
}

Both makepkg.conf and pacman.conf have the correct architecture setting (snippets):

makepkg.conf

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-unknown-linux-gnu"

pacman.conf

Architecture = x86_64

Can someone explain to me what I am doing wrong here?
Many thanks in advance.

Last edited by Frontier (2015-06-09 05:30:07)

Offline

#2 2015-06-08 19:39:10

esa
Member
Registered: 2011-12-29
Posts: 143
Website

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

Just stating that i thought to see a typo with the %{*_*pkgname}..
Can one delete one owns posts?

Last edited by esa (2015-06-08 20:03:20)


Author of: TUI (Text User Interface for scripts), VHS (Video Handler Script, using ffmpeg) and YASSI (Yet Another Simple Script Installer)

Offline

#3 2015-06-08 19:55:32

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

You're passing --source, so makepkg is not going to build a package for your architecture and it won't include any downloadable sources in the tarball.

And shouldn't that be {source,md5sums}_i686 instead of plain {source,md5sums}?

Last edited by Raynman (2015-06-08 19:56:12)

Offline

#4 2015-06-08 19:59:03

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

esa wrote:

Can one delete one owns posts?

The polite method is to use [᠎s] & [᠎/s] to strike out the text and perhaps add an "EDIT" comment to explain:

nonsense I wish to retract

https://bbs.archlinux.org/help.php#bbcode

(Sorry OP!)

Offline

#5 2015-06-08 20:04:32

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,846
Website

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

esa wrote:

Can one delete one owns posts?

No, and please don't blank your posts, we consider it rude. If you screwed up and posted in the wrong topic somehow, you can use the report function to let a mod know.

Frontier, I think you posted the wrong link, and it's this one that you're thinking of: https://bbs.archlinux.org/viewtopic.php?id=198390

The man page isn't very clear, but "sources=" is for architecture-independent sources. These are downloaded as well as "sources_$ARCH=", so you're probably downloading both the 32- and 64-bit sources whe nyou run on an x86_64 system. You should be using sources_i686 for the 32-bit sources, and sources_x86_64 for the 64-bit sources.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#6 2015-06-09 05:21:51

Frontier
Member
From: Chios, Greece
Registered: 2012-11-14
Posts: 11
Website

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

Raynman wrote:

You're passing --source, so makepkg is not going to build a package for your architecture and it won't include any downloadable sources in the tarball.

And shouldn't that be {source,md5sums}_i686 instead of plain {source,md5sums}?

I've also tried (source,md5sums)_i686 and same thing happens.

Offline

#7 2015-06-09 05:29:51

Frontier
Member
From: Chios, Greece
Registered: 2012-11-14
Posts: 11
Website

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

WorMzy wrote:

Frontier, I think you posted the wrong link, and it's this one that you're thinking of: https://bbs.archlinux.org/viewtopic.php?id=198390

You are right, I've c&p the wrong link.
I've followed your suggestion about updating PKGBUILD to use architecture-specific arrays as I was using bash conditionals.

The man page isn't very clear, but "sources=" is for architecture-independent sources. These are downloaded as well as "sources_$ARCH=", so you're probably downloading both the 32- and 64-bit sources whe nyou run on an x86_64 system. You should be using sources_i686 for the 32-bit sources, and sources_x86_64 for the 64-bit sources.

Noted, PKGBUILD updated, thank you.

Speaking of the man page, one thing to notice is that this suggestion to use namcap to test the sanity of a package now produces warnings when using architecture-specific source arrays instead of bash conditionals.

Marked topic as "Solved"

Offline

#8 2015-06-09 05:33:27

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

The PKGBUILD posted is wrong, it will use both x86.tgz and x86_64.tgz files. I you tried something else, post it.

Now, when you say

on issuing 'makepkg --source' the system does not take into account neither the source_x86_64 or md5sums_x86_64 arrays

What exactly do you mean? Where are you looking to see if it's taken into account?

Offline

#9 2015-06-09 06:00:42

Frontier
Member
From: Chios, Greece
Registered: 2012-11-14
Posts: 11
Website

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

Scimmia wrote:

The PKGBUILD posted is wrong, it will use both x86.tgz and x86_64.tgz files. I you tried something else, post it.

Nothing more than Raynman and WorMzy suggested; using architecture-specific source arrays.
The updated PKGBUILD:

# Maintainer: Frontier (frontier314 at gmail dot com)

pkgname=jaspersoftstudio
_pkgname=JaspersoftStudio
_binname="Jaspersoft Studio"
pkgver=6.1.0
pkgrel=1
pkgdesc="Eclipse based Jasper Reports generator"
arch=('i686' 'x86_64')
url="http://community.jaspersoft.com/project/jaspersoft-studio"
license=('Eclipse')
depends=('java-runtime' 'gtk2')
source_x86_64=("http://sourceforge.net/projects/jasperstudio/files/JaspersoftStudio-${pkgver}/TIBCOJaspersoftStudio-${pkgver}.final-linux-x86_64.tgz")
source_i686=("http://sourceforge.net/projects/jasperstudio/files/JaspersoftStudio-${pkgver}/TIBCOJaspersoftStudio-${pkgver}.final-linux-x86.tgz")
md5sums_x86_64=('01e1da5e396a07b82dbc0cd20be437de')
md5sums_i686=('2e6710b79c96f2f21880640fe8176048')

package() {
install -d -m 0755 ${pkgdir}/opt/${pkgname}
cp -a ${srcdir}/TIBCOJaspersoftStudio-${pkgver}.final/* ${pkgdir}/opt/${pkgname}
install -d -m 0755 ${pkgdir}/usr/bin
ln -sf "/opt/${_pkgname}/${_binname}" ${pkgdir}/usr/bin/${_pkgname}
ln -sf "/opt/${_pkgname}/${_binname}" ${pkgdir}/usr/bin/${pkgname}

cat > ${_pkgname}.desktop << EoF
[Desktop Entry]
Version=${pkgver}
Encoding=UTF-8
Name=Jaspersoft Studio
Comment=${pkgdesc}
Exec=GTK2_RC_FILES=/usr/share/themes/Raleigh/gtk-2.0/gtkrc /opt/${_pkgname}/${_binname}
Icon=/opt/${_pkgname}/icon.xpm
Terminal=false
Type=Application
Categories=Java;Development;
EoF

install -D -m 0644 ${srcdir}/${_pkgname}.desktop ${pkgdir}/usr/share/applications/${_pkgname}.desktop
}

Now, when you say

on issuing 'makepkg --source' the system does not take into account neither the source_x86_64 or md5sums_x86_64 arrays

What exactly do you mean? Where are you looking to see if it's taken into account?

On the previous version of the PKGBUILD (still available on the "old" AUR3.5), I've used bash conditionals to check for the correct binary package download:

# Maintainer: Frontier (frontier314 at gmail dot com)

pkgname=jaspersoftstudio
_pkgname=JaspersoftStudio
_binname="Jaspersoft Studio"
pkgver=6.1.0
pkgrel=1
pkgdesc="Eclipse based Jasper Reports generator"
arch=('i686' 'x86_64')
url="http://community.jaspersoft.com/project/jaspersoft-studio"
license=('Eclipse')
depends=('java-runtime' 'gtk2')

if [ "$CARCH" = "i686" ]; then
source=("http://sourceforge.net/projects/jasperstudio/files/JaspersoftStudio-${pkgver}/TIBCOJaspersoftStudio-${pkgver}.final-linux-x86.tgz")
md5sums=('2e6710b79c96f2f21880640fe8176048')
fi

if [ "$CARCH" = "x86_64" ]; then
source=("http://sourceforge.net/projects/jasperstudio/files/JaspersoftStudio-${pkgver}/TIBCOJaspersoftStudio-${pkgver}.final-linux-x86_64.tgz")
md5sums=('01e1da5e396a07b82dbc0cd20be437de')
fi

package() {
install -d -m 0755 ${pkgdir}/opt/${pkgname}
cp -a ${srcdir}/TIBCOJaspersoftStudio-${pkgver}.final/* ${pkgdir}/opt/${pkgname}
install -d -m 0755 ${pkgdir}/usr/bin
ln -sf "/opt/${_pkgname}/${_binname}" ${pkgdir}/usr/bin/${_pkgname}
ln -sf "/opt/${_pkgname}/${_binname}" ${pkgdir}/usr/bin/${pkgname}

cat > ${_pkgname}.desktop << EoF
[Desktop Entry]
Version=${pkgver}
Encoding=UTF-8
Name=Jaspersoft Studio
Comment=${pkgdesc}
Exec=GTK2_RC_FILES=/usr/share/themes/Raleigh/gtk-2.0/gtkrc /opt/${_pkgname}/${_binname}
Icon=/opt/${_pkgname}/icon.xpm
Terminal=false
Type=Application
Categories=Java;Development;
EoF

install -D -m 0644 ${srcdir}/${_pkgname}.desktop ${pkgdir}/usr/share/applications/${_pkgname}.desktop
}

Testing THIS PKGBUILD with namcap produces no warnings, where testing the updated PKGBUILD produces warnings for the source_* arrays (probably namcap isn't updated to 'understand' architecture array strings).
Also with the old PKGBUILD when issuing makepkg --source, due to the bash conditionals, one could 'see' (from the shell messages) that the correct source package was downloaded. Now, when issuing the same command on the new PKGBUILD it downloads the i686 source always; however, issuing makepkg (without --source) downloads the correct source (in my case x86_64).

Last edited by Frontier (2015-06-09 06:02:02)

Offline

#10 2015-06-09 06:23:47

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

Hmm, yeah, looks like a bug.

Edit: actually no, I just tried it. It downloads all source entries to verify the checksums. It should be downloading both architectures.

Last edited by Scimmia (2015-06-09 06:26:19)

Offline

#11 2015-06-09 06:47:32

Frontier
Member
From: Chios, Greece
Registered: 2012-11-14
Posts: 11
Website

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

Scimmia wrote:

Hmm, yeah, looks like a bug.

Edit: actually no, I just tried it. It downloads all source entries to verify the checksums. It should be downloading both architectures.

I guess the man page should be updated to reflect that behaviour change, coupled with what WorMzy noted earlier.

Thank you very much for the information you've provided.

Offline

#12 2015-06-09 07:22:50

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

Frontier wrote:
Scimmia wrote:

Hmm, yeah, looks like a bug.

Edit: actually no, I just tried it. It downloads all source entries to verify the checksums. It should be downloading both architectures.

I guess the man page should be updated to reflect that behaviour change

Which change? The description for --source says

Because integrity checks are verified, all source files of the package need to be present or downloadable.

and I don't think that's a recent change. Of course the hack with bash conditionals made it hard for makepkg to do that correctly in the past -- is that what you meant?

Offline

#13 2015-06-09 07:44:28

Frontier
Member
From: Chios, Greece
Registered: 2012-11-14
Posts: 11
Website

Re: [SOLVED] Source Architectures Arrays not recognized by makepkg

@Raynman: Yes.

Offline

Board footer

Powered by FluxBB