Difference between revisions of "Talk:PKGBUILD"

From ArchWiki
Jump to: navigation, search
(Declare more mirrors for a file)
(Sources: close)
 
(90 intermediate revisions by 13 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> array writing style </s>==
  
== Variables/noextract about zip? ==
+
When talking about arrays, should we separate them from variables with: {{ic|1=array=()}}, e.g. {{ic|makedepends}}, {{ic|source_x86_64}} vs. {{ic|1=makedepends=()}}, {{ic|1=source_x86_64=()}}? --'''<span style="text-shadow:grey 0.1em 0.1em 0.1em; font-size:110%">[[User:Det|<span style="color:gold">D</span><span style="color:orange">e</span><span style="color:red">t</span>]][[User talk:Det|<sup><font color="white">talk</font></sup>]]</span>''' 06:52, 6 February 2015 (UTC)
  
Isn't this information outdated? It seems bsdtar can now perfectly handle zip-files.
+
:Judging from [https://wiki.archlinux.org/index.php?title=PKGBUILD&diff=359725&oldid=359724] it should be the former, but does this mean if all arrays were converted to the {{ic|1=''name''=()}} style, then it would be fine? —'''<span style="text-shadow:grey 0.1em 0.1em 0.1em; font-size:110%">[[User:Det|<span style="color:gold">D</span><span style="color:orange">e</span><span style="color:red">t</span>]][[User talk:Det|<sup><font color="white">talk</font></sup>]]</span>''' 21:58, 6 February 2015 (UTC)
  
--[[User:Paolo|Paolo]] 11:03, 8 September 2010 (EDT)
+
::It ''would'' be fine consistency-wise, but I don't see the need to do it: it's not that there can be a non-array variable with the same name of an array one, so adding {{ic|1==()}} would only be redundant. I would consider instead using the first instances of variables in each section as anchors for links to other sections, e.g. [[#source]], but I'd like to hear other opinions about this possibility. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 04:49, 7 February 2015 (UTC)
  
== Installing the package ==
+
:::Old, closed. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 06:56, 14 January 2018 (UTC)
  
It might be helpful for beginners to know how to install the package after building it.
+
==<s> relative path in the local source files </s>==
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.
+
Phrase "''These paths are resolved relative to the directory of the PKGBUILD.''" is confusing because there is no possible relative paths, just files placed in the same directory as PKGBUILD. According to makepkg script source and man PKGBUILD: "''Source files must either reside in the same directory as the PKGBUILD, or be a fully-qualified URL..''."
 +
Maybe it will be better to remove this phrase?
  
[[User:Slopjong|Slopjong]] 12:00, June 9th 2010 (CET)
+
{{unsigned|08:29, 27 October 2015‎|Validname}}
::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.
 
::2. pacman can install uncompressed <tt>.pkg.tar</tt> archives too.
 
::3. 'makepkg -i' will install the compiled package.
 
::-- [[User:Karol|Karol]] 06:52, 9 June 2011 (EDT)
 
  
== External links ==
+
:Uh, true, I've just tested it, you can update the article. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 07:54, 28 October 2015 (UTC)
  
One of the two links is redundant, is the same mentioned here
+
::[https://wiki.archlinux.org/index.php?title=PKGBUILD&type=revision&diff=507493&oldid=506645 Fixed]. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 07:03, 14 January 2018 (UTC)
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 ==
+
== Changes to the handling of PKGBUILD variables in split packages ==
  
the default ''PKGBUILD'' in ''/usr/share/pacman'' now contains a ''check'' function and a ''checkdepends'' array. Some explanation would be nice.
+
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.)
--[[User:Oal|Oal]] 15:41, 26 July 2011 (EDT)
 
:Some quick references: [https://bugs.archlinux.org/task/15145], [http://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).
+
[[#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:
  
== epoch ==
+
splitpkg_overrides=('pkgdesc' 'arch' 'url' 'license' 'groups' 'depends'
 +
                    'optdepends' 'provides' 'conflicts' 'replaces' 'backup'
 +
                    'options' 'install' 'changelog')
  
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).
+
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?
[[User:Hollunder|hollunder]] 12:20, 11 September 2011 (EDT)
 
  
== package compression ==
+
{{unsigned|04:35, 7 May 2016‎|JamesAn}}
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? ==
+
==<s> Sources </s>==
  
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)?
+
In '''source''', I changed the Note into a Warning as having the same downloaded file name could probably cause system issues and regrouped the Note and the Tip into one Tip box (to avoid having 3 boxes) but other opinions may be useful, let me know if you see things differently. - [[User:Kewl|Kewl]] ([[User talk:Kewl|talk]]) 15:50, 6 January 2018 (UTC)
: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 ==
+
:Thanks, I've only done [https://wiki.archlinux.org/index.php?title=PKGBUILD&type=revision&diff=507496&oldid=507493], closing. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 07:18, 14 January 2018 (UTC)
{{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 07:19, 14 January 2018

array writing style

When talking about arrays, should we separate them from variables with: array=(), e.g. makedepends, source_x86_64 vs. makedepends=(), source_x86_64=()? --Dettalk 06:52, 6 February 2015 (UTC)

Judging from [1] it should be the former, but does this mean if all arrays were converted to the name=() style, then it would be fine? —Dettalk 21:58, 6 February 2015 (UTC)
It would be fine consistency-wise, but I don't see the need to do it: it's not that there can be a non-array variable with the same name of an array one, so adding =() would only be redundant. I would consider instead using the first instances of variables in each section as anchors for links to other sections, e.g. #source, but I'd like to hear other opinions about this possibility. — Kynikos (talk) 04:49, 7 February 2015 (UTC)
Old, closed. -- Kynikos (talk) 06:56, 14 January 2018 (UTC)

relative path in the local source files

Phrase "These paths are resolved relative to the directory of the PKGBUILD." is confusing because there is no possible relative paths, just files placed in the same directory as PKGBUILD. According to makepkg script source and man PKGBUILD: "Source files must either reside in the same directory as the PKGBUILD, or be a fully-qualified URL..." Maybe it will be better to remove this phrase?

—This unsigned comment is by Validname (talk) 08:29, 27 October 2015‎. Please sign your posts with ~~~~!

Uh, true, I've just tested it, you can update the article. — Kynikos (talk) 07:54, 28 October 2015 (UTC)
Fixed. -- Kynikos (talk) 07:03, 14 January 2018 (UTC)

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 ~~~~!

Sources

In source, I changed the Note into a Warning as having the same downloaded file name could probably cause system issues and regrouped the Note and the Tip into one Tip box (to avoid having 3 boxes) but other opinions may be useful, let me know if you see things differently. - Kewl (talk) 15:50, 6 January 2018 (UTC)

Thanks, I've only done [2], closing. -- Kynikos (talk) 07:18, 14 January 2018 (UTC)