You are not logged in.
Imagine you need to install a proprietary software that you need to login to get the executable. The file goes to you Downloads folder. To avoid the (small) hassle of moving the file to your PKGBUILD location, how can I simply define a source file that is in the user's Download folder?
The closest I've got was
source=(file://$HOME/Downloads/$installer)but that doesn't work because the variables in the path get replaced such as:
source=(file:///home/<myUsername>/Downloads/<theActualFile>)How to make the <userName> part generic?
Offline
My download folder is /tmp and the browser also asks me where to store stuff - don't blindly assume things about 3rd systems.
That being said:
the path get replaced such as
Where when and how?
The PKGBUILD will be interpreted on the building system, ie. on *your* system $HOME gets expanded to /home/cafe and on my system to /home/seth - what should be what you want, no?
Offline
Thanks seth
Digging a little deeper, I found out that the variable replacement happens when generating the .SRCINFO file.
makepkg --printsrcinfo > .SRCINFOSo I manually edited the file to remove the user refererence. Now it is working as intended.
Package is: https://aur.archlinux.org/packages/dsim (you can compare the first submission with the last one)
Thanks for the help.
Offline
You're thanking him while ignoring the main point of his post? DO NOT DO WHAT YOU'RE DOING. Assuming people download to $HOME/Downloads is just insane.
Offline
Just to confirm, there's no $HOME/Downloads in my system
Offline
The basis for the use of `$HOME/Downloads` is that the user is incapable of moving a file into the same directory as the PKGBUILD if a different download location was used?
Offline
To avoid the (small) hassle of moving the file to your PKGBUILD location
s/incapable/too lazy/Offline
i use ~/downloads because its more sane

Last edited by system72 (2025-11-25 06:31:55)
Offline
I remember the time when arch wiki was a place were people would help each other. It's a shame we've lost that spirit.
I did not like been called insane when I was just trying to help others creating a package that would simplify other's people life.
Assuming that people use a standard XDG dirs location is perfectly fine.
I thanked seth because he did helped me think a little deeper about this _simple_ problem. The others were just toxic.
Offline
I would not consider pointing out one's default download location to be "toxic", if if so - I started that.
Also *you* have not been called insane by anyone, but relying on the premise of a standard absolute download location. It is in the sense that it is not a sane premise as people have at least anecdotally rejected it.
The chosen pattern here is completely uncommon and therefore unexpectable and would in doubt force users to create a hard coded path predetermined by you.
If you really think locating the sources next to the pkgbuild is too much effort, you could remove it from the array and find it in the filesystem in a custom prepare or build function - I personally would not necessarily consider that a sane approach either (for its ridiculous inefficiency)
The overall suggestion in this thread, however toxic, remains to require the sources in a relative path to not force specific environments on your users.
Offline
There are two paths that are defined to be available in a PKGBUILD $srcdir and $pkgdir. Where $srcdir, $pkgdir and $HOME resolve to is undefined. As such paths are undefined they should not be relied upon. You are also imposing another requirement on the build environment used by not quoting $srcdir and $pkgdir meaning those paths can not contain spaces. Pointing out these issues is not intended to be toxic or targeted at you in particular.
Last edited by loqs (2025-11-30 22:02:46)
Offline