You are not logged in.

#1 2020-10-30 17:17:41

MountainX
Member
Registered: 2016-02-08
Posts: 262

[SOLVED] PKGBUILD review request: nordpy-plasmoid

This plasmoid is related to the existing AUR package nordpy. I am not the maintainer of that package nor the creator of this plasmoid. I just wish to submit this PKGBUILD to the AUR. It will be my first. Do I need permission from the person who created this (morpheusthewhite)?

I started with the source from https://github.com/morpheusthewhite/nordpy-plasmoid. It includes this build.sh file:

$ cat build.sh
#!/bin/sh

echo "Building and installing plugin"
mkdir -p plugin/build
cd plugin/build
qmake .. && make && sudo make install || { echo "Failed building plugin"; exit 1; }

echo "Building and installing plasmoid"
cd ../..
mkdir -p build
cd build
cmake .. && make && sudo make install || { echo "Failed building plasmoid"; exit 1; }

I attempted to translate that into a PKGBUILD, but I am getting this error. It appears I don't have directories correct.

==> Starting build()...
/startdir/PKGBUILD: line 29: qmake: command not found
CMake Error: The source directory "/build/nordpy-plasmoid/src/nordpy-plasmoid" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Build failed, check /mnt/chroots/arch/myrepo/myruser/build

I don't understand the solution because I don't use qmake and I have zero experience with CMakeLists.txt files. But I can guess the solution is to fix the directories in my PKGBUILD somehow.

The current directory tree:

$ tree .
.
├── build.sh
├── CMakeLists.txt
├── icons
│   ├── CMakeLists.txt
│   └── sc-apps-nordvpn.svgz
├── LICENSE
├── nordpy-plasmoid.git
├── nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst.sig
├── package
│   ├── contents
│   │   ├── images
│   │   │   └── nordvpn.png
│   │   ├── screenshot.png
│   │   ├── scripts
│   │   │   └── utils.mjs
│   │   └── ui
│   │       └── main.qml
│   └── metadata.desktop
├── PKGBUILD
├── plugin
│   ├── nordpyconnectionmanager.cpp
│   ├── nordpyconnectionmanager.h
│   ├── nordpy_plugin.cpp
│   ├── nordpy_plugin.h
│   ├── plugin.pro
│   └── qmldir
└── README.md

7 directories, 20 files

My PKGBUILD (produces the error above):

# Maintainer: morpheusthewhite <zffromGerace@hotmail.it>
# Contributor: MountainX

pkgname=nordpy-plasmoid
pkgver=r10.ec6491c
pkgrel=1
pkgdesc="Plasma widget to control NordPy; it uses the last server type used within the application to establish the VPN connection."
arch=('any')
url="https://github.com/morpheusthewhite/nordpy-plasmoid.git"
license=('GPL')
depends=('polkit' 'nordpy' 'extra-cmake-modules') 
makedepends=('git' 'extra-cmake-modules')
source=("https://github.com/morpheusthewhite/nordpy-plasmoid.git")
sha256sums=('SKIP')

# pkgver() {
#   cd "$srcdir/${pkgname}"
#   printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
# }

prepare() {
  mkdir -p "$srcdir/${pkgname}/build"
  mkdir -p "$srcdir/${pkgname}/plugin/build"
}

build() {
  # "Building and installing plugin"
  cd "$srcdir/${pkgname}/plugin/build"
  qmake .. && make # && sudo make install

  # "Building and installing plasmoid"
  cd "$srcdir/${pkgname}/build"
  cmake .. && make # && sudo make install 
}

package() {

  cd "$srcdir/${pkgname}/plugin/build"
  make DESTDIR="$pkgdir" install

  cd "$srcdir/${pkgname}/build"
  make DESTDIR="$pkgdir" install
}

Last edited by MountainX (2020-11-01 21:43:52)

Offline

#2 2020-10-30 19:04:50

loqs
Member
Registered: 2014-03-06
Posts: 12,094

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

You do not understand the following?

/startdir/PKGBUILD: line 29: qmake: command not found

Missing git+ so no source will be present.

source=("https://github.com/morpheusthewhite/nordpy-plasmoid.git")

Last edited by loqs (2020-10-30 19:05:11)

Offline

#3 2020-10-30 19:12:57

MountainX
Member
Registered: 2016-02-08
Posts: 262

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

loqs wrote:

You do not understand the following?

/startdir/PKGBUILD: line 29: qmake: command not found

Not exactly... do I need to add a package that provides qmake to the makedepends? (I'm not a developer.)

loqs wrote:

Missing git+ so no source will be present.

source=("https://github.com/morpheusthewhite/nordpy-plasmoid.git")

should it be this?

source=("${pkgname}::git+https://github.com/bit-shift-io/audiobook.git")

or this?

source=("git+https://github.com/bit-shift-io/audiobook.git")

Offline

#4 2020-10-30 19:31:03

loqs
Member
Registered: 2014-03-06
Posts: 12,094

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

MountainX wrote:
loqs wrote:

You do not understand the following?

/startdir/PKGBUILD: line 29: qmake: command not found

Not exactly... do I need to add a package that provides qmake to the makedepends? (I'm not a developer.)

Yes

MountainX wrote:
loqs wrote:

Missing git+ so no source will be present.

source=("https://github.com/morpheusthewhite/nordpy-plasmoid.git")

should it be this?

source=("${pkgname}::git+https://github.com/bit-shift-io/audiobook.git")

or this?

source=("git+https://github.com/bit-shift-io/audiobook.git")
source=("git+https://github.com/morpheusthewhite/nordpy-plasmoid.git")

As the following makes no difference when the pkgname already matches the git repository name

pkgname=nordpy-plasmoid
source=("${pkgname}::git+https://github.com/morpheusthewhite/nordpy-plasmoid.git")

Edit:

# Maintainer: morpheusthewhite <zffromGerace@hotmail.it>
# Contributor: MountainX

pkgname=nordpy-plasmoid
pkgver=r10.ec6491c
pkgrel=1
pkgdesc="Plasma widget to control NordPy; it uses the last server type used within the application to establish the VPN connection."
arch=('x86_64')
url="https://github.com/morpheusthewhite/nordpy-plasmoid.git"
license=('GPL3')
depends=('polkit' 'nordpy' 'qt5-base' 'qt5-declarative' 'plasma-framework') 
makedepends=('git' 'extra-cmake-modules')
source=("git+https://github.com/morpheusthewhite/nordpy-plasmoid.git")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  # "Building and installing plugin"
  qmake $pkgname/plugin -o build-plugin/Makefile
  make -C build-plugin
  
  # "Building and installing plasmoid"
  cmake -B build $pkgname
  make -C build
}

package() {
  make -C build-plugin INSTALL_ROOT="$pkgdir" install
  make -C build DESTDIR="$pkgdir" install
}

CMake_package_guidelines
Makepkg#Specifying_install_directory_for_QMAKE_based_packages

Last edited by loqs (2020-10-30 20:31:51)

Offline

#5 2020-10-30 21:13:33

MountainX
Member
Registered: 2016-02-08
Posts: 262

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

Thank you. That package is qt5-base. It turns out I also needed to add plasma-framework as a makedepends because of this:

CMake Error at CMakeLists.txt:8 (find_package):
  By not providing "FindKF5Plasma.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "KF5Plasma", but CMake did not find one.

(I will show the full CMakeLists.txt below.)

Here is my updated PKGBUILD (still not error-free).

pkgname=nordpy-plasmoid
pkgver=r10.ec6491c
pkgrel=1
pkgdesc="Plasma widget to control NordPy; it uses the last server type used within the application to establish the VPN connection."
arch=('any')
url="https://github.com/morpheusthewhite/nordpy-plasmoid.git"
license=('GPL')
depends=('polkit' 'nordpy') 
makedepends=('git' 'extra-cmake-modules' 'plasma-framework' 'qt5-tools' 'qt5-base')
source=("git+https://github.com/morpheusthewhite/nordpy-plasmoid.git")
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/${pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  mkdir -p "$srcdir/${pkgname}/build"
  mkdir -p "$srcdir/${pkgname}/plugin/build"
}

build() {
  # "Building and installing plugin"
  cd "$srcdir/${pkgname}/plugin/build"
  qmake .. && make 

  # "Building and installing plasmoid"
  cd "$srcdir/${pkgname}/build"
  cmake .. && make 
}

package() {
  cd "$srcdir/${pkgname}/plugin/build"
  make DESTDIR="$pkgdir" install

  cd "$srcdir/${pkgname}/build"
  make DESTDIR="$pkgdir" install
}

contents of CMakeLists.txt:

cmake_minimum_required(VERSION 3.0)

project(nordpy)

find_package(ECM 1.4.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

find_package(KF5Plasma REQUIRED)

plasma_install_package(package org.kde.nordpy)

add_subdirectory(icons)

... and now I get this error:

==> Entering fakeroot environment...
==> Starting package()...
mkdir: cannot create directory ‘/usr/lib/qt/qml/org/kde/private/nordpy’: Permission denied
make: *** [Makefile:658: install_target] Error 1
==> ERROR: A failure occurred in package().
    Aborting...
==> ERROR: Build failed, check /mnt/chroots/arch/myrepo/myuser/build
pkgver=r10.ec6491c
/path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst
ERROR: /path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst not found. Is there a version problem?
ls: cannot access 'nordpy-plasmoid*.pkg.tar.zst': No such file or directory
namcap -i /path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst:
Error: Problem reading /path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst

Usage: /usr/lib/python3.8/site-packages/namcap.py [OPTIONS] packages

Options are:
    -L, --list                       : list available rules
    -i                               : prints information (debug) responses from rules
    -m                               : makes the output parseable (machine-readable)
    -e rulelist, --exclude=rulelist  : don't apply RULELIST rules to the package
    -r rulelist, --rules=rulelist    : only apply RULELIST rules to the package
    -t tags                          : use a custom tag file
    -v version                       : print version and exit
gpg: can't open '/path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst': No such file or directory
gpg: signing failed: No such file or directory
stat: cannot statx '/path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst': No such file or directory
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: processing message failed: Unknown system error
repo add /path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst:
==> Verifying database signature...
gpg: assuming signed data in '/path/to/myrepo//myrepo.db.tar.zst'
gpg: Signature made Thu 29 Oct 2020 09:30:57 PM EDT
gpg:                using RSA key ZYZ
gpg: Good signature from "MountainX" [ultimate]
  -> Database signature file verified.
==> Extracting myrepo.db.tar.zst to a temporary location...
==> Verifying database signature...
gpg: assuming signed data in '/path/to/myrepo//myrepo.files.tar.zst'
gpg: Signature made Thu 29 Oct 2020 09:30:57 PM EDT
gpg:                using RSA key XYZ
gpg: Good signature from "MountainX" [ultimate]
  -> Database signature file verified.
==> Extracting myrepo.files.tar.zst to a temporary location...
==> ERROR: File '/path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst' not found.
==> No packages modified, nothing to do.
cp: cannot stat '/path/to/packages/myrepo/nordpy-plasmoid/nordpy-plasmoid-r10.ec6491c-1-any.pkg.tar.zst': No such file or directory

Is the permissions problem at ‘/usr/lib/qt/qml/org/kde/private/nordpy’ due to my error? Or is there something wrong with the source install instructions (such as maybe this line in CMakeLists.txt: plasma_install_package(package org.kde.nordpy)? I have nordpy listed as a dependency in the PKGBUILD, so I'm not sure it needs to be listed in CMakeLists.txt, does it?

Last edited by MountainX (2020-10-30 21:28:46)

Offline

#6 2020-10-30 21:18:46

loqs
Member
Registered: 2014-03-06
Posts: 12,094

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

See My edit to post #4 and the link to specifying the install directory for qmake.

Offline

#7 2020-10-30 21:40:47

MountainX
Member
Registered: 2016-02-08
Posts: 262

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

loqs wrote:

See My edit to post #4 and the link to specifying the install directory for qmake.

Thank you. I really appreciate your help. I had read both of those links but I also need to learn more about "make". I learned a lot from seeing what you did.

Last edited by MountainX (2020-10-30 21:44:34)

Offline

#8 2020-11-01 06:21:57

MountainX
Member
Registered: 2016-02-08
Posts: 262

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

Offline

#9 2020-11-01 20:14:35

MountainX
Member
Registered: 2016-02-08
Posts: 262

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

I cannot build the package from the AUR now... here is what happened:

I submitted the PKGBUILD we created in this thread to the maintainer of nordpy-plasmoid and he published it on the AUR at https://aur.archlinux.org/packages/nordpy-plasmoid-git.

I had tested the PKGBUILD on my system and was able to build it in a clean chroot. The main difference is that he named the package "nordpy-plasmoid-git" whereas in my testing I had been using the pkgname "nordpy-plasmoid". (He also added "groups=()" but I assume that is inconsequential.)

The error is:

==> Retrieving sources...
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
  -> Creating working copy of nordpy-plasmoid git repo...
Cloning into 'nordpy-plasmoid'...
done.
==> Starting build()...
Cannot find file: nordpy-plasmoid-git/plugin.
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Build failed, check /mnt/chroots/arch/aurds/computeruser/build

However, if I change the pkgname in his PKGBUILD from:

pkgname=nordpy-plasmoid-git

to:

pkgname=nordpy-plasmoid

I can build the package again. I know this must be a stupid question, but what is the proper solution? I assume he can't/won't rename his github repo. I also assume the proper name for the package in AUR is the name he used (nordpy-plasmoid-git).

Offline

#10 2020-11-01 21:24:21

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,768

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

You need to cd "$srcdir/${pkgname%-git}"

BTW the person who changed the pkgname should have verified it still worked...

Last edited by eschwartz (2020-11-01 21:24:54)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#11 2020-11-01 21:27:28

MountainX
Member
Registered: 2016-02-08
Posts: 262

Re: [SOLVED] PKGBUILD review request: nordpy-plasmoid

eschwartz wrote:

You need to cd "$srcdir/${pkgname%-git}"

Thank you. That's simple.

eschwartz wrote:

BTW the person who changed the pkgname should have verified it still worked...

Yes, but since he developed the package, I don't mind contributing this small effort to get it on the AUR. Also, it helps me learn.

EDIT: the working PKGBUILD:

pkgname=nordpy-plasmoid-git
pkgver=r10.ec6491c
pkgrel=1
pkgdesc="Plasma widget to control NordPy; it uses the last server type used within nordpy to establish the VPN connection."
arch=('x86_64')
url="https://github.com/morpheusthewhite/nordpy-plasmoid.git"
license=('GPL3')
groups=()
depends=('polkit' 'nordpy' 'qt5-base' 'qt5-declarative' 'plasma-framework') 
makedepends=('git' 'extra-cmake-modules')
source=("git+https://github.com/morpheusthewhite/nordpy-plasmoid.git")
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  # "Building and installing plugin"
  qmake ${pkgname%-git}/plugin -o build-plugin/Makefile
  make -C build-plugin
  
  # "Building and installing plasmoid"
  cmake -B build ${pkgname%-git}
  make -C build
}

package() {
  make -C build-plugin INSTALL_ROOT="$pkgdir" install
  make -C build DESTDIR="$pkgdir" install
}

Last edited by MountainX (2020-11-01 21:36:34)

Offline

Board footer

Powered by FluxBB