zqqw / pakku Goto Github PK
View Code? Open in Web Editor NEWPacman wrapper with AUR support
License: GNU General Public License v3.0
Pacman wrapper with AUR support
License: GNU General Public License v3.0
Info update:
The Nim compile option "-d:nimPreviewSlimSystem" allows this to be tested, and with a recent nim-git build at this commit:
commit 53eed2be4515a3ae853ae4d2fbd84daa49c1d6d6
Date: Sun Dec 18 22:31:13 2022 +0800
this works and builds fine - although at that point in Nim it fails on a normal build, without these modifications below! I will probably commit these small changes in preparation for Nim 2.0 but leave the -d:nimPreviewSlimSystem commented out, because that option would not be relevant in old or future versions of Nim, so users can edit the Makefile to enable it if desired - or required.
diff --git a/Makefile b/Makefile
index bae3b09..c9b2639 100644
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,7 @@ NIM_OPTIONS = \
--putenv:'PROG_LOCALSTATEDIR'="${LOCALSTATEDIR}" \
--putenv:'PROG_SYSCONFDIR'="${SYSCONFDIR}" \
-d:'${NIM_TARGET}' \
+ -d:nimPreviewSlimSystem \
--opt:'${NIM_OPTIMIZE}' \
--hint'[Conf]':off \
--hint'[Processing]':off \
diff --git a/lib/install.nim b/lib/install.nim
index 2a89ade..f2886df 100644
--- a/lib/install.nim
+++ b/lib/install.nim
@@ -1,5 +1,6 @@
import
os, posix, sequtils, strutils, sugar
+when not declared(system.stdout): import std/syncio
proc splitCommands(params: seq[string], index: int, res: seq[seq[string]]): seq[seq[string]] =
if index < params.len:
diff --git a/src/args.nim b/src/args.nim
index deabeff..f17f60b 100644
--- a/src/args.nim
+++ b/src/args.nim
@@ -1,6 +1,7 @@
import
options, os, posix, sequtils, sets, strutils, sugar,
utils
+when not declared(system.stdout): import std/syncio
type
ArgumentType* {.pure.} = enum
diff --git a/src/common.nim b/src/common.nim
index da36c0d..46831ce 100644
--- a/src/common.nim
+++ b/src/common.nim
@@ -2,6 +2,7 @@ import
options, os, osproc, posix, sequtils, sets, strutils, sugar, tables,
args, config, format, lists, package, pacman, utils,
"wrapper/alpm"
+when not declared(system.stdout): import std/syncio
type
CacheKind* {.pure.} = enum
diff --git a/src/config.nim b/src/config.nim
index 598b488..a5fab96 100644
--- a/src/config.nim
+++ b/src/config.nim
@@ -1,6 +1,7 @@
import
std/[options, posix, re, sequtils, sets, strutils, sugar, tables],
utils
+when not declared(system.stdout): import std/syncio
type
ColorMode* {.pure.} = enum
diff --git a/src/feature/syncinfo.nim b/src/feature/syncinfo.nim
index ffb299e..647dac1 100644
--- a/src/feature/syncinfo.nim
+++ b/src/feature/syncinfo.nim
@@ -3,6 +3,7 @@ import
"../args", "../aur", "../common", "../config", "../format", "../package",
"../pacman", "../utils",
"../wrapper/alpm"
+when not declared(system.stdout): import std/syncio
const
pacmanInfoStrings = [
diff --git a/src/feature/syncinstall.nim b/src/feature/syncinstall.nim
index a728851..ec7e748 100644
--- a/src/feature/syncinstall.nim
+++ b/src/feature/syncinstall.nim
@@ -3,6 +3,7 @@ import
"../args", "../aur", "../config", "../common", "../format", "../lists", "../package",
"../pacman", "../utils",
"../wrapper/alpm"
+when not declared(system.stdout): import std/syncio
type
Installed = tuple[
diff --git a/src/format.nim b/src/format.nim
index cf4b9db..60c550d 100644
--- a/src/format.nim
+++ b/src/format.nim
@@ -1,6 +1,7 @@
import
std/[macros, options, posix, sequtils, strutils, sugar, times, unicode, terminal],
utils
+when not declared(system.stdout): import std/syncio
type
PackageLineFormat* = tuple[
diff --git a/src/main.nim b/src/main.nim
index 3960d59..c6745d8 100644
--- a/src/main.nim
+++ b/src/main.nim
@@ -1,6 +1,7 @@
import
options, os, posix, re, sequtils, strutils, sugar,
args, config, format, pacman, utils
+when not declared(system.stdout): import std/syncio
import
"feature/localquery",
diff --git a/src/package.nim b/src/package.nim
index e48b01f..9cfe49e 100644
--- a/src/package.nim
+++ b/src/package.nim
@@ -1,6 +1,7 @@
import
options, os, re, sequtils, sets, strutils, sugar, tables, utils,
"wrapper/alpm"
+when not declared(system.stdout): import std/syncio
type
ConstraintOperation* {.pure.} = enum
diff --git a/src/pacman.nim b/src/pacman.nim
index c37a54c..ee20a07 100644
--- a/src/pacman.nim
+++ b/src/pacman.nim
@@ -1,6 +1,7 @@
import
macros, options, posix, sequtils, sets, strutils, sugar, tables,
args, config, utils
+when not declared(system.stdout): import std/syncio
type
OpGroup* {.pure.} = enum
==> Finished making: nim-git 1:0.19.6.r4510.c7ccbfac3-1 (Sat 10 Oct 2020 14:27:36 BST)
:: Continue installing? [Y/n] y
[sudo] password for user:
loading packages...
error: '/tmp/pakku-user/nim-git-1:0.19.4.r1821.d24585c49-1-x86_64.pkg.tar.xz': could not find or read package
Trying again:
error: '/tmp/pakku-username/nim-git-1:0.19.4.r1821.d24585c49-1-x86_64.pkg.tar.xz': could not find or read package
The file is there, but has a newer revision name: nim-git-1:0.19.6.r4511.992952d86-1-x86_64.pkg.tar.xz
(This happens when building nim-git with pakku-git compiled with nim-git.)
Workaround: cd to /tmp/pakku-username and manually install with pakku -U
pakku -S keysmith-git
complains, "error: unable to satisfy dependency 'frameworkintegration ' required by keysmith-git"
but this package is already installed from 'extra' and compiling it with makepkg (no changes to PKGBUILD) gives no errors.
Pakku v0.14-31-g334e09a
Pacman v6.0.2 - libalpm v13.0.2
Having just updated the man pages I thought this was something I had done, but no - and it was building fine recently when I was testing this, downgrading asciidoc to 9.1.1-4 sees it build again.
Adding -v to the a2x command options in pakku/Makefile gives a little more output, but not sure of the fix yet...
${MAN_PAGES:=.in}: ${MAN_PAGES:=.txt}
@echo "GEN: $@"
@a2x \
-v \
--doctype manpage \
pakku
currently asks for your editor every time you inspect a PKGBUILD. This gets tedious after a while, and I've never had a use case where I wanted to use anything other than my default editor. So I was going to do one of the following:
/etc/pakku.conf
$EDITOR
without askingI may take a look at implementing this over the weekend. Would either of these be something you all would be interested in?
$ pakku -Sn hexedit
checking official repositories...
(1/1) cloning repositories 00:00 [################################################################] 100%
error: hexedit: failed to get package info
It works with 1.2.6.
let srcInfo = obtainSrcInfo(repoPath.unsafeGet & "/" & git.path) is returning nothing in src/common.nim
execResult(makePkgCmd, "--printsrcinfo") in obtainSrcInfo where makePkgCmd is "/usr/bin/makepkg" doesn't seem to return anything although there is a PKGBUILD in the dir at that point.
execResult itself seems to work OK. The forks, exec, and redirection make it tricky to find out what happens.
I think I have the answer now - it will just take a little while to get it sorted and pushed here.
Hi there,
I'm using pakku as AUR helper. it's simple and lightweight. According to the latest pacman update to version 14, pakku needs to be updated to use libalpm.so.14. otherwise it doesn't work:
pakku error while loading shared libraries: libalpm.so.13: cannot open shared object file: No such file or directory
Thanks a lot.
Seems like the pacman 6.1 upgrade added new libalpm libraries.
Getting a pakku: error while loading shared libraries: libalpm.so.13: cannot open shared object file: No such file or directory
when trying to run pakku -Syu
.
It is similar to this Morganamilo/paru#1149.
Let me know if anything else is needed to help with this.
Compiling pakku for debug not release:
$ pakku -Ss linux
...
aur/linux-a11y-sound-theme r19.730e525-1 [0 / 0.000000]
Sound theme for the linux accessibility organization
aur/linux-aarch64-raspberrypi 4.19.76.r791998.gf1da5f42022d-2 [2 / 0.000080]
/src/pakku/src/main.nim(263) main
t/src/pakku/src/main.nim(254) run
/pakku/src/main.nim(92) handleSync
/pakku/src/feature/syncsearch.nim(53) handleSyncSearch
/pakku/src/format.nim(152) printPackageSearch
/pakku/src/format.nim(86) splitLines
/usr/lib/nim/pure/unicode.nim(322) runeOffset
/usr/lib/nim/pure/unicode.nim(62) runeLenAt
/usr/lib/nim/system/fatal.nim(49) sysFatal
Error: unhandled exception: index out of bounds, the container is empty [IndexError]
With this build, many searches work but some fail, like "linux" or "steam". No problems updating, installing or removing packages so far.
I adopted the pakku
package for the time being. Looking at the wiki page on plans, I think there could probably be a 0.15 release now, and fixing AUR comments and removing build dependencies could come in a later version.
@zqqw: would you like maintence of the AUR package? If not, I'm happy to keep it updated.
Lots of cstring warnings with current nim-git build, something that will probably need fixing in due course, if anyone does come up with a fix for this in the meanwhile let me know!
/tmp/pakku/pakku-git/src/pakku/src/utils.nim(326, 33) Warning: implicit conversion to 'cstring' from a non-const location: user.name; this will become a compile time error in the future [CStringConv]
/tmp/pakku/pakku-git/src/pakku/src/utils.nim(327, 37) Warning: implicit conversion to 'cstring' from a non-const location: user.name; this will become a compile time error in the future [CStringConv]
/tmp/pakku/pakku-git/src/pakku/src/utils.nim(328, 36) Warning: implicit conversion to 'cstring' from a non-const location: user.name; this will become a compile time error in the future [CStringConv]
/tmp/pakku/pakku-git/src/pakku/src/utils.nim(329, 33) Warning: implicit conversion to 'cstring' from a non-const location: user.home; this will become a compile time error in the future [CStringConv]
/tmp/pakku/pakku-git/src/pakku/src/utils.nim(330, 34) Warning: implicit conversion to 'cstring' from a non-const location: user.shell; this will become a compile time error in the future [CStringConv]
an issue from hell ๐คฉ
see https://aur.archlinux.org/packages/pakku#comment-902444. I triggered this while trying to build+install pakku on a different computer, then reran it and built successfully.
There seems to be a redirect to gitlab, and the existing method to clone the build info dir fails, extra debug printout shows command used, not yet sure what the replacement should be, suggestions welcome:
$ pakku -Sz hexedit
(0/1) cloning repositories --:-- [c o o o o o o o o o o o o o o o o o o ] 0%
/usr/bin/git -C /tmp/pakku-username clone -q https://git.archlinux.org/svntogit/community.git -b packages/hexedit --single-branch hexedit
fatal: unable to update url base from redirection:
asked for: https://git.archlinux.org/svntogit/community.git/info/refs?service=git-upload-pack
redirect: https://gitlab.archlinux.org/explore/groups
(1/1) cloning repositories 00:00 [--------------------------------------------------------] 100%
error: hexedit: failed to clone git repository
maybe it's just me, but tried to install pakku on a fresh archlinux and it didnt compile with nim 1.6.8 (installed using choosenim)
==> Starting build()...
NIM: src/pakku
pakku/src/utils.nim(295, 34) Warning: Deprecated since 1.5; TaintedString is deprecated [Deprecated]
pakku/src/feature/syncinstall.nim(210, 52) template/generic instantiation of `createCloneProgress` from here
pakku/src/feature/syncinstall.nim(42, 3) Error: cannot instantiate: 'result:type'
make: *** [Makefile:120: src/pakku] Error 1
==> ERROR: A failure occurred in build().
Aborting...
Fix for TaintedString warning, but not the last bit:
diff --git a/src/utils.nim b/src/utils.nim
index 1f58b8f..5cd33f6 100644
--- a/src/utils.nim
+++ b/src/utils.nim
@@ -292,13 +292,13 @@ proc execRedirect*(args: varargs[string]): int =
return -1
var outp = outputStream(p)
close(inputStream(p))
- var line = newStringOfCap(120).TaintedString
+ var line = newStringOfCap(120)
while true:
if outp.readLine(line):
if writeFlag == false:
- echo line.string
+ echo line
else:
- discard write(fd[1], line.string.cstring, len(line.string))
+ discard write(fd[1], line.cstring, len(line))
discard write(fd[1], "\n".cstring, 1)
else:
code = peekExitCode(p)
(TaintedString wasn't really doing much here, it got included with something that I had adapted from elsewhere)
The last bit is something related to the update/terminate closures again, and I'll also try another newer build of nim-git as that was one built on the 14th.
getting:
==> Updated version: pakku-git 1:0.14.r31.g334e09a-1
==> Starting build()...
GEN: completion/bash
GEN: completion/zsh
2 out of 8 hunks FAILED
make: *** [Makefile:94: completion/zsh] Error 1
==> ERROR: A failure occurred in build().
Aborting...
error: failed to build 'pakku-git'
since kitsunyan is still mia, this is the only working pakku for our tiny niche within a niche of Nim and Arch users
would you be willing to adopt an orphan package for mere hours a month?
The README says options -Sn
and -Sz
will only work if they have distro specific support. I know @zqqw worked really hard for the Artix support, but there are some isArch
, isArtix
and isParabola
variables defined and I am not sure how they change the behavior or what features they imply.
So, could someone list the supported extra features, by distro? I didn't even know that Pakku had Parabola only features.
Hello,
Apparently dependencies are not reparsed after the editing of the dependencies, which make the said editing completely useless.
As far as I am concerned, this is one of the most common editing I do to PKGBUILD, so it would be nice to reparse the deps after editing.
Is this something that would be implemented ?
I am not a daily Nim programmer, but I think I know enough of it that I could look into implementing this if it is acceptable for you.
Artix packages don't work with -Sz (fixed by 19de8f0) and -Sn
LTO will soon be default in Arch builds. Testing it, this new compiler option works fine with Pakku, Nim has supported it for a long while.
diff --git a/Makefile b/Makefile
index 04ce4cb..f3049bb 100644
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,8 @@ NIM_OPTIMIZE = size
NIM_CACHE_DIR = nimcache
NIM_OPTIONS = \
+ --passC:"-flto" \
+ --passL:"-flto" \
--putenv:'PROG_VERSION'="${RVERSION}" \
--putenv:'PROG_COPYRIGHT'="${COPYRIGHT}" \
--putenv:'PROG_PKGLIBDIR'="${PKGLIBDIR}" \
Result, a smaller binary:
Total Installed Size: 0.74 MiB
Net Upgrade Size: -0.12 MiB
Can this Pakku be updated the easiest/best way to like Arch update way, meant is there binary, say, pakku-s, to fetch the latest binary kept in a repo replacing current pakku one in local location, if not (yet) may ask it as user's feature request?
CC: tools.nim
Hint: Release build [BuildMode]
NIM: src/pakku
/pakku/src/common.nim(231, 40) template/generic instantiation of `toHashSet` from here
/usr/lib/nim/pure/collections/sets.nim(241, 33) template/generic instantiation of `incl` from here
/usr/lib/nim/pure/collections/setimpl.nim(49, 21) template/generic instantiation of `rawGet` from here
/usr/lib/nim/pure/collections/hashcommon.nim(74, 14) template/generic instantiation of `genHashImpl` from here
/usr/lib/nim/pure/collections/hashcommon.nim(64, 12) template/generic instantiation of `hash` from here
/usr/lib/nim/pure/hashes.nim(548, 30) template/generic instantiation of `hash` from here
/pakku/src/utils.nim(70, 6) Error: type mismatch: got <Option[package.VersionConstraint], proc (x: float): Hash{.inline, noSideEffect, gcsafe, locks: 0.} | proc (x: pointer): Hash{.inline, noSideEffect, gcsafe, locks: 0.} | proc (x: ptr T): Hash{.inline.} | proc (x: T: Ordinal or enum): Hash{.inline.} | proc (x: ref T): Hash{.inline.} | proc (x: openArray[A]): Hash | proc (x: set[A]): Hash | proc (x: string): Hash{.noSideEffect, gcsafe, locks: <unknown>.} | proc (x: cstring): Hash{.noSideEffect, gcsafe, locks: <unknown>.} | proc (sBuf: string, sPos: int, ePos: int): Hash{.noSideEffect, gcsafe, locks: <unknown>.} | proc (x: T: tuple or object or proc): Hash{.inline.} | proc (aBuf: openArray[A], sPos: int, ePos: int): Hash>
but expected one of:
proc map[T, R](self: Option[T]; callback: proc (input: T): R): Option[R]
first type mismatch at position: 2
required type for callback: proc (input: T): R{.closure.}
but expression 'hash' is of type: None
proc map[T](self: Option[T]; callback: proc (input: T))
first type mismatch at position: 2
required type for callback: proc (input: T){.closure.}
but expression 'hash' is of type: None
2 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
expression: map(x[2], hash)
make: *** [Makefile:120: src/pakku] Error 1
==> ERROR: A failure occurred in build().
Aborting...
You need to modify the nim-git PKGBUILD to build it at present to get this error.
Would please one expert work to prepare and let us all have Pakku project package that has been tested and is ready to perfectly be built on Msys2/Mingw64
So it'd be nice have a clear helpful build instructions in files namedly, say, BUILD and INSTALL file
It seems like something have broken with Pakku and/or AUR. I'm trying to install the GCC cross-compiler for ARM and I just get an error saying it can't find arm-linux-gnueabihf-gcc-stage2 which is evidently there. It seems to be able to find other things just fine, but not this specific package.
[peter ~ ] 16685 $ pakku -S arm-linux-gnueabihf-gcc
:: Resolving build targets...
checking AUR database for targets...
(1/1) cloning repositories 00:00 [########################################################################################] 100
resolving dependencies...
(1/1) cloning repositories 00:00 [########################################################################################] 100
(2/2) cloning repositories 00:00 [########################################################################################] 100
error: unable to satisfy dependency 'arm-linux-gnueabihf-gcc-stage2>=11.2.0-3' required by arm-linux-gnueabihf-glibc
โ1โ[peter ~ ] 16686 $ pakku -S arm-linux-gnueabihf-gcc-stage2
:: Resolving build targets...
checking AUR database for targets...
(1/1) cloning repositories --:-- [########################################################################################] 100
error: target not found: arm-linux-gnueabihf-gcc-stage2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.