You are not logged in.
Hello!
Can someone please make me a PKGBUILD for my project (https://gitlab.com/T4rtP1ck73/aio-backup)? Also, if you have a gitlab/github, please give me the link to it so I can give credit . Thanks!
Last edited by T4rtP1ck73 (2021-08-14 14:29:39)
Offline
Why do you think that you need a makefile when building the project doesn't involve make?
Offline
I mixed up "makefile" with "PKGBUILD", LOL
Offline
OK, so follow the wiki page I linked to and post what you've come up with so far.
Offline
pkgname=aio-backup
pkgver=0.1.2
pkgrel=3
makedepends=('rust' 'cargo')
arch=('any')
prepare() {
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release
}
package () {
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
}
\
I really can't figure out how to make the pkgbuild, I pretty much just gave up.
Last edited by T4rtP1ck73 (2021-08-14 14:44:51)
Offline
That looks like an improvement over what you had in your previous thread. What is missing, or what's wrong (you already know about the source array mentioned in your previous thread)? Where are you stuck? Does that result in errors? If so, what are they? Note that you should use the advice in the rust PKGBUILD page as a supplement to the general PKGBUILD wiki page.
I pretty much just gave up.
Ah ... that's not how this works. We're here to help, but you need to make an effort. Again, the content of the PKGBUILD in the last post shows you were making effort and making progress - keep it up. Ask specific questions to get useful feedback.
Last edited by Trilby (2021-08-14 16:01:53)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Ok, but what is
srcdir
?
Offline
This is all explained in the wiki...
https://wiki.archlinux.org/title/Creating_packages
https://wiki.archlinux.org/title/PKGBUILD
Offline
Well, the explanation isn't super clear to me. From what I understand srcdir is the directory where the package is extracted, is that correct? If so, then isn't pkgdir the exact same thing?
Offline
Well, the explanation isn't super clear to me. From what I understand srcdir is the directory where the package is extracted, is that correct? If so, then isn't pkgdir the exact same thing?
No Creating_packages#Defining_PKGBUILD_variables
makepkg defines two variables that you should use as part of the build and install process:
srcdir
This points to the directory where makepkg extracts or symlinks all files in the source array.pkgdir
This points to the directory where makepkg bundles the installed package, which becomes the root directory of your built package.
Have you added the source for your package to the source array?
Offline
Oh, yes I have
Offline
So what are you currently stuck on? What is the current PKGBUILD?
Edit:
makedepends=('rust' 'cargo')
As the project requires the nightly release of rust makedepends should be rustup or rust-nightly.
Some changes I made as a result of having to use rustup
prepare() {
...
RUSTUP_HOME="$srcdir/.rustup" rustup install nightly
RUSTUP_HOME="$srcdir/.rustup" cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
...
build() {
...
RUSTUP_HOME="$srcdir/.rustup" cargo build --frozen \
--release \
--target-dir=target
}
Default for RUSTUP_HOME is ~/.rustup so to avoid reading and writing to ~ I changed it to be under $srcdir. I did not want to export RUSTUP_HOME and pollute the environment so it is specified for each invocation.
Switched to using the target-dir option to drop exporting CARGO_TARGET_DIR.
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
The generated binary as of d7f0c86e3025370fd94963f453b6a936b5b4267c is aio_backup not $pkgname.
Last edited by loqs (2021-08-15 15:21:31)
Offline