You are not logged in.

#1 2007-04-12 15:19:47

rixxon
Member
Registered: 2007-03-09
Posts: 16

"USE flags" for makepkg

I have an idea for makepkg, but I wanted to discuss it before I file a feature request on flyspry. The idea is similar to Gentoo's USE flags, but don't let this pollude your opinion if you dislike Gentoo.

The idea goes like this. In some config file, the user could specify flags for building, example:

vim=(!perl python ruby !tcl)

This variable would then be exported in the vim PKGBUILD which would interpret it to do:

./configure --disable-perlinterp --enable-pythoninterp --enable-rubyinterp --disable-tclinterp

Makepkg should probably assist in the interpretation somehow.

This is different from Gentoo in the way it is package-specific (allows for better fine tuning) and uses arch-style bash-arrays. Possibly, there could be a global variable aswell (perhaps called ALL or the like).

Pros:
- Easily fine tune packages before building (i.e. yaourt -Sb)
- Don't need to know all the switches for ./configure or the like, to modify a package

Cons:
- Makes creating PKGBUILDs more complex (if the creator wants to support these flags)
- Need to change lots of PKGBUILDS (but this can be done over time)
- ZOMG GENTOO??

There are ofcourse more pros/cons I haven't thought of, and the idea can probably be improved upon - please discuss!

Offline

#2 2007-04-12 15:40:15

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: "USE flags" for makepkg

bad idea. if you want custom build options, look at srcpac.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2007-04-12 15:43:29

rixxon
Member
Registered: 2007-03-09
Posts: 16

Re: "USE flags" for makepkg

cactus wrote:

bad idea. if you want custom build options, look at srcpac.

srcpac is a hack, not a solution.

Offline

#4 2007-04-12 16:01:19

hacosta
Member
From: Mexico
Registered: 2006-10-22
Posts: 423

Re: "USE flags" for makepkg

i think this is way too much work and will slow down development..
--

Offline

#5 2007-04-12 17:32:12

rixxon
Member
Registered: 2007-03-09
Posts: 16

Re: "USE flags" for makepkg

An idea for how it could look in a PKGBUILD:

% echo "./configure `./ifuse perl --enable-perlinterp` `./ifuse python --enable-pythoninterp` `./ifuse ruby --enable-rubyinterp` `./ifuse tcl --enable-tclinterp`"
./configure  --enable-pythoninterp --enable-rubyinterp

Well, in an actual PKGBUILD this would rather be something like,

build() {
  ./configure `ifuse perl --enable-perlinterp` `ifuse python --enable-pythoninterp` `ifuse ruby --enable-rubyinterp` `ifuse tcl --enable-tclinterp`
}

ifuse being a function.

Offline

#6 2007-04-12 17:56:28

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: "USE flags" for makepkg

We're a binary based distro, not a source based distro with geeks like gentoo is. This means USE flags are completely obsolete for archlinux. IMHO a source PKGBUILD should always match the binary we generate out of that, so we won't support useflags, not now, not in the future. What would happen if some maintainer dislikes KDE and has -kde in his useflags? Would that mean that all packages uploaded by the dev have KDE support disabled, no matter if it's useful or not?

Offline

#7 2007-04-12 18:05:31

rixxon
Member
Registered: 2007-03-09
Posts: 16

Re: "USE flags" for makepkg

JGC wrote:

We're a binary based distro, not a source based distro with geeks like gentoo is. This means USE flags are completely obsolete for archlinux. IMHO a source PKGBUILD should always match the binary we generate out of that, so we won't support useflags, not now, not in the future. What would happen if some maintainer dislikes KDE and has -kde in his useflags? Would that mean that all packages uploaded by the dev have KDE support disabled, no matter if it's useful or not?

You mean like the vim package does not support any interpreters? There would be guide lines for how to set default flags, and what to use when building to official repos (probably default then).

This would merely be a neater, cleaner and more flexible way than editing a PKGBUILD. No, the real problem about this idea is depends, I'm not sure I'm convinced myself anymore thinking of this. It would be complex to have flags alter depends, but it would be inconviniant and incomplete not to.

Offline

#8 2007-04-12 18:10:30

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: "USE flags" for makepkg

Excellent idea ! 
This is the goal which I have for customizepkg and yaourt.
Actually, the user have to create a file in /etc/customize.d/ for each package but it works.

The best solution would be to have some flags in PKGBUILD like "./ifuse" 8)

Offline

#9 2007-04-12 20:08:32

space-m0nkey
Member
From: UK
Registered: 2007-03-26
Posts: 16

Re: "USE flags" for makepkg

-1, for me and a lot of people makepkg's BIG plus is it's simple. Adding things like dynamic configurations adds complexities which leads to weird and wonderful bugs. If you don't like the options a package is compiled with rebuild it with the options you want.

It also leads to a lot of extra support request. It is assumed that the config in a PKGBUILD has been tested and is known to work. Adding dynamic config options adds X number of addition configurations that need to be tested.


"Instead, people would take pains to tell her that beauty was only skin-deep, as if a man ever fell for an attractive pair of kidneys."
(Terry Pratchett, Maskerade)

Offline

#10 2007-04-13 08:33:39

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: "USE flags" for makepkg

-1, and it won't happen, and it's already implemented in srcpac.

To include it, would add a lot of complexities to makepkg and PKGBUILD. These are not needed, as JGC said, we're a binary distro.

Use srcpkg, it's better than any USE flag implementation could be.

James

Offline

#11 2007-04-13 09:01:34

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: "USE flags" for makepkg

-1 I also think that it makes the compilation more opaque in the rare cases where you actually want to customize the configuration options. In those cases there is nothing better than understanding what actually that option means for the specific package; if you do not know well vim it is not immediately clear what perl and python mean for it; thus, the best thing to do is to pass through a 'makepkg -o', a 'cd src/vim<version>, a './configure --help'. Once you have actually understood the options you can go back to modify the PKGBUILD, in order to have this routine done also for the next versions of vim.

This problem affects also gentoo USE flags, their meaning is often heterogeneous, opaque and misleading: just a filter between the user and the developer of the app, while when customizing you want to be in touch with what he meant with certain options.


Mortuus in anima, curam gero cutis

Offline

#12 2007-04-13 10:34:56

miko
Member
From: Poland
Registered: 2006-04-16
Posts: 49

Re: "USE flags" for makepkg

I dislike this idea - the USE issues where main reason why I switched from gentoo to archlinux - after many months of recompiling packages and changing global USE flags my system was in "unknown" and unstable state - the package capabilities depended on time when they were compiled.
I think the PLD idea (of making many small subpackages for different capabilities) is way better, but at the cost of added complexity and more maintenance. I would also like to see support for optional dependencies, so the user could recompile the package if he needs additional functionality.

Regards,
miko

Offline

#13 2007-04-13 11:22:01

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: "USE flags" for makepkg

-1 - nope and never we will have that.

if you want more: there's always ABS and srcpac to play with.

Offline

#14 2007-04-13 12:08:37

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: "USE flags" for makepkg

Look at the mplayer's PKGBUILD.

Do you think that patching sources with mplayer-lirc-libdl.diff is more kiss than `ifuse lirc --enable-lirc` ?? roll

Offline

#15 2007-04-13 12:52:39

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: "USE flags" for makepkg

wain wrote:

Look at the mplayer's PKGBUILD.

Do you think that patching sources with mplayer-lirc-libdl.diff is more kiss than `ifuse lirc --enable-lirc` ?? roll

yes. Besides, mplayer is *one* package. It's far more kiss to patch that one package, than add ifuse sillyness to *every* package in the repos.

would you prefer to rewrite that ./configure line for mplayer adding ifuse for *every* configuration option? There's more ./configure options that aren't listed there. Just do it as an example, and you might realise how impractical your idea is.

James

Last edited by iphitus (2007-04-13 12:54:35)

Offline

#16 2007-04-13 14:50:12

equadon
Member
Registered: 2007-04-12
Posts: 25

Re: "USE flags" for makepkg

Poisoning the PKGBUILDs with something like this seems like a temporary solution to me. It's nothing that would work in the end and it would generate a big mess. I would not suggest adding a "USE-flag" system to Arch either. It works well in Gentoo, but it was designed with it in mind, Arch was not. It would require some work to implement it.

The best solution I can think of would be to add an optional entry to PKGBUILD, such as optional=('guile' 'tk'), where the optional configure options could be listed. Then makepkg would generate a correct ./configure statement. An example could be like this:

# $Id: PKGBUILD,v 1.8 2007/02/11 11:27:15 damir Exp $
# Maintainer: damir <damir@archlinux.org>
# Contributor: damir <damir@archlinux.org>

pkgname=xbindkeys
pkgver=1.8.0
pkgrel=1
pkgdesc="xbindkeys allows you to launch shell commands with your keyboard or your mouse under X Window"
arch=(i686 x86_64)
url="http://hocwp.free.fr/xbindkeys"
depends=('libx11')
optional=('guile' 'tk')
source=($url/${pkgname}-${pkgver}.tar.gz)

build() {
  cd ${startdir}/src/${pkgname}-${pkgver}
  ./configure --prefix=/usr ${optional}
  make || return 1
  make DESTDIR=${startdir}/pkg install
}
md5sums=('71755c23faa113e891de6f2f871e0c76')

If the user had specified in /etc/makepkg.conf that he/she didn't want tk and guile, makepkg would append --disable-guile --disable-tk to the ./configure statement. If the user want the default, and haven't edited makepkg.conf, nothing will be appended to the ./configure statement.

If the defaults would be not to include guile and tk, then the optional line would look like: optional=('!guile' '!tk')

I didn't give this much thought, so I'm not sure if it would actually work. I also don't know how consistent the application developers name their optional configuration options.

Offline

#17 2007-04-13 15:26:17

rata
Member
Registered: 2006-04-10
Posts: 46

Re: "USE flags" for makepkg

I think the customizability is a missing concept in AL. I don't mean that "USE flag" idea is a great idea and in addition i don't think that "USE flag" idea means that *all* the packages in AL must have this "USE flags".

For example, i don't like how mplayer is compiled in [extra]. I use it from the xterm, so i don't need any GUI or something like that. For that reason i had to modify the PKGBUILD myself, but logically that PKGBUILD don't upgrade automatically to the next version, so i must "maintain" it. Is there a way to make that a little simpler?
How can i customize a package without have to maintain it?

Maybe that exists, but i don't know it.

P.S.: sorry for my english.

Offline

#18 2007-04-13 15:29:53

space-m0nkey
Member
From: UK
Registered: 2007-03-26
Posts: 16

Re: "USE flags" for makepkg

equadon wrote:

I didn't give this much thought, so I'm not sure if it would actually work. I also don't know how consistent the application developers name their optional configuration options.

Developers can't be trusted to do anything consistently tongue


"Instead, people would take pains to tell her that beauty was only skin-deep, as if a man ever fell for an attractive pair of kidneys."
(Terry Pratchett, Maskerade)

Offline

#19 2007-04-13 15:41:37

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: "USE flags" for makepkg

iphitus wrote:

would you prefer to rewrite that ./configure line for mplayer adding ifuse for *every* configuration option? There's more ./configure options that aren't listed there. Just do it as an example, and you might realise how impractical your idea is.

James

I do not have say that the implementation suggested by xrixxonx was the best. This sort of USE-Flags concern only one negligible part of the PKGBUILD and it would be easy to implement and very useful.


rata wrote:

I think the customizability is a missing concept in AL. I don't mean that "USE flag" idea is a great idea and in addition i don't think that "USE flag" idea means that *all* the packages in AL must have this "USE flags".

For example, i don't like how mplayer is compiled in [extra]. I use it from the xterm, so i don't need any GUI or something like that. For that reason i had to modify the PKGBUILD myself, but logically that PKGBUILD don't upgrade automatically to the next version, so i must "maintain" it. Is there a way to make that a little simpler?
How can i customize a package without have to maintain it?

Maybe that exists, but i don't know it.

P.S.: sorry for my english.

just download customizepkg from AUR and save this file in /etc/customizepkg.d/mplayer
Next time you do yaourt -Su, if there is an update for mplayer, it will be automatically rebuilt with your options.

Offline

#20 2007-04-13 16:02:51

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: "USE flags" for makepkg

people. srcpac IS the solution to this. I suggest installing it, reading about it, and trying to use it.
Here is an example in the wiki where somebody has customized postfix with custom compile options, and is using srcpac to keep it up to date (with the modifications).

http://wiki.archlinux.org/index.php/Pos … _With_SASL

Take the following into consideration:

1. Arch is a binary distribution. This means, often, shooting for the most common package usage. Any additional work you require of the devs will only increase their load, and reduce their effectiveness.

2. Arch is largely a meta distribution. pkgbuilds are used to build the binaries. This means the end user can very easily modify pkgbuilds in the ABS tree to create new binaries for themselves. Offloading some of the work to the end user that requires customization differing from mainline, in cases where it would impact the devs negatively, is sometimes o.k.

3. There ARE tools that make it easier to maintain your own 'fork' of packages in ABS, so that you can easily keep your system up to date, compile directly from abs, and have everything transparent to the person doing it..while not impacting the larger set of users who do not need it.

4. Making your own repository is trivial. You can create your own 'forked' packages, and share them with others. You can share them with all the systems you manage.

5. I think trying to shoehorn USE flags into Archlinux, is severely a case of trying to use a saw to pound a nail. If you want USE flags, then use a distribution that has that as a TARGET FEATURE. Gentoo for instance, maybe sourcemage, etc. If you need a hammer for a job, then use a hammer.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#21 2007-04-13 16:30:59

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: "USE flags" for makepkg

cactus wrote:

people. srcpac IS the solution to this. I suggest installing it, reading about it, and trying to use it.
Here is an example in the wiki where somebody has customized postfix with custom compile options, and is using srcpac to keep it up to date (with the modifications).

srcpac is very limited, buggy and doesn't work with pacman3. The patchs proposed on bugs.archlinux.org are not integrated any more.

There has always been disagreements for some packages between users and maintainers about compile options and optional depends. It is possible to solve this problem while making evolve PKGBUILD's syntax and respecting the KISS-principe.
This is not more complicated than new makepkg OPTIONS=(strip !docs !libtool emptydirs),  BUILDENV=(fakeroot !distcc color ccache), DOC_DIRS etc... roll

Offline

#22 2007-04-14 05:31:53

rata
Member
Registered: 2006-04-10
Posts: 46

Re: "USE flags" for makepkg

I use already pacman3. Is srcpac a solution? according to which wain says, it's not.

Is customizepkg a solution? can customizepkg remove files from source array and remove lines from the build() statement, for example, to do that mplayer PKGBUILD don't apply a certain patch or don't install/copy the files of the "Blue" skin? when it removes a file from the source array, removes it automatically the entry of that file from the md5sum array too? or that's unnecessary?

Offline

#23 2007-04-14 08:02:11

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: "USE flags" for makepkg

rata wrote:

I use already pacman3. Is srcpac a solution? according to which wain says, it's not.

Is customizepkg a solution? can customizepkg remove files from source array and remove lines from the build() statement, for example, to do that mplayer PKGBUILD don't apply a certain patch or don't install/copy the files of the "Blue" skin? when it removes a file from the source array, removes it automatically the entry of that file from the md5sum array too? or that's unnecessary?

customizepkg can easily remove files from source array but remove the corresponding md5 is not possible. I will try to add this feature asap.
Remove or add lines from build() is very easy for customizepkg. Just add this in /etc/customizepkg.d/mplayer

remove#global#^.*patch -p1.*gnome.*$
remove#global#^.*mv ${startdir}\\/src\\/Blue.*$

Offline

#24 2007-04-14 18:52:31

_alexmyself
Member
From: france
Registered: 2005-09-18
Posts: 89

Re: "USE flags" for makepkg

wain +1  big_smile

Offline

#25 2007-04-16 15:22:45

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: "USE flags" for makepkg

Man, I should use one of those "text snippet" apps, because I seem to say this a lot:

I disagree with this, and think it's silly - HOWEVER, you are free to implement it and send us patches.  If you actually make working code, rather than expecting us to do something we disagree with, there is a vastly higher chance something will be incorporated.

Offline

Board footer

Powered by FluxBB