[aur-general] a little PKGBUILD help please?
Howdy guys, One of my PKGBUILDs has an architecture-specific make line, and I'd like to have a different line used depending on the architecture. Now, if someone grabs and uses the PKGBUILD unmodified from the aur, and has an x86 box, the build will be wrong. I have no idea how to add a check to my PKGBUILD. Can someone give me a hand? Want me to post it here, or do you want to just look at it in the aur? Thanks. --
I have no idea how to add a check to my PKGBUILD. Can someone give me a hand? Want me to post it here, or do you want to just look at it in the aur? Use the $CARCH variable. It will be either i686 or x86_64.
Use the $CARCH variable. It will be either i686 or x86_64.
thanks, but I don't think that will work. There are multiple makefiles with the form "make_platform" then in the build section there's "make -f make_platform" so "make -f make_$CARCH" won't work. I was thinking that it would require something like - parse the src directory and list the makefiles - available have the user choose from a list have the - choice inserted at the right spot in the PKGBUILD. or - don't bother and tell the user to edit the PKGBUILD by hand. (what you have to do now) :-) is something like this possible? (besides the last option :-) ) --
2008/8/12 <scrawler@gmail.com>:
thanks, but I don't think that will work. There are multiple makefiles with the form "make_platform" then in the build section there's "make -f make_platform" so "make -f make_$CARCH" won't work. I was thinking that it would require something like
- parse the src directory and list the makefiles - available have the user choose from a list have the - choice inserted at the right spot in the PKGBUILD.
I suppose you mean your newlisp PKGBUILD? If the 64 bit and 32 bit have separate makefiles then keeping this in build() should do: if [ "$CARCH" == "i686" ]; then make -f make_whatever else make -f make_else fi Also replace $startdir/src and $startdir/pkg with $srcdir and $pkgdir respectively. While the former will work for some time, $pkgdir is preferred as of version makepkg 3.2.0. Manual pages should also be installed to /usr/share/man instead of /usr/man. You should also use namcap (pacman -S namcap) which points out problems/missing information in PKGBUILDs. HTH, Abhishek
if [ "$CARCH" == "i686" ]; then make -f make_whatever else make -f make_else fi
My preferred method is below, so that it will work correctly for ArchPPC or uArch. case $CARCH in i686) make -f make_foo ;; x86_64) make -f make_bar ;; *) echo "$CARCH is not supported!" ;; esac
thanks, guys, for the help. I only have two packages in the aur, but they may as well be done correctly. I'm off to fix newlisp, and I might wanna have somebody look at gnuserv as well--I want to make some changes suggested in a forum post first though. thanks again. --
participants (3)
-
Abhishek Dasgupta
-
Daenyth Blank
-
scrawler@gmail.com