- Arch Linux
- #1 2019-02-07 20:43:50
- [Solved]Optional dependencies that change build process
- #2 2019-02-07 20:48:15
- Re: [Solved]Optional dependencies that change build process
- #3 2019-02-07 20:52:25
- Re: [Solved]Optional dependencies that change build process
- #4 2019-02-07 21:04:53
- Re: [Solved]Optional dependencies that change build process
- Arch Linux
- #1 2010-05-21 19:10:20
- [SOLVED] pacman show dependency list
- #2 2010-05-21 19:14:29
- Re: [SOLVED] pacman show dependency list
- #3 2010-05-21 19:17:07
- Re: [SOLVED] pacman show dependency list
- #4 2010-05-21 19:29:48
- Re: [SOLVED] pacman show dependency list
- #5 2010-05-21 19:40:41
- Re: [SOLVED] pacman show dependency list
- #6 2010-05-21 19:54:29
- Re: [SOLVED] pacman show dependency list
- #7 2010-05-21 20:12:20
- Re: [SOLVED] pacman show dependency list
- #8 2010-05-21 20:40:22
- Re: [SOLVED] pacman show dependency list
- Arch Linux
- #1 2009-11-06 17:57:28
- [SOLVED] pacman log optional dependencies
- #2 2009-11-07 03:12:11
- Re: [SOLVED] pacman log optional dependencies
- #3 2009-11-07 07:14:14
- Re: [SOLVED] pacman log optional dependencies
- #4 2009-11-07 07:44:19
- Re: [SOLVED] pacman log optional dependencies
- #5 2009-11-07 07:50:53
- Re: [SOLVED] pacman log optional dependencies
- #6 2009-11-07 14:32:11
- Re: [SOLVED] pacman log optional dependencies
- #7 2009-11-07 16:22:15
- Re: [SOLVED] pacman log optional dependencies
- #8 2009-11-07 18:19:34
- Re: [SOLVED] pacman log optional dependencies
- #9 2009-11-07 19:18:38
- Re: [SOLVED] pacman log optional dependencies
- #10 2009-11-08 02:05:33
- Re: [SOLVED] pacman log optional dependencies
- #11 2009-11-08 14:00:21
- Re: [SOLVED] pacman log optional dependencies
Arch Linux
You are not logged in.
#1 2019-02-07 20:43:50
[Solved]Optional dependencies that change build process
I’m trying to make a package that optionally depends on another program(its mason script checks whether or not it is installed).
My question is: how to package it so that correct ‘build path’ is chosen? How do official packages deal with it (I can install optional dependency after and the program just knows to use it)?
Last edited by MatlertheGreat (2019-02-07 21:14:02)
#2 2019-02-07 20:48:15
Re: [Solved]Optional dependencies that change build process
If you add it as a makedepends=() then it is guaranteed to be installed during the build.
If you also add it as an optdepends, users can uninstall it (e.g. makepkg -sri) after building the package, and pacman will tell them they could choose to reinstall it.
Does the meson build check only package the optional feature when build-time support was detected?
Managing AUR repos The Right Way — aurpublish (now a standalone tool)
#3 2019-02-07 20:52:25
Re: [Solved]Optional dependencies that change build process
Does the meson build check only package the optional feature when build-time support was detected?
Yes, it adds additional source files to compile. So the resulting program is either with or without the specific feature.
On the other hand, building with the feature included and having later removed the optional dependency will cause errors.
Last edited by MatlertheGreat (2019-02-07 20:56:09)
#4 2019-02-07 21:04:53
Re: [Solved]Optional dependencies that change build process
Yes, it adds additional source files to compile. So the resulting program is either with or without the specific feature.
On the other hand, building with the feature included and having later removed the optional dependency will cause errors.
Then that is not an optional feature. You need to add it to depends. so that it is both compiled and enforced at runtime. Some projects have a plugin-based system that only loads additional features if their dependencies are present, but apparently that is not the case here.
So typically official packages opt to compile with more features, while Gentoo would add USE flags that let users determine whether to enable the features (and then add dependencies as relevant, change meson flags, etc.) and Debian might compile two copies of the program, one with the feature and one without.
In comparison, take vim for example. It optionally depends on python, ruby, lua, perl, and tcl for scripting support, but does so by dlopen() and if the optdepends is not available, then vim will log an error and just tell you there is no support for that scripting language. This is how to do optional depends correctly, but it requires that the source code support it.
Similarly, python applications will often have try/except clauses that attempt to import an optdepends and if that is not available, it will disable the feature.
Each language is a bit different in how it does things, but that is the general way things work.
Managing AUR repos The Right Way — aurpublish (now a standalone tool)
Источник
Arch Linux
You are not logged in.
#1 2010-05-21 19:10:20
[SOLVED] pacman show dependency list
How can I make pacman show all dependencies of some package?
Last edited by silenc3r (2010-05-21 20:00:12)
#2 2010-05-21 19:14:29
Re: [SOLVED] pacman show dependency list
By checking man pacman.
#3 2010-05-21 19:17:07
Re: [SOLVED] pacman show dependency list
Or finding «show dependencies» here.
#4 2010-05-21 19:29:48
Re: [SOLVED] pacman show dependency list
I know about pacman -Qi/Si but I was wondering if there’s some way to show only simple list of dependencies not whole package info.
#5 2010-05-21 19:40:41
Re: [SOLVED] pacman show dependency list
Maybe not a very graceful solution, but still working
#6 2010-05-21 19:54:29
Re: [SOLVED] pacman show dependency list
thanks a lot hidefromkgb, that is exactly what I was looking for
#7 2010-05-21 20:12:20
Re: [SOLVED] pacman show dependency list
Careful, that fails for when depends extend to multiple lines.
This will do it but it a sloppy way I think
Last edited by tesjo (2010-05-21 20:33:14)
#8 2010-05-21 20:40:22
Re: [SOLVED] pacman show dependency list
Here is a little command I wrote a while back while I was learning sed. It gives a bulk output of all your programs, their dependencies and optional dependencies. I ran into the «fails for when depends extend to multiple lines» issue and this should fix that. I haven’t tested it very much so you be the judge.
Small Example Output: (looks much cleaner in the Terminal)
I added the equal signs for looks and to fit my default Terminal window. Just add or subtract them in the command to fit yours or to get rid of them just drop off the last section of the pipe.
In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically. —Sherlock Holmes
Источник
Arch Linux
You are not logged in.
#1 2009-11-06 17:57:28
[SOLVED] pacman log optional dependencies
Coming from ubuntu, just been trying Arch to get to know better the linux system and try a more KISS approach. I really like it, however I had a few troubles on the way which I am resolving slowly.. however concrenng pacman, maybe I am blind but I can’t find a way to get all the messages displayed during some package installation in the pacman.log ; in particular all the optional dependencies are not listed there..
Is there a way to get the full pacman log as shown during the installation in a log file ?
Last edited by Alain2 (2009-11-08 02:05:52)
#2 2009-11-07 03:12:11
Re: [SOLVED] pacman log optional dependencies
if you are looking for the dependencies of a package, try
#3 2009-11-07 07:14:14
Re: [SOLVED] pacman log optional dependencies
I think you are right. When I remove xarchiver and install again:
This is written to the console but not to the logs . maybe on purpose ?
Last edited by kermana (2009-11-07 07:22:14)
#4 2009-11-07 07:44:19
Re: [SOLVED] pacman log optional dependencies
As far as I understand it, the logs contain only stuff which was really installed. There is no value in adding information about stuff you could also install but didn’t choose to do so.
#5 2009-11-07 07:50:53
Re: [SOLVED] pacman log optional dependencies
Why pollute the log with irrelevant info? Pacman’s log only contains information about installed packages. It also contains the post-install messages, if I’m not mistaken (would have to check that, and I’m not on a Linux box atm).
There is no point in having information like this in a log — you can query any package about its dependencies — optional or required — and pacman will tell you about it. It would be totally redundant.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
#6 2009-11-07 14:32:11
Re: [SOLVED] pacman log optional dependencies
this is my output:
maybe there’s a more elegant solution, anyway this one works with both pacman and abs packages.
Last edited by skipio (2009-11-07 14:42:58)
#7 2009-11-07 16:22:15
Re: [SOLVED] pacman log optional dependencies
@All
Thanks for you quick replies
As far as I understand it, the logs contain only stuff which was really installed. There is no value in adding information about stuff you could also install but didn’t choose to do so.
It is not that I chose not to install, it’s more I was not aware of the optional dependency and that information interests me to investigate relevance or not for me. Please consider that I am new to linux (just started on ubuntu about a month ago after years on windows systems), and I am not well aware of all the common useful packages / dependencies as I am on a windows system. The learning curve is quite steep for me at this point..
Why pollute the log with irrelevant info? Pacman’s log only contains information about installed packages. It also contains the post-install messages, if I’m not mistaken (would have to check that, and I’m not on a Linux box atm).
There is no point in having information like this in a log — you can query any package about its dependencies — optional or required — and pacman will tell you about it. It would be totally redundant.
Well I don’t fully share your point of view, I think it is a relevant information, I think it would be good if we were able to set the verbosity level of the log file produced by pacman to add this information displayed during installation (so considered relevant enough during installation to be shown..) for people like me who are not yet well versed in all the packages available and their interest.. If I wanted to push your reasoning, why log package xxx installed at all in the log, you can get this information very easily with pacman -Q for instance, just log the warnings.
Also this is really a problem for me occuring during installation of group packages (as per the Beginner’s guide) where lots of packages are installed at once, and although my screen is 1600×1200, I don’t have time to read and take good note of all these information displayed.
But thank you (and x33a) for making me realize this information is actually the same as displayed in the information pacman -Si or -Qi shows
@skipio
Thanks! I still have not had time to learn bash shell scripting so I can’t really modify your script to my need, but you have the basic good idea! The problem is that your script only capture the first line optional dependency listed for a package, and for instance for the xarchiver package as mentionned by kermana the output is:
Do you think there is there a way to improve your script so it would capture all the optional dependencies ? From the output of a pacman -Qi, I would guess to capture all lines from [grep «Optional Deps»]=true up to the first line starting with a character different from a space char.. ?
#8 2009-11-07 18:19:34
Re: [SOLVED] pacman log optional dependencies
i didn’t notice that bug
i’m not really good with awk, sed, etc. hopefully someone will improve this script. anyway this one should grab all the dependencies correctly.
#9 2009-11-07 19:18:38
Re: [SOLVED] pacman log optional dependencies
optdepsmeta might be interesting for you, too. However, there is a «bug» with optional dependencies without a description and I haven’t found a way to solve it yet (the problem is pacman’s ‘line-wrap’ feature, which will be fixed in pacman 3.4).
#10 2009-11-08 02:05:33
Re: [SOLVED] pacman log optional dependencies
Not sure it is entirely bullet-proof code, I have for instance this in the return of the script:
but that seems to do a good enough job indeed for me
@xduugu
Thanks for your post, I will have a look at your script when I get a bit more comfortable with the arch building system.
I’ll tag the thread as closed then.
Last edited by Alain2 (2009-11-08 02:09:04)
#11 2009-11-08 14:00:21
Re: [SOLVED] pacman log optional dependencies
I saw this and had to take up the challenge.
How’s this? It’s pure sed at work. It shows both required and optional dependencies.
This is a command line version of course so just make an alias for it in .bashrc. If you want to log it then create a cron script to update it. By the way this should alleviate the multi-line issue you were having as I did some reverse thinking on this. I just eliminated what we didn’t need as opposed to just trying to find what we did need. Sometimes that works better.
Here’s an example output: (The actual output is nice and tidy. Pasting into the forum here mucked the alignment up. ) lol!
Name : pcmciautils
Depends On : glibc sysfsutils module-init-tools>=3.2pre9
Optional Deps : None
Name : pcre
Depends On : gcc-libs
Optional Deps : None
Name : perl
perl-archive-tar=1.52 perl-autodie=2.06_01
perl-attribute-handlers=0.85 perl-autoloader=5.68
perl-b-debug=1.11 perl-b-lint=1.11 perl-base=2.14
perl-bignum=0.23 perl-cgi=3.43 perl-class-isa=0.33
perl-compress-raw-bzib2=2.020 perl-compress-raw-zlib=2.020
perl-constant=1.17 perl-cpan=1.9402 perl-cpanplus=0.88
perl-db_file=1.820 perl-dprof=20080331.00
perl-data-dumper=2.124 perl-devel-ppport=3.19
perl-devel-peek=1.04 perl-digest=1.16 perl-digest-md5=2.39
perl-digest-sha=5.47 perl-encode=2.35
perl-encoding-warnings=0.11 perl-exporter=5.63
perl-extutils-cbuilder=0.2602 perl-extutils-command=1.16
perl-extutils-constant=0.22 perl-extutils-embed=1.28
perl-extutils-install=1.54 perl-extutils-makemaker=6.55_02
perl-extutils-manifest=1.56 perl-extutils-parsexs=2.2002
perl-file-fetch=0.20 perl-file-path=2.07_03
perl-file-temp=0.22 perl-filter=1.37
perl-filter-simple=0.84 perl-getopt-long=2.38 perl-if=0.05
perl-io=1.25 perl-io-compress=2.020 perl-io-zlib=1.09
perl-ipc-cmd=0.46 perl-ipc-sysv=2.01 perl-libnet=1.22
perl-locale-codes=2.07 perl-locale-maketext=0.13
perl-locale-maketext-simple=0.18 perl-log-message=0.02
perl-log-message-simple=0.04 perl-mime-base64=3.08
perl-math-bigint=1.89 perl-math-bigint-fastcalc=0.19
perl-math-bigrat=0.22 perl-math-complex=1.56
perl-memoize=1.01_03 perl-module-build=0.340201
perl-module-corelist=2.18 perl-module-load=0.16
perl-module-load-conditional=0.30 perl-module-loaded=0.02
perl-module-pluggable=3.9 perl-next=0.64 perl-net-ping=2.36
perl-object-accessor=0.34 perl-package-constants=0.02
perl-params-check=0.26 perl-parent=0.221
perl-parse-cpan-meta=1.39 perl-pathtools=3.30
perl-pod-escapes=1.04 perl-pod-latex=0.58
perl-pod-parser=1.37 perl-pod-perldoc=3.14_04
perl-pod-simple=3.07 perl-podlators=2.2.2 perl-safe=2.18
perl-scalar-list-utils=1.21 perl-selfloader=1.17
perl-shell=0.72_01 perl-storable=2.20 perl-switch=2.14
perl-sys-syslog=0.27 perl-term-cap=1.12 perl-term-ui=0.20
perl-test=1.25_02 perl-test-harness=3.17
perl-test-simple=0.92 perl-text-balanced=2.0.0
perl-text-parsewords=3.27 perl-text-soundex=3.03
perl-text-tabs+wraps=2009.0305 perl-thread-queue=2.11
perl-thread-semaphore=2.09 perl-threads=1.72
perl-threads-shared=1.29 perl-tie-file=0.97_02
perl-tie-refhash=1.38 perl-time-hires=1.9719
perl-time-local=1.1901 perl-time-piece=1.15
perl-unicode-collate=0.52 perl-unicode-normalize=1.03
perl-version=0.77 perl-win32=0.39 perl-win32api-file=0.1101
perl-xsloader=0.10 perlio-via-quotedprint=0.06
Depends On : gdbm db>=4.8 coreutils glibc sh
Optional Deps : None
Name : perl-crypt-ssleay
Depends On : perl>=5.10.0
Optional Deps : None
Have a nice day!!
Hope this helps
P.S. Here’s another little tool I wrote you might find useful. Add to .bashrc
wtd: (What They Do)
This will output the description for the program(s) with program name in the title.
Edit: Well, I just showed above with Perl (duh!) I’m still having a multi-line issue with the Provides line. Where a program shows more than one Provides entry it’s only deleting the first line. I’ll work on it and get back. Other than that this works (at least it should).
Edit2: Here is a slightly hacked form of the above command that at least fixes the perl issue. This will still fail when encountering other multi-line Provides lines. I think those are fairly rare so I’m leaving it at that. Sed does have limits and I’m sure a more complex command could be written using sed but I think this will get you in the ballpark.
Last edited by harryNID (2009-11-08 19:12:03)
In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically. —Sherlock Holmes
Источник