You are not logged in.
Hello,
I am a Debian user and would like to create an Arch package. I created an Arch chroot and a PKGBUILD file, installed the dependencies and am now attempting to run makekpg.
The problem that I have now is that there is no remote URL for the sources, nor are there release tarballs. The PKGBUILD file is maintained together with the "upstream" source code in the same git tree.
Are there any best practices for such a situation?
Thanks!
Last edited by Nikratio (2019-11-10 16:30:13)
Offline
Read the description for the source array in the PKGBUILD man page, it's all explained there.
Offline
The PKGBUILD file is maintained together with the "upstream" source code in the same git tree.
This is common. I used to do this with several of my pages:
https://github.com/TrilbyWhite/Iocane
https://aur.archlinux.org/packages/iocane/
The problem that I have now is that there is no remote URL for the sources
You just said the source code is in git ... is this only a local git repo, or is it hosted somewhere?
If it is only local code that you never intend to share then you could either re-checkout the sources into src or just symlink src to the top-level directory. If there are only a few files, you could - of course - just list those files in the source array.
Of course if you ever intend to share this PKGBUILD, the source code would have to be hosted somewhere that other users could get to it.
Last edited by Trilby (2019-11-10 15:20:18)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Read the description for the source array in the PKGBUILD man page, it's all explained there.
I did read PKGBUILD, but I'm afraid it didn't help me much. The only option that seemed feasible was to enumerate *all* the files individually (relying on them being interpreted relative to PKGBUILD directory). But that seemed rather painful because of the verbosity and need to keep the list up-to-date. I am also not sure how I'd handle subdirectories . Is that what you had in mind?
Last edited by Nikratio (2019-11-10 15:22:37)
Offline
The source is the git repository.
source=(git+file:///path/to/source)
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
Nikratio wrote:The PKGBUILD file is maintained together with the "upstream" source code in the same git tree.
This is common. I used to do this with several of my pages:
https://github.com/TrilbyWhite/Iocane
https://aur.archlinux.org/packages/iocane/Nikratio wrote:The problem that I have now is that there is no remote URL for the sources
You just said the source code is in git ... is this only a local git repo, or is it hosted somewhere?
If it is only local code that you never intend to share then you could either re-checkout the sources into src or just symlink src to the top-level directory. If there are only a few files, you could - of course - just list those files in the source array.
Of course if you ever intend to share this PKGBUILD, the source code would have to be hosted somewhere that other users could get to it.
The Git repo is not hosted anywhere and not intended to be shared.
What do you mean with "re-checkout the sources"? Is there a way to point at a local repository in sources? Looking the description of the format, I didn't see a way.
With the symlinking approach, would I put just "src" into sources, and it would be copied recursively?
Offline
The source is the git repository.
source=(git+file:///path/to/source)
That would be great - but how do I specify the *current* directory?
$ grep source PKGBUILD
source=("foobar::git+file://.#branch=master")
$ makepkg
[..]
-> Cloning foobar git repo...
Cloning into bare repository '/home/nikratio/tmp/foobar'...
fatal: no path specified; see 'git help pull' for valid url syntax
Offline
Figured it out! - `source=("${pkgname}::git+file://$(pwd)#branch=master")` seems to work great. Thanks everyone!
Offline
If you never intend to share the PKGBUILD, then you could leave the source array empty and use "$startdir" to find the source files.
I'd suggest adding some logic to prepare() that makes sure $startdir is the correct git repository.
Last edited by progandy (2019-11-10 15:39:24)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Please remember to mark your thread as solved by editing the first post and amending the topic title.
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
If you never intend to share the PKGBUILD, then you could leave the source array empty and use "$startdir" to find the source files.
I'd suggest adding some logic to prepare() that makes sure $startdir is the correct git repository.
Oh, that's neat since it avoids the pointless cloning! I didn't realize I could leave $source empty.
Will go with this option, thanks! I just hope it won't stop working too soon, given that $startdir is "deprecated and strongly discouraged"...
Offline