Difference between revisions of "Talk:PKGBUILD"

From ArchWiki
Jump to: navigation, search
(use https for links to archlinux.org)
(Undo "Remove incorrect warning": re)
 
(98 intermediate revisions by 14 users not shown)
Line 1: Line 1:
This needs to be updated for split packages. [[User:Daenyth|Daenyth]] 22:55, 4 December 2009 (EST)
+
== <s>Changes to the handling of PKGBUILD variables in split packages</s> ==
  
== Variables/noextract about zip? ==
+
The body of articles related to packaging guidelines and creating, maintaining, and reviewing packages includes very little about split packages, specifically how they differ from their non-split counterparts and what guidelines or conventions should be reflected in PKGBUILDs for split packages. There are some inconsistencies between what's documented on ArchWiki and what is implemented in pacman/makepkg. (I'll try to re-find the inconsistencies I've encountered.)
  
Isn't this information outdated? It seems bsdtar can now perfectly handle zip-files.
+
[[#pkgbase]] documents, "Everything, except [[#makedepends]], [[#Sources]], and [[#Integrity]] variables can be overridden within each split package's {{ic|package()}} function", while the actual code of [[makepkg]] seems to allow overrides for a subset of those variables as defined in the following:
  
--[[User:Paolo|Paolo]] 11:03, 8 September 2010 (EDT)
+
splitpkg_overrides=('pkgdesc' 'arch' 'url' 'license' 'groups' 'depends'
 +
                    'optdepends' 'provides' 'conflicts' 'replaces' 'backup'
 +
                    'options' 'install' 'changelog')
  
== Installing the package ==
+
Specifically, [[#Version]] and [[#checkdepends]] variables are not part of that overrides' array but are not mentioned in [[#pkgbase]]. Is makepkg missing the ability to process overrides for these variables or is the documentation inaccurate in not listing these variables as not subject to overrides?
  
It might be helpful for beginners to know how to install the package after building it.
+
{{unsigned|04:35, 7 May 2016‎|JamesAn}}
Maybe it should be explicity mentioned that one can install it with '''sudo pacman -U yourpackage.pkg.tar.??'''
 
  
where ?? can be xz, gz or something else.
+
:From {{ic|man PKGBUILD}}:
  
[[User:Slopjong|Slopjong]] 12:00, June 9th 2010 (CET)
+
:All options and directives for the split packages default to the global values given in
::1. It's a package - you install it as any other package. The introduction clearly states that ''The resulting package contains binary files and installation instructions; readily installed with pacman.'' and a link to the pacman article.
+
:the PKGBUILD. Nevertheless, the following ones can be overridden within each split
::2. pacman can install uncompressed <tt>.pkg.tar</tt> archives too.
+
:package’s packaging function: pkgdesc, arch, url, license, groups, depends, optdepends,
::3. 'makepkg -i' will install the compiled package.
+
:provides, conflicts, replaces, backup, options, install, and changelog.
::-- [[User:Karol|Karol]] 06:52, 9 June 2011 (EDT)
 
  
== External links ==
+
:Just realised this post is two years old. Maybe the man page was not clear at the time.
 +
:It's certainly clear now though so I think it's safe to change it.
 +
:[[User:Morganamilo|Morganamilo]] ([[User talk:Morganamilo|talk]]) 21:09, 9 June 2018 (UTC)
  
One of the two links is redundant, is the same mentioned here
+
== Undo "Remove incorrect warning" ==
Tip: A prototype .install is provided at /usr/share/pacman/proto.install.
 
the second one should be added to proto installed by pacman package.
 
  
== check / checkdepends ==
+
{{Warning|Placing the depends array inside {{ic|package()}} is only useful for split packaging. You should '''not''' do this for single packages, even if you know the dependencies are run time only.}}
  
the default ''PKGBUILD'' in ''/usr/share/pacman'' now contains a ''check'' function and a ''checkdepends'' array. Some explanation would be nice.
+
I believe this warning is valid. Sure makepkg will allow you to override the depends on a singular package. But I don't think this is recommended at all and is a needless complication.
--[[User:Oal|Oal]] 15:41, 26 July 2011 (EDT)
 
:Some quick references: [https://bugs.archlinux.org/task/15145], [https://mailman.archlinux.org/pipermail/pacman-dev/2010-December/012131.html]. -- [[User:Kynikos|Kynikos]] 04:23, 27 July 2011 (EDT)
 
  
:: Have you seen [https://www.archlinux.org/pacman/PKGBUILD.5.html man PKGBUILD]?. [[User:Vadmium|Vadmium]] 04:54, 27 July 2011 (EDT).
+
Without the warning, clarifying that depends inside of {{ic|package()}} are run time only might give readers that this should be done any time they have run time only depends but that is not the case.
 +
[[User:Morganamilo|Morganamilo]] ([[User talk:Morganamilo|talk]]) 21:40, 9 June 2018 (UTC)
 +
:It is also perfectly acceptable when repackaging pre-built binaries. Putting this restriction in here has no basis in fact and is just plain wrong.
 +
:[[User:Scimmia|Scimmia]] ([[User talk:Scimmia|talk]]) 21:45, 9 June 2018 (UTC)
  
== epoch ==
+
::Alright if that's the case I guess the warning was overkill. I still would like to see at least a note of some sort saying that you don't need to go separating the make only and run only dependencies. It is perfectly acceptable to put run time deps in the global depends.
  
There is an epoch variable in the PKGBUILD.proto and an explanation here in the wiki, but for me at least the explanation doesn't cut it, I'd have no idea how to use it. I'm not sure that something that seems to be only meant for very special cases should be in the proto (which is meant for new packages, as I see it).
+
::If you disagree feel free to close this topic. [[User:Morganamilo|Morganamilo]] ([[User talk:Morganamilo|talk]]) 21:57, 9 June 2018 (UTC)
[[User:Hollunder|hollunder]] 12:20, 11 September 2011 (EDT)
 
 
 
== package compression ==
 
Please add some info about PKGEXT variable, eg. for disable compression
 
<pre>
 
PKGEXT='.pkg.tar'
 
</pre>
 
Compression is IMO useless for game's package and almost nobody from aur is using this variable... And they are looking usually for info in archwiki ;)
 
:See [https://bbs.archlinux.org/viewtopic.php?id=127894] for a couple ways to skin this cat. -- [[User:Karol|Karol]] 05:55, 12 December 2011 (EST)
 
 
 
== makedepends should not include base? ==
 
 
 
There is a warning not to include base-devel packages in makedepends, but should it also be said not to include base pacakges in makedepends (or even in depends)?
 
:This is not the proper place for discussing the guidelines for PKGBUILDs, please post in the forums or the mailing lists. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 12:28, 11 July 2012 (UTC)
 
 
 
== package description ==
 
{{Note|Do not follow this rule thoughtlessly when submitting packages to [[AUR]]. If package name differs from application name for some reason, inclusion of full name into description can be the only way to ensure that package can be found during search.}}
 
 
 
I never had trouble with pre-/postfixed application names so the note doesn't apply to this case. Does it? [[User:Slopjong|Slopjong]] 03:19, 11 July 2012 (CEST)
 
 
 
:I think the note leaves the decision up to the maintainer, and it seems reasonable to me. If you're intentioned to discuss the guidelines for PKGBUILDs, this is not the right place, please post in the forums or the mailing lists. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 12:28, 11 July 2012 (UTC)
 
 
 
== Declare more mirrors for a file ==
 
 
 
Hello everyone,
 
I have created the paragraph «[[PKGBUILD#Declare_more_mirrors_for_a_file|Declare more mirrors for a file]]». Improvements/Suggestions? --[[User:Grufo|Grufo]] <sup>[ [[Special:Contributions/Grufo|contribs]] | [[User_talk:Grufo|talk]] ]</sup> 12:18, 22 November 2012 (UTC)
 
:Forum thread created…: [https://bbs.archlinux.org/viewtopic.php?id=153535 https://bbs.archlinux.org/viewtopic.php?id=153535]
 
:--[[User:Grufo|Grufo]] <sup>[ [[Special:Contributions/Grufo|contribs]] | [[User_talk:Grufo|talk]] ]</sup> 01:35, 24 November 2012 (UTC)
 

Latest revision as of 21:57, 9 June 2018

Changes to the handling of PKGBUILD variables in split packages

The body of articles related to packaging guidelines and creating, maintaining, and reviewing packages includes very little about split packages, specifically how they differ from their non-split counterparts and what guidelines or conventions should be reflected in PKGBUILDs for split packages. There are some inconsistencies between what's documented on ArchWiki and what is implemented in pacman/makepkg. (I'll try to re-find the inconsistencies I've encountered.)

#pkgbase documents, "Everything, except #makedepends, #Sources, and #Integrity variables can be overridden within each split package's package() function", while the actual code of makepkg seems to allow overrides for a subset of those variables as defined in the following:

splitpkg_overrides=('pkgdesc' 'arch' 'url' 'license' 'groups' 'depends'
                    'optdepends' 'provides' 'conflicts' 'replaces' 'backup'
                    'options' 'install' 'changelog')

Specifically, #Version and #checkdepends variables are not part of that overrides' array but are not mentioned in #pkgbase. Is makepkg missing the ability to process overrides for these variables or is the documentation inaccurate in not listing these variables as not subject to overrides?

—This unsigned comment is by JamesAn (talk) 04:35, 7 May 2016‎. Please sign your posts with ~~~~!

From man PKGBUILD:
All options and directives for the split packages default to the global values given in
the PKGBUILD. Nevertheless, the following ones can be overridden within each split
package’s packaging function: pkgdesc, arch, url, license, groups, depends, optdepends,
provides, conflicts, replaces, backup, options, install, and changelog.
Just realised this post is two years old. Maybe the man page was not clear at the time.
It's certainly clear now though so I think it's safe to change it.
Morganamilo (talk) 21:09, 9 June 2018 (UTC)

Undo "Remove incorrect warning"

Warning: Placing the depends array inside package() is only useful for split packaging. You should not do this for single packages, even if you know the dependencies are run time only.

I believe this warning is valid. Sure makepkg will allow you to override the depends on a singular package. But I don't think this is recommended at all and is a needless complication.

Without the warning, clarifying that depends inside of package() are run time only might give readers that this should be done any time they have run time only depends but that is not the case. Morganamilo (talk) 21:40, 9 June 2018 (UTC)

It is also perfectly acceptable when repackaging pre-built binaries. Putting this restriction in here has no basis in fact and is just plain wrong.
Scimmia (talk) 21:45, 9 June 2018 (UTC)
Alright if that's the case I guess the warning was overkill. I still would like to see at least a note of some sort saying that you don't need to go separating the make only and run only dependencies. It is perfectly acceptable to put run time deps in the global depends.
If you disagree feel free to close this topic. Morganamilo (talk) 21:57, 9 June 2018 (UTC)