You are not logged in.

#1 2021-08-14 14:14:51

T4rtP1ck73
Member
Registered: 2021-08-11
Posts: 10

Can someone make me a Makefile for for my project?

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 big_smile. Thanks!

Last edited by T4rtP1ck73 (2021-08-14 14:29:39)

Offline

#2 2021-08-14 14:21:52

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Can someone make me a Makefile for for my project?

Why do you think that you need a makefile when building the project doesn't involve make?

https://wiki.archlinux.org/title/Rust_p … guidelines


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2021-08-14 14:29:17

T4rtP1ck73
Member
Registered: 2021-08-11
Posts: 10

Re: Can someone make me a Makefile for for my project?

I mixed up "makefile" with "PKGBUILD", LOL

Offline

#4 2021-08-14 14:34:33

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Can someone make me a Makefile for for my project?

OK, so follow the wiki page I linked to and post what you've come up with so far.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2021-08-14 14:44:08

T4rtP1ck73
Member
Registered: 2021-08-11
Posts: 10

Re: Can someone make me a Makefile for for my project?

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

#6 2021-08-14 15:51:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,533
Website

Re: Can someone make me a Makefile for for my project?

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.

T4rtP1ck73 wrote:

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

#7 2021-08-14 20:17:15

T4rtP1ck73
Member
Registered: 2021-08-11
Posts: 10

Re: Can someone make me a Makefile for for my project?

Ok, but what is

srcdir

?

Offline

#8 2021-08-14 20:20:23

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Can someone make me a Makefile for for my project?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#9 2021-08-15 00:49:28

T4rtP1ck73
Member
Registered: 2021-08-11
Posts: 10

Re: Can someone make me a Makefile for for my project?

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

#10 2021-08-15 01:11:32

loqs
Member
Registered: 2014-03-06
Posts: 17,376

Re: Can someone make me a Makefile for for my project?

T4rtP1ck73 wrote:

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

wiki wrote:

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

#11 2021-08-15 02:32:11

T4rtP1ck73
Member
Registered: 2021-08-11
Posts: 10

Re: Can someone make me a Makefile for for my project?

Oh, yes I have

Offline

#12 2021-08-15 07:34:33

loqs
Member
Registered: 2014-03-06
Posts: 17,376

Re: Can someone make me a Makefile for for my project?

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

Board footer

Powered by FluxBB