You are not logged in.

#1 2019-11-10 15:14:25

Nikratio
Member
Registered: 2019-11-10
Posts: 6

[SOLVED] How to create package without remote sources

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

#2 2019-11-10 15:17:20

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] How to create package without remote sources

Read the description for the source array in the PKGBUILD man page, it's all explained there.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2019-11-10 15:19:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] How to create package without remote sources

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.

Last edited by Trilby (2019-11-10 15:20:18)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2019-11-10 15:21:51

Nikratio
Member
Registered: 2019-11-10
Posts: 6

Re: [SOLVED] How to create package without remote sources

Slithery wrote:

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

#5 2019-11-10 15:23:59

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,783
Website

Re: [SOLVED] How to create package without remote sources

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

#6 2019-11-10 15:26:09

Nikratio
Member
Registered: 2019-11-10
Posts: 6

Re: [SOLVED] How to create package without remote sources

Trilby wrote:
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

#7 2019-11-10 15:31:38

Nikratio
Member
Registered: 2019-11-10
Posts: 6

Re: [SOLVED] How to create package without remote sources

WorMzy wrote:

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

#8 2019-11-10 15:36:32

Nikratio
Member
Registered: 2019-11-10
Posts: 6

Re: [SOLVED] How to create package without remote sources

Figured it out! - `source=("${pkgname}::git+file://$(pwd)#branch=master")` seems to work great. Thanks everyone!

Offline

#9 2019-11-10 15:37:47

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

Re: [SOLVED] How to create package without remote sources

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

#10 2019-11-10 15:50:37

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,783
Website

Re: [SOLVED] How to create package without remote sources

Please remember to mark your thread as solved by editing the first post and amending the topic title.

https://wiki.archlinux.org/index.php/Co … ow_to_post


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

#11 2019-11-10 16:29:21

Nikratio
Member
Registered: 2019-11-10
Posts: 6

Re: [SOLVED] How to create package without remote sources

progandy wrote:

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

Board footer

Powered by FluxBB