You are not logged in.
In the PKGBUILD file for an AUR I am working on, I get the following error in my package() function:
./install.sh: No such file or directory
here is the function:
package() {
cd /opt/"$pkgname"/pymoab
./install.sh
python setup.py install
}
The file is in the directory, and it is called 'install.sh.cmake'.
I have tried changing the command in the package() function multiple ways, including:
bash install.sh
bash install.sh.cmake
bash ./install.sh
bash ./install.sh.cmake
./install.sh
./install.sh.cmake
. ./install.sh
. ./install.sh.cmake
All give the same error.
I originally wrote this as a set of shells scripts, which work well. In the shell script the command is:
bash install.sh
So I'm not sure why it doesn't work in the package() function.
All input appreciated. Let me know if I can provide more detail.
Offline
If /opt/"$pkgname"/pymoab is created by the PKGBUILD you can not use it in the PKGBUILD as it will not exist until the package is installed.
Offline
Ohh that would explain it. Thanks.
Offline
So are you actually using Arch now or have you just reposted this hiding the fact that your using a different distro?
Offline
But when I look at other AURs, I see that package() is entering directories created in the build function.
Offline
@Slithery, using Arch and seeing the same issue
Offline
But when I look at other AURs, I see that package() is entering directories created in the build function.
Yes, but /opt (or anything underneath) is certainly not created by the build() function. Your PKGBUILD code should ideally only operate within $srcdir and $pkgdir.
Offline
I updated my package() function to only include $srcdir and $pkgdir but I am still seeing the same error:
package() {
cd $srcdir/$pkgname/build
make DESTDIR="${pkgdir}" install
cd $srcdir/$pkgname/pymoab
bash install.sh
python setup.py install
}
bash: install.sh: No such file or directory
Any ideas?
Offline
What are you trying to package, exactly?
Offline
this PKGBUILD is for moab (https://bitbucket.org/fathomteam/moab)
Offline
Post the complete PKGBUILD you are having issues with, we need to see it in it's entirety.
Offline
So the CMakeLists.txt file includes this ( https://bitbucket.org/fathomteam/moab/s … t#lines-89 ), and it has to be processed by cmake to make the install.sh script. Have you done this?
Or better yet, skip install.sh all together, all it does is call setup.py. https://bitbucket.org/fathomteam/moab/s … e#lines-12
Last edited by Scimmia (2022-02-23 17:03:40)
Offline
Sure, see below:
pkgname=moab
pkgver=git
pkgrel=1
pkgdesc="The Mesh-Oriented datABase MOAB is a component for representing and evaluating mesh data"
arch=(x86_64)
url="https://bitbucket.org/fathomteam/moab"
license=(GPL3)
makedepends=(
git
python
cmake
gcc-fortran
eigen
netcdf
hdf5
cython
blas
lapack
python-numpy
python-setuptools
"glibc>=2.34"
)
provides=("${pkgname%}")
source=("${pkgname}::git+${url}.git")
build() {
cd $srcdir/$pkgname
mkdir build && cd build
# test later if it's necessary to have double compilation
cmake .. -DENABLE_HDF5=ON \
-DENABLE_PYMOAB=ON \
-DENABLE_NETCDF=ON \
-DENABLE_FORTRAN=OFF \
-DENABLE_BLASLAPACK=OFF \
-DBUILD_SHARED_LIBS=ON
make
}
package() {
cd $srcdir/$pkgname/build
make DESTDIR="${pkgdir}" install
cd $srcdir/$pkgname/pymoab
bash install.sh
python setup.py install
}
Offline
@Scimmia I don't think I've done that and I'm not really clear on what it means, but when I wrote this as a set of shell scripts it worked fine, so I'm not convinced that that's the issue.
Offline
If you had to run 'python setup.py' separately, it DIDN'T work fine.
Offline
I see. Well that comes after the bash install.sh command so I don't think it would be the reason that that didn't run no?
Offline
ah I just saw your edit. I've tried that and then I get the same error on the python script. Will try again now.
Offline
Similar error on the python script:
[$srcdir]/moab/pymoab/setup.py': [Errno 2] No such file or directory
I can see the file in the directory as "setup.py.in"
Offline
Found it. You're building in $srcdir/$pkgname/build, but you're trying to install pymoab from the raw, unbuilt source in $srcdir/$pkgname/pymoab.
Before you upload the PKGBUILD, though, you have a LOT of things to fix. Even the pkgname is wrong.
Last edited by Scimmia (2022-02-23 17:30:33)
Offline
Ok. I'm not sure how that resolves the issue I'm seeing though. Shouldn't it still be able to run a bash script or a python script even if that were the case? Regardless of where I am building/installing, those files exist in the directories when the commands are run.
What do you mean that the pkgname is wrong?
Offline
That's my entire point, those files do not exist where you're trying to run them. Look for yourself. They only exist in build/pymoab.
As for cleaning up the PKGBUILD, including the pkgname, start here: https://wiki.archlinux.org/title/VCS_package_guidelines
Offline
For cleaning up the PKGBUILD, follow the link above and review the pkgname, pkgver, depends, and makedepends variables (and some checksum variable), then add a pkgver and prepare function to create the build directory as the current use of mkdir (at least without "-p") in the build function will make rebuilds fail.
Last edited by Trilby (2022-02-24 16:13:50)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
When I look I see the files there. If I go to .../src/moab/pymoab I see both the the python script and the shell script (not sure if this forum allows for screenshots). Just to demonstrate, I added an ls command just before it tries to run the python script.
package() {
cd $srcdir/$pkgname/build
make DESTDIR="${pkgdir}" install
cd $srcdir/$pkgname/pymoab
ls
python setup.py install
}
Here is the output
CMakeLists.txt cmake interface_notes.txt pyproject.toml setup.py.cmake.in tests
Makefile.am install.sh.cmake pymoab requirements.txt setup.py.in
python: can't open file '[$srcdir/$pkgname]/pymoab/setup.py': [Errno 2] No such file or directory
So unless I'm misunderstanding something about the way this package() function works, it is certainly in the correct directory when it attempts to run the files.
Offline
install.sh.cmake and setup.py.cmake.in/setup.py.in ARE NOT SCRIPTS. We covered this back in post #12. You cannot run them.
Offline
I see. Seems to be working now. I am past that error at least. Thanks for your help.
Offline