You are not logged in.

#1 2020-10-03 06:50:05

Anonymous20210217
Banned
Registered: 2020-10-03
Posts: 5

[SOLVED] "WARNING: Package contains reference to $srcdir"

Hii everybody....!

I recently installed Arch on my laptop and have a very few experience in Arch. After installing, I was successful to set up GUI and other components. I installed pamac GUI to manage packages from official repos and AUR. While building `font-manager` package from AUR in pamac, it throws a warning like this :

==> WARNING: Package contains reference to $srcdir
usr/lib/font-manager/libfontmanager.so.0.7.9

Should I worry about this warning ? Is it harmful to my system's health anyway or is just a debug info ? After googling a bit, I found that this warning seems to affect many packages in AUR.

Last edited by Anonymous20210217 (2020-10-04 05:56:37)

Offline

#2 2020-10-03 13:51:47

philo
Member
Registered: 2015-01-26
Posts: 275

Re: [SOLVED] "WARNING: Package contains reference to $srcdir"

Offline

#3 2020-10-03 14:13:59

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,456

Re: [SOLVED] "WARNING: Package contains reference to $srcdir"

@abhidesh128 Do you get the same warning if you use makepkg as per @philo's link? AUR helpers are not recommended, especially if you don't have a lot of experience with building AUR packages the recommended way.

Offline

#4 2020-10-03 14:17:16

Daerandin
Member
From: Norway
Registered: 2013-05-07
Posts: 280
Website

Re: [SOLVED] "WARNING: Package contains reference to $srcdir"

https://wiki.archlinux.org/index.php/Ma … to_$srcdir

This has nothing to do with using an aur helper.

EDIT: In case it is not clear, this is generally not a problem and is frequently caused by the __FILE__ macro in C/C++ code, which can be safely ignored.

Last edited by Daerandin (2020-10-03 14:21:49)

Offline

#5 2020-10-03 17:27:57

loqs
Member
Registered: 2014-03-06
Posts: 19,043

Re: [SOLVED] "WARNING: Package contains reference to $srcdir"

diff --git a/PKGBUILD b/PKGBUILD
index 834f1e4..1330a6f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -22,7 +22,7 @@ sha256sums=('654ed997ffb4671ba943a7d76ccdf305a20aa46f12c65845604211c16bde36da')
 
 build() {
     cd "$pkgname-$pkgver"
-    meson --prefix /usr --buildtype=release build_dir
+    meson --prefix /usr --libexecdir lib --buildtype=release build_dir -D reproducible=true
     ninja -v -C build_dir
 }
 

-D reproducible=true fixes the use of $srcdir
--libexecdir lib changes the installation layout to match Arch guidelines which use /usr/lib/$pkgname or /usr/bin instead of /usr/libexec.

Last edited by loqs (2020-10-03 17:30:01)

Offline

#6 2020-10-04 05:51:35

Anonymous20210217
Banned
Registered: 2020-10-03
Posts: 5

Re: [SOLVED] "WARNING: Package contains reference to $srcdir"

Hii..!

Thank you all for your comments. I carried out an experiment in which first I built font manager with the recommended way as @philo and @twelveeighty mentioned, and then again tried it building with the way mentioned by @loqs.

Building with the recommended way gave me the same warning. I used this command to find out which files are causing this :

 $ grep -R "$PWD/src" pkg/ 

It gave me these results :

Binary file pkg/font-manager/usr/lib/font-manager/libfontmanager.so.0.7.9 matches
Binary file pkg/font-manager/usr/lib/font-manager/libfontmanager.so.0 matches
Binary file pkg/font-manager/usr/lib/font-manager/libfontmanager.so matches

Then I tried the way mentioned by @loqs. I edited PKGBUILD file and rebuilt font manager in pamac. It worked correctly and didn't threw that warning.

I guess that warning is causing because some portion of PKGBUILD is not in conformance with Arch's Guidelines. Also, as @Daerandin mentioned, I guess this will not cause any problem and can be safely ignored. Though I didn't find the __FILE__ macro in source files while I built it manually, so the reason for this may be random.

Currently, the warning is gone, so marking this as solved.

Last edited by Anonymous20210217 (2020-10-04 05:59:03)

Offline

#7 2020-10-05 04:48:50

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] "WARNING: Package contains reference to $srcdir"

https://github.com/FontManager/font-man … in#L30-L35

static const gchar *POSSIBLE_SCHEMA_DIRS[] = {
    "@prefix@/share/glib-2.0/schemas",
#ifdef NOT_REPRODUCIBLE
    "@abs_top_srcdir@/data"
#endif

This code is purely intended for letting you run it in a git checkout and thus hardcodes the source directory as an additional lookup path for data files. Amazing... this should be the default behavior, in lieu of which the PKGBUILD should definitely pass this option.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB