Need help creating a PKGBUILD

Hello!

I have a program whose contributor only supplies it in zip and never packages it, so I want to make the package myself

How can I make a correct PKGBUILD so that the system can install this zip and create a desktop file (so that the visual shell can display the shortcut)

My current pkgbuild (not working)

pkgname=vtmessenger
pkgver=later
pkgrel=later
pkgdesc="VTMessenger for Linux x64"
arch=('x86_64')
url="https://t.me/vtmsg"
license=('custom')
depends=('alsa-lib' 'expat' 'gtk3' 'libgcrypt' 'libgnome-keyring' 'libnotify' 'libxss' 'libxtst' 'nss' 'xdg-utils')
optdepends=('gnome-keyring')
source=("linux64.zip")
sha256sums=('06feab09d8410349d0635f1757c0afc74327c15b849d3e05fa1a7ea6d31449f3')

prepare() {
    echo "hello world"
}

package() {
    mv "${srcdir}"/* "${pkgdir}"
}

Moderator edit: remove useless screenshot

What program? The source archive type doesn’t matter.

No idea until you link the source code.

hello world

1 Like

You didn’t link to the file in question - just a screenshot …
The url in your PKGBUILD is no good to get the file you want.

Download the file
(and put the download url in the PKGBUILD)

look at what’s inside it
and find out where to put the contents
usually, there are install instructions

translate that into what the PKGBUILD needs to do
where to unpack it to …

without the file
no one knows what it is, what is in it or how it is supposed to be used

and where did you get the “depends” from?
they seem rather specific

Your link leads to Telegram Desktop.
There surely is a PKGBUILD for that already.

Have you read the documentation yet?
https://wiki.archlinux.org/title/Creating_packages#Creating_a_PKGBUILD
https://wiki.archlinux.org/title/PKGBUILD

How can I make a correct PKGBUILD so that the system can install this zip

The situation is not optimal because the download is only on telegram; I didn’t find a website either, I don’t know if exist some cli programs that can download from there

It is a client for VKontakte?

# Maintainer: 

pkgname=vtmessenger
pkgver=3.1.13
pkgrel=1
pkgdesc="Proprietary messenger"
arch=(x86_64)
url="https://t.me/vtmsg"
license=(unknown)
depends=(alsa-lib expat gtk3 libgcrypt libgnome-keyring libnotify libxss libxtst nss xdg-utils)
optdepends=(gnome-keyring)
source_x86_64=("local://linux64.zip")
sha256sums_x86_64=('06feab09d8410349d0635f1757c0afc74327c15b849d3e05fa1a7ea6d31449f3')
noextract=(linux64.zip)
options=(!strip)

pkgver() {
  bsdtar -zxf linux64.zip version
  cat version | sed 's/^v//g'
}

package() {
  install -d "${pkgdir}/opt/vtmessenger"
  bsdtar -xf linux64.zip -C "${pkgdir}/opt/vtmessenger"

  install -d "${pkgdir}/usr/bin"
  ln -s /opt/vtmessenger/vk "${pkgdir}/usr/bin/vtmessenger"

  install -D "${pkgdir}/opt/vtmessenger/icon256.png" "${pkgdir}/usr/share/pixmaps/vtmessenger.png"

  install -d "${pkgdir}/usr/share/applications/"
  cat > ${pkgdir}/usr/share/applications/vtmessenger.desktop << _EOD
[Desktop Entry]
Name=Proprietary messenger
Exec=/opt/vtmessenger/vk %U
Terminal=false
Type=Application
Icon=vtmessenger
Comment=
Categories=;
_EOD
}

I’ve used source_x86_64=("local://linux64.zip") because users need to provide the file and put it alongside the pkgbuild (or in the shared source directory if configured)

A barebone .desktop file is created too

It is an electron program

There isn’t AUR (en) - Packages

context :wink:

This URL suggests some name (vtmsg) - but it leads only to download Telegram Desktop
That’s why I said what I said - there is a PKGBUILD for that.

I’d have thought that they amended the post by now and gave a proper URL for what they wanted - but your assumption of what that is might be correct.

Yes, it is fork of vk-messenger

Problem is there are already vk-messenger in AUR but this fork doesn’t have RPM package - only archive with resources and executable. To launch that I only need to unzip and launch the main file. And yes, fork developer only post archives on telegram, there are no website or something

I just wanted to create a repository where the PKGBUILD and the archive with the program will already be, so users can easily install it

Your solution works perfectly, thank you very much

That was only for test xd

Then why didn’t you say so to begin with?

Why did you not use the vk-messenger AUR PKGBUILD as a template and change the source URL?

Please be clear and concise. See How to Post. Provide more information and you’ll receive more detailed and educated answers in your replies. Making us guess wastes the time of volunteers.

Give, and it shall be given to you. A good measure, pressed down and shaken together and running over shall be put into your lap. For with the same measure with which you measure, it shall be measured back to you.

– Luqas (Luke) 6:38 TS2009

Yes, I’m aware of that. :wink:

I actually did that. Look at source PKGBUILD and mine - they are same

I realized that a lot of details were missing, henceforth I will write more information. Thanks again for your help