You are not logged in.

#1 2026-03-29 23:21:30

stickynotememo
Member
Registered: 2025-09-29
Posts: 13

Creating symlinks

A build script for a python package requires certain files to be in the `/usr/includes/python3.14/CXX` directory. They are installed in the `/usr/includes/python3.14/cxx` directory.

A user workaround for this program has been to symlink the CXX folder to the cxx folder. However, I cannot do that in the PKGBUILD without root permissions. This leaves me with three options.

1. Create a symlink in the user's home directory and point the build script to ~
2. Create a symlink in $pkgdir/usr/includes/python3.1.4
3. Create a symlink in $pkgdir/~

2 and 3 will not work because the build script will be run before pacman moves the symlink into the user's actual filesystem. Alternatively I could point the build script to a path inside $pkgdir, but then the package would break if the package cache is deleted.

Any suggestions?

Offline

#2 2026-03-29 23:41:19

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,680

Re: Creating symlinks

Are these files part of the project you're trying to build, or something external? What are these files, anyway?

Offline

#3 2026-03-29 23:42:07

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,611

Re: Creating symlinks


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2026-03-29 23:55:05

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,386
Website

Re: Creating symlinks

Nothing in the Arch repos provides "/usr/includes/". but perhaps that was a typo. Still, nothing in the Arch repos provides "/usr/include/python3.14/cxx" either.

In any case, if a build script is doing dumb shit, patch the build script and report it upstream.


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

#5 2026-03-30 07:18:24

stickynotememo
Member
Registered: 2025-09-29
Posts: 13

Re: Creating symlinks

@Scimmia The package is https://aur.archlinux.org/packages/python-pysvn.

@WorMzy I think the files are provided by python-pycxx, which is a dependency of python-pysvn. Yes, it is technically /usr/include but it is definitely the package that provides these files.

# pacman -Ql python-pycxx
python-pycxx /usr/
python-pycxx /usr/include/
python-pycxx /usr/include/python3.14/
python-pycxx /usr/include/python3.14/cxx/

@ewaller this would have the same problem as making a symlink AFAICT

Offline

#6 2026-03-30 07:18:28

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,100

Re: Creating symlinks

Is this about https://aur.archlinux.org/packages/python-pysvn ?
There's also https://sourceforge.net/p/pysvn/tickets/21/ - the code looks targeted at windows and win32 is case insensitive, so there might be more problems itr

Last edited by seth (2026-03-30 07:19:18)

Offline

#7 2026-03-30 09:37:13

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,873

Re: Creating symlinks

Creating a symlink in package() should work, but you need to be sure it links to the location where the target will be after installation .

Try Something like

pushd "$pkgdir"/usr/include/python3.14/
ln -s /usr/include/python.3214/cxx CXX
popd

namcap and similar tools will issue a warning/complaint you created a dead link .


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

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 2026-03-30 14:05:01

loqs
Member
Registered: 2014-03-06
Posts: 18,853

Re: Creating symlinks

Based on Lone_Wolf's approach adjusted to apply in prepare() as it is only needed for build and edit the applied patch to add pycxx-dir option pointing to the symlink:

diff --git a/PKGBUILD b/PKGBUILD
index a5373ff..660393c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,7 +15,7 @@ license=('Apache')
 source=("https://downloads.sourceforge.net/project/pysvn/pysvn/V${pkgver}/pysvn-${pkgver}.tar.gz"
        "fix-setup.py.patch")
 sha256sums=('001aeed679e0d516987d9c1ed19d0dc44f74ad4fc9da1fc1873527be0adab029'
-            '59b56272570bdf957570cafb57680a4516f8f0dfbf94c301f133410130b0a8be')
+            'c82137919f3a766f0de4c4807fe079caa8f12b05c37dddbe63734a96bcd60f4e')
 
 prepare() {
   cd "$_name-$pkgver"
@@ -25,6 +25,8 @@ prepare() {
 
   # build with fixed module name and no RPATH
   patch -p1 -i "$srcdir/fix-setup.py.patch"
+  local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
+  ln -s /usr/include/python$python_version/cxx Source/CXX
 }
 
 build() {
diff --git a/fix-setup.py.patch b/fix-setup.py.patch
index 137f7d5..be77ad7 100644
--- a/fix-setup.py.patch
+++ b/fix-setup.py.patch
@@ -14,7 +14,7 @@
          # .so that we'll package.
          os.chdir( 'Source' )
 -        os.system( sys.executable + ' setup.py configure' )
-+        os.system( sys.executable + ' setup.py configure --verbose --fixed-module-name --norpath' )
++        os.system( sys.executable + ' setup.py configure --verbose --fixed-module-name --norpath --pycxx-dir=.' )
          os.system( 'make clean' )
          os.system( 'make' )
  

Last edited by loqs (2026-03-30 14:06:28)

Offline

#9 2026-03-31 22:52:41

stickynotememo
Member
Registered: 2025-09-29
Posts: 13

Re: Creating symlinks

I did consider this option, but like I said above:
> Alternatively I could point the build script to a path inside $pkgdir, but then the package would break if the package cache is deleted.

If I point pycxx-dir to the host system location where the symlink will be copied to, the build script will not run since the files aren't copied until the end of the packaging process, after build() afaik

Last edited by stickynotememo (Yesterday 03:28:32)

Offline

#10 Yesterday 03:38:02

loqs
Member
Registered: 2014-03-06
Posts: 18,853

Re: Creating symlinks

stickynotememo wrote:

@loqs, can you paste in the patch you made?

It was include in https://bbs.archlinux.org/viewtopic.php … 4#p2292804 here it is as well https://gist.github.com/loqs/593c68cf1d … 61df2bfdae

stickynotememo wrote:

I did consider this option, but like I said above:
> Alternatively I could point the build script to a path inside $pkgdir, but then the package would break if the package cache is deleted.

The symlink only needs to exist for the build. The symlink is from "$srcdir"/$_name-$pkgver/Source/CXX to /usr/include/python$python_version/cxx which is provided by python-pycxx which is a dependency so will be present unless that package is corrupted or changed. After the build the symlink / python-pycxx are no longer required.

Last edited by loqs (Yesterday 03:48:21)

Offline

#11 Yesterday 04:23:22

stickynotememo
Member
Registered: 2025-09-29
Posts: 13

Re: Creating symlinks

Ah. Yeah, if python-pycxx is only required for the build then I guess that does make things easier. I don't know how I missed the fact that it was in makedepends and not depends. Thanks for the help and the patch.

Offline

Board footer

Powered by FluxBB