You are not logged in.
I'm trying to automatically recompile onedrive-abraunegg when liblphobos has been updated.
I have the following command:
yay -S --rebuild --answerclean None --nodiffmenu onedrive-abraunegg
But it asks me to select providers interactively for "d-compiler" and "d-runtime":
:: There are 2 providers available for d-compiler:
:: Repository extra
1) dmd 2) ldc
Enter a number (default=1):
==> 2
I can't find how to preselect ldc and liblphobos. How do I do that, so that this can be scripted and doesn't require input?
For more context: I frequently encounter the following issue:
/usr/bin/onedrive: error while loading shared libraries: libphobos2-ldc-shared.so.104: cannot open shared object file: No such file or directory
Which is caused by dynamic linking and requires a recompilation. I'm trying to resolve this automatically through a pacman hook, in order no to be stuck with a broken OneDrive. I currently have "/etc/pacman.d/hooks/onedrive-recompile.hook":
[Trigger]
Operation = Upgrade
Type = Package
Target = liblphobos
[Action]
Description = Recompile onedrive-abraunegg with new liblphobos.
When = PostTransaction
Depends = onedrive-abraunegg
Exec = /usr/bin/yay -S --rebuild --answerclean None --nodiffmenu onedrive-abraunegg
Offline
It's a make dependency, no idea whether yay has anything for that, but you could just explicitly install and remove the package around the build (if you don't want to keep it around all the time)?
Offline
...
Exec = /usr/bin/pacman -S --asdeps ldc liblphobos
Exec = /usr/bin/yay -S --rebuild --answerclean None --nodiffmenu onedrive-abraunegg
However I doubt invoking pacman (or yay which is just a wrapper for pacman) from within a pacman hook is wise. But if your yay command worked in that context, the additional installation of the build deps would work fine too.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
It's probably indeed not wise to have such a hook indeed, but what's a good alternative?
I could try to install those dependencies in the same command indeed, but the hook is also on that package.
Offline
Schedule the update, eg. fork a script that first waits five minutes or so or add a systemd timer, atq job or a trigger for a cronjob.
Offline
Or maybe it's a good idea that I create a binary version of this package, so that this issue doesn't exist for me and other people anymore?
Offline
How would that fix anything about the rebuild requirement - worse, you could not rebuild it b/c it's now some precompiled binary.
Offline
A good alternative could be a hook just echoing a message telling you to rebuild that package. In fact there are ready made tools just for this purpose (to list which foreign packages need to be rebuilt).
If you really wanted, you could then have a script that automated everything needed to rebuild/install it, though I don't know how much simpler it could be than:
cd /path/to/thing && makepkg -risc
Yay seems to make it more complicated.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Another alternative is to statically link in the libraries from liblphobos as Arch still packages them; based on [1] and build tested only, the following diff shows the changes I made to the PKGBUILD:
diff --git a/PKGBUILD b/PKGBUILD
index 0eab432..016e6ed 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,14 +11,14 @@ license=('GPL')
conflicts=('onedrive' 'onedrive-abraunegg-git' 'onedrive-bin' 'onedrive-git' 'onedrive-fork-git')
source=("https://github.com/abraunegg/onedrive/archive/v$pkgver.tar.gz")
provides=("onedrive=$pkgver")
-depends=('libnotify' 'sqlite' 'd-runtime')
-makedepends=('d-compiler')
+depends=('libnotify' 'sqlite')
+makedepends=('ldc' 'liblphobos')
md5sums=('09a7b7be0f24006ec7afd10e2ba194da')
build() {
# Fix "W: ELF file ('usr/bin/onedrive') lacks FULL RELRO, check LDFLAGS."
# https://bbs.archlinux.org/viewtopic.php?id=280157
- export DCFLAGS='-L-zrelro -L-znow'
+ export DCFLAGS='-L-zrelro -L-znow -L--as-needed -L-l:libphobos2-ldc.a -L-l:libdruntime-ldc.a'
cd "$_pkgname-$pkgver"
./configure --sysconfdir=/etc \
[1]: https://forum.dlang.org/thread/irvhgnbw … .dlang.org
Last edited by loqs (2023-11-05 18:32:10)
Offline
How would that fix anything about the rebuild requirement - worse, you could not rebuild it b/c it's now some precompiled binary.
By static linking. So no rebuilds would be needed.
Offline
A good alternative could be a hook just echoing a message telling you to rebuild that package. In fact there are ready made tools just for this purpose (to list which foreign packages need to be rebuilt).
If you really wanted, you could then have a script that automated everything needed to rebuild/install it, though I don't know how much simpler it could be than:
cd /path/to/thing && makepkg -risc
Yay seems to make it more complicated.
This makes it seem like what I'm trying to do is an exotic use case. But this must pretty common, no?
Can you give an example of such a tool? So that tool would run as a pacman hook and then after pacman updates, that list can be used to do rebuilds?
Offline
Another alternative is to statically link in the libraries from liblphobos as Arch still packages them; based on [1] and build tested only, the following diff shows the changes I made to the PKGBUILD:
diff --git a/PKGBUILD b/PKGBUILD index 0eab432..016e6ed 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -11,14 +11,14 @@ license=('GPL') conflicts=('onedrive' 'onedrive-abraunegg-git' 'onedrive-bin' 'onedrive-git' 'onedrive-fork-git') source=("https://github.com/abraunegg/onedrive/archive/v$pkgver.tar.gz") provides=("onedrive=$pkgver") -depends=('libnotify' 'sqlite' 'd-runtime') -makedepends=('d-compiler') +depends=('libnotify' 'sqlite') +makedepends=('ldc' 'liblphobos') md5sums=('09a7b7be0f24006ec7afd10e2ba194da') build() { # Fix "W: ELF file ('usr/bin/onedrive') lacks FULL RELRO, check LDFLAGS." # https://bbs.archlinux.org/viewtopic.php?id=280157 - export DCFLAGS='-L-zrelro -L-znow' + export DCFLAGS='-L-zrelro -L-znow -L--as-needed -L-l:libphobos2-ldc.a -L-l:libdruntime-ldc.a' cd "$_pkgname-$pkgver" ./configure --sysconfdir=/etc \
Nice, thanks. Could be useful to create e.g. "onedrive-abraunegg-bin" on AUR.
Offline
Nice, thanks. Could be useful to create e.g. "onedrive-abraunegg-bin" on AUR.
It was intended solely to help you. As you have so much difficulty in maintaining your system with respect to the AUR package you use.
Offline
Can you give an example of such a tool? So that tool would run as a pacman hook and then after pacman updates, that list can be used to do rebuilds?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline