You are not logged in.

#1 2013-06-06 20:48:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

source=() parsing in the AUR

It's not a huge deal, but is there something that can be done about output like this:
https://aur.archlinux.org/packages/aurqt/

Sources
    -c1/aurqt/aurqt-0.2.1.tar.gz
    aurqt
    cut
    http://pypi.python.org/packages/source/
    |

https://aur.archlinux.org/packages/au/aurqt/PKGBUILD

Offline

#2 2013-06-06 20:52:39

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: source=() parsing in the AUR

Ah, the joys of abusing Bash in PKGBUILDs.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2013-06-06 20:59:34

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: source=() parsing in the AUR

I haven't found one. I have a similar problem in the source arrays of some -git packages. I'd prefer to just have pkgname=name-git and then, in the source array, use "${pkgname//-/.}", but it leads to some ugly source listings on the AUR, so I avoid it.

All the best,

-HG

Offline

#4 2013-06-06 21:30:15

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: source=() parsing in the AUR

This PKGBUILD should at least use bash string manipulation instead of cut: ${_pyname:0:1}


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2013-06-06 21:31:20

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: source=() parsing in the AUR

progandy wrote:

This PKGBUILD should at least use bash string manipulation instead of cut: ${_pyname:0:1}

Would it make the source output saner?

Offline

#6 2013-06-06 21:37:03

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: source=() parsing in the AUR

karol wrote:
progandy wrote:

This PKGBUILD should at least use bash string manipulation instead of cut: ${_pyname:0:1}

Would it make the source output saner?

I believe so. I know I saw PKGBUILDs using that, but I don't remember whether it was in the ABS or AUR.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#7 2013-06-06 23:08:00

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: source=() parsing in the AUR

Well, it will show less sources, but they won't be more sane. That's the scenario I mentioned earlier.

All the best,

-HG

Offline

#8 2013-06-07 15:02:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: source=() parsing in the AUR

Unfortunately seems it can't be fixed atm https://bugs.archlinux.org/task/25210 (somehow missed that report ;P)

Offline

#9 2013-06-08 11:12:26

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: source=() parsing in the AUR

You don't need to mangle pkgname at all. Really.

pkgname=foobar-git

source=("$pkgname"::git://url)

build() {
    cd "$pkgname"
    ...
}

I wish people would stop doing it.

Offline

#10 2013-06-08 11:21:29

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,401

Re: source=() parsing in the AUR

frankly, this problem looks like some people don't know where to stop.
I've checked the real source url and i don't really understand why all that string processing is needed.

https://pypi.python.org/packages/source/a/aurqt/aurqt-0.2.1.tar.gz

it could be written as :

source=(https://pypi.python.org/packages/source/a/${pkgname}/${pkgname}-${pkgver}.tar.gz

no string manipulation needed at all, easily human readable at the cost of 1 additonal hardcoded part of the source url.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#11 2013-06-08 11:23:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: source=() parsing in the AUR

Lone_Wolf wrote:

at the cost of 1 additonal hardcoded part of the source url.

I think maintainers are trying to avoid that.

Offline

#12 2013-06-08 11:29:52

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,401

Re: source=() parsing in the AUR

i understand that, and speaking in general agree with it.
However the first part of the url is hardcoded anyway, this means that sources from pypi need a (small) onetime manual change to check the hardcoded part is correct when the  pkgbuild is created.
And you need to verify the source url is correct anyway when creating  a new package.

is it really worth it ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#13 2013-06-10 01:35:42

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: source=() parsing in the AUR

I found a really cute one: https://aur.archlinux.org/packages/mplayer-mt-lite/ :-)

Dependencies (32)
    -Q
    -Q
    -Q
    -Q
    2>/dev/null
    2>/dev/null
    2>/dev/null
    2>/dev/null
    awk
    awk
    awk
    awk
    faad2
    ffmpeg-mt-lite
    libass
    libdvdread
    libgl
    libjpeg
    libmad
    libpulse
    libxss
    libxv
    libxvmc
    smbclient
    {print
    {print
    {print
    {print
    |
    |
    |
    |

Offline

#14 2013-06-10 01:56:14

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,653
Website

Re: source=() parsing in the AUR

Oh dear lord. How did you find that monstrosity?

In my opinion, PKGBUILDs should define clearly what they need to build. None of this "if alsa's installed, include it as a dependency rubbish.

Also, people should use clean chroots to build packages, and amend their PKGBUILDs as required, but that's probably asking too much.


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.

Offline

#15 2013-06-10 02:13:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: source=() parsing in the AUR

WorMzy wrote:

Oh dear lord. How did you find that monstrosity?

I found it by chance a long while ago, comparing different mplayer PKGBUILDs in the AUR. It's a different case from https://aur.archlinux.org/packages/aurqt/ , which may now be considered a milder issue ;P

Offline

#16 2013-06-10 04:27:50

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: source=() parsing in the AUR

The only time conditional dependencies should be a thing (imho) is when you have something like the following:

depends=('alsa-lib')
[ "$CARCH" == 'x86_64' ] && depends+=('lib32-alsa-lib')

That way you have sensible dependency resolution for both x86 and x64 architectures. But, I'm with you karol, conditional dependencies based on installed packages seems non-sensical to me.

All the best,

-HG

Offline

#17 2013-06-10 04:31:40

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: source=() parsing in the AUR

I can see it. A lot of times the build system will autodetect what's on the system and build in support for that. Usually that means you end up with deps that aren't listed, this is a method of getting them into the dep list.

Not saying it's a good idea, just that I can understand why someone would do it.

Last edited by Scimmia (2013-06-10 04:32:29)

Offline

#18 2013-06-10 04:34:21

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: source=() parsing in the AUR

Scimmia wrote:

I can see it. A lot of times the build system will autodetect what's on the system and build in support for that. Usually that means you end up with deps that aren't listed, this is a method of getting them into the dep list.

Not saying it's a good idea, just that I can understand why someone would do it.

But wouldn't that just be easier to handle as opt-depends, or in a configure script rather than awk'd conditional dependencies?

All the best,

-HG

Offline

#19 2013-06-10 04:37:39

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: source=() parsing in the AUR

optdepends don't keep deps from being uninstalled, plus they tell you nothing about what was built into the program since their presence really only matters at build time.

I'm thinking that a check and then using depends+= wouldn't actually be too bad of an idea

Offline

#20 2013-06-10 04:39:12

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: source=() parsing in the AUR

A Fair point. Unrelated: congrats on breaking the 1k post mark big_smile

All the best,

-HG

Offline

#21 2013-06-10 05:11:37

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: source=() parsing in the AUR

Thanks! One or two of them have even been useful.

Offline

#22 2013-06-16 12:12:11

josephg
Member
From: Brazil
Registered: 2009-09-28
Posts: 118

Re: source=() parsing in the AUR

For what is worth, I managed to hide some bash scripting in this PKGBUILD i maintain: https://aur.archlinux.org/packages/counter-strike-2d/

Offline

Board footer

Powered by FluxBB