You are not logged in.

#1 2018-01-16 02:16:31

rez_23
Member
Registered: 2017-05-24
Posts: 11

Strange issues with PKGBUILD [SOLVED]

Im writing a PKGBUILD for install github-desktop gengjiawen's fork for linux, but I have a very strange issue during the package() function.
When the package function copy the binary AppImage file the result file has wrong size (from 80mb of the original file to 30kb). The result, obviusly, is a not working program after that the package was installed.
I really don't know why this happen.
the PKGBUILD

pkgname=github-desktop
pkgver=1.0.4_beta0
pkgrel=1
arch=('x86_64')
url="https://github.com/gengjiawen/desktop/releases"
source=('github-desktop.desktop')
sha256sums=(
			'SKIP')
prepare() {
			wget https://github.com/gengjiawen/desktop/releases/download/v1.0.4-beta0/desktop-1.0.4-beta0-x86_64.AppImage -O ${pkgname}.AppImage
			chmod +x ${pkgname}.AppImage
}
package() {
mkdir -p "${pkgdir}"/usr/{bin,share/applications}
cp ${srcdir}/${pkgname}.desktop ${pkgdir}/usr/share/applications
cp ${srcdir}/${pkgname}.AppImage ${pkgdir}/usr/bin/${pkgname}
#mv ${pkgdir}/usr/bin/${pkgname}.AppImage ${pkgdir}/usr/bin/${pkgname}
}

Furthermore if I try to copy it outside of $pkgdir  the resulting file is created correctly without issues.
Someone know why this happen?
Regard rez23

Last edited by rez_23 (2018-01-19 06:15:18)

Offline

#2 2018-01-16 02:39:35

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

Re: Strange issues with PKGBUILD [SOLVED]

First, why are you using wget manually, put the source in the source array.  Second, if you really have to use wget (you don't) it needs to be in the makedeps.

As to you actual question, the size difference is due to makepkg stripping binaries.  If you run `strip` on the original binary, you will see it's size drop drastically.

Note, there are also many other problems with this PKGBUILD that need to be fixed before it could be submitted.

Last edited by Trilby (2018-01-16 02:44:31)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-01-16 13:05:45

phw
Member
Registered: 2013-05-27
Posts: 318

Re: Strange issues with PKGBUILD [SOLVED]

AppImage executables should never be stripped, as this will remove the actual data, the squashfs image. To disable stripping you have to add

options=(!strip)

to your PKGBUILD. Not sure if having a PKGBUILD for an AppImage makes sense, though. After all the idea of an AppImage is that the user can just run it, no need to install.

For actual installed software it would be better to place it properly in the file system, no need to have the entire AppImage squashfs. If the software is also available in other formats (source, binary archive) I would look into packaging this. If not, extracting the AppImage and collecting the files from there might be another option.

Related discussion: https://bbs.archlinux.org/viewtopic.php?id=233510

Offline

#4 2018-01-19 06:10:38

rez_23
Member
Registered: 2017-05-24
Posts: 11

Re: Strange issues with PKGBUILD [SOLVED]

Ok, thanks, I didn't know that makepkg auto strip the binaries, I worked with the packeged AppImage because I don't want have too many file in file system, and I didn't found the sources of the project befpre of today @Trilby really, I don't know if I will submit the PKGBUILD in the AUR, I wrote this was only because I prefer manage the installed software ever as package . @phw yeha I have agree with you and now Im using the source for make the PKGBUILD,  my question was mainly because after has found this problem I was curios to understand the  reason.  Sorry for the late reponse, thanks for your great help
Regards Rez_23

Offline

#5 2018-01-19 06:16:52

rez_23
Member
Registered: 2017-05-24
Posts: 11

Re: Strange issues with PKGBUILD [SOLVED]

I've marked the post as solved thank for your help smile

Offline

Board footer

Powered by FluxBB