You are not logged in.

#1 2021-09-12 05:32:57

followait
Banned
Registered: 2019-11-01
Posts: 58

Failed to create symbolic link when makepkg

pkgname=wxgtk3-my
pkgver=3.1
pkgrel=1
arch=('x86_64')
url="https://wxwidgets.org"
license=('LGPL')
makedepends=('gst-plugins-base' 'glu' 'webkit2gtk' 'libnotify')
options=('strip')
source=("$pkgname-$pkgver"::"git+ssh://github.com/wxWidgets/wxWidgets.git")
sha256sums=('SKIP')
install_prefix="/usr/local"

build() {
    cd "$pkgname-$pkgver"

    cmake -S . \
          -B out -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_INSTALL_PREFIX="$install_prefix" \
          -DwxBUILD_INSTALL=ON \
          -DwxBUILD_SHARED=ON

    cmake --build out
}

package() {  
    pkgdesc='GTK+3 implementation of wxWidgets API for GUI'
    depends=('gtk3' 'gst-plugins-base-libs' 'libsm' 'libxxf86vm' 'libnotify')
    optdepends=('webkit2gtk: for webview support')
    conflicts=('wxgtk<3.0.3.1-2' 'wxgtk3')
    provides=('wxgtk3')

    cd "$pkgname-$pkgver"
    DESTDIR="$pkgdir/" cmake --install out
    ln -s "$install_prefix/lib/wx/config/gtk3-unicode-3.1" "$pkgdir$install_prefix/bin/wx-config-gtk3"
    ln -s "$install_prefix/bin/wxrc-3.1" "$pkgdir$install_prefix/bin/wxrc"
}
CMake Error: failed to create symbolic link '/usr/local/bin/wx-config': Permission denied

Ignore the error, and do ln explicitly in package() can solve the problem.
But better if no error reporting, because it's misleading, it might waste the time of a user of the PKGBUILD.
Any good solution?

Last edited by followait (2021-09-12 06:39:49)

Offline

#2 2021-09-12 05:54:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Failed to create symbolic link when makepkg

Paste the PKGBUILD, a single line is useless: https://bbs.archlinux.org/viewtopic.php?id=57855


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2021-09-12 06:22:26

seth
Member
Registered: 2012-09-03
Posts: 51,165

Re: Failed to create symbolic link when makepkg

It also looks like cmake is trying to create a symlink in an absolute path of the build host?
That's hardly what you want anyway.

Offline

#4 2021-09-12 06:40:53

followait
Banned
Registered: 2019-11-01
Posts: 58

Re: Failed to create symbolic link when makepkg

jasonwryan wrote:

Paste the PKGBUILD, a single line is useless: https://bbs.archlinux.org/viewtopic.php?id=57855

PKGBUILD all there now

Offline

#5 2021-09-12 06:43:27

seth
Member
Registered: 2012-09-03
Posts: 51,165

Re: Failed to create symbolic link when makepkg

install_prefix="/usr/local"
-DCMAKE_INSTALL_PREFIX="$install_prefix" \

Offline

#6 2021-09-12 11:38:01

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,919

Re: Failed to create symbolic link when makepkg

setting install_prefix to /usr gives the same error.

It happens in package() and at the very end of the --install command .
Building with ninja instead of make also gives that error, maybe something in the sourcecode causes it .

A few more comments :

Atleast cmake and git should be added to makedepends .

source=("$pkgname-$pkgver"::"git+ssh://github.com/wxWidgets/wxWidgets.git")

This will fail if the makepkg user doesn't have a valid ssh login configured.
Using git+https instead will retrieve  a public read-only copy without needing user configuration.

Incase you do want to stick with ssh access, add openssh to makedepends.
(adding  a comment to the PKGBUILD that ssh access needs to be configured may also be useful)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2021-09-12 12:21:51

seth
Member
Registered: 2012-09-03
Posts: 51,165

Re: Failed to create symbolic link when makepkg

I'd say that the install_prefix needs to go somewhere to $pkgdir$install_prefix

The call in package() is probably not the issue since

The OP wrote:

Ignore the error, and do ln explicitly in package() can solve the problem.

Offline

#8 2021-09-12 12:48:40

followait
Banned
Registered: 2019-11-01
Posts: 58

Re: Failed to create symbolic link when makepkg

Lone_Wolf wrote:

setting install_prefix to /usr gives the same error.

It happens in package() and at the very end of the --install command .
Building with ninja instead of make also gives that error, maybe something in the sourcecode causes it .

A few more comments :

Atleast cmake and git should be added to makedepends .

source=("$pkgname-$pkgver"::"git+ssh://github.com/wxWidgets/wxWidgets.git")

This will fail if the makepkg user doesn't have a valid ssh login configured.
Using git+https instead will retrieve  a public read-only copy without needing user configuration.

Incase you do want to stick with ssh access, add openssh to makedepends.
(adding  a comment to the PKGBUILD that ssh access needs to be configured may also be useful)

Quite useful though I use it privately.
Thanks

Last edited by followait (2021-09-12 12:48:50)

Offline

Board footer

Powered by FluxBB