You are not logged in.
Pages: 1
Topic closed
Hi, all!
I want to understand how to download source code from the arch repositories. Like `apt-get source <package>`.
I know about yaourt, pacman, etc. but I was required to manually change some code lines of a package and rebuild it.
So, the first thing I did is:
sudo pacman -S abs
error: target not found: abs
To my surprise, there is no such a package. As I understand abs was suppressed over using svn instead. Arch wiki suggest the following instructions:
svn checkout --depth=empty svn://svn.archlinux.org/packages
cd packages
svn update <package>
It seems like it works but on the requested openvpn package - I didn't find anything useful:
svn checkout --depth=empty svn://svn.archlinux.org/packages
cd packages
svn update openvpn
Updating 'openvpn':
A openvpn
A openvpn/repos
A openvpn/repos/core-i686
A openvpn/repos/core-i686/0004-openssl-1-1-0.patch
A openvpn/repos/core-i686/PKGBUILD
A openvpn/repos/core-i686/openvpn.install
A openvpn/repos/core-x86_64
A openvpn/repos/core-x86_64/0004-openssl-1-1-0.patch
A openvpn/repos/core-x86_64/PKGBUILD
A openvpn/repos/core-x86_64/openvpn.install
A openvpn/trunk
A openvpn/trunk/PKGBUILD
A openvpn/trunk/0004-openssl-1-1-0.patch
A openvpn/trunk/openvpn.install
So how to do things the right way in order to download_souce-build-install a package in the Arch environment?
I do not use svn on my day-to-day basis, so if there are any options to use git instead - please, give the instructions how to use it!
Last edited by timfayz (2017-05-29 12:36:44)
Offline
You can use the web interface, e.g. https://git.archlinux.org/svntogit/pack … ges/pacman
There are also tools that you can use such as pbget. There should be others on the wiki.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
You need to look in the source array in the PKGBUILD file.
Offline
slithery, I think the OP is a step behind that. Once one has the PKGBUILD it's as simple as `makepkg -o`. But the reference to ABS an SVN show that the OP is still trying to get the PKGBUILD (and associated build files).
timfayz, abs was the right answer for this until quite recently. I'm not familiar with the above-mentioned pbget, but asp is (also) a good substitute for abs.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
asp is not just a substitute for abs, it is the official replacement.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
asp is not just a substitute for abs, it is the official replacement.
I'm glad I checked here, I haven't checked the news site for a while, and would be confused about the abs if I needed it haha
Offline
asp is not just a substitute for abs, it is the official replacement.
Complete with appropriate commit message....
Offline
Thank you for the explanation regarding abs and asp. It's much clearer now.
However, I didn't get the idea how to use this staff to build "pacman-compatible" package from the source. After a long searching, I've ended up with getting sources from github (https://github.com/OpenVPN/openvpn) and build it according to docs. But the question is how can I, later on, do somethings like this:
tar -zxf openvpn.tar.gz
cd openvpn
./configure
make
#skipping make install
cd ../ && tar -cf openvpn.tar
pacman -U openvpn.tar
So the point is I want to install it like an ordinary package to be able to remove it later using pacman.
Last edited by timfayz (2017-05-30 07:48:48)
Offline
Not sure why you want this but... use makepkg once you get the PKGBUILD and related files. Just add an exit command after the make setup and manually tar up the srcdir.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I might get killed for this, but usually I do:
$ yaourt -G <package>
$ cd <package>
$ makepkg -sr --nobuild
Last edited by smirky (2017-05-30 07:57:26)
Personal spot :: https://www.smirky.net/ :: Try not to get lost!
Offline
I might get killed for this [...]
Nah, we'll just throw you in a lake. With some weights.
$ yaourt -G <package>
How is this better than `git clone https://aur.archlinux.org/<package>`? It uses an unsupported tool, and last time I checked, it didn't bring the history with it.
--edit-- I just realised that the `git clone` approach was never posted in this thread. I apologise. I must've confused it with another, similar, active thread.
--edit2-- And I also just realised that this is about official packages, too, so:
git clone https://git.archlinux.org/svntogit/packages.git --single-branch -b packages/{pkgbase} # for core/extra
git clone https://git.archlinux.org/svntogit/community.git --single-branch -b packages/{pkgbase} # for community
Scripting this is recommened. And I note to myself: should always get some coffeine before posting here in the morning. I apologise.
Last edited by ayekat (2017-05-30 08:18:47)
Offline
Thank you for the explanation regarding abs and asp. It's much clearer now.
However, I didn't get the idea how to use this staff to build "pacman-compatible" package from the source. After a long searching, I've ended up with getting sources from github (https://github.com/OpenVPN/openvpn) and build it according to docs. But the question is how can I, later on, do somethings like this:tar -zxf openvpn.tar.gz cd openvpn ./configure make #skipping make install cd ../ && tar -cf openvpn.tar pacman -U openvpn.tar
So the point is I want to install it like an ordinary package to be able to remove it later using pacman.
You need to use a PKGBUILD and makepkg. The PKGBUILD contains the build instructions and necessary metadata. It's really just a Bash script that runs the build commands (e.g. configure, make) and installs the files to a local directory along with some metadata. The resulting package is just an archive of that directory, but it's not the same as archiving the output of "make" yourself, as in your example above.
Basically, whatever commands you need to build the package on the command-line go in the PKGBUILD, which is just a Bash script with a fixed format. If you want to create a custom package, edit the PKGBUILD and add the commands that you would run on the command-line. Makepkg will then download the source files, modify them according to your commands, and build the package.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I just test built (test got?) a package (nvidia), and I found asp to be a lot more intuitive, and it also was a giant help to tell the user where the packages were located, rather than hunting them down after downloading them like with the abs
it was as simple as
asp checkout nvidia
where with the abs, you had to specify the target repo, i.e. core/pacman, so you'd have to pacman -Ss first to figure out the repo (or download the entire abs snapshot which is bandwidth/space/time consuming). by far my favourite feature of asp, however, is that it tells you the download location.
Last edited by HiImTye (2017-05-31 22:50:15)
Offline
smirky wrote:I might get killed for this [...]
Nah, we'll just throw you in a lake. With some weights.
$ yaourt -G <package>
How is this better than `git clone https://aur.archlinux.org/<package>`? It uses an unsupported tool, and last time I checked, it didn't bring the history with it.
--edit-- I just realised that the `git clone` approach was never posted in this thread. I apologise. I must've confused it with another, similar, active thread.
--edit2-- And I also just realised that this is about official packages, too, so:
git clone https://git.archlinux.org/svntogit/packages.git --single-branch -b packages/{pkgbase} # for core/extra git clone https://git.archlinux.org/svntogit/community.git --single-branch -b packages/{pkgbase} # for community
Scripting this is recommened. And I note to myself: should always get some coffeine before posting here in the morning. I apologise.
And the final step is to realize that someone else has already written a script to do that. And it's called asp and you can get it from [extra].
It even includes some extras like resolving pkgname ==> pkgbase via the Arch website, for split package support.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
I might get killed for this, but usually I do:
$ yaourt -G <package> $ cd <package> $ makepkg -sr --nobuild
Except... yaourt uses (used) abs, which means this no longer works and is removed in unreleased -git versions of yaourt.
There is, however, an undocumented yaourtrc config variable to make it download the snapshots from the svntogit repository, which said unreleased -git version of yaourt now unilaterally switches to.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
And the final step is to realize that someone else has already written a script to do that.
Yes, there was quite a lack of brain my post.
OTOH, as a response to that suggestion to use an AUR helper, showing that there is no magic behind the process of obtaining a PKGBUILD seems still valid to me
Offline
And the final step is to realize that someone else has already written a script to do that. And it's called asp and you can get it from [extra].
It even includes some extras like resolving pkgname ==> pkgbase via the Arch website, for split package support.
And if you want that plus support for AUR packages, there's pbget which was posted above
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I might get killed for this, but usually I do:
$ yaourt -G <package> $ cd <package> $ makepkg -sr --nobuild
Thanks, best of all solutions
Offline
Please don't empty post.
https://wiki.archlinux.org/index.php/Co … mpty_posts
As this is a five month old topic, and OP seems to have abandoned it, I'm going to go ahead and close it now.
Closing.
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
Pages: 1
Topic closed