Package Details: nchat 4.41-1

Git Clone URL: https://aur.archlinux.org/nchat.git (read-only, click to copy)
Package Base: nchat
Description: console-based chat client with support for Telegram
Upstream URL: https://github.com/d99kris/nchat
Licenses: MIT
Conflicts: nchat-git
Submitter: doclai
Maintainer: doclai
Last Packager: doclai
Votes: 2
Popularity: 0.046207
First Submitted: 2023-10-11 00:33 (UTC)
Last Updated: 2024-04-03 02:47 (UTC)

Required by (0)

Sources (1)

Latest Comments

xiota commented on 2024-04-03 14:44 (UTC) (edited on 2024-04-03 14:45 (UTC) by xiota)

The requirement is for direct depends, not makedepends. The packages you list are not direct depends for most programs.

gesh commented on 2024-04-03 12:59 (UTC) (edited on 2024-04-03 12:59 (UTC) by gesh)

Right, cf my qualifier that it's not an urgent matter given that it doesn't practically make a difference.

Checking the data confuses me even more -- cf the data points I posted on the PKGBUILD Talk page, with glibc and gcc-libs in the triple digits of occurrences in depends. file does appear, pulled in by subversion, util-linux, xdg-utils, and zathura. On the other hand, I'd think coreutils, filesystem, tar, util-linux, bzip2 and xz would at least be in many packages' implicit makedepends, raising the question of where the dividing line is.

All in all, consider my objection dropped until a clearer policy statement is given. I'm sorry about the wasted time, this seemed so obvious and trivial that I didn't expect it to drag on this much.

xiota commented on 2024-04-03 12:27 (UTC) (edited on 2024-04-03 12:39 (UTC) by xiota)

@gesh I had a typo in the command I used to check depends. file is pulled in by base, and there is no practical difference whether it's listed in depends.

There is no exemption in current guidelines for listing depends. As far as I can tell, it is intentional. If base or another package changes, the package would still work, instead of breaking.

Ultimately up to the maintainer. An active maintainer could fix the package. An inactive maintainer could leave it broken until someone else takes over.

gesh commented on 2024-04-03 12:16 (UTC)

In fact, I actually don't see the base exemption documented anywhere, annoyingly enough.

gesh commented on 2024-04-03 12:10 (UTC) (edited on 2024-04-03 12:11 (UTC) by gesh)

My mistake in re the guidelines, but pacman -Qi base does list file as one of the direct dependencies of base. It is true that it is a common dependency with base-devel, but so are archlinux-keyring, findutils, gawk, gettext, grep, gzip, pacman and sed.

xiota commented on 2024-04-03 11:32 (UTC)

@gesh file is pulled in by base-devel, not base. It can/should be excluded from makedepends, but not depends because the built package may be installed on a different machine that does not have base-devel installed. Newer guidelines require including it.

gesh commented on 2024-04-03 11:16 (UTC)

Just went through the new commit, thanks! I forgot to remove file from depends in my patch -- it's unnecessary, given that it's in base. No rush for that, though, it's not harmful.

A stylistic point, though -- I notice you moved the url and license to be near the source -- any reason for that? I generally like to have my PKGBUILDs follow PKGBUILD.proto guideline of having the metadata being in increasing order of specificity to this PKGBUILD (so pkgname, pkgver, ... are near the top, depends are in the middle, and install, source, *sums are at the bottom), but perhaps you have a different style? It doesn't matter that much though, so feel free to ignore this point.

gesh commented on 2024-03-26 13:38 (UTC) (edited on 2024-03-26 19:37 (UTC) by gesh)

The following should address my concerns: EDIT: After discussing the matter with the packager for nchat-git, I've edited the below to be more in line with that package (in particular, I invoke cmake directly, instead of relying on upstream's flaky make.sh)

diff --git a/PKGBUILD b/PKGBUILD
index 8e88343..0a989cb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,26 +1,50 @@
 # Maintainer: Hoang Nguyen <toi at doclai dot com>

 _pkgname=nchat
-pkgname=${_pkgname}
-pkgver=4.13
+pkgname="${_pkgname}"
+pkgver=4.41
 pkgrel=1
-pkgdesc="nchat is a console-based chat client for Linux and macOS with support for Telegram."
-arch=('any')
+pkgdesc="console-based chat client with support for Telegram"
 url="https://github.com/d99kris/nchat"
 license=('MIT')
-depends=('ncurses' 'gperf' 'help2man' 'readline' 'openssl' 'zlib'  'sqlite' 'go' 'file')
-makedepends=('ccache' 'cmake')
+arch=('x86_64')

-provides=('nchat')
-conflicts=('nchat' 'nchat-git')
-source=("v$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
-md5sums=('SKIP')
+depends=(
+    'file'
+    'ncurses'
+    'openssl'
+    'sqlite'
+    'zlib'
+)
+makedepends=(
+    'cmake'
+    'go'
+    'gperf'
+)
+
+conflicts=("${_pkgname}-git")
+
+_pkgsrc="$_pkgname-$pkgver"
+source=("$_pkgsrc.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
+sha256sums=('368cfe30594b88c580d9e9ccf24a0ff4eda7e6fea3d5a2e0f4051eab81fbf9ca')

 build() {
-    cd "${srcdir}/${pkgname}-${pkgver}"
-   bash ./make.sh build
+    local _cmake_options=(
+      -B build
+      -S "$_pkgsrc"
+      -G 'Unix Makefiles'
+      -DCMAKE_BUILD_TYPE=None
+      -DCMAKE_INSTALL_PREFIX='/usr'
+      -DCMAKE_INSTALL_MANDIR='/usr/share/man'
+      -Wno-dev
+    )
+
+    cmake "${_cmake_options[@]}"
+    cmake --build build
 }
+
 package() {
-    cd "${srcdir}/${pkgname}-${pkgver}/build"
-   make DESTDIR="${pkgdir}" install
+    DESTDIR="$pkgdir" cmake --install build
+
+    install -D -m644 "$_pkgsrc/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
 }

gesh commented on 2024-03-26 12:16 (UTC) (edited on 2024-03-26 12:24 (UTC) by gesh)

v4.41 was released a couple of days ago. Some critiques of the package:

  • arch is definitely not any -- the package built is platform-specific, and needs to be rebuilt for any new architecture

  • No need for _pkgname when it is equal to pkgname

  • No need for $pkgname in provides and conflicts

  • Given that this isn't a VCS package, setting *sums=('SKIP') is unacceptable. Also, prefer SHA to MD5 for checksums (though the attack vector here is sufficiently unrealistic that it's not a big deal)

  • Pet peeve, but please don't mix hard-tabs and spaces

Also, comparing to the -git package, I find several unnecessary differences

  • The -git package's description more closely approximates man PKGBUILD's guidelines for what a good pkgdesc is

  • It would help for comparison if the layout (variable order, dependency order) were shared between the packages

  • go, gperf are made depends here, where the -git package correctly sees them as makedepends

  • @Freso's correct questioning of the addition of ccache to makedepends -- it should be a Wiki suggestion, with tradeoffs clearly marked

  • help2man is unnecessary -- it's just used in bash ./make.sh doc, which appears to be an upstream release engineering step and unnecessary for us.

  • Missing -DCMAKE_BUILD_TYPE and -DCMAKE_INSTALL_{PREFIX,MANDIR} recommended by https://wiki.archlinux.org/title/CMake_package_guidelines

Freso commented on 2023-12-31 18:58 (UTC)

Why does this depend on ccache and cmake rather than makedepend? Also, why force ccache? Shouldn’t that be up to users whether they decide to use it or not?