You are not logged in.
Hi there,
I want to create a new package for the AUR. I have created a PKGBUILD file and I have been reading the information in the arch wiki here. I am trying to create a PKG Build for a binary version of the ungoogled-chromium packages as I am aware there are two packages in the AUR for the GIT and the original source. The main reason for this is that building the ungoogled-chromium package from using these two always takes such a long time because I do not have a very powerful machine to complete the build process. I found that on the GIT page there is a link to binary builds of the application. To save me some time manually installing each time I thought it was time I learned how to complete this myself.
I followed a number of YouTube tutorials that show information on how to make PKGBUILD files for source packages etc. However I was not so successful in finding any that deal with binaries. I thought I would use an existing binary I know of the brave-bin as a base line to assist me with getting my PKGBUILD file to a good place so that I could test everything. However I have run into some problems.
Here is my current PKGBUILD. This has commented out section which was sourced from the brave-bin pkgbuild as I am not certain what is needed etc.
# Maintainer: Your Name <youremail@domain.com>
pkgname='ungoogled-chromium'
pkgver='91.0.4472.114'
pkgrel=1
pkgdesc="A lightweight approach to removing Google web service dependency"
arch=(x86_64)
url='https://github.com/Eloston/ungoogled-chromium'
license=('BSD')
depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils' 'libva'
'desktop-file-utils' 'hicolor-icon-theme')
optdepends=('pipewire: WebRTC desktop sharing under Wayland'
'kdialog: support for native dialogs in Plasma'
'org.freedesktop.secrets: password storage backend on GNOME / Xfce'
'kwallet: support for storing passwords in KWallet on Plasma')
provides=('chromium')
conflicts=('chromium')
source=("$pkgname.tar.xz::https://github.com/mealwhiles/ungoogled-chromium-binaries/releases/download/$pkgver-1/$pkgname.tar.xz")
sha256sums=('c166c737177dce1207716f3dd1648264384aa5c25b0f719314a659dd3547aa8b')
# prepare() {
# mkdir -p ungoogled-chromium
# bsdtar -xf "$pkgname.tar.xz" -C ungoogled-chromium
# chmod +x ungoogled-chromium
# }
package() {
make DESTDIR="$pkgdir/"
install -dm0755 "$pkgdir/usr/lib"
cp -a usr "$pkgdir/usr/lib/$pkgname"
# # allow firejail users to get the suid sandbox working
# chmod 4755 "$pkgdir/usr/lib/ungoogled-chromium-bin/chrome-sandbox"
# install -Dm0755 "$pkgname.sh" "$pkgdir/usr/bin/ungoogled-chromium"
# install -Dm0644 -t "$pkgdir/usr/share/applications/" "ungoogled-chromium-browser.desktop"
# install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
# pushd "$pkgdir/usr/"
# for size in 16x16 24x24 32x32 48x48 64x64 128x128 256x256; do
# install -Dm0644 "lib/$pkgname/product_logo_${size/x*/}.png" \
# "share/icons/hicolor/$size/apps/ungoogled-chromium-desktop.png"
# done
}Additionally here is the makepkg log when attempting to run this.
❯ makepkg
==> Making package: ungoogled-chromium 91.0.4472.114-1 (Sat 07 Aug 2021 20:50:20)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found ungoogled-chromium.tar.xz
==> Validating source files with sha256sums...
ungoogled-chromium.tar.xz ... Passed
==> Extracting sources...
-> Extracting ungoogled-chromium.tar.xz with bsdtar
==> Entering fakeroot environment...
==> Starting package()...
make: *** No targets specified and no makefile found. Stop.
==> ERROR: A failure occurred in package().
Aborting...Granted I was not expecting this to work, I just wanted to provide this in case it is at all relevant.
Any assistance or insight you can provide would be great. Also if you would like source information for the videos I have watched regarding pkgbuild files etc, I am more than happy to sight them here.
Thank you in advanced.
P.S. I know the Maintainer details have not been filled in yet, I will complete this once I know that I can get this working and I will be able to maintain this. Thanks ![]()
Last edited by ArcticStag (2021-08-08 12:48:40)
Offline
Input
package() {
make DESTDIR="$pkgdir/"Output
==> Starting package()...
make: *** No targets specified and no makefile found. Stop.You expect make to work without a makefile? If you are following https://aur.archlinux.org/packages/brave-bin/ where did the call to make come from?
Offline
==> Starting package()...
make: *** No targets specified and no makefile found. Stop.
makepkg already tells you what the problem is. The downloaded package doesn't have a makefile.
EDIT: loqs beat me to it...
Last edited by d_fajardo (2021-08-07 11:08:51)
Offline
Appologies, This came from testing from another video I watched. I thought I had removed that.
This is the actual version.
# Maintainer: Your Name <youremail@domain.com>
pkgname='ungoogled-chromium'
pkgver='91.0.4472.114'
pkgrel=1
pkgdesc="A lightweight approach to removing Google web service dependency"
arch=(x86_64)
url='https://github.com/Eloston/ungoogled-chromium'
license=('BSD')
depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils' 'libva'
'desktop-file-utils' 'hicolor-icon-theme')
optdepends=('pipewire: WebRTC desktop sharing under Wayland'
'kdialog: support for native dialogs in Plasma'
'org.freedesktop.secrets: password storage backend on GNOME / Xfce'
'kwallet: support for storing passwords in KWallet on Plasma')
provides=('chromium')
conflicts=('chromium')
source=("$pkgname.tar.xz::https://github.com/mealwhiles/ungoogled-chromium-binaries/releases/download/$pkgver-1/$pkgname.tar.xz")
sha256sums=('c166c737177dce1207716f3dd1648264384aa5c25b0f719314a659dd3547aa8b')
# prepare() {
# mkdir -p ungoogled-chromium
# bsdtar -xf "$pkgname.tar.xz" -C ungoogled-chromium
# chmod +x ungoogled-chromium
# }
package() {
install -dm0755 "$pkgdir/usr/lib"
cp -a usr "$pkgdir/usr/lib/$pkgname"
# # allow firejail users to get the suid sandbox working
# chmod 4755 "$pkgdir/usr/lib/ungoogled-chromium-bin/chrome-sandbox"
# install -Dm0755 "$pkgname.sh" "$pkgdir/usr/bin/ungoogled-chromium"
# install -Dm0644 -t "$pkgdir/usr/share/applications/" "ungoogled-chromium-browser.desktop"
# install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
# pushd "$pkgdir/usr/"
# for size in 16x16 24x24 32x32 48x48 64x64 128x128 256x256; do
# install -Dm0644 "lib/$pkgname/product_logo_${size/x*/}.png" \
# "share/icons/hicolor/$size/apps/ungoogled-chromium-desktop.png"
# done
}It does seem to build now, though I still don't feel this is right. I end up with a file tree that looks like this.
pkg
└── ungoogled-chromium
├── usr
│ └── lib
│ └── ungoogled-chromium
│ ├── bin
│ │ ├── chromedriver -> /usr/lib/chromium/chromedriver
│ │ └── chromium
│ ├── lib
│ │ └── chromium
│ │ ├── locales
└── share
│ ├── applications
│ │ └── chromium.desktop
│ ├── drirc.d
│ │ └── 10-ungoogled-chromium.conf
│ ├── icons
│ │ └── hicolor
│ ├── licenses
│ │ └── chromium
│ │ ├── LICENSE
│ │ └── LICENSE.launcher
│ ├── man
│ │ └── man1
│ │ └── chromium.1.gz
│ └── metainfo
│ └── chromium.appdata.xmlOffline
install -dm0755 "$pkgdir/usr/lib"
cp -a usr "$pkgdir/usr/lib/$pkgname"What do you believe the above is doing?
If you the layout in the downloaded archive is correct, do not extract it. Use bsdtar to extract the archive in package() with the -C option to set the directory to $pkgdir.
Offline
ungoogled-chromium-bin has been removed from the AUR multiple times. I don't recall the specific reasons, but I believe it's due to there being no official binary release.
Offline
Thanks yochananmarqos for this information. I am not sure why this would be the case because from what I understand their is an official binary located here.
May I please get some feedback on my new pkgbuild
# Maintainer: Your Name <youremail@domain.com>
pkgname='ungoogled-chromium'
pkgver='91.0.4472.114'
pkgrel=1
pkgdesc="A lightweight approach to removing Google web service dependency"
arch=(x86_64)
url='https://github.com/Eloston/ungoogled-chromium'
license=('BSD')
depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils' 'libva'
'desktop-file-utils' 'hicolor-icon-theme')
optdepends=('pipewire: WebRTC desktop sharing under Wayland'
'kdialog: support for native dialogs in Plasma'
'org.freedesktop.secrets: password storage backend on GNOME / Xfce'
'kwallet: support for storing passwords in KWallet on Plasma')
provides=('chromium')
conflicts=('chromium')
source=("$pkgname.tar.xz::https://github.com/mealwhiles/ungoogled-chromium-binaries/releases/download/$pkgver-1/$pkgname.tar.xz")
sha256sums=('c166c737177dce1207716f3dd1648264384aa5c25b0f719314a659dd3547aa8b')
package() {
install -dm0755 "$pkgdir/usr/lib"
install -dm0755 "$pkgdir/usr/share"
install -dm0755 "$pkgdir/usr/bin"
cp -a usr "$pkgdir/"
}Offline
You renamed the downloaded archive to the same name. I can not see the point of creating the directories before the copy operation and I would extract from the archive instead copying.
source=("https://github.com/mealwhiles/ungoogled-chromium-binaries/releases/download/$pkgver-1/$pkgname.tar.xz")
sha256sums=('c166c737177dce1207716f3dd1648264384aa5c25b0f719314a659dd3547aa8b')
noextract=($pkgname.tar.xz)
package() {
bsdtar -xf $pkgname.tar.xz -C "$pkgdir"
}Offline
You renamed the downloaded archive to the same name. I can not see the point of creating the directories before the copy operation and I would extract from the archive instead copying.
source=("https://github.com/mealwhiles/ungoogled-chromium-binaries/releases/download/$pkgver-1/$pkgname.tar.xz") sha256sums=('c166c737177dce1207716f3dd1648264384aa5c25b0f719314a659dd3547aa8b') noextract=($pkgname.tar.xz) package() { bsdtar -xf $pkgname.tar.xz -C "$pkgdir" }
So you would say something that looks more like this?
# Maintainer: Your Name <youremail@domain.com>
pkgname='ungoogled-chromium'
pkgver='91.0.4472.114'
pkgrel=1
pkgdesc="A lightweight approach to removing Google web service dependency"
arch=(x86_64)
url='https://github.com/Eloston/ungoogled-chromium'
license=('BSD')
depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils' 'libva'
'desktop-file-utils' 'hicolor-icon-theme')
optdepends=('pipewire: WebRTC desktop sharing under Wayland'
'kdialog: support for native dialogs in Plasma'
'org.freedesktop.secrets: password storage backend on GNOME / Xfce'
'kwallet: support for storing passwords in KWallet on Plasma')
provides=('chromium')
conflicts=('chromium')
source=("$pkgname-$pkgver.tar.xz::https://github.com/mealwhiles/ungoogled-chromium-binaries/releases/download/$pkgver-1/$pkgname.tar.xz")
sha256sums=('c166c737177dce1207716f3dd1648264384aa5c25b0f719314a659dd3547aa8b')
package() {
bsdtar -xf $pkgname-$pkgver.tar.xz -C "$pkgdir"
}when this is installed with sudo pacman -U "Add_Package_Name_Here" will this automatically place all of the files into the correct directories in usr/bin, usr/share and /usr/lib?
Sorry if that question is stupid.
Offline
when this is installed with sudo pacman -U "Add_Package_Name_Here" will this automatically place all of the files into the correct directories in usr/bin, usr/share and /usr/lib?
That will install the package with the layout that was created with makepkg under "$pkgdir". As the archive you downloaded has the files in the correct location extracting the archive under $pkdir achieves the result you want.
I would add the noextract line to save extracting the archive during prepare. You can also drop the redundant archive rename on download. See post #8.
Edit:
I forgot you want the extracted contents to be owned by root so --no-same-owner
package() {
bsdtar --no-same-owner -xf $pkgname.tar.xz -C "$pkgdir"
}Last edited by loqs (2021-08-08 07:57:22)
Offline
That will install the package with the layout that was created with makepkg under "$pkgdir". As the archive you downloaded has the files in the correct location extracting the archive under $pkdir achieves the result you want.
I would add the noextract line to save extracting the archive during prepare. You can also drop the redundant archive rename on download. See post #8.
Thank you for this. I think this will do me. I am going to go and read the documentation now on how to publish this to the AUR.
Thank you for your assistance. I will mark this as resolved
Offline
I would ask on the aur-general mailing list if the package is allowed first with respect to the issue yochananmarqos raised.
Also see my edit to post #10. I also just noticed /usr/lib/chromium/chrome-sandbox is not setuid which I believe is required if user namespaces are not enabled.
Offline
I also just noticed /usr/lib/chromium/chrome-sandbox is not setuid which I believe is required if user namespaces are not enabled.
are you referring to adding something like
chmod 4755 "$pkgdir/usr/lib/ungoogled-chromium-bin/chrome-sandbox"Offline
loqs wrote:I also just noticed /usr/lib/chromium/chrome-sandbox is not setuid which I believe is required if user namespaces are not enabled.
are you referring to adding something like
chmod 4755 "$pkgdir/usr/lib/ungoogled-chromium-bin/chrome-sandbox"
Exactly.
Offline
I would ask on the aur-general mailing list if the package is allowed first with respect to the issue yochananmarqos raised.
Last question, Where do I find the information about the aur-general mailing list to ask about this package?
Offline
Offline
Wouldn't these official pre-built packages make your life easier?
https://github.com/ungoogled-software/u … x/releases
Last edited by Ammako (2021-08-08 10:58:31)
Offline
Wouldn't these official pre-built packages make your life easier?
Well hot damn... Wish this comment came up sooner...
Oh well, I guess on the bright side I learned how to make a pkgbuild file somewhat.
Thank you for this link, I will not be submitting my binary to the AUR i guess
Offline