Kicad missing symbols and footprints

2023-10-16 Thread phodina via
Hi,

does somebody use Kicad on Guix? If so how do you load the symbols and 
footprints.

The point still to /gnu/store/-kicad-7.0.8 but they are in kicad-symbols 
and kicad-footprints packages.

I've changed the paths appropriately as well as cloned the repo to home dir but 
I always get just an empty list.

```
$ guix show kicad
name: kicad
version: 7.0.8
outputs:
+ out: everything
systems: x86_64-linux
dependencies: bash-minimal@5.1.16 boost@1.80.0 cairo@1.16.0
+ curl@7.85.0 desktop-file-utils@0.26 gdk-pixbuf@2.42.8
+ gettext-minimal@0.21 glew@2.2.0 glm@0.9.9.8 gtk+@3.24.37
+ hicolor-icon-theme@0.17 libngspice@41 libsm@1.2.3 mesa@23.1.4
+ opencascade-occt@7.6.2 openssl@3.0.8 pkg-config@0.29.2
+ python-wrapper@3.10.7 python-wxpython@4.2.0 swig@4.0.2+ unixodbc@2.3.9 
wxwidgets@3.2.2.1 zlib@1.2.13
```
Petr

Expose USB devices in Guix container

2023-03-04 Thread phodina via
Hi,

I wanted to run an AppImage inside Guix container with FHS. But there is an 
issue about USB as the application connects to a mobile phoen and install OS 
there [1].

However, inside the container even the simple lsusb​ does not work. I've 
exposed the /dev/bus/usb​ .

And the open syscall still fails even though the device is mapped into the 
container as you can see in the strace log
```
openat(AT_FDCWD, "/dev/bus/usb/004/001", O_RDONLY|O_CLOEXEC) = -1 ENODEV (No 
such device)
```

```
$ guix shell --container --network --emulate-fhs --development 
ungoogled-chromium gcc:lib --preserve='^DISPLAY$' --preserve='^XAUTHORITY$' 
--expose=$XAUTHORITY --preserve='^DBUS_' --expose=/var/run/dbus 
--expose=/sys/dev --expose=/sys/devices --expose=/dev/dri --expose=/dev/bus/usb 
android-udev-rules libusb usbutils strace
[env]$ lsusb
unable to initialize libusb: -1
[env] $ strace lsusb
execve("/bin/lsusb", ["lsusb"], 0x7ffd6a4c05a0 /* 31 vars */) = 0
brk(NULL) = 0x17de000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f5ce212
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
readlink("/proc/self/exe", "/gnu/store/wp2nnsdii68wa2kcqpbwh"..., 4096) = 66
openat(AT_FDCWD, 
"/gnu/store/wp2nnsdii68wa2kcqpbwhrd6c7apwmbw-usbutils-015/etc/ld.so.cache", 
O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=6412, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 6412, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5ce211e000
close(3) = 0
openat(AT_FDCWD, 
"/gnu/store/vjlg2z75qwbwxdp5qiklcdx7df9xvbb2-libusb-1.0.24/lib/libusb-1.0.so.0",
 O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360V\0\0\0\0\0\0"..., 
832) = 832
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\1\0\1\300\4\0\0\0\t\0\0\0\0\0\0\0"..., 
48, 110560) = 48
newfstatat(3, "", {st_mode=S_IFREG|0555, st_size=117728, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 120064, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5ce210
mmap(0x7f5ce2105000, 57344, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f5ce2105000
mmap(0x7f5ce2113000, 36864, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 
0x13000) = 0x7f5ce2113000
mmap(0x7f5ce211c000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f5ce211c000
close(3) = 0
openat(AT_FDCWD, 
"/gnu/store/53nv7cam6agri3s60p0fqmkwg1896zf6-eudev-3.2.11/lib/libudev.so.1", 
O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\Y\0\0\0\0\0\0"..., 
832) = 832
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\1\0\1\300\4\0\0\0\t\0\0\0\0\0\0\0"..., 
48, 141208) = 48
newfstatat(3, "", {st_mode=S_IFREG|0555, st_size=146936, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 150952, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5ce20db000
mmap(0x7f5ce20e, 86016, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f5ce20e
mmap(0x7f5ce20f5000, 36864, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 
0x1a000) = 0x7f5ce20f5000
mmap(0x7f5ce20fe000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f5ce20fe000
close(3) = 0
openat(AT_FDCWD, 
"/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6", 
O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 9\2\0\0\0\0\0"..., 832) 
= 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 
784, 64) = 784
pread64(3, 
"\4\0\0\\0\0\0\5\0\0\0GNU\0\2\200\0\300\4\0\0\0\1\0\0\0\0\0\0\0"..., 64, 
848) = 64
pread64(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0 \0\0\0", 32, 
912) = 32
newfstatat(3, "", {st_mode=S_IFREG|0555, st_size=1806776, ...}, AT_EMPTY_PATH) 
= 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 
784, 64) = 784
mmap(NULL, 1840808, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5ce1f19000
mmap(0x7f5ce1f3b000, 1314816, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f5ce1f3b000
mmap(0x7f5ce207c000, 327680, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 
0x163000) = 0x7f5ce207c000
mmap(0x7f5ce20cc000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b2000) = 0x7f5ce20cc000
mmap(0x7f5ce20d2000, 34472, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5ce20d2000
close(3) = 0
openat(AT_FDCWD, 
"/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0", 
O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320k\0\0\0\0\0\0"..., 
832) = 832
pread64(3, 
"\4\0\0\\0\0\0\5\0\0\0GNU\0\2\200\0\300\4\0\0\0\1\0\0\0\0\0\0\0"..., 64, 
792) = 64
pread64(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0 \0\0\0", 32, 
856) = 32
newfstatat(3, "", {st_mode=S_IFREG|0555, st_size=110088, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 128016, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5ce1ef9000
mmap(0x7f5ce1eff000, 57344, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP

Cross-compile Rust packages

2023-02-08 Thread phodina via
Hello,

is there a way to cross-compile the Rust binaries in Guix? I attempted to 
cross-compile Alacritty for Aarch64 architecture but got error.

$ ./pre-inst-env guix build alacritty --target=aarch64-linux-gnu
guix build: error: gnu/packages/terminals.scm:1396:2: alacritty@0.9.0: build 
system `cargo' does not support cross builds


Petr

Re: Python build system cross build

2023-01-29 Thread phodina


> 
> Review/apply this patch: https://issues.guix.gnu.org/60847 :-)
> 

Wow, thanks Maxim for the patch set! I'll check it out.


Petr



Python build system cross build

2023-01-28 Thread phodina via
Hi,

what are the necessary steps to allow python-build-system to be cross buildable?

```
guix build gnome-shell --target=aarch64-linux-gnu
guix build: error: gnu/packages/gtk.scm:2066:2: python-pycairo@1.20.0: build 
system `python' does not support cross builds
```


Petr

Re: [PATCH 1/2] gnu: Add python-rx.

2023-01-16 Thread phodina
Hello,

sorry for this email, the correct recipient should have been 
guix-patc...@gnu.org.



Petr

--- Original Message ---
On Monday, January 16th, 2023 at 12:00 PM, phodina via  
wrote:


> Hi,
> 
> here are two Python modules to upstream.
> 
> 
> Petr



[PATCH 1/2] gnu: Add python-rx.

2023-01-16 Thread phodina via
Hi,

here are two Python modules to upstream.


PetrFrom 31a313be47093eae5cd211094fa2bea38148f657 Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Mon, 16 Jan 2023 11:40:34 +0100
Subject: [PATCH 1/2] gnu: Add python-rx.

* gnu/packages/python-xyz.scm (python-rx): New variable.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 32d826d3c5..a9e0981e9a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4028,6 +4028,25 @@ (define-public python-roman
 to Roman Numerals.")
 (license license:psfl)))
 
+(define-public python-rx
+  (package
+(name "python-rx")
+(version "3.2.0")
+(source (origin
+  (method url-fetch)
+  (uri (pypi-uri "Rx" version))
+  (sha256
+   (base32
+"076rcgcyqqpr5y7jyg7za6ngfm75qbx0kzfwyyi5sj5a8lmwlmxn"
+(build-system python-build-system)
+(arguments
+ (list #:tests? #f)) ;no test suite
+(native-inputs (list python-pytest))
+(home-page "https://reactivex.io/";)
+(synopsis "Reactive Extensions for Python")
+(description "This package provides Reactive Extensions for Python.")
+(license license:expat)))
+
 (define-public python-unidecode
   (package
 (name "python-unidecode")
-- 
2.38.1

From a396f110c527b6f06839e91ea89d1d1724c6 Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Mon, 16 Jan 2023 11:41:00 +0100
Subject: [PATCH 2/2] gnu: Add python-injector.

* gnu/packages/python-xyz.scm (python-injector): New variable.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a9e0981e9a..ebada3d15e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20228,6 +20228,31 @@ (define-public python-iniconfig
  @end itemize")
 (license license:expat)))
 
+(define-public python-injector
+  (package
+(name "python-injector")
+(version "0.20.1")
+(source (origin
+  (method url-fetch)
+  (uri (pypi-uri "injector" version))
+  (sha256
+   (base32
+"0fi2zw6nffl91ihx25wfvr5mq8jyrdx2pa56wdhww2c35ydb8qc6"
+(build-system python-build-system)
+(propagated-inputs (list python-typing-extensions))
+(native-inputs (list python-black
+ python-check-manifest
+ python-dataclasses
+ python-mypy
+ python-pytest
+ python-pytest-cov))
+(home-page "https://github.com/python-injector/injector";)
+(synopsis "Python dependency injection framework")
+(description
+ "This package provides Python dependency injection framework - inspired by
+Guice.")
+(license license:bsd-3)))
+
 (define-public python-mamba
   (package
 (name "python-mamba")
-- 
2.38.1



Packaging Grafana

2023-01-15 Thread phodina via
Hi Guix,

Grafana [1] is an awesome tool to visualize and analyze various kind of data.

It's FOSS project under AGPL3+.

The small drawback is it's written in Go and Typescript.

As far as I understand for Go there's the file go.mod​ describing the 
dependencies [2] and for Typescript there's file package.json​.[3]

I've tried to use the guix import​ command, however, it fails to add even the 
Go dependencies.

Also since the dependency chain is obviously huge how should the porting be 
done?

Any experience porting some similar package with dos and don'ts?

The short term solution at least in my case is to use the prebuilt static 
binary which works after running patchelf on it. That's also how Nix package 
looks like. [4]

Here's what the importer returns:

---8<---cut here---start->8---
$ guix import go -r github.com/grafana/grafana
(define-public go-github-com-grafana-grafana
(package
(name "go-github-com-grafana-grafana")
(version "5.4.5+incompatible")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/grafana/grafana";)
(commit (go-version->git-ref version
(file-name (git-file-name name version))
(sha256
(base32
"1rgcy21amrh6syf21p2gpdbwzc2mcjw6wsbhwwr7v40rdx12rmcm"
(build-system go-build-system)
(arguments
'(#:import-path "github.com/grafana/grafana"))
(home-page "https://github.com/grafana/grafana";)
(synopsis "")
(description
"@@url{https://grafana.com,Website} | @@url{https://twitter.com/grafana,Twitter}
| @@url{https://community.grafana.com,Community & Forum}") (license 
license:asl2.0)))

---8<---cut here---end->8---

1 https://grafana.com/
2 https://github.com/grafana/grafana/blob/main/go.mod
3 https://github.com/grafana/grafana/blob/main/package.json
4 
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix


Petr

Re: Guix supported-systems option

2023-01-14 Thread phodina via
Hi Julien,

> I think you have multiple packages with the same name and version, but 
> different supported systems. Am I right?

you are correct. I have multiple package definitions as shown in the attached 
scheme file.

The names and versions are exactly the same, just the origin differs and Guix 
picks "randomly" one of them.

I did as you suggested to rename the packages - append the arch. This works in 
short term but I'd like to have one profile and just apply it on my laptop 
(x86_64) as well as on Raspberry Pi (aarch64, recently added to Guix by Stefan).

Having different names will then not work or results in even bigger mess with 
if statements.

> Now, supported-systems does not mean "remove this package on other 
> architectures", but rather "can't build this on other architectures". So it's 
> perfectly possible that guix will arbitrarily select a package for a 
> different architecture.

Well this is the reason I ask. I though this has deeper meaning as to tell 
Guix, okay you found a package with that name, but it's not for current 
architecture. So keep looking and if you don't find any other return this one 
with a warning that it's not supported.

So the "right" way would be conditionally select the right origin for the 
package and use just one package definition with list of supported systems, 
right?


Petr

Guix supported-systems option

2023-01-14 Thread phodina via
Hello,

I have recently uncovered a "feature" that works little bit than described in 
the manual,

During definition of a new variable, package, there is an option called 
supported-systems​ which defaults to %default-systems​.

However, if the package is known to work on certain architecture the right 
thing is to list the supported architectures, right?

If I select package which is not supported by my current architecture and build 
it I get notification like this one:
`warning: package grafana@9.3.2 does not support x86_64-linux`

So suppose I have the same package for different architectures, each has it's 
own unique tarball.

I've defined one package and inherited from it, changing the source​ for the 
other and selecting the correct supported-systems​.
Unfortunately, this approach fails as Guix does not select the right package I 
want to use on the current system.

So should the approach be to define just one variable for the package and then 
conditionally select the right tarball/git for the package?

Also is this considered bug or a feature?

FIY I know the right way would be to build Grafana from source in this case 
which would solve the issue I just wanted to know in general more about the use 
case of the supported-systems​ option.


Petr;;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Copyright © 2021-2022 Petr Hodina 

(define-module (nongnu packages grafana)
  #:use-module (guix packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages elf)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages glib)
  #:use-module (guix download)
  #:use-module (nonguix build-system binary)
  #:use-module ((guix licenses)
#:prefix license:))

(define-public grafana-bin
  (package
(name "grafana")
(version "9.3.2")
(source (origin
  (method url-fetch)
  (uri (string-append
"https://dl.grafana.com/oss/release/grafana-"; version
".linux-amd64.tar.gz"))
  (sha256
   (base32
"177d396sg6pwa7vwsdwqy6fg17kq47n619s4745z62s6inq3i0vr"
(build-system binary-build-system)
(arguments
 '(#:strip-binaries? #f ;TODO: For some reason it fails validate-runpath
   ;; phase if enabled
   #:install-plan `(("bin/grafana-cli" "bin/grafana-cli")
("bin/grafana-server" "bin/grafana-server")
("conf/defaults.ini" "etc/grafana/grafana.ini")
("conf" "share/grafana/")
("public" "share/grafana/")
("scripts" "share/grafana/")
("plugins-bundled" "share/grafana/"))
   #:patchelf-plan (list (list "bin/grafana-cli"
   '("glibc" "gcc:lib"))
 (list "bin/grafana-server"
   '("glibc" "gcc:lib")))
   #:phases
   ;; TODO: This should be moved to the service
   (modify-phases %standard-phases
 (add-after 'unpack 'fix-data-dir-path
   (lambda _
 (substitute* "conf/defaults.ini"
   (("data = data")
"data = /var/lib/grafana")
   (("logs = data/log")
"data = /var/logs/grafana")
   (("plugins = data/plugins")
"data = /var/lib/grafana")))

(supported-systems '("x86_64-linux"))
(native-inputs (list patchelf))
(inputs `(("gcc:lib" ,gcc "lib")
  ("glibc" ,glibc)))
(synopsis "Platform for monitoring and observability")
(description
 "Grafana allows you to query, visualize, alert on
and understand your metrics no matter where they are stored.  Create, explore,
and share dashboards with your team and foster a data-driven culture:
@enumerate
@ite Visualizations: Fast and flexible client side graphs with a multitude
of options.  Panel plugins offer many different ways to visualize metrics
and logs
@item Dynamic Dashboards: Create dynamic & reusable dashboards with template
variables that appear as dropdowns at the top of the dashboard.
@item Explore Metrics: Explore your data through ad-hoc queries and dynamic
drilldown.  Split view and compare different time ranges, queries and data
sources side by side.
@item Explore Logs: Experience the magic of switching from metrics to logs with
preserved label filters. Quickly search through all your logs or streaming them
live.
@item Alerting: Visually define alert rules for your most important metrics.
Grafana will continuously evaluate and send notifications to systems like Slack,
PagerDuty, VictorOps, OpsGenie.
@item Mixed Data Sources: Mix different data sources in the same graph! You can
specify a data source on a per-query basis. This works for even custom
datasources.
@end enumerate")
(home-page "https://grafana.com/";)
(license license:agpl3)))

(define-public grafana-bin-aarch64
  (package
(inherit grafana-bin)
(name 

3D print enthusiasts

2023-01-14 Thread phodina via
Hi,

I was wondering how many of us are there 3D print enthusiasts.

And also what solution do you use?

For me it's the following stack Prusa slicer, Prusa i3 Mk3s and Octoprint.

Here are also the patches for Octoprint if you want to to test. [1]

Also would it make sense to prepare the package for the firmware for the 
printer using Guix?

The firmware for the printer is based on Marlin [2] and compiled with 
arm-none-gcc.

1 [https://issues.guix.gnu.org/51314](https://issues.guix.gnu.org/51314#113)2 
https://github.com/MarlinFirmware/Marlin


Petr

HELP: Apply local patch in phase

2022-12-27 Thread phodina via
Hello,

could you please suggest how to apply local patch using gexp?

The reason the patch is not applied to source is that it patches code from 
submodule which is downloaded after unpack phase finishes.

There's nice example in the file 'gnu/packages/games.scm'

Here we list the patch as dependency:
```
(native-inputs
`(("unzip" ,unzip)
("patch" ,patch) ("love-11.patch" ,(search-patch 
"mrrescue-support-love-11.patch"
```
Here's transformation to inputs without labels for my case:
```
(native-inputs
`(("unzip" ,unzip)
("patch" ,patch) ("love-11.patch" ,(search-patch 
"mrrescue-support-love-11.patch"
```
And later we apply the patch:
```
(invoke patch "-p1" "-i"
(assoc-ref %build-inputs "love-11.patch")))
```
The issue here is when I attempt to do so with following code the expression 
returns #f as the patch is not found:
```
(invoke (search-input-file inputs "/bin/patch") "-p1" "-i" (search-input-file 
inputs "zenlib_dynamic_physfs.diff"))
```

Any ideas what to change?


Petr

Re: Sourcing a script in phases

2022-12-27 Thread phodina
Hi,

thanks for both ideas.

I went the easiest path and opted for:


(invoke "bash" "-c" "source env.sh && kmk")


Not the most polished line of code but it moves me a step ahead :-D

FIY: I'm attempting to build Virtualbox


Petr



Re: Specifying rust version

2022-12-27 Thread phodina
Hi,

>> the documentation for 'cargo-build-system' [1] refers to parameter
>> '#:rust' which allows user to specify the Rust compiler version.
>> However, I've found this commit
>> 9635119a61a9ab1b023558727fcdf1816fdc7fc6 from Maxim which makes all
>> 'rust-.*' definitions private.  Is there a way to specify newer Rust
>> compiler? Something like 'rust-next'?  The package requires version
>> 1.62 but the current is 1.60. Also both version are already defined.
>> What's missing is just way to select them.
>> 
>> [1] https://guix.gnu.org/manual/en/html_node/Build-Systems.html
>> 
>
> I checked gnu/packages/rust.scm and it looks like the rust packages
> aren't hidden but actually not exported. If they were just hidden then
> you could still do `#:rust ,rust-1.62`. Since they're actually not
> exported you need to use the not-really-supported `@@` to refer to that
> variable, so you'd have to use something like:
> #:rust ,(@@ (gnu packages rust) rust-1.62)

Thanks Efraim, this is exactly what I've been looking for atm as temporary
hack.

> Given how it would be useful to have access to newer rust versions I
> think it'd be worthwhile to make a post in guix-devel about making the
> newer versions of rust use define-public but be hidden, so they can be
> used as expected for the #:rust keyword.

It would be definitely great to have access to the latest packaged version
of rust. However, I understand this will trigger a lot of rebuilds.

> > > 
> > > the documentation for 'cargo-build-system' [1] refers to parameter
> > > '#:rust' which allows user to specify the Rust compiler version.
> > > However, I've found this commit
> > > 9635119a61a9ab1b023558727fcdf1816fdc7fc6 from Maxim which makes all
> > > 'rust-.*' definitions private. Is there a way to specify newer Rust
> > > compiler? Something like 'rust-next'? The package requires version
> > > 1.62 but the current is 1.60. Also both version are already defined.
> > > What's missing is just way to select them.
> > > 
> > > [1] https://guix.gnu.org/manual/en/html_node/Build-Systems.html
> > 
> > I checked gnu/packages/rust.scm and it looks like the rust packages
> > aren't hidden but actually not exported. If they were just hidden then
> > you could still do `#:rust ,rust-1.62`. Since they're actually not
> > exported you need to use the not-really-supported `@@` to refer to that
> > variable, so you'd have to use something like:
> > #:rust ,(@@ (gnu packages rust) rust-1.62)
> 
> 
> Normally only the newest released Rust version is supported by upstream,
> so what we should do is add a newer rust and use it by default.
> 
> The reasons previous rust versions are not exported is because they
> aren't intended to be used by applications; they are built using
> '--stage=1' to speed up compilation, which creates slower binaries and
> may expose ABI stability problems (*if I remember the rust people's
> explanation correctly).
> 
> When adding new version of rust, we move all the tests and final rust
> version specifics to the leaf (last) rust version, and keep the
> intermediary rusts minimal (no test, no tools, stage=1, etc.)
> 
> > Given how it would be useful to have access to newer rust versions I
> > think it'd be worthwhile to make a post in guix-devel about making the
> > newer versions of rust use define-public but be hidden, so they can be
> > used as expected for the #:rust keyword.
> 
> 
> It's typical that build system or services expose a way for the user to
> use a variant of a package, but in the case of rust, I don't think it
> should be advertised as a way to use different rust versions (given only
> the last version is supported by upstream, e.g. sometimes fixing CVEs).

I have to agree with you that this is just an anti-pattern and the #:rust
should not be advertised.

The best approach would be to add new rust version and switch to it.

So do you think Maxim the `#:rust` parameter should be dropped and the
documentation also removed?

I guess same approach would apply for antioxidant-build-system, right? [1]

1 https://notabug.org/maximed/cargoless-rust-experiments


Petr






Re: Corefreq: How to specify output in OS definition

2022-12-26 Thread phodina
Hello Efraim,

> I was able to get it to say it would be added when I added the following
> to my OS config:
> 
> (kernel-loadable-modules (list `(,corefreq "linux-module")))
> 
> I didn't actually try building or running it though.

Adding this line to OS definition fixes the initial issue.

However, you still need to manually add the kernel module and start the 
corefreqd daemon as a root.

```
$ corefreq-cli
Daemon connection error code 2
corefreq-ro-shm: 'No such file or directory' @ line 19075
$ corefreqd
corefreqd execution error code 13
Permission denied @ line 8002
$ sudo -E corefreqd
Password:
Driver connection error code 2
/dev/corefreqk: 'No such file or directory' @ line 7998
$ sudo -E modprobe corefreqk
$ sudo -E corefreqd &
CoreFreq Daemon 1.90.1  Copyright (C) 2015-2022 CYRIL INGENIERIE
$ corefreq-cli
# Now it launches :-)
```
So maybe a service would be handy, what do you think?


Petr



Specifying rust version

2022-12-26 Thread phodina via
Hi,

the documentation for 'cargo-build-system' [1] refers to parameter '#:rust' 
which allows user to specify the Rust compiler version.

However, I've found this commit 9635119a61a9ab1b023558727fcdf1816fdc7fc6 from 
Maxim which makes all 'rust-.*' definitions private.

Is there a way to specify newer Rust compiler? Something like 'rust-next'?

The package requires version 1.62 but the current is 1.60. Also both version 
are already defined. What's missing is just way to select them.

[1] https://guix.gnu.org/manual/en/html_node/Build-Systems.html

EDIT: Add help-guix@gnu.org to list of recipients.
----
Petr

--- Forwarded Message ---
From: phodina 
Date: On Monday, December 26th, 2022 at 9:39 AM
Subject: Specifying rust version
To: Maxim Cournoyer , Efraim Flashner 


> Hi,
>
> the documentation for 'cargo-build-system' [1] refers to parameter '#:rust' 
> which allows user to specify the Rust compiler version.
>
> However, I've found this commit 9635119a61a9ab1b023558727fcdf1816fdc7fc6 from 
> Maxim which makes all 'rust-.*' definitions private.
>
> Is there a way to specify newer Rust compiler? Something like 'rust-next'?
>
> The package requires version 1.62 but the current is 1.60. Also both version 
> are already defined. What's missing is just way to select them.
>
> [1] https://guix.gnu.org/manual/en/html_node/Build-Systems.html
>
> 
> Petr

Sourcing a script in phases

2022-12-25 Thread phodina via
Hi,

is there a way to source a script in the phases?
I tried to do:

(invoke "source" "env.sh")
or
(invoke "." "env.sh")

But it didn't work since they are builtin in the shell.


Petr

Corefreq: How to specify output in OS definition

2022-12-24 Thread phodina via
Hi Tobias,

how do you specify output "linux-module" for the package corefreq in the OS 
definition in the field kernel-loadable-modules?


Petr

Re: PinePhone Pro & Guix

2022-12-24 Thread phodina
Hello,

> Hi all, I'm trying to write a guix code that will generate images for
> pinephone pro. Can anyone share the config .scm file if anyone has done it?
> Thanks.

I do have same interest in mind. The bigger issue I'd say is to have working 
mobile UI environment as the console would otherwise be useless.

There are two possibilites:
- Plasma mobile [1][2]
- Phosh [3][4]

None of the above currently works in Guix.

Recently also Gnome Shell, but that I haven't yet tested. [5]

After these environments are running in Guix we can look into the hardware. The 
biggest drawback I'd say is that's still development platform. Sure you can use 
it daily but the mileage varies from Android or iOS (mainly power and 
peripherals such as camera)[6]. Though the work already done is amazing and 
continues to improve!

Besides the code not yet being merged in the upstream kernel there's another 
issue.

Without the issue you won't be able to have bluetooth, WiFI, USB peripherals 
(probably more like fingerprint, nfc).

Definitely having libre phone is admirable goal but it's not possible under 
current circumstances.

The best way is to have Guix on foreign distibution.

There's similar project in the NixOS world, might check that. [7]

Or just use PostmarketOS. [8][9]

The last issue is probably running Android apps using Waydroid. [10]

FIY I've been putting together the definition for the Pine64 products on 
nonguix channel :-)

1 https://issues.guix.gnu.org/57608
2 https://plasma-mobile.org/
3 https://issues.guix.gnu.org/44400
4 https://puri.sm/posts/phosh-overview/
5 https://blogs.gnome.org/shell-dev/2022/09/09/gnome-shell-on-mobile-an-update/
6 
https://tuxphones.com/pinephone-pro-sony-imx258-camera-demo-samples-mainline-linux/
7 https://mobile.nixos.org/
8 https://postmarketos.org/
9 https://issues.guix.gnu.org/49577
10 https://issues.guix.gnu.org/51737


Petr





Re: Seeking help to create link to libstdc++.so in /lib64

2022-11-10 Thread phodina


> You probably want to use the new
> 
> guix shell -CF ...
> 
> command; the -F is short for --emulate-fhs.
> 

This is probably the best approach to run it in a container with FHS.


Petr



Re: How to use/install rust nightly on guix ?

2022-11-01 Thread phodina
Hi,

> Hello guys,
> Any ideas for the best way to install rust nightly on guix ? I don't find it 
> in the guix channel, neither rustup.
> I need rust nightly to compile a certain project (this one : 
> https://github.com/paritytech/substrate).
> 
> Thanks,
> Mohamed Amine LEGHERABA

Not sure it's what you asked but my workflow with Rust is to create/clone Rust 
package. Then create Guix package with source pointing to that directory and 
adding all the build dependencies (plus all other fields package should have).
The last part is to enable the RUSTC_BOOTSTRAP=1 environment variable in the 
arguments after unpack phase. [1]

> The build system sets RUSTC_BOOTSTRAP=1. This special variable means to break 
> the stability guarantees of rust: Allow using #![feature(...)] with a 
> compiler that's not nightly. This should never be used except when 
> bootstrapping the compiler.

It's a hack that works for now but haven't found a better way yet.

Last step is to run:
guix shell -D PKG

This gives you environment to test the build locally.


Petr



Re: Seeking help to create link to libstdc++.so in /lib64

2022-11-01 Thread phodina
Hi Milind,



> If instead of file-append, I use string-append like this:
> #~(string-append $#gcc:lib "/lib/libstdc++.so.6")
> it works to the extent that gcc:lib is expanded correctly, but then
> activate-service.scm script contains
> (activate-special-files (quote (("/lib64/libstdc++.so.6"
> (string-append "/gnu/store/6d0pl5khj08j3c2619jnypc8bznspgx8-gcc-10.3.0-lib"
> "/lib/libstdc++.so.6")
> 
> and which results in an error:
> wrong type (expecting string): (string-append
> "/gnu/store//gnu/store/6d0pl5khj08j3c2619jnypc8bznspgx8-gcc-10.3.0.lib"
> "/lib/libstdc++.so.6")
> 

IMHO you can try the following code instead of the Gexp:
`(,gcc "lib")

Hope it helps!


Petr



Re: Can't reconnect to WiFi easily

2022-11-01 Thread phodina
Hi,

have you looked into the kernel ring buffer? If it's something related to the 
kernel or the Wifi AP then you'll see some messages regarding loosing signal, 
authentication, etc.

So the `dmesg` command should give us more insight into if it's kernel/Wifi 
problem or just the SW stack Gnome Shell/Network Manager...

This is hard to replicate as we don't have your environment and also I run 
different kernel + DE stack (i3). I have machine with (recent) Gnome shell and 
the wifi works there ok - both 2.4GHz and 5GHz. I'll check the commits and 
versions.



Petr





Re: OnlyOffice?

2022-10-07 Thread phodina






Sent with Proton Mail secure email.

--- Original Message ---
On Friday, October 7th, 2022 at 10:07 AM, Ricardo Wurmus  
wrote:


> Yasuaki Kudo y...@yasuaki.com writes:
> 
> > For our IT worker cooperative in preparation, one of my areas of
> > interest is the realistic partial alternative to Google and Microsoft
> > office suite, for a specific market segment. […]
> 
> 
> Is this for an Office suite accessible throught the web browser?
> 
> > Has anyone here tried to build or assess the possibility of Guix
> > package for OnlyOffice?
> 

Why not use Nextcloud office suite? It's designed to be used in cloud 
environment. [1]

[1] https://nextcloud.com/office/


Petr



Update of packages in gnome.scm

2022-09-14 Thread phodina via
Hi,

I've been working on updating and linting packages in the gnome.scm.

The aim was to update the Gnome shell to recent version and fix the issues 
listed in the linter.

I don't want to push the patches yet as they are not finished.

However, I wanted to announce there's git branch with WIP update of Gnome [1].

I just have question how to use the guix graph​ command in order to produce a 
linear list of dependencies.

The issue is following. I've modified the packages in let's say linear order 
top to bottom of the file.

This results in multiple rebuilds. How can I minimize the number of rebuilds? 
I'll then rebase the git commits based on the order of dependencies.

Also based on the updated review process I should add the persons from 
/etc/teams.scm, right?

Who should be the best candidates? There's no label such as gui, desktop, gnome 
...

[1] https://github.com/phodina/guix/tree/patch/gnome


Petr

Sent with [Proton Mail](https://proton.me/) secure email.

Reuse package output for new package

2022-09-12 Thread phodina via
Hi,

is there a way to create a new package by reusing the output of the original 
derivation and just add files to the new package into the new output?

The usecase is PhotoGimp [1] which is set of files which are added to an 
already built gimp package.

There standard way is to inherit the package and add these files but that will 
result in rebuilt, right?

Alternative idea is to use copy-build-system and copy the already created 
package files into the output. Then just add additional files.

However, there's also a draw back if the original package contains hardcoded 
variable. But this would be only problem if I specify something in the 
#:phases, correct?

The main idea here is to save the computing resources on packages that take 
long time and their behviour can be changed by plugins/config files etc.

Of course the simplest way to use [1] it is to unpack the content of the home 
dir but IMHO that's not the correct way how to package this program.

[1] https://github.com/Diolinux/PhotoGIMP


Petr

NPM importer or how create packages

2022-08-13 Thread phodina via
Hi,

I'd like to package one NPM module [1]. It works with archive format and 
provides enqueue and dequeue operations.

However, I'm not javascript developer and with knowledge of Rust and Go 
dependencies I expect the package will pull lot of them as simple package 
definition yielded missing packages coming from `package.json`.

I read discussion around binary npm imported Merging the “binary” NPM importer. 
[2]

So if there is no guix import npm​ what would be the best approach to create 
package(s) for this NPM module?

Or is it better to create some simple script in Python/Go/Rust to do the job in 
the meantime? I don't need NPM or Javascript for the project otherwise - just 
extract the archive.

Also using Nix version is not a possibility as it pulls to much dependencies.

Btw thanks for the link to John Carmack speech.

[1] https://www.npmjs.com/package/asar[2] 
https://lists.gnu.org/archive/html/guix-devel/2021-10/msg00290.html


Petr

[PATCH 1/3] gnu: openssl-3.0: Update to 3.0.4.

2022-06-22 Thread phodina via
Hi,

these patches fixes issue with failing tests for openssl 1.x.x and 3.x.x due to 
expired certificate.

I opted to go for the newest release which has all the patches instead of 
including the patches and dropping them later.

On the slightly dark side it means rebuilding ~1 packages.

I noticed some issues regarding Python 2 modules that have been recently 
removed. The guix refresh --list dependent command failed so I removed all the 
references in the second patch.


PetrFrom 6e96191998304c8d28c471d5ce60b69601fdbf07 Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Wed, 22 Jun 2022 11:00:10 +0200
Subject: [PATCH 3/3] gnu: openssl/fixed: Update to 1.1.1p.

* gnu/packages/tls.scm (openssl/fixed): Update to 1.1.1p.

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index c7d5b90ae2..206715d937 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -22,6 +22,7 @@
 ;;; Copyright © 2021 Matthew James Kraai 
 ;;; Copyright © 2021 John Kehayias 
 ;;; Copyright © 2022 Greg Hogan 
+;;; Copyright © 2022 Petr Hodina 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -507,7 +508,7 @@ (define openssl/fixed
   (package
 (inherit openssl)
 (name "openssl")
-(version "1.1.1n")
+(version "1.1.1p")
 (source (origin
   (method url-fetch)
   (uri (list (string-append "https://www.openssl.org/source/openssl-";
@@ -520,7 +521,7 @@ (define openssl/fixed
   (patches (search-patches "openssl-1.1-c-rehash-in.patch"))
   (sha256
(base32
-"0ymif8rlc5cf5qp5bh2pxlrgq6xryh7g4sqfvrdjg9gnli8ypp20"))
+"0vyfibydji26wk1fmm0piz0810mfr7j4vaa2k5iwgiv6m8mbcqdz"))
 
 (define-public openssl-3.0
   (package
-- 
2.36.1

From 604215e1120251f543a6bb83a1ae300a08de7d91 Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Wed, 22 Jun 2022 10:31:04 +0200
Subject: [PATCH 1/3] gnu: openssl-3.0: Update to 3.0.4.

* gnu/packages/tls.scm (openssl-3.0): Update to 3.0.4.

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index cf50a88410..c7d5b90ae2 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -525,7 +525,7 @@ (define openssl/fixed
 (define-public openssl-3.0
   (package
 (inherit openssl)
-(version "3.0.3")
+(version "3.0.4")
 (source (origin
   (method url-fetch)
   (uri (list (string-append "https://www.openssl.org/source/openssl-";
@@ -538,7 +538,7 @@ (define-public openssl-3.0
   (patches (search-patches "openssl-3.0-c-rehash-in.patch"))
   (sha256
(base32
-"02wcan5izwsxg6vl5fzkqq4icwi7cp4hrj327h05zppirsnph07f"
+"03y0q2pzpkpgfgf74x4pf8gyar9d7pb0l0p7g2s0m2k6k8z88c98"
 (arguments
  (substitute-keyword-arguments (package-arguments openssl)
((#:phases phases '%standard-phases)
-- 
2.36.1

From 0b4939e46fc556094e483ad6190424acd9d4efdc Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Wed, 22 Jun 2022 10:45:53 +0200
Subject: [PATCH 2/3] gnu: Remove references to already removed Python 2
 modules.

* gnu/packages/python-crypto.scm (python2-cryptography): [native-inputs]: Remove
  python2-hypothesis, python2-pretend, python2-pytz python2-pytest.
  [propageted-inputs]: Remove all.
* gnu/packages/python-xyz.scm (python-idna): [properties]: Remove.
* gnu/packages/time.scm (python-iso8601): [properties]: Remove.

diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 92c1638c6d..479c4a3330 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -654,14 +654,8 @@ (define-public python2-cryptography
;; modules "_openssl" and "_padding".
(delete 'sanity-check
   (native-inputs
-   (list python2-cryptography-vectors python2-hypothesis python2-pretend
- python2-pytz python2-pytest))
-  (inputs (list openssl))
-  (propagated-inputs
-   (modify-inputs (package-propagated-inputs crypto)
- (prepend python2-ipaddress
-  python2-backport-ssl-match-hostname
-  python2-enum34))
+   (list python2-cryptography-vectors))
+  (inputs (list openssl)
 
 (define-public python-pyopenssl
   (package
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7d73c145b7..5746d099db 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11846,7 +11846,6 @@ (define-public python-idna
 suitable drop-in replacement for the “encodings.idna” module that comes with
 the Python standard library but currently only supports the older 2003
 specification.")
-(properties `((python2-variant . ,(delay python2-idna
 (license license:bsd-4)))
 
 (define-public python-libsass
diff --git a/gnu/packages/time.scm b/gnu/packages/time.scm
index 5b0ef6af9e..8a2fb17745 100644
--- a/gnu/packages/time.scm
+++ b/gnu/packages/time.scm
@@ -359,7 +359,6 @@ (define-public python-iso8601
 

[PATCH 1/2] gnu: python-pycodestyle: Update to 2.8.0.

2022-06-06 Thread phodina via
Hi Efraim,

I've also noticed broken python-flake8 and saw your fix 
b995c1bd10e445cfdabadb1a5e30935729ce094c.

Here are the patches to make it redundant :-)

Kind regards
PetrFrom 921a6da57ce688587734af3c51a337cc7c77dddb Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Mon, 6 Jun 2022 22:13:03 +0200
Subject: [PATCH 1/2] gnu: python-pycodestyle: Update to 2.8.0.

* gnu/packages/python-xyz.scm (python-pycodestyle): Update to 2.8.0.
  [arguments]: Respect tests?.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6132019a53..69ddd3608b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6444,21 +6444,22 @@ (define-public python-socksipychain
 (define-public python-pycodestyle
   (package
 (name "python-pycodestyle")
-(version "2.7.0")
+(version "2.8.0")
 (source
  (origin
(method url-fetch)
(uri (pypi-uri "pycodestyle" version))
(sha256
 (base32
- "1vqwmzmjdv331kmfq3q9j3as2x7r2r49lf83r9w4147pdg8c32f3"
+ "0zxyrg8029lzjhima6l5nk6y0z6lm5wfp9qchz3s33j3xx3mipgd"
 (build-system python-build-system)
 (arguments
  `(#:phases
(modify-phases %standard-phases
  (replace 'check
-   (lambda _
- (invoke "pytest" "-vv"))
+   (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+   (invoke "pytest" "-vv")))
 (native-inputs
  (list python-pytest))
 (home-page "https://pycodestyle.readthedocs.io/";)
-- 
2.35.1

From cf237f9d413cb69df5fed12f75cde87555fd5c4b Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Mon, 6 Jun 2022 22:15:10 +0200
Subject: [PATCH 2/2] gnu: python-flake8: Update to 4.0.1.

* gnu/packages/python-xyz.scm (python-flake8): Update to 4.0.1.
  [source]: Remove snippet.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 69ddd3608b..dec7a45961 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -10195,27 +10195,21 @@ (define-public python-mccabe
 (define-public python-flake8
   (package
 (name "python-flake8")
-(version "3.9.2")
+(version "4.0.1")
 (source (origin
   (method url-fetch)
   (uri (pypi-uri "flake8" version))
   (sha256
(base32
-"0sspgh2ph7bb5fmf49mrdhi7n5m421kfkxk1n0vn4akgg20q6lh7"))
-  (snippet
-   #~(begin
-   (use-modules (guix build utils))
-   (substitute* "setup.cfg"
- ;; Remove upper bound on pyflakes version.
- (("(pyflakes >=.*), .*" _ pyflakes)
-  (string-append pyflakes "\n")))
+"03c7mnk34wfz7a0m5zq0273y94awz69fy5iww8alh4a4v96h6vl0"
 (build-system python-build-system)
 (arguments
  `(#:phases (modify-phases %standard-phases
   (replace 'check
-(lambda* (#:key inputs outputs #:allow-other-keys)
-  (add-installed-pythonpath inputs outputs)
-  (invoke "pytest" "-v"))
+(lambda* (#:key tests? inputs outputs #:allow-other-keys)
+  (when tests?
+(add-installed-pythonpath inputs outputs)
+(invoke "pytest" "-v")))
 (propagated-inputs (list python-pycodestyle python-entrypoints
  python-pyflakes python-mccabe))
 (native-inputs (list python-mock python-pytest))
-- 
2.35.1



How to build ramdisk and minimal roots

2022-06-02 Thread phodina via
Hi,

I'm attempting to run Guix on Pinenote - eink tablet running Aarch64 [1].

Here's definition for the kernel based on mainline kernel with patches.

I build the kernel running this command:

guix build -f kernel.scm --target=aarch64-linux-gnu

However, I'm still missing ramdisk and I don't know how to build it. Do I have 
to come up with the whole system definition or is there way to generate it 
without one?

Also what's the best way to generate minimal roots, pack it as tarball?

I've run:

guix system image --list-image-types

but none of them is simple tarball. Should I instead pick some dir and run guix 
init on it and later just put the content into tarball?

(define-module (kernel)
#:use-module (gnu packages)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix gexp)
#:use-module (srfi srfi-1)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (gnu packages linux)
#:use-module ((guix licenses) #:prefix license:))

(define linux-next
(let ((commit "d869c01c005f5ef5e77485409e890d62a4ae353d")
(revision "1"))
(package
(inherit linux-libre-arm64-generic)
(name "linux-next")
(version (git-version "5.17-" revision commit))
(source
(origin
(method url-fetch)
(uri (string-append "https://gitlab.com/pgwipeout/linux-next/-/archive/"; commit 
"/linux-next-" commit ".tar.gz"))
(sha256
(base32
"13mckij4492i0bhgvppxi58wxbgqxai6p08qw269y2k7khvafyqd"
(native-inputs
`(("kconfig" ,(local-file "pinenote_defconfig"))
,@(alist-delete "kconfig" (package-native-inputs linux-libre)))

[1] https://wiki.pine64.org/wiki/PineNote[2] 
https://guix.gnu.org/manual/en/html_node/Initial-RAM-Disk.html


Petr

[HELP] Packaging open source NVIDIA kernel driver

2022-05-12 Thread phodina via
Hi,

NVIDIA has released open source kernel driver though the firmware for the GPU 
is still closed source. [1]

I'm currently trying to package it but there are 2 issues I ran into.

First if I don't override the build phase it fails to find the utils.mk file as 
it does not run the make command from the root of the repo.

That links to second issue where the linux kernel version of the driver fails:

make -C kernel-open modules
make[1]: Entering directory 
'/tmp/guix-build-nvidia-gpu-linux-module-515.43.04.drv-0/source/kernel-open'
make[2]: Entering directory 
'/gnu/store/gcwhb3632xh588ihsddi2ss3y3v45zlz-nvidia-gpu-linux-module-515.43.04/lib/modules/5.17.5/build'make[2]:
 *** No rule to make target 'modules'. Stop.

Any ideas how to fix this?

[1] https://www.phoronix.com/scan.php?page=article&item=nvidia-open-kernel&num=1


PetrFrom d800feb8a3d9ba1663b99ccfb2de1d620ce23f8b Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Thu, 12 May 2022 09:45:35 +0200
Subject: [PATCH] gnu: Add nvidia-gpu-linux-module.

* gnu/packages/linux.scm (nvidia-gpu-linux-module): New variable.

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9bb2314ebd..ebeb59dcea 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1345,6 +1345,56 @@ (define-public librem-ec-acpi-linux-module
 and the notification, WiFi, and Bluetooth LED.")
 (license license:gpl2)))
 
+(define-public nvidia-gpu-linux-module
+  (package
+(name "nvidia-gpu-linux-module")
+(version "515.43.04")
+(home-page "https://github.com/NVIDIA/open-gpu-kernel-modules";)
+(source (origin
+  (method git-fetch)
+  (uri (git-reference
+(url home-page)
+(commit version)))
+  (file-name (git-file-name name version))
+  (sha256
+   (base32
+"1byk8rah79h0diwvdx4nggc71f7y6fhjadjavpc3kqlrspjjpc6m"
+(build-system linux-module-build-system)
+(arguments
+ (list #:tests?
+   #f ;no tests
+   #:make-flags
+   #~(list (string-append "CC="
+  #$(cc-for-target)))
+   #:phases
+   #~(modify-phases %standard-phases
+   (add-after 'unpack 'fix-modules-prefix
+ (lambda* _
+   (substitute* "kernel-open/Makefile"
+ (("\\$\\(shell uname -r\\)") #$(package-version
+ linux-libre))
+ (("/lib/modules/") (string-append #$output
+   "/lib/modules/")
+   (replace 'build
+ (lambda* (#:key (make-flags '())
+   (parallel-build? #t) #:allow-other-keys)
+   (mkdir-p "build")
+   (mkdir-p (string-append #$output "/lib/modules/"
+   #$(package-version linux-libre)
+   "/build"))
+   (apply invoke "make"
+  (string-append "-C"
+ (getenv "PWD") "/source")
+  `(,@(if parallel-build?
+  `("-j" ,(number->string (parallel-job-count)))
+  '()) ,@make-flags)))
+(native-inputs (list inetutils)) ;hostname
+(synopsis "Linux kernel module for NVIDIA GPU")
+(description
+ "This package provides Linux kernel module for NVIDIA GPUs based on Turing
+and newer models.")
+(license (list license:gpl2+ license:expat
+
 (define-public rtl8821ce-linux-module
   (let ((commit "dce62b9bbb7c76339b514153fcebb3a19bafdcc7")
 (revision "5"))
-- 
2.34.0



Re: Screen sharing ungoogled-chromium

2022-04-30 Thread phodina via
Jitsi works in chromium and I'm able to share screen.

But I'm trying to switch to Guix as my work laptop but in order to do that the 
Teams screen share would have to work.

Anyway it's proprietary garbage so if there isn't anybody who got it working 
let's just close the discussion.

Petr

Sent from ProtonMail mobile

 Original Message 
On Apr 28, 2022, 7:41 PM, Giovanni Biscuolo wrote:

> Hi phodina this sounds like an upstream bug, or do you think it depends on 
> Guix packaging? phodina via  writes: > Hi, > > I'm attempting to share my 
> screen in the chromium browser (100.0.4896.127-1). > > I've enabled the 
> #enable-webrtc-pipewire-capturer flag and I also have xdg-desktop-portal 
> install on my Guix System. > > However, when I click in Teams do you mean 
> Microsoft Teams? I never used that service, sorry I cannot help here. [...] > 
> Does somebody use the screen sharing feature? I regurarly use the screen 
> sharing feature in Jitsi and it works out of the box (some previous 
> ungoogled-chromium had issues with video on Jisti, depending on servers) HTH! 
> Gio' -- Giovanni Biscuolo Xelera IT Infrastructures

Screen sharing ungoogled-chromium

2022-04-27 Thread phodina via
Hi,

I'm attempting to share my screen in the chromium browser (100.0.4896.127-1).

I've enabled the #enable-webrtc-pipewire-capturer flag and I also have 
xdg-desktop-portal install on my Guix System.

However, when I click in Teams on share the whole desktop, window or just a 
chromium tab the browser crashes and shows in the window the following error.

Aw Snap, something went wrong!

Error code: 4

In the console I see several of these errors to appear:

[29296:29312:0428/074526.629746:ERROR:bus.cc(397)] Failed to connect to the 
bus: Could not parse server address: Unknown address type (examples of valid 
types are "tcp" and on UNIX "unix")

Does somebody use the screen sharing feature?

I'm currently running on X11 (i3-gaps).


Petr

Re: Help: Packaging Bottles

2022-04-25 Thread phodina
Thanks Luis!

The suggestion worked. However, now I'm fighting with gsettings.

I've added GSETTINGS_SCHEMA_DIR to wrap-program, but that didn't help. Here's 
the error message as well as updated patch:

$ /gnu/store/gdpv6p3flxnmsb1aziwhsci1c37fwj5q-bottles-2022.4.14/bin/bottles
Traceback (most recent call last):
  File 
"/gnu/store/gdpv6p3flxnmsb1aziwhsci1c37fwj5q-bottles-2022.4.14/share/bottles/bottles/main.py",
 line 171, in do_command_line
self.do_activate()
  File 
"/gnu/store/gdpv6p3flxnmsb1aziwhsci1c37fwj5q-bottles-2022.4.14/share/bottles/bottles/main.py",
 line 206, in do_activate
user_theme = subprocess.check_output([
  File 
"/gnu/store/papscspynmdi5ljmngw5x5wbi9ijc1xj-python-3.9.9/lib/python3.9/subprocess.py",
 line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File 
"/gnu/store/papscspynmdi5ljmngw5x5wbi9ijc1xj-python-3.9.9/lib/python3.9/subprocess.py",
 line 505, in run
with Popen(*popenargs, **kwargs) as process:
  File 
"/gnu/store/papscspynmdi5ljmngw5x5wbi9ijc1xj-python-3.9.9/lib/python3.9/subprocess.py",
 line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
  File 
"/gnu/store/papscspynmdi5ljmngw5x5wbi9ijc1xj-python-3.9.9/lib/python3.9/subprocess.py",
 line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'gsettings'

Kind regards,
Petr




Sent with ProtonMail secure email.
--- Original Message ---
On Monday, April 25th, 2022 at 1:33 PM, phodina via  wrote:


> Hi,
>
> could I ask for help packaging Bottles? Patch provided below.
>
> When I attempt to run the binary I get this message:
>
> /gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/bin/bottles
> Traceback (most recent call last):
> File 
> "/gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/bin/.bottles-real",
>  line 42, in 
>
> from bottles import main
> File 
> "/gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/share/bottles/bottles/main.py",
>  line 28, in 
>
> gi.require_version('WebKit2', '4.0')
> File 
> "/gnu/store/li6pai7xjn0xwc99rvdz29mx25ifznac-python-pygobject-3.40.1/lib/python3.9/site-packages/gi/init.py",
>  line 129, in require_version
> raise ValueError('Namespace %s not available for version %s' %ValueError: 
> Namespace WebKit2 not available for version 4.0
>
> How should I wrap the binary to fix this error?
>
> 
> PetrFrom 5ce3a3c4869622cd53e9941d40a57fcbaa0b985b Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Mon, 25 Apr 2022 13:30:01 +0200
Subject: [PATCH v2] gnu: Add bottles.

* /gnu/packages/wine.scm (bottles): New variable.

diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 7ca2b9d0c7..9a758f97cc 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2017, 2020 Nicolas Goaziou 
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice 
 ;;; Copyright © 2019 Pierre Neidhardt 
+;;; Copyright © 2022 Petr Hodina 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,7 @@ (define-module (gnu packages wine)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
@@ -38,15 +40,19 @@ (define-module (gnu packages wine)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages cups)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages image)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages kerberos)
@@ -54,10 +60,13 @@ (define-module (gnu packages wine)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages mingw)
   #:use-module (gnu packages openldap)
+  #:use-module (gnu packages patool)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages photo)
   #:use-module (gnu packages samba)
@@ -66,11 +75,78 @@ (define-module (gn

Help: Packaging Bottles

2022-04-25 Thread phodina via
Hi,

could I ask for help packaging Bottles? Patch provided below.

When I attempt to run the binary I get this message:

/gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/bin/bottles
Traceback (most recent call last):
File 
"/gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/bin/.bottles-real",
 line 42, in 
from bottles import main
File 
"/gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/share/bottles/bottles/main.py",
 line 28, in 
gi.require_version('WebKit2', '4.0')
File 
"/gnu/store/li6pai7xjn0xwc99rvdz29mx25ifznac-python-pygobject-3.40.1/lib/python3.9/site-packages/gi/__init__.py",
 line 129, in require_version
raise ValueError('Namespace %s not available for version %s' %ValueError: 
Namespace WebKit2 not available for version 4.0

How should I wrap the binary to fix this error?


PetrFrom 07286c8d74380a750c7b489f73bb5affbcc3dc7a Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Mon, 25 Apr 2022 13:30:01 +0200
Subject: [PATCH] gnu: Add bottles.

* /gnu/packages/wine.scm (bottles): New variable.

diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 7ca2b9d0c7..40668973a1 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2017, 2020 Nicolas Goaziou 
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice 
 ;;; Copyright © 2019 Pierre Neidhardt 
+;;; Copyright © 2022 Petr Hodina 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,7 @@ (define-module (gnu packages wine)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
@@ -38,15 +40,19 @@ (define-module (gnu packages wine)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages cups)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages image)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages kerberos)
@@ -54,10 +60,13 @@ (define-module (gnu packages wine)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages mingw)
   #:use-module (gnu packages openldap)
+  #:use-module (gnu packages patool)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages photo)
   #:use-module (gnu packages samba)
@@ -66,11 +75,69 @@ (define-module (gnu packages wine)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages vulkan)
+  #:use-module (gnu packages webkit)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
+(define-public bottles
+  (package
+(name "bottles")
+(version "2022.4.14")
+(source (origin
+  (method git-fetch)
+  (uri (git-reference
+(url "https://github.com/bottlesdevs/Bottles";)
+(commit (string-append version "-trento-2"
+  (sha256
+   (base32
+"0w1dc8f7pxvfriy552a1s9hxk32zxgsni6d9zid0zy0f105vyfpb"
+(build-system meson-build-system)
+(arguments
+ (list #:phases
+   #~(modify-phases %standard-phases
+   (add-after 'install 'patch-python-references
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+   (let* ((site (string-append #$output "/lib/python"
+   #$(version-major+minor (package-version
+   python))
+   "/site-packages")) (path (getenv
+ "GUIX_PYTHONPATH")))
+ (wrap-program (string-append #$output "/bin/bottles")
+   `("GUIX_PYTHONPATH" ":" prefix
+ (,site ,path))
+   `("GI_TYPELIB_PATH" ":" prefix
+ (,(getenv "GI_TYPELIB_PATH"))
+(native-inputs (list cmake
+ desktop-file-utils
+ gettext-minimal
+

Tex packages on core-updates failing

2022-04-21 Thread phodina via
Hi,

I'm attempting to build packages on branch core-updates 
(3f2b0e12f1ef0cc9e13d5ae00275fee8a0fa752d) and it seems some tex packages are 
broken.

I've attempted to fix one of them - texlive-amsmath - but there's another 
failing - texlive-psnfss-fixed.

I've found issue and applied patches about texlive-psnfss but now it does not 
build. [1]

Could you please help?

[1] https://issues.guix.gnu.org/53454#6


Petr

d9270jmvap4fjl8dlj0fr2k8vlgs16-texlive-psnfss-fixed-59745.drv.gz
Description: application/gzip
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 7fab21679e..c39a568e2b 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -4168,11 +4168,15 @@ (define-public texlive-amsmath
  (add-before 'copy-files 'unchdir
(lambda _
  (chdir "../../..")))
- (add-after 'copy-files 'delete-extra-files
-   (lambda* (#:key outputs #:allow-other-keys)
- (delete-file-recursively
-  (string-append (assoc-ref outputs "out")
- "/share/texmf-dist/source/latex/amsmath/build"
+ (replace 'copy-files
+   (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((origin (assoc-ref inputs "source"))
+   (source (string-append (assoc-ref outputs "out")
+  "/share/texmf-dist/source"))
+   (doc (string-append (assoc-ref outputs "doc")
+   "/share/texmf-dist/doc")))
+   (copy-recursively (string-append origin "/source") source)
+   (copy-recursively (string-append origin "/doc") doc
   (home-page "https://www.ctan.org/pkg/amsmath";)
   (synopsis "AMS mathematical facilities for LaTeX")
   (description


Re: Nix on Guix?

2022-04-16 Thread phodina via
Hi,

Hello Guix,
I'm trying to get the Nix package manager running on Guix. I followed the 
instructions at: 
 and 
successfully installed it, but trying to install and/or run any Nix 
applications gives me permission errors.
I installed for the 'guix-system'; should I have installed for 'guix-user'? Or 
do I need to add my user to some Nix-related group? Or have I done something 
else wrong?
best,
—Ben

I have nix-service running when I build my guix system and then I just run the 
following:

nix-channel --add https://nixos.org/channels/nixos-unstable
nix-channel --update

Petr

Re: Kernel panic on new machine

2022-04-14 Thread phodina
Hi,

> This is a Guix init issue, not "really" a kernel panic. As you can see,
> there is some kind of error in the Scheme code being run at boot time,
> but instead of being dropped into a debug shell, it exits, which causes
> the kernel to panic.
> This is because Guile is running as PID 1, that is, it is the first
> process the kernel starts. PID 1 is kinda special and AFAIK it is not
> allowed to exit, ever. Otherwise you get that panic.

yes, I know Guix init process exiting and due to being PID 1 kernel panics.

In the meantime I reinstalled Guix again and it booted correctly, no idea what 
caused it.


However, my question was/still is how to fix this? Also is there a way to 
determine what caused this? Is there a way to launch the debug shell instead of 
exiting?

PS: Sorry for the image spam but it appeared that the image was not posted the 
first time so I tried also sending a smaller image

Petr




Re: Kernel panic on new machine

2022-04-11 Thread phodina via
Hi,

I've installed Guix to a new machine and after rebooting the live install I get 
kernel panic.

The machine is Dell x86_64 uefi machine with FAT32 boot partition and Luks 
partition with Btrfs filesystem with rootfs.

Could you please help me?

Petr

Herd commands not responding

2022-03-18 Thread phodina via
Hi,

lately I've run into issue with commands concerning herd. As I execute the 
command it never responds with any output.

Is there a reason why this would happen?

The current fix for me is to go and reboot the laptop.
$ guix describe
guix f8aa76a
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master commit: f8aa76ab1fd3b4c9c87d2e68a811477adc844217
$ uptime
07:58:07 up 6 days 18:41, 1 user, load average: 0.25, 1.03, 2.37
$ sudo herd status
^C


Petr

Changed tty setting upon exiting docker run

2022-02-10 Thread phodina via
Hi,

I've recently discovered an issue with running docker images. Upon exit I can't 
see any characters I type. The settings of my tty are changed for some reason.

They can be fixed by running stty sane but I'd like to ask if somebody also has 
this issue?

Here's what happens:

$ stty
speed 38400 baud; line = 0;
-brkint -imaxbel
$ docker run --rm -it ubuntu
root@a0a76c5fdd94:/# stty
speed 38400 baud; line = 0;
-brkint -imaxbel
root@a0a76c5fdd94:/# exit
$stty
speed 0 baud; line = 0;uix$
intr = ; quit = ; erase = ; kill = ; eof = ; 
start = ; stop = ; susp = ;
rprnt = ; werase = ; lnext = ; discard = ; min = 0; 
time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
$ stty sane
$ stty
speed 0 baud; line = 0;

If I run the command without the '-t' argument it does not augment the tty but 
also the tty in docker is not usable.

$ stty
speed 38400 baud; line = 0;
-brkint -imaxbel iutf8
$ docker run -i ubuntu
stty
stty: 'standard input': Inappropriate ioctl for device
$ stty
speed 38400 baud; line = 0;
-brkint -imaxbel iutf8


Petr

Re: Guix system build fails on Aarch64

2022-01-13 Thread phodina
Thanks Chris for the detailed response.

I'll check the threads and investigate the points you suggested.



Petr



Re: Packaging a python package that is using setuptools_rust

2022-01-12 Thread phodina
Hi Hamzeh and Lars,

> Hi Hamzeh,
>
> > I want to package the `etebase-py` library: 
> > https://github.com/etesync/etebase-py/
>
> did you manage to package this library? I’m also interested in it,
>
> because I want to try etesync-dav.
>
> Thanks,
>
> Lars

I'm also interested in packaging this Python module as Rust makes it's way into 
Python universe.

Also since it's setuptools should we also modify the Python build system?


Petr



Re: Guix Home Entertainment SoC Media Server?

2022-01-12 Thread phodina
Hi Blake,

> Hiya Guix!
>
> I just got a TV and want to put together a little SoC home media server for
>
> it (perhaps with beaglebone black, as that appears to be the recommended
>
> SoC for Guix). Has anyone had any experience with this? Thoughts?
>
> I figure it could be a fun use of `Guix Deploy`, but I've never put
>
> together a SoC media server before, so I'm not sure what packages to
>
> peek at, or what "out of the box" (re: raspbian etc) options are
>
> available.
>
> Seems like this could be some cool shoes for Guix to fill!
>
> ez,
>
> blake

I'd probably recommend something like Raspberry Pi. The latest iteration is 
quite powerful and you can run Kodi there.

There's a patch pending to support this fruit board in Guix :-)

Patches to install guix system on Raspberry Pi [1]

[1] https://lists.gnu.org/archive/html/guix-patches/2021-06/msg01228.html


Petr



Re: Guix System on Pine64's Quartz64?

2021-12-23 Thread phodina
Hi Mekeor,

On Wednesday, December 22nd, 2021 at 9:00 PM, Mekeor Melire  
wrote:

> Hello Guix,
>
> the manufacturer Pine64 offers a single-board computer called Quartz64
>
> (AARCH64 architecture and up to 8GB memory). Is it possible to run Guix
>
> System on it? Does anybody have experience with this?
>
> Goodbye
>
> Mekeor

Yes, it's possible. I'm running Guix on foreign distro (Manjaro ARM). See the 
console output.

You can get the image for the board here [1].
Also in the latest blog post [2] the dedicate section to Quartz64:

Linux 5.15 brings Quartz64 device tree
Quartz64 now outputs video via HDMI at 1080p 60hz for now; audio out via 
SPDIF also works out of the box
GPU works using the Panforst open driver
Tianocore EDK II implemented and allows for full UEFI

I can tell the board now boots and the Sway session over HDMI works. Before a 
month ago I was only able to get SSH connection.

Please follow the instructions in section on installing Guix [3].

Not sure how difficult it would be to run full Guix System there atm. Currently 
I focus more on the PinePhone and Pinebook Pro.

$ uname -a
Linux quartz64-b 5.16.0-rc6-1-MANJARO-ARM #1 SMP PREEMPT Sun Dec 19 22:31:26 
UTC 2021 aarch64 GNU/Linux
$ guix describe
  guix a0178d3
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: a0178d34f582b50e9bdbb0403943129ae5b560ff


Petr

[1] https://github.com/manjaro-arm/quartz64-bsp-images/releases/tag/20211220
[2] https://www.pine64.org/2021/12/15/december-update-a-year-in-review/
[3] https://guix.gnu.org/manual/en/html_node/Binary-Installation.html




Re: Providing/Submitting substitutes

2021-12-22 Thread phodina
Hi Tobias,

> Petr,
>
> phodina via 写道:
>
> > However, since I already built the browser and it took several > hours
> >
> > I'd like to provide it also to other people.
>
> That's very considerate of you. Thank you!

My thanks go to all contributors of Guix for creating such amazing project!

>
> > Is there a way to submit the outputs of derivation to the > official
> >
> > substitution server or the only way would be to make public my
> >
> > substitution server?
>
> I'm afraid so (the latter). As you mention, this would require trusting the 
> other party but to an unreasonably degree: the ability to redistribute 
> arbitrary binaries, signed by the project, to all Guix users.

I was afraid so. However, that is understandable as security and trust would 
have to be sacrificed and it would open a large vector of attack against Guix 
users.
>
> That said, if your substitution server has decent uptime, traffic, and a 
> public IP, nothing's stopping you from putting up a disclaimer page (like 
> guix.tobias.gr… or better) and serving your substitutes to others.

I do have a VPS server currently running NixOS as this was the first system 
with the different concepts. Though, I'm now creating a patch for the provider 
[1] in order to run Guix System there. It has decent storage, performance and 
network connectivity.

>
> Adding the guix publish service is trivial, about as much work as typing 
> ‘guix archive --export’ once, and is a one-time effort!
>
> 

No need for the promo, I want to run a substitution server (figure out how to 
do it correctly and securely) as otherwise this machine is sitting there mostly 
idle.

>
> > Correct me if I'm wrong but can't this be solved be verified by
> >
> > using guix challenge?
>
> In this case, I don't see how. Guix challenge is a valuable tool but to use 
> it in this way requires a fundamentally trusted party (e.g., you, or say, 
> bordeaux.guix.gnu.org) to be distributing their own independently-built copy.

>
> If that were the case you wouldn't have had to build it yourself. So it could 
> be used after the fact, or for general ‘hm, this is interesting’ flagging for 
> further research, and that's not good enough here. Copies would have been 
> distributed by then.
>
> Challenges between 2 supposedly independent unofficial substitute providers 
> would be quite vulnerable to various kinds of subversion.
>
> Kind regards,
>
> T G-R

Thanks for the explanation. If I understand this correctly than it basically
boils down to trusting the parties themselves.


Petr

[1] https://vpsfree.cz



Re: Aarch64 build of rust-1.39.0 fails

2021-12-22 Thread phodina
Hi Vagrant and Maxim,

thanks for the clarification.

I do now see that the latest supported version is rust@1.39.0 om Aarch64 [1].

Thanks also Danny Milosavljevic for blog post on bootstrapping rust [2].

Yes, it's great that Rust is used more, however, at the same time it causes 
problems integrating it into the Guix system properly.


Petr

[1] https://github.com/thepowersgang/mrustc
[2] https://guix.gnu.org/en/blog/2018/bootstrapping-rust/





Providing/Submitting substitutes

2021-12-16 Thread phodina via
Hi,

is there a way how to submit built packages to the official substitution server?

My point here is I wanted to install ungoogled-chromium-
96.0.4664.93-1 on my x86_64 machine and unfortunately it was not available [1]. 
Therefore I built it on more powerful machine and shared the outputs of the 
derivation.

However, since I already built the browser and it took several hours I'd like 
to provide it also to other people.

Is there a way to submit the outputs of derivation to the official substitution 
server or the only way would be to make public my substitution server?

I do understand that accepting the derivation outputs also involves trusting 
the other party. Correct me if I'm wrong but can't this be solved be verified 
by using guix challenge?
[1] http://ci.guix.gnu.org/search?query=ungoogled-chromium


Petr

Aarch64 build of rust-1.39.0 fails

2021-12-16 Thread phodina via
Hi,

I checked the build server and there were no substitutes [1] for rust-1.39.0 
for the Aarch64 system.

When building natively (Pinebook Pro) there is this problem:

$ uname -a
Linux valhalla 5.14.9-gnu #1 SMP PREEMPT 1 aarch64 GNU/Linux
~/guix$ guix build rust -K
...
> /tmp/guix-build-rust-1.39.0.drv-0/mrustc/bin/mrustc 
> rustc-1.39.0-src/src/libcore/lib.rs -o output/libcore.rlib --crate-name core 
> --crate-type rlib -C emit-depfile=output/libcore.rlib.d --crate-tag 0_0_0 -g 
> --cfg debug_assertions -O -L output --edition 2018
rustc-1.39.0-src/src/libcore/slice/mod.rs:67: warn:0:Unexpected attribute 
allow_internal_unstable on associated item
rustc-1.39.0-src/src/libcore/str/mod.rs:2173: warn:0:Unexpected attribute 
allow_internal_unstable on associated item
In file included from output/libcore.rlib.c:7:
output/libcore.rlib.c: In function 
‘ZRQG2ch4core50_0_03ffi10VaListImpl0g2cb05clone5Clone0gb30g’:
output/libcore.rlib.c:219717:10: warning: passing argument 1 of 
‘__builtin_va_copy’ from incompatible pointer type 
[-Wincompatible-pointer-types]
219717 | va_copy(var3, arg0);
| ^~~~
| |
| struct s_ZRG2ch4core50_0_03ffi10VaListImpl0g **
output/libcore.rlib.c:219717:10: note: expected ‘__va_list *’ but argument is 
of type ‘struct s_ZRG2ch4core50_0_03ffi10VaListImpl0g **’
output/libcore.rlib.c:219717:16: error: incompatible type for argument 2 of 
‘__builtin_va_copy’
219717 | va_copy(var3, arg0);
| ^~~~
| |
| struct s_ZRG2ch4core50_0_03ffi10VaListImpl0g *
output/libcore.rlib.c:219717:16: note: expected ‘__va_list’ but argument is of 
type ‘struct s_ZRG2ch4core50_0_03ffi10VaListImpl0g *’
C Compiler failed to execute - error code 256
Process exited with non-zero exit status 1
BUILD FAILED
make: *** [minicargo.mk:82: output/libstd.rlib] Error 1
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-f" "minicargo.mk" 
"output/rustc" "-j6" "RUSTC_TARGET=aarch64-unknown-linux-gnu" 
"RUSTC_VERSION=1.39.0" "MRUSTC_TARGET_VER=1.39" "OUTDIR_SUF=") exit-status: 2 
term-signal: #f stop-signal: #f>
phase `build' failed after 1006.4 seconds
command "make" "-f" "minicargo.mk" "output/rustc" "-j6" 
"RUSTC_TARGET=aarch64-unknown-linux-gnu" "RUSTC_VERSION=1.39.0" 
"MRUSTC_TARGET_VER=1.39" "OUTDIR_SUF=" failed with status 2

Not sure if this PR [2] would help as I don't know how to apply the patch to 
the package definition for rust-1.39.

[1] http://ci.guix.gnu.org/search?query=rust-1.39
[2] https://github.com/rust-lang/rust/pull/49878


Petr

Re: Guix system with home-environment

2021-12-13 Thread phodina
Hi Andrew,

sorry for the late response. I've looked into the user-account record in 
gnu/system/accounts.scm to add home-environment field and how the 
home-environment is instantiated in gnu/home/services.scm.

However, I haven't implemented the functionality as of now.


Petr

‐‐‐ Original Message ‐‐‐

On Friday, December 10th, 2021 at 8:48 AM, Andrew Tropin  wrote:

> On 2021-11-08 06:52, phodina wrote:
>
> > Hi Andrew,
> >
> > On Wednesday, November 3rd, 2021 at 8:35 AM, Andrew Tropin and...@trop.in 
> > wrote:
> >
> > > On 2021-11-02 11:38, phodina wrote:
> > >
> > > > Hi,
> > > >
> > > > I just want to ask if it's possible to create an image which has both 
> > > > the operating-system and home-environment configuration together.
> > > >
> > > > Currently the way to build them is to do:
> > > >
> > > > ;; Guix System
> > > >
> > > > guix system build os.scm
> > > >
> > > > ;; Guix Home
> > > >
> > > > guix home build home.scm
> > > >
> > > > However, if I want to build and test a VM, I'm missing the home 
> > > > environment.
> > > >
> > > > Would it be the correct way to add additional record to user-account 
> > > > definition, which would instantiate the home-environment for the 
> > > > particular user?
> > > >
> > > > Or is there another way how to do that?
> > > >
> > > > Petr
> > >
> > > Hi again!)
> > >
> > > I have a plan to have a system service, which accepts list of pairs of
> > >
> > > user name and home-environment and instantiates home environments for
> > >
> > > these users during `guix system reconfigure`, but the task has a low
> > >
> > > priority right now. You can try to implement it yourself and send a
> > >
> > > patch for review or can wait until someone will do it.
> > >
> > > P.S. It doesn't have to be a separate service, maybe extending some
> > >
> > > existing record with additional field will also work.
> > >
> > > Best regards,
> > >
> > > Andrew Tropin
> >
> > I was exactly thinking of a record in the operating system for list of 
> > pairs (user and home-environment) as you suggest.
> >
> > Though then it hit me - it's already there in user accounts.
> >
> > Therefore why introduce complexity and not just modify them by one record 
> > for each user set by default to false.
> >
> > Sure it's major modification but in order to get the functionality it will 
> > have to modify either users or operating-system (or another field within).
> >
> > I understand it's low priority, I just wanted your opinion on this matter.
> >
> > I'll look into that and try to come up with some implementation.
> >
> > Petr
>
> Hi,
>
> Do you have any developments or additional thoughts on this matter?
>
> I have plans to implement it, so we can generate iso or VM image with
>
> home-environment inside.
>
> 
>
> Best regards,
>
> Andrew Tropin



Re: xounalpp package issues

2021-11-18 Thread phodina
Hi,
‐‐‐ Original Message ‐‐‐

On Thursday, November 18th, 2021 at 5:10 PM, Alexander Asteroth 
 wrote:

> Dear all,
>
> I tried to install xournalpp on guix-system (after guix update && guix
>
> package -u). The installation worked fine (and probably the build does as
>
> well) but the programm fails to run with the following error messages
>
> (see below).
>
> I already tried to manually also install all dependencies mentioned in
>
> the package file (no changes), but don't find what's missing (seems to
>
> be something with missing icons but I have no clue what guix package
>
> might contain what's missing (if that's the cause anyway).
>
> Cheers,
>
> Alex
>



I've checked stackoverflow and seems there are several lines in the config that 
cause this issue. So you might try removing them as suggested here [1].

The problematic package is not xournalpp itself but alsa-lib.

grep pcm.rear $(guix build alsa-lib)/share/alsa/alsa.conf

Hope it helps!

Petr

[1]: 
https://stackoverflow.com/questions/7088672/pyaudio-working-but-spits-out-error-messages-each-time



Re: Running Out of Inodes

2021-11-14 Thread phodina via
Hi Jonathan,

On Nov 14, 2021, 12:14 PM, Jaft via < help-guix@gnu.org> wrote:
Hey, hey.
It could very well be my own ignorance about things but I'm running into an 
issue that I wouldn't think I'd run into so naïvely; if there's any further 
light to be shed, I very much appreciate it.
I wanted to try out Guix so I installed it to a laptop I have; the previous 
distro I had on there had been using a root partition of about 46G so I just 
decided to keep the same partition setup (though reformatting each one).
About 17 packages in, I started getting a "No space left on device" error; 
looking closer at it, – while I still had ~20% of free disk space available – I 
was fresh out of free inodes. I remembered that someone I'd read, somewhere, 
had said you'd probably want, at least, 50G for Guix so I figured I probably 
shot myself in the foot with so small a root and just opted to reinstall.
This time, I deleted the home partition and the root one to create one 156G 
partition for the entire install and figured that'd be sufficient (I've been 
using ext4 for these, in case that information is relevant, any).
This time, though, I managed 21 packages before running into the same issue.
There's still 70% of the disk space free but I'm entirely out of free inodes; 
leastwise, I was but I tried a guix gc, just to see what all got freed up, and, 
now, I have 5% of all inodes free.
Is this relatively typical? I figured I hadn't done anything particularly out 
of ordinary usage (Guix's new to me so I literally just did an install and then 
started installing packages from the gnu channel).
Let me know if there's any further or more particular info. to include, if 
that'd help; I just wouldn't know what to provide.
Thanks!
Jonathan

You might check this thread [1] as it's similar question. Unfortunately I'm 
running on btrfs.

Hope it helps!


Kind regards
Petr

[1]: https://lists.gnu.org/archive/html/help-guix/2020-06/msg00015.html

Re: Custom libre kernel configuration devolving into Anbox review I guess

2021-11-13 Thread phodina
Tobias,

On Saturday, November 13th, 2021 at 1:23 PM, Tobias Geerinckx-Rice 
 wrote:

> Petr,
>
> phodina 写道:
>
> > Though the issue seems to come from the Archlinux Wiki[1] where > they 
> > supply wrong CONFIG options.
>
> Well… yes, it's a wiki. The Arch one in particular has a reputation to uphold.
>
> Still, it[1] doesn't suggest either of the problematic
>
> -   ("CONFIG_ASHMEM" . m)
> -   ("CONFIG_ANDROID_BINDER_IPC" . m)
>
> values. These can't work:
>
> config ASHMEM
>
> bool "Enable the Anonymous Shared Memory Subsystem"
>
> config ANDROID_BINDER_IPC
>
> bool "Android Binder IPC Driver"
>
> So don't waste time hunting down dependencies which don't exist. The 
> third-party modules[2] were never part of Linux and are by now well obsolete.

I checked the kernel KConfig help on that one and compared the options with 
Fedora 35, where I have a running Waydroid instance.

>
> From the same wiki:
>
> > CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
> >
> > [lalala lala]
> >
> > With your new kernel, you will need to append the following to > your
> >
> > boot arguments:
> >
> > binder.devices=binder,hwbinder,vndbinder,anbox-binder,\
> >
> > anbox-hwbinder,anbox-vndbinder
>
> Why does it first recommend a different value from what ‘you will need’ to 
> boot with later? Merely because it's the Kconfig default? This does not fill 
> me with confidence.

As you already mentioned this sounds fishy. I'm also noticing the 
inconsistencies and would like to get it right here in Guix.

>
> Later(!) on, it suggests yet a third, seemingly preferred, option:
>
> > scripts/config --set-str CONFIG_ANDROID_BINDER_DEVICES ""
> >
> > [because]
> >
> > Not everybody was happy with the binder module in Linux. To > address
> >
> > the issues, binderfs was created. One has to choose between the > old
> >
> > and the new way when compiling the kernel. With the options > [above],
> >
> > one will use binderfs instead.
>
> So… maybe that's the cool (and more secure) new thing and we should be using 
> binderfs without any DEVICES instead? Is binderfs some kind of /dev/pts for 
> them? Have you tested Waydroid without any?

I'm trying to test/port Waydroid now on Guix. However, firstly it requires the 
modification of the kernel as already discussed (though not resolved on what 
exact configuration is needed).

Secondly there needs to be the Waydroid Python userspace app. I've created a 
patch for that here [1]. Still awaits review.

In order to run Waydroid you need Wayland compositor and LXD service. The 
latter is not yet implemented. I've found a patch implementing the support, but 
it need some polishing [2]. Though at the current state the LXD runs.

After adding the LXD service to the system I managed to initiate the Waydroid.

But as I attempt to open a session I get error regarding not running wayland 
session which is strange.

# waydroid.py session start
Password:
[07:40:41] XDG Session is not "wayland"

The official setup is Debian with systemd, so I'll investigate this issue 
further on the repo's github issues.

On Fedora and Archlinux I don't have this issue.

>
> I'm picky because I want to suggest the following, which makes it important 
> that at least one person understands these changes and that we get them right:
>
> Do we really need yet another kernel variant? Building nearly-identical 
> kernels on CI is quite expensive, especially on ARM. Let's not add them 
> lightly.
>

I totally agree with you as another kernel variant is huge demand on the CI 
resources. On the other hand people not wanting running the Android apps on 
their machine would probably prefer to have this disabled, right?

Also is it possible to add the kernel variant but mark it not to build on the 
CI?

> Is this code so dubious — compared to the rest of CONFIG_STAGING, which we 
> already enable — that it must be quarantined in a separate kernel? If so, why?
>

Well you add additional code complexity, creating kernel which needs more 
resources and creating a potential security issue with new syscall. Though I'm 
not expert in this area and it definitely need deeper discussion.

I also used/I'm using Fedora/Archlinux and the current status there is that 
they these setting are not enabled by default in the "main" kernel, but they 
build one - Zen (Arch) and XanMod (Fedora) - where these options are enabled.

Don't know the reason why they separate it, IMHO it might be due to the reasons 
mentioned above.

> Do these o

Re: Custom libre kernel configuration

2021-11-13 Thread phodina
Thanks Tobia,

> You're not matching numbers here: ‘number’ is your chosen variable name, not 
> magic. It could be ‘foo’. It could be anything, without changing the effect 
> of this code.
>
> >   ((option . string)
> >(string-append option "=\\"" string >
> > "\\"")))
> >
>
> This will never be reached.
>
> I'm almost certain that this is, at least in part, why your BINDER 
> configuration isn't taking effect.
>
> Here's mine:
>
> (define option->string
>
> (match-lambda ((option . #f)
>
> (format #f "# ~a is not set" option))
>
> ((option . #t)
>
> (format #f "~a=y" option))
>
> ((option . 'm)
>
> (format #f "~a=m" option))
>
> ((option . (? number? value))
>
> (format #f "~a=~a" option value))
>
> ((option . (? string? value))
>
> (format #f "~a=\"~a\"" option value
>
> Kind regards,
>
> T G-R

I took your changes and applied them to the code:

(define (config->string options)
  (string-join (map (match-lambda
  ((option . #f)
   (format #f "# ~a is not set" option))
  ((option . #t)
   (format #f "~a=y" option))
  ((option . 'm)
   (format #f "~a=m" option))
  ((option . (? number? value))
   (format #f "~a=~a" option value))
  ((option . (? string? value))
   (format #f "~a=\"~a\"" option value)))
options)
   "\n"))

However, the CONFIG_ANDROID_BINDER_IPC is still not part of the config :-/

$ grep BINDER .config
# CONFIG_ANDROID_BINDER_IPC is not set

The Guix part of generating the code is fine though. Thanks.

So I digged little deeper and it seems that they have to be compiled into the 
kernel.

$ tar xf $(guix build linux-libre --source)
$ cd linux-5.14.17
$ guix environment linux --ad-hoc ncurses pkg-config -- make 
MENUCONFIG_COLOR=mono menuconfig
$ grep ANDROID .config
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set

Though the issue seems to come from the Archlinux Wiki[1] where they supply 
wrong CONFIG options.

Kind regards
Petr

[1] https://wiki.archlinux.org/title/Waydroid



Re: Custom libre kernel configuration

2021-11-11 Thread phodina


> I'm not on a GNU system right now but from memory, Kconfig places double
>
> quotation marks around "string values", doesn't add any around numbers.
>
> Don't know how liberal it is in accepting foo="42" and bar=string.
>
> Add "s to you current string fallbakc and add a 'number' quasipattern
>
> above that without "s to play it safe.
>

I've modified it already. Seems to build, but I want to wait (well have to on 
my x230 :-D) till I can give a spin.

Here's the modification:

(define (config->string options)
  (string-join (map (match-lambda
  ((option . 'm)
   (string-append option "=m"))
  ((option . #t)
   (string-append option "=y"))
  ((option . #f)
   (string-append option "=n"))
  ((option . number)
   (string-append option "=" number))
  ((option . string)
   (string-append option "=\"" string "\"")))
options)
   "\n"))




Re: Custom libre kernel configuration

2021-11-11 Thread phodina
Hi Tobias,

On Thursday, November 11th, 2021 at 2:23 PM, Tobias Geerinckx-Rice 
 wrote:

> On 2021-11-11 13:31, phodina wrote:
>
> > Throw to key `match-error' with args` ("match" "no matching pattern"
> >
> > ("CONFIG_ANDROID" . y))'.
>
> I guess you meant to write #t here. With that change the rest looks
>
> correct, goodl uck!
>
> Kind regards,
>
> T G-R
>

Thanks! Somehow it was staring at my face :-D

Though there is also one more issue. The match lambda does not accept strings. 
I'm added one more "case", though I'm not sure if it won't have any 
consequences.

(define (config->string options)
  (string-join (map (match-lambda
  ((option . 'm)
   (string-append option "=m"))
  ((option . #t)
   (string-append option "=y"))
  ((option . #f)
   (string-append option "=n"))
  ((option . value)
   (string-append option "=" value)))
options)
   "\n"))



Re: Custom libre kernel configuration

2021-11-11 Thread phodina
Hi Andre,

On Thursday, November 11th, 2021 at 1:49 PM, André A. Gomes 
 wrote:

> phodina phod...@protonmail.com writes:
>
> > --- a/gnu/packages/linux.scm
> >
> > +++ b/gnu/packages/linux.scm
> >
> > @@ -722,6 +722,14 @@ (define %bpf-extra-linux-options
> >
> > ;; kheaders module
> >
> > ("CONFIG_IKHEADERS" . #t)))
>
> Isn't there an extra closing parenthesis on this s-exp?
>

Unfortunately no. If I leave only CONFIG_ASHMEM and CONFIG_ANDROID_BINDER_IPC 
the kernel builds.

Then again when I check the kernel menuconfig the other options are present, 
but for some reason Guix fails.

Petr





Custom libre kernel configuration

2021-11-11 Thread phodina
Hi!

I'm attempting to compile a custom linux libre kernel with several additional 
config options enabled (listed below).

Unfortunately I get the following error messages:

Throw to key `match-error' with args `("match" "no matching pattern" 
("CONFIG_ANDROID" . y))'.

I followed the blog post[1] on customizing kernel.

Downloaded the sources and checked for the options in menuconfig:

tar xf $(guix build linux-libre --source)
guix environment linux-libre --ad-hoc ncurses -- make menuconfig

Could you please give me hint on what I'm doing wrong?

Petr

--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -722,6 +722,14 @@ (define %bpf-extra-linux-options
 ;; kheaders module
 ("CONFIG_IKHEADERS" . #t)))

+(define %waydroid-extra-linux-options
+  `(;; Modules required for waydroid:
+   ("CONFIG_ASHMEM" . m)
+   ("CONFIG_ANDROID" . y)
+   ("CONFIG_ANDROID_BINDER_IPC" . m)
+   ("CONFIG_ANDROID_BINDERFS" . n)
+   ("CONFIG_ANDROID_BINDER_DEVICES" . "binder,hwbinder,vndbinder")))
+
 (define (config->string options)
   (string-join (map (match-lambda
   ((option . 'm)
@@ -1143,6 +1151,25 @@ (define-public linux-libre-mips64el-fuloong2e
   `(("CONFIG_OVERLAY_FS" . m))
   %default-extra-linux-options)))

+(define-public linux-libre-with-waydroid
+  (let ((base-linux-libre
+ (make-linux-libre*
+  linux-libre-5.14-version
+  linux-libre-5.14-gnu-revision
+  linux-libre-5.14-source
+  '("x86_64-linux" "i686-linux" "armhf-linux"
+"aarch64-linux" "riscv64-linux")
+  #:extra-version "bpf"
+  #:configuration-file kernel-config
+  #:extra-options
+  (append %bpf-extra-linux-options
+  %waydroid-extra-linux-options
+  %default-extra-linux-options
+(package
+  (inherit base-linux-libre)
+ (name "linux-libre-waydroid")
+  (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))
+
 (define-public linux-libre-with-bpf
   (let ((base-linux-libre
  (make-linux-libre*

---

[1] 
https://guix.gnu.org/en/blog/2019/creating-and-using-a-custom-linux-kernel-on-guix-system



[PATCH] gnu: Update sdlpop.

2021-11-08 Thread phodina
Hi,

Unfotunately the price executable looks for a diractory DATA in the directory 
of argv[0], therefore the prince executable runs only from the 
/guix/store/xxx-sdlpop/bin directory.

The following patch replaces the former location with the latter.

* gnu/packages/games.scm (sdlpop)[arguments]: Substitute location of executable.

---8<---cut here--->8---

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index a474933c93..62e753316e 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -12642,7 +12642,7 @@ (define-public sdlpop
 "1yy5r1r0hv0xggk8qd8bwk2zy7abpv89nikq4flqgi53fc5q9xl7"
 (build-system gnu-build-system)
 (arguments
- `(#:tests? #f ; no tests provided
+ `(#:tests? #f  ; no tests provided
#:phases
(modify-phases %standard-phases
  (delete 'configure)
@@ -12666,6 +12666,8 @@ (define-public sdlpop
(chdir "..")
(install-file "prince" bin)
(substitute* template (("\\$ROOT") out))
+   (substitute* "src/seg009.c" (("g_argv[0]") (string-append "\""
+ out 
"\"")))
(install-file template app)
(rename-file (string-append app "/SDLPoP.desktop.template")
 (string-append app "/SDLPoP.desktop"))
--
2.33.1




Re: Guix system with home-environment

2021-11-07 Thread phodina
Hi Andrew,

On Wednesday, November 3rd, 2021 at 8:35 AM, Andrew Tropin  
wrote:

> On 2021-11-02 11:38, phodina wrote:
>
> > Hi,
> >
> > I just want to ask if it's possible to create an image which has both the 
> > operating-system and home-environment configuration together.
> >
> > Currently the way to build them is to do:
> >
> > ;; Guix System
> >
> > guix system build os.scm
> >
> > ;; Guix Home
> >
> > guix home build home.scm
> >
> > However, if I want to build and test a VM, I'm missing the home environment.
> >
> > Would it be the correct way to add additional record to user-account 
> > definition, which would instantiate the home-environment for the particular 
> > user?
> >
> > Or is there another way how to do that?
> >
> > Petr
>
> Hi again!)
>
> I have a plan to have a system service, which accepts list of pairs of
>
> user name and home-environment and instantiates home environments for
>
> these users during `guix system reconfigure`, but the task has a low
>
> priority right now. You can try to implement it yourself and send a
>
> patch for review or can wait until someone will do it.
>
> P.S. It doesn't have to be a separate service, maybe extending some
>
> existing record with additional field will also work.
>
> ---
>
> Best regards,
>
> Andrew Tropin

I was exactly thinking of a record in the operating system for list of pairs 
(user and home-environment) as you suggest.

Though then it hit me - it's already there in user accounts.

Therefore why introduce complexity and not just modify them by one record for 
each user set by default to false.

Sure it's major modification but in order to get the functionality it will have 
to modify either users or operating-system (or another field within).

I understand it's low priority, I just wanted your opinion on this matter.

I'll look into that and try to come up with some implementation.

Petr



Re: home-files-service-type file permissions

2021-11-07 Thread phodina
Hi Andrew,

On Wednesday, November 3rd, 2021 at 8:24 AM, Andrew Tropin  
wrote:

> On 2021-11-02 11:31, phod...@protonmail.com wrote:
>
> > Hi Andrew,
> >
> > Thanks for the development of Guix home. I've recently switch to it from my 
> > dotfiles.
> >
> > However, there is one thing that I do not know how to set.
> >
> > When using the service home-files-service-type I encountered a situation 
> > where I'm copying a script:
> >
> > (simple-service 'dotfiles
> >
> > home-files-service-type
> >
> > (list
> >
> > ...
> >
> > `("config/sway/wallpaper-change.sh" ,(local-file 
> > "config/sway/wallpaper-change.sh"
> >
> > However, after guix home reconfigure the file has only read flags set not 
> > execute. Even though the original file has execute flags.
> >
> > Is the home-files-service-type the correct service to use?
> >
> > Petr
>
> If there is no specific home service for your use case, which generates
>
> all necessary configs and executables for you the answer is probably
>
> yes, using home-files-service-type directly is a way to go.
>
> > Or do I have to patch it in order to keep the permissions?
>
> AFAIK, local-file, mixed-text-file create non-executable files in the
>
> store by design.

Thanks, I've now looked more at the implementation and spend time understanding 
the differences between local-file, plain-file, computed-file, program-file.
>
> If you want to make an executable file you have at least a few options:
>
> 0. You can use recursive? flag to keep permissions.
>
> (local-file "blabla" #:recursive? #t)
>

Nice and simple solution.

> The quote from documentation:
>
> > if file designates a flat file and recursive? is true, its contents
> >
> > are added, and its permission bits are kept.
>
> http://guix.gnu.org/en/manual/devel/en/guix.html#index-local_002dfile
>
> 1.  Use program-file
>
> http://guix.gnu.org/en/manual/devel/en/guix.html#index-program_002dfile
>
> For example I do it for generating screenshot scripts:
>
> https://git.sr.ht/~abcdw/rde/tree/master/item/rde/features/wm.scm#L188

Thanks for this example! This is what I've been looking for.

> 2.  Use computed-file, which will call chmod with apropriate arguments
>
> inside gexp. Take a look at "empty-tree" example in the manual, you can
>
> create a file and set apropriate permissions in the same way.
>
> --

This is also super useful as it allows to do what's needed to the file.

>
> Best regards,
>
> Andrew Tropin



Re: Incorrect display of system fonts after guix system reconfigure (2021_10_29)

2021-11-02 Thread phodina
Hi,

On Sunday, October 31st, 2021 at 10:00 PM, Christophe Pisteur 
 wrote:

> Le samedi 30 octobre 2021 à 13:06 +0000, phodina a écrit :
>
> > Hi Christophe,
> >
> > have you tried to run
> >
> > fc-cache -f
> >
> > to update the font cache to solve the issue?
> >
> > Petr
>
> Thank you very much. This solved the problem inside my session, but:- not in 
> the gdm login screen, which still shows bold fonts without precise outline;- 
> I don't understand why I had to do this action (fc-cache -f) when all other 
> times, a 'sudo guix system reconfigure' worked out of the box. is this a 
> bug?Christophe

You're welcome :-)

Looked around and found this long open issue regarding the font update [1].

Now to the gdm issue. I use sddm instead so I just checked some documentation.

Based on the Archwiki [2] I'd have a look at dconf. I will probably also be 
necessary to run manually dconf update.

1: http://issues.guix.gnu.org/18640

2: https://wiki.archlinux.org/title/GDM#dconf_configuration



Guix system with home-environment

2021-11-02 Thread phodina via
Hi,

I just want to ask if it's possible to create an image which has both the 
operating-system and home-environment configuration together.

Currently the way to build them is to do:

;; Guix System
guix system build os.scm

;; Guix Home
guix home build home.scm

However, if I want to build and test a VM, I'm missing the home environment.

Would it be the correct way to add additional record to user-account 
definition, which would instantiate the home-environment for the particular 
user?

Or is there another way how to do that?

Petr

home-files-service-type file permissions

2021-11-02 Thread phodina via
Hi Andrew,

Thanks for the development of Guix home. I've recently switch to it from my 
dotfiles.

However, there is one thing that I do not know how to set.

When using the service home-files-service-type I encountered a situation where 
I'm copying a script:

(simple-service 'dotfiles
home-files-service-type
(list
...
`("config/sway/wallpaper-change.sh" ,(local-file 
"config/sway/wallpaper-change.sh"

However, after guix home reconfigure the file has only read flags set not 
execute. Even though the original file has execute flags.

Is the home-files-service-type the correct service to use? Or do I have to 
patch it in order to keep the permissions?

Petr

Re: U-Boot for Raspberry Pi

2021-11-02 Thread phodina
Hi Stefan,

On Monday, November 1st, 2021 at 12:09 AM, Stefan  
wrote:

> Hi!
>
> There is already a patch series available since May – patiently awaiting a 
> review –, which brings support for the Raspberry Pi. It even supports booting 
> via NFS, which helps to avoid all the common troubles with microSD cards.

Thanks for your amazing work! I've applied the patches and it builds the system.

>
> For the usual mircoSD card installation just partition and format it as 
> usual, and put the well known bootloader blob on the FAT partition. Then do a 
> ‘guix system init config.scm /mnt/microsd’. The patch series contains an 
> example configuration at ‘gnu/system/examples/raspberry-pi-64.tmpl’.


However, I ran into several issues.

Firstly it's hard to run the init command as it requires root.
What I did is the following:

sudo guix environment --pure guix --ad-hoc coreutils findutils which

This gives me pure environment with the patches and root access.

Do you have different suggestion on how to invoke the guix system init command?

Secondly I have to run the command to init the system on the microSD card with 
the following flag --skip-checks:

[env]# ./pre-inst-env guix system init -s aarch64-linux 
gnu/system/examples/raspberry-pi-64.tmpl /mnt  --skip-checks

Otherwise I have to build with the following initrd config:

(initrd-modules (append (list "mmc_block" "rtsx_pci_sdmmc" "rtsx_pci")
   ;; %base-initrd-modules))

But adding these the build fails. Thought they might be needed as the kernel 
needs to access the blocks on microSD.

Another issue were certificates:

...
initializing operating system under '/mnt'...
copying to '/mnt'...  
[#  
  ]i/o error: 
/gnu/store/j76446v1asknzjl5lvzp9mnrg8gxl24d-nss-certs-3.59/etc/ssl/certs/NetLock_Arany_=Class_Gold=_F??tan??s??tv??ny:2.6.73.65.44.228.0.16.pem:
 No such file or directory
copying to '/mnt'...  
[## 
  ]i/o error: 
/gnu/store/db3kp42msgw9f53jk5hvp2bgsaq6jdyv-profile/etc/ssl/certs/NetLock_Arany_=Class_Gold=_F??tan??s??tv??ny:2.6.73.65.44.228.0.16.pem:
 No such file or directory
copying to '/mnt'...
populating '/mnt'...

Lastly the init fails as the FAT file system not supporting symlinks.

guix system: error: symlink: Operation not permitted: "/boot/efi/gnu/store"

I formatted the microSD card with FAT32 and Ext4 partitions.
The FAT32 partition is mounted to /boot.

Could you please help me as I've might done something incorrectly?

>
> Take a look here: http://issues.guix.gnu.org/48314#10
>
> In hope to get more attention and interest for a review, allow me to add two 
> side notes.
>
> Ever in need for a Guix System on an USB thump drive? Give the new 
> ‘grub-efi-netboot-removable-bootloader’ a try instead of 
> ‘grub-efi-bootloader’. It is not only usable for booting over network.
>
> Ever in need to quickly modify the kernel Linux? Give the new function 
> ‘modify-linux’ a try. For the Raspberry this is needed to get the kernel 
> linux-libre working. (By the way, would Guix System be the first distribution 
> using a libre kernel on the Raspberry?)
>
> For example to enable NFS root functionality for virtual machines, use a 
> kernel definition like this in your operating-system definition:
>
> (kernel (modify-linux #:configs '("CONFIG_E1000=y"
>
> "CONFIG_ROOT_NFS=y"
>
> "CONFIG_NFS_FS=y"
>
> "CONFIG_NFS_V4=y")))
>
> Bye
>
> Stefan



Re: guix package: error: unsupported manifest format

2021-11-01 Thread phodina
On Monday, November 1st, 2021 at 6:09 PM, phodina via  wrote:

> Hi,
>
> I've rebooted my laptop with Guix System installed there and I'm faced with 
> this dreadful message when I attempt to install package with guix package -i 
> PKG:
>
> guix package: error: unsupported manifest format
>
> I've tried to do guix pull, which succeeded but I'm still unable to do 
> anything. Also my profile is empty and I have to go to VT as some packages 
> are missing for X session to run.
>
> What is a proper way to resolve this issue?
>
> Does it mean there was a change in the format between Guix update and now the 
> old running Guix daemon is unable to read the new format?
>
> My current Guix version is
>
> 7af3b822178782d6598865e1d6a780a756dd0cb3

So the issue is solved.

The problem was that the symlink:

ls /var/guix/profiles/per-user/user/guix-profile -al
lrwxrwxrwx 1 user users 20 Nov  1 22:35 
/var/guix/profiles/per-user/user/guix-profile -> guix-profile-85-link

It pointed to a profile, where the contents of file manifest were empty. 
Removing this profile and changing the symlink to the older profile solved the 
problem after relogin.

Though it still make me curious as I don't understand how this could happen.



guix package: error: unsupported manifest format

2021-11-01 Thread phodina via
Hi,

I've rebooted my laptop with Guix System installed there and I'm faced with 
this dreadful message when I attempt to install package with guix package -i 
PKG:

guix package: error: unsupported manifest format

I've tried to do guix pull, which succeeded but I'm still unable to do 
anything. Also my profile is empty and I have to go to VT as some packages are 
missing for X session to run.

What is a proper way to resolve this issue?

Does it mean there was a change in the format between Guix update and now the 
old running Guix daemon is unable to read the new format?

My current Guix version is
7af3b822178782d6598865e1d6a780a756dd0cb3

Re: U-Boot for Raspberry Pi

2021-10-30 Thread phodina
Hi vagrant,

On Sunday, October 31st, 2021 at 12:05 AM, Vagrant Cascadian 
 wrote:

> On 2021-10-30, phodina via wrote:
>
> > I'm trying to run Guix System on Raspberry Pi. In order to do that we
> >
> > need a way to boot it up.
> >
> > There is the nonfree Broadcom bootloader, which does the job and it's
> >
> > used by many distributions.
> >
> > However, there is also an open source alternative as U-Boot supports
> >
> > the BCM SoCs.
>
> Well, you still need to load u-boot from the broadcom
>
> firmware/bootloader...

Yes, unfortunately you are right. The VC4 GPU core is started first and requires
the closed source binaries (bootcode.bin, start.elf and fixup.dat).

Also no disrespect was meant to the Guix help mailing list. I thought the 
closed source code could
be avoided.

>
> > If I inherit from the u-boot itself and specify the name, it's then in the 
> > list and I can build it.
> >
> > But the I can't use the package for the bootloader record.
> >
> > There must be something trivial I had overlooked.
> >
> > Could you please guide me on the procedure for porting the u-boot to new 
> > board as a new Guix package?
>
> There are install targets defined in gnu/bootloader/u-boot.scm, though
>
> most (all?) of those targets install to a raw device offset, whereas
>
> u-boot for the rpi needs u-boot.bin to be copied to your firmware
>
> partition and needs to be specified as a "kernel" in config.txt, if I
>
> recall correctly.

As you correctly pointed out that you can specify in the config.txt the next 
executable
to be loaded which in this case is the u-boot.

Also with U-boot it's the usually the case that you place it at specific flash 
location.

However, Raspberry Pi has BootRom which is able to access FAT file system
and load files from there. Therefore the SD card has to be formatted with
MBR layout, FAT boot partition and then let's say Linux root partition.

>
> > (define-public u-boot-raspberry-pi-4
> >
> > (make-u-boot-package "rpi_4" "aarch64-linux-gnu"))
>
> I would also try to keep the u-boot-BOARD matching the defconfig,
>
> e.g. u-boot-rpi-4 instead of u-boot-raspberry-pi-4. Not for any
>
> technical reason, per se, just keeping the u-boot target naming
>
> consistent.

Good idea. Though the longer version would be more readable.

>
> You might want to just build the u-boot package, and then manually copy
>
> it to your firmware partition and configure that appropriately once, and
>
> then just use guix to generate and update the extlinux.conf... I forget

That's the point of my original question as I created this package definition.
It builds fine and all the files are there. But as stated above can't be passed
to the bootloader record in the operating-system.

(define-public u-boot-rpi-2
  (let ((base (make-u-boot-package "rpi_2" "arm-linux-gnueabihf")))
  (package
  (inherit base)
  (name "uboot-rpi-2"

The contents of the package are here:

tree /gnu/store/77syxs86n0c52pslnzfsn9xzv1dzmxhc-uboot-rpi-2-2021.10/libexec
/gnu/store/77syxs86n0c52pslnzfsn9xzv1dzmxhc-uboot-rpi-2-2021.10/libexec
├── arch
│   └── arm
│   └── dts
│   ├── bcm2835-rpi-a.dtb
│   ├── bcm2835-rpi-a-plus.dtb
│   ├── bcm2835-rpi-b.dtb
│   ├── bcm2835-rpi-b-plus.dtb
│   ├── bcm2835-rpi-b-rev2.dtb
│   ├── bcm2835-rpi-cm1-io1.dtb
│   ├── bcm2835-rpi-zero.dtb
│   ├── bcm2835-rpi-zero-w.dtb
│   ├── bcm2836-rpi-2-b.dtb
│   ├── bcm2837-rpi-3-a-plus.dtb
│   ├── bcm2837-rpi-3-b.dtb
│   ├── bcm2837-rpi-3-b-plus.dtb
│   └── bcm2837-rpi-cm3-io3.dtb
├── doc
│   └── README.commands.spl
├── dts
│   └── dt.dtb
├── lib
│   └── efi_loader
│   └── helloworld.efi
├── scripts
│   └── Makefile.spl
├── tools
│   └── binman
│   └── test
│   └── descriptor.bin
├── u-boot
├── u-boot.bin
└── u-boot-nodtb.bin

>
> the exact syntax to generate extlinux.conf without actually installing
>
> u-boot, but I've done it in the past.

So do I now need to define a new bootloader target in gnu/bootloader/u-boot.scm,
where instead of writing directly to the image follow more the pattern of 
function
install-grub-efi, where based on the UEFI you also need to have EFI FAT 
partition
and just copy the files over to their correct location?

>
> Another option would be to build the raspberry pi UEFI (not 100% sure of
>
> the licensing, but reasonably free) instead of u-boot, and then use
>
> guix's standard UEFI configuration with grub-efi and such.

Then I can treat the closed source firmware to boot as UEFI and
just package the u-boot, right?

>
> live well,
>
> vagrant



U-Boot for Raspberry Pi

2021-10-30 Thread phodina via
Hi,

I'm trying to run Guix System on Raspberry Pi. In order to do that we need a 
way to boot it up.

There is the nonfree Broadcom bootloader, which does the job and it's used by 
many distributions.

However, there is also an open source alternative as U-Boot supports the BCM 
SoCs.

I had look at different u-boot definitions under gnu/packages/bootloaders.scm 
and gnu/bootloader.scm.

From my understanding the way how to define a new board is find the defconfig 
name in the configs directory in U-Boot.
Then use the make-u-boot-package with the config name and target triplet to 
define the package.

Unfortunately, the definitions below are not found by Guix if I run guix search 
-L. raspberry

If I inherit from the u-boot itself and specify the name, it's then in the list 
and I can build it.
But the I can't use the package for the bootloader record.

There must be something trivial I had overlooked.

Could you please guide me on the procedure for porting the u-boot to new board 
as a new Guix package?

--8<---cut here---start->8---
(define-module (raspberry-pi)
#:use-module (guix packages)
#:use-module (gnu packages bootloaders)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module ((guix licenses) #:prefix license:))

(define-public u-boot-raspberry-pi-2
(make-u-boot-package "rpi_2" "arm-linux-gnueabihf"))

(define-public u-boot-raspberry-pi-3
(make-u-boot-package "rpi_3" "aarch64-linux-gnu"))

(define-public u-boot-raspberry-pi-4
(make-u-boot-package "rpi_4" "aarch64-linux-gnu"))

Re: Incorrect display of system fonts after guix system reconfigure (2021_10_29)

2021-10-30 Thread phodina via
Hi Christophe,

have you tried to run

fc-cache -f

to update the font cache to solve the issue?

Petr

 Original Message 
On Oct 29, 2021, 12:14 PM, Christophe Pisteur < christophe.pist...@fsfe.org> 
wrote:
Hello,
I installed some time ago guix system (1.3) on a Lenovo libreboot with
the gnome desktop.
I made today:guix pullfollowed by sudo guix system reconfigure
/etc/config.scm
and I lost the cantarell fonts for the gnome desktop display. I then
selected (in gnome-tweaks) the available fonts (liberation serif, etc.)
but the display of the menus is still faulty (bold fonts without
precise outline). The problem already appears from the gdm login
screen.
So I went back to the previous generation and everything is displayed
correctly (with liberation serif as with cantarell).
Below is the list of the two generations of guix system concerned.
Generation 6 is working; generation 7 is the one with the problem.
Any ideas?
Christophe
-

Génération 604 oct 2021 16:47:11(actuelle) nom de fichier :
/var/guix/profiles/system-6-link nom de fichier canonique :
/gnu/store/90srxmrcc0a5d826zz0p0f161hnjc11d-system étiquette : GNU
with Linux-Libre 5.14.9 chargeur de démarrage : grub périphérique
racine : UUID : ea096464-f368-46b6-a1f8-c9c0e2c9736d noyau :
/gnu/store/k1xanirwdhy14clvnfc1q5fwm39znxhb-linux-libre-5.14.9/bzImage
canaux : guix: URL du dépôt :
https://git.savannah.gnu.org/git/guix.git branche :
master commit : a03562b478f50c302b6398fe5793fc072ed621f2 fichier
de configuration : /gnu/store/idfmbzq8lvcs0dmq23g89x61fk6zalvq-
configuration.scm
Génération 729 oct 2021 08:04:51 nom de fichier :
/var/guix/profiles/system-7-link nom de fichier canonique :
/gnu/store/a5g97vcml10cjw833cmxvy0p5mplv9gs-system étiquette : GNU
with Linux-Libre 5.14.15 chargeur de démarrage : grub périphérique
racine : UUID : ea096464-f368-46b6-a1f8-c9c0e2c9736d noyau :
/gnu/store/dm0y0agial5vzsni0b398ykdkxwfg1yr-linux-libre-
5.14.15/bzImage canaux : guix: URL du dépôt :
https://git.savannah.gnu.org/git/guix.git branche :
master commit : ad39268cdf075f4c4eeb87ed78ce46ca6f817675 fichier
de configuration : /gnu/store/idfmbzq8lvcs0dmq23g89x61fk6zalvq-
configuration.scm

Re: Crates versions and their replacement

2021-10-10 Thread phodina
Hi Hartmut,

On Tuesday, October 5th, 2021 at 8:19 PM, Hartmut Goebel 
 wrote:

> Am 03.10.21 um 09:02 schrieb phodina:
>
> > Now comes the question. How often should it be use and what are the
> >
> > pros and cons?
>
> I suggest to use this only if required, since versions are defined to
>
> strict.

Thanks for the answer. So there are only two options.

1. Create a patch for the package - that means bump up the version in the 
Cargo.toml and fix all the stuff in the code so that it works. Then send this 
PR to the project and include the patch in patches directory.

2. Include the required package definition in the Guix cargo-*.scm file even if 
there is a version similar to the one that I package or if the version is an 
older one.

The substitution is possible only in rare cases.

This is also probably applicable to other languages, right?
>
> -
>
> Regards
>
> Hartmut Goebel
>
> | Hartmut Goebel | h.goe...@crazy-compilers.com |
>
> | www.crazy-compilers.com | compilers which you thought are impossible |



Error in install-efi + build with graft freezes

2021-10-05 Thread phodina
Hi Guix,

I've attempted to build image for beaglebone black based on the example found 
in gnu/system/examples/beaglebone-black.tmpl. To build the image I run the 
following command:

time guix system image --no-grafts --system=armhf-linux 
examples/beaglebone-black.tmpl -v3
The following derivations will be built:
   /gnu/store/1ivscl4dkmw65lgl3s7ml8qgx8dgj6zv-disk-image.drv
   /gnu/store/dydpw2nvm8yq330bs7gcqicl2fb6qd21-genimage.cfg.drv
   /gnu/store/i271lgxhafnb7kgp8kr1pc81bng0ys6q-partition.img.drv
   /gnu/store/riiw4lrrh73slwa4dihkfnpssshn5wf0-partition.img.drv
building /gnu/store/i271lgxhafnb7kgp8kr1pc81bng0ys6q-partition.img.drv...
Backtrace:
   3 (primitive-load "/gnu/store/ha96i5s8bvx7zcdnp3sqnr03gvf…")
In ice-9/eval.scm:
    619:8  2 (_ #(# # …))
In ./gnu/build/bootloader.scm:
 99:4  1 (install-efi-loader "/gnu/store/y5c7xy8gn5maimw3nvksvm…" …)
    78:35  0 (install-efi _ "grub.cfg" _)

./gnu/build/bootloader.scm:78:35: In procedure install-efi:
In procedure car: Wrong type argument in position 1 (expecting pair): 
#
environment variable `PATH' set to 
`/gnu/store/62c83bc4a6vnx94cmgn0h37j3mj8nif8-e2fsprogs-1.45.6/bin:/gnu/store/62c83bc4a6vnx94cmgn0h37j3mj8nif8-e2fsprogs-1.45.6/sbin:/gnu/store/fk1gaqga9rkq2g4pxnjlxxmy6xv0994m-fakeroot-1.25.3/bin:/gnu/store/6mz29a52531f6529455gscxsrcm9q0wb-dosfstools-4.2/sbin:/gnu/store/ryx6nf7cqsqvi2cwrv6mkj7nbb5gpc0f-mtools-4.0.35/bin'
builder for `/gnu/store/i271lgxhafnb7kgp8kr1pc81bng0ys6q-partition.img.drv' 
failed with exit code 1
build of /gnu/store/i271lgxhafnb7kgp8kr1pc81bng0ys6q-partition.img.drv failed
View build log at 
'/var/log/guix/drvs/i2/71lgxhafnb7kgp8kr1pc81bng0ys6q-partition.img.drv.bz2'.
cannot build derivation 
`/gnu/store/dydpw2nvm8yq330bs7gcqicl2fb6qd21-genimage.cfg.drv': 1 dependencies 
couldn't be built
cannot build derivation 
`/gnu/store/1ivscl4dkmw65lgl3s7ml8qgx8dgj6zv-disk-image.drv': 1 dependencies 
couldn't be built
guix system: error: build of 
`/gnu/store/1ivscl4dkmw65lgl3s7ml8qgx8dgj6zv-disk-image.drv' failed

real 0m3.055s
user 0m2.297s
sys 0m0.113s

Based on the backtrace the issue is in install-efi-loader calling install-efi 
with incorrect parameter. I checked also the gnu/build/bootloader.scm where 
these function are defined.

Unfortunately, I'm not that skilled in Guile to debug the code, set breakpoint 
and view/modify the arguments.

Could you recommend me some guide how to debug the Guile code in order to learn 
how to fix this issue?

Also one more question related to the Guix. I had to use the argument 
--no-graft. When I measure the time it takes to build the system with grafts 
the process freezes for like a half day so I kill it. Without the grafts I at 
least get to the partition error above.

Could someone please explain the reason or point me in the right direction why 
grafts freeze or is it normal it takes that long?
(for cross-compilation, when building native system for my laptop I don't see 
this issue)

Petr



Python gi module not found

2021-10-05 Thread phodina via
Hi Guix,

I've put together package definition for postmarketos-tweaks. This issue comes 
up when I attempt to run the pmos-tweaks. I get this message reagrding missing 
Python module gi:

$ guix environment --pure bash
[env]$ 
/gnu/store/zsybq9wphfckhph4f6fizzs31kjsd04x-postmarketos-tweaks-0.7.3/bin/pmos-tweaks
Traceback (most recent call last):
File 
"/gnu/store/zsybq9wphfckhph4f6fizzs31kjsd04x-postmarketos-tweaks-0.7.3/bin/pmos-tweaks",
 line 17, in 
import gi
ModuleNotFoundError: No module named 'gi'

If I check for the module I do see it in the PYTHON_PATH:

$ environment --pure bash --ad-hoc python-pygobject python-pyyaml python

$ printenv
...
PYTHONPATH=/gnu/store/qhg0djz37c2c884v64m6287d62xsqbz2-profile/lib/python3.8/site-packages
...
$ ls 
/gnu/store/qhg0djz37c2c884v64m6287d62xsqbz2-profile/lib/python3.8/site-packages/
PyGObject-3.34.0.egg-info pip
PyYAML-5.4.1-py3.8.egg-info pip-19.2.3.dist-info
README.txt pkg_resources
__pycache__ pygtkcompat
_yaml setuptools
easy_install.py setuptools-41.2.0.dist-info
gi yaml

Any tips what to change so that the modules are imported correctly?

Petr

--8<---cut here---start->8---

Subject: [PATCH] gnu: Add postmarketos-tweaks.

* gnu/packages/gnome.scm (postmarketos-tweaks): New variable.

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 4a311a379c..afd185480c 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -11345,6 +11345,47 @@ integrate seamlessly with the GNOME desktop.")
(home-page "https://wiki.gnome.org/Apps/Polari";)
(license license:gpl2+)))

+(define-public postmarketos-tweaks
+ (package
+ (name "postmarketos-tweaks")
+ (version "0.7.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/postmarketOS/postmarketos-tweaks";)
+ (commit version)))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "05110x0y1pvzdgzmz66fhq9bnlyym1nd7zgn61knihzp4dx3acf5"
+ (build-system meson-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-install-dir
+ (lambda* _
+ (substitute* "data/meson.build"
+ (("/etc/init.d") (string-append %output "/etc/init.d"
+ (native-inputs `(("pkg-config" ,pkg-config)
+ ("gtk+:bin"
+ ,gtk+ "bin") ; for gtk-update-icon-cache
+ ("glib:bin"
+ ,glib "bin") ; glib-compile-schemas, etc.
+ ("desktop-file-utils"
+ ,desktop-file-utils) ; for update-desktop-database
+ ("cmake" ,cmake)))
+ (inputs `(("libhandy" ,libhandy)
+ ("gtk+" ,gtk+)
+ ("python" ,python)
+ ("python-pygobject" ,python-pygobject)
+ ("python-pyyaml" ,python-pyyaml)))
+ (home-page "https://gitlab.com/postmarketOS/postmarketos-tweaks";)
+ (synopsis "Extra settings on mobile platforms")
+ (description "Postmarket tweaks is an application for tweaking settings
+on desktop environments supported by postmarketOS.")
+ (license license:lgpl3)))
+
(define-public gnome-boxes
(package
(name "gnome-boxes")
--
2.32.0

Re: Plugins for Kicad and other programs

2021-10-04 Thread phodina
On Sunday, October 3rd, 2021 at 7:37 PM, Efraim Flashner 
 wrote:

> On Sun, Oct 03, 2021 at 11:31:40AM +0000, phodina via wrote:
>
> > Hi Guix,
> >
> > Lots of programs now allow users to extend their features through plugins.
> >
> > On non Guix distros where the user does not have the root priviledges they 
> > place
> >
> > the the content of their plugin in the configuration directory in home 
> > directory.
> >
> > Here's example for Kicad:
> >
> > ~/.kicad_plugins/
> >
> > ~/.kicad/scripting/
> >
> > ~/.kicad/scripting/plugins/
> >
> > To further complicate things they can have their own plugin manager (e.g. 
> > Freecad).
> >
> > In some cases they contain just some raw data or configs. However, large 
> > amount has
> >
> > some code embedded like shell scripts, python which needs special handling 
> > on Guix.
> >
> > Therefore my question is how to integrate them?
> >
> > What I propose is with the merge of home services [2], there is now 
> > possibility to:
> >
> > -   create package defintion of the plugin
> > -   create home service that will link the plugin into the correct location
> >
> > within the home dir
> >
> > There is also an alternative.
> >
> > I searched the Kicad forum for plugin installation and installation into 
> > system dirs
> >
> > (under /usr) is not recommended [2]. The plugin could be linked into the 
> > plugin
> >
> > location under the /gnu/store/xxx-package. This could be done by inheriting 
> > kicad
> >
> > package and adding the plugins to the input. That approach wouldn't be very 
> > flexible,
> >
> > as it would create to many package combinations.
> >
> > Also I never installed plugins into system directories on distibutions used 
> > before
> >
> > Guix system so I don't know if it would work.
> >
> > [1] commit 6ae4644984608b7eff7ab54d3a5787c661d85b2e
> >
> > [2] https://forum.kicad.info/t/plugin-location-ubuntu-refresh-solved/24396
>
> Following down that thread, I came across this other bit too:
>
> Can you follow the instruction in the document you linked to:
>
> Open Tools -> Scripting Console in pcbnew
>
> type import pcbnew; print pcbnew.PLUGIN_DIRECTORIES_SEARCH
>
>
> What does it tell?
>
> v3xX
>
> Aug 2020
>
> /usr/share/kicad/scripting
>
> /usr/share/kicad/scripting/plugins
>
> /home//.config/kicad/scripting
>
> /home//.config/kicad/scripting/plugins
>
> /home//.kicad_plugins
>
> /home//.kicad/scripting
>
> /home//.kicad/scripting/plugins
>
> it looks like it should search in this folders.
>
> so it looks like kicad could have a search-path of 'share/kicad' or
>
> 'share/kicad/scripting' and the plugins installed to
>
> %out/share/kicad/scripting for each plugin.
>

I checked the output in the scripting console as you suggested and got similar 
output:

>>> import pcbnew
>>> print pcbnew.PLUGIN_DIRECTORIES_SEARCH
/gnu/store/nvjsh0xdg6r1kkz9n8a3kx4lrg0s1dc3-kicad-5.1.6/share/kicad/scripting
/gnu/store/nvjsh0xdg6r1kkz9n8a3kx4lrg0s1dc3-kicad-5.1.6/share/kicad/scripting/plugins
/home/user/.config/kicad/scripting
/home/user/.config/kicad/scripting/plugins
/home/user/.kicad_plugins
/home/user/.kicad/scripting
/home/user/.kicad/scripting/plugins

So that means the plugins can be installed into the /gnu/store, right?

The question now is how do you symlink the plugin into the kicad plugin 
directory?

Does it mean the definition of the kicad package has to be modified? By that I 
mean create a new package definition, inherit kicad and add the plugin to the 
inputs? Don't think this approach will scale nicely.

It would be better to let the plugins create the symlinks themselves but this 
creates the problem that the outputs in /gnu/store are read-only. Therefore 
plugin package won't create a symlink into the directory inside kicad package.

Or create symlink in the user home directory?

>
> Efraim Flashner efr...@flashner.co.il רנשלפ םירפא
>
> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
>
> Confidentiality cannot be guaranteed on emails sent or received unencrypted



Plugins for Kicad and other programs

2021-10-03 Thread phodina via
Hi Guix,

Lots of programs now allow users to extend their features through plugins.
On non Guix distros where the user does not have the root priviledges they place
the the content of their plugin in the configuration directory in home 
directory.

Here's example for Kicad:
~/.kicad_plugins/
~/.kicad/scripting/
~/.kicad/scripting/plugins/

To further complicate things they can have their own plugin manager (e.g. 
Freecad).

In some cases they contain just some raw data or configs. However, large amount 
has
some code embedded like shell scripts, python which needs special handling on 
Guix.

Therefore my question is how to integrate them?

What I propose is with the merge of home services [2], there is now possibility 
to:

- create package defintion of the plugin
- create home service that will link the plugin into the correct location
within the home dir

There is also an alternative.
I searched the Kicad forum for plugin installation and installation into system 
dirs
(under /usr) is not recommended [2]. The plugin could be linked into the plugin
location under the /gnu/store/xxx-package. This could be done by inheriting 
kicad
package and adding the plugins to the input. That approach wouldn't be very 
flexible,
as it would create to many package combinations.

Also I never installed plugins into system directories on distibutions used 
before
Guix system so I don't know if it would work.

[1] commit 6ae4644984608b7eff7ab54d3a5787c661d85b2e
[2] https://forum.kicad.info/t/plugin-location-ubuntu-refresh-solved/24396

Crates versions and their replacement

2021-10-03 Thread phodina
Hi Guix,

I got questions regarding packaging Rust crates in Guix and
unfotunately I haven't found an answer in the documentation nor
in the help archive.

1. Sometimes the crate described in the Cargo.toml of a new package
  is not available but there is another with different higher minor
  or patch version. It is understandable that the repo will not have
  all the Rust packages that are on the crates.io. It also applies
  when the author specifies exact commit.

  In the gnu/packages/crates-io.scm there is a special phase usually
  called fix-version-requirements. Here's the excerpt:

 (add-after 'unpack 'fix-version-requirements
   (lambda _
 (substitute* "Cargo.toml"
   (("0.7.7") ,(package-version rust-mio-0.7)))
 #t)

  Now comes the question. How often should it be use and what are the
  pros and cons?

  I understand that it's better than the patch as this replaces the
  version with the correct one on the fly.

2. How do I do multiline replace as with large crate dependency list
   there are sometimes crates with the same version?

   Based on the substitute description it replaces only a line but
   the definition of the crate and the version are on separate lines
   in the Cargo.toml.

Petr





Resources issue with glib-compile-resources

2021-10-02 Thread phodina
Hi Guix,

I'm struggling to build this package (patch provided below)
and would like to ask for your ideas.

The issue is that in Makefile we call glib-compile-resources
to compile the resources. However, the path needs to be substituted
otherwise the resources are not found when the app is launched.

But by substituting the location the build phase fails as the
glib-compile-resources command looks for the resources in the
/gnu/store/x where the files are not yet present.

The only solution I come up with is to install those files there
before the build stage.

What do you think?

--8<---cut here---start->8---

>From 5b75a1733107268fe41207c32e714d60643b9714 Mon Sep 17 00:00:00 2001
From: Petr Hodina 
Date: Sat, 2 Oct 2021 15:58:53 +0200
Subject: [PATCH] gnu: Add pine-flasher.

* gnu/packages/embedded.scm (pine-flasher): New variable.

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index f388c11c3d..9b790b1aa5 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -43,12 +43,16 @@
   #:use-module ((gnu packages base) #:prefix base:)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages dejagnu)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gdb)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages libftdi)
   #:use-module (gnu packages libusb)
@@ -60,6 +64,7 @@
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))

@@ -1217,6 +1222,74 @@ SPI, I2C, JTAG.")
 (home-page "https://hyvatti.iki.fi/~jaakko/pic/picprog.html";)
 (license license:gpl3+)))

+(define-public pinetime-flasher
+(package
+  (name "pinetime-flasher")
+  (version "0.1")
+  (source (origin
+(method git-fetch)
+(uri (git-reference
+ (url "https://github.com/arteeh/pinetime-flasher";)
+ (commit version)))
+(file-name (git-file-name name version))
+(sha256
+ (base32
+  "1n5isqi2s4y69w80ymfwndyqxzqgp5aycimm27dpmsxnx3rxsx48"
+  (build-system gnu-build-system)
+  (arguments
+`(#:tests? #f ; no test suite
+  #:phases
+  (modify-phases %standard-phases
+(delete 'configure)
+(add-before 'build 'fix-icon-location-chdir
+  (lambda* (#:key outputs #:allow-other-keys)
+(let* ((out (assoc-ref outputs "out"))
+  (icons (string-append out
+   "/share/icons/hicolor/scalable/apps")))
+(substitute* "src/pinetime-flasher.ui"
+  (("../build") icons))
+(substitute* "src/pinetime-flasher.gresource.xml"
+  (("../build") icons))
+(chdir "build") #t)))
+(replace 'install
+  (lambda* (#:key outputs #:allow-other-keys)
+(let* ((out (assoc-ref outputs "out"))
+   (bin (string-append out "/bin"))
+   (share (string-append out "/share"))
+   (udev (string-append out "/lib/udev/rules.d"))
+   (udev-rule (string-append
+ (assoc-ref inputs "udev-rules") "/60-openocd.rules"))
+   (icons (string-append share 
"/icons/hicolor/scalable/apps")))
+ (mkdir-p bin)
+ (mkdir-p icons)
+ (mkdir-p share)
+ (mkdir-p udev)
+ (install-file "icon.png" icons)
+ (install-file "icon.svg" icons)
+ (install-file udev-rule udev)
+ (install-file "com.arteeh.Flasher.desktop" share)
+ (install-file "pinetime-flasher" bin)))
+  (native-inputs `(("glib" ,glib "bin")
+   ("libxml2" ,libxml2)
+   ("pkg-config" ,pkg-config)))
+  (inputs `(("curl" ,curl)
+("gtk+" ,gtk+)
+("libhandy" ,libhandy)
+("stlink" ,stlink)
+("udev-rule"
+   ,(origin
+  (method url-fetch)
+(uri (string-append "https://sourceforge.net/p/openocd";
+
"/code/ci/master/tree/contrib/60-openocd.rules?format=raw"))
+  (sha256
+(base32
+  
"1xvgpk6nzd6kp86sh240iqk122yqbarhwi6s6js98zfj43190sn0"))
+  (synopsis "Flashing app for PineTime")
+  (description "Pinetime Flasher provides a GTK app for easily flashing
+the Pinetime smartwatch with an ST-Link.")
+

Re: Apply patch to read-only file

2021-10-02 Thread phodina
Hi Guillaume,

On Wednesday, September 29th, 2021 at 10:42 AM, Guillaume Le Vaillant 
 wrote:

> Hi,
>
> I tried with simplified versions of your package definition and patch,
>
> and it builds fine for me. The patch gets applied successfully.
>

Thanks for the help and the package definition. I also managed to figure out 
what went wrong - I created the patch on master and attempted to patch 0.17.0.

The only other issue I had was with the xmlto, where I attempted to use local 
validation using docbook-xml based on example provided in 
gnu/packages/gnome.scm. See the attached file.

However, I gave up and also used the --disable-docs flag.
> However I haven't tried using the program to see if it works.

Well, that's another issue.
- It needs correct config file
- There has to be a service running. So I'll look into that now.

Thanks and have a nice day
Petr(define-module (endgame packages realmd)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu packages kerberos)
  #:use-module (gnu packages openldap)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages docbook)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages polkit)
  #:use-module (gnu packages xml)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module ((guix licenses) #:prefix license:))

(define-public realmd
  (package
(name "realmd")
(version "0.17.0")
(source (origin
  (method git-fetch)
  (uri (git-reference
(url "https://github.com/freedesktop/realmd";)
(commit version)))
  (file-name (git-file-name name version))
  (patches '("endgame/packages/patches/realmd-remove-distro-detection.patch"))
  (sha256
(base32
  "1c6q2a86kk2f1akzc36nh52hfwsmmc0mbp6ayyjxj4zsyk9zx5bf"
(build-system gnu-build-system)
(arguments
 `(#:configure-flags (list "--with-systemd-unit-dir=no" "--with-systemd-journal=no" "--disable-doc")
   #:phases
   (modify-phases %standard-phases
 (add-after 'unpack 'xml-validation
   (lambda* (#:key inputs #:allow-other-keys)
 (let ((local (string-append (assoc-ref inputs "docbook-xml") "/xml/dtd/docbook")))
	 ; substitute in order to validate locally due to network restriction
 (substitute*  "doc/internals/realmd-internals.xml"
			   (("http://.*/xml/4.3";) local))
 (substitute*  "doc/manual/realm.xml"
			   (("http://.*/xml/4.2";) local))
 (substitute*  "doc/manual/realmd.conf.xml"
			   (("http://.*/xml/4.2";) local))
 (substitute*  "doc/manual/realmd-docs.xml"
			   (("http://.*/xml/4.3";) local))
 (substitute*  "doc/manual/realmd-guide-active-directory.xml"
			   (("http://.*/xml/4.3";) local))
 (substitute*  "doc/manual/realmd-guide-ipa.xml"
			   (("http://.*/xml/4.3";) local))
 (substitute*  "./doc/manual/realmd-guide-kerberos.xml"
			   (("http://.*/xml/4.3";) local))#t))
  (native-inputs `(("pkg-config" ,pkg-config)
   ("autoconf" ,autoconf)
   ("intltool" ,intltool)
   ("libxslt" ,libxslt)
   ("xmlto" ,xmlto)
   ("python" ,python)
		   ("docbook-xml" ,docbook-xml)
   ("automake" ,automake)))
  (inputs `(("glib" ,glib "bin")
	("dbus" ,dbus)
	("mit-krb5" ,mit-krb5)
	("openldap" ,openldap)
("polkit" ,polkit)))
  (synopsis "DBus service for configuring kerberos and other online identities")
  (description "Dbus system service that manages discovery and enrollment
in realms/domains like Active Directory or IPA.")
  (home-page "https://www.freedesktop.org/software/realmd/";)
  (license license:lgpl2.1)))


Re: Apply patch to read-only file

2021-09-27 Thread phodina
Hi Guillaume,

Sure, here's the formatted file. My appology for the issue with the mail client.

--8<---cut here---start->8---

(define-module (realmd)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu packages image)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages polkit)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module ((guix licenses) #:prefix license:))

(define-public realmd
(package
  (name "realmd")
  (version "0.17.0")
  (source (origin
(method git-fetch)
(uri (git-reference
 (url "https://github.com/freedesktop/realmd";)
 (commit version)))
(file-name (git-file-name name version))
(modules '((guix build utils)))
 (snippet
  '(begin
   (delete-file "configure.ac")
   ;(make-file-writable "configure.ac")
#t))
(patches '("endgame/packages/patches/realmd-guixsd-support.patch"))
(sha256
 (base32
  "1c6q2a86kk2f1akzc36nh52hfwsmmc0mbp6ayyjxj4zsyk9zx5bf"
  (build-system gnu-build-system)
  (arguments
`(#:phases
  (modify-phases %standard-phases
 (add-after 'unpack 'make-git-checkout-writable
(lambda* (#:key inputs #:allow-other-keys)
   (make-file-writable "configure.ac"))
 (add-after 'unpack 'apply-patches
 (for-each
   (lambda (file)
 (invoke "patch" "--force" "-p1" 
"-input" "endgame/packages/patches/realmd-guixsd-support.patch"
 

 ; gnuzilla.scm
 ; jami.scm
  (native-inputs `(("pkg-config" ,pkg-config)
   ("autoconf" ,autoconf)
   ("intltool" ,intltool)
   ("automake" ,automake)))
  (inputs `(("glib" ,glib)
("polkit" ,polkit)))
  (synopsis "DBus service for configuring kerberos and other online identities")
  (description "Dbus system service that manages discovery and enrollment
in realms/domains like Active Directory or IPA.")
  (home-page "https://www.freedesktop.org/software/realmd/";)
  (license license:lgpl2.1)))



Re: GuixSD distro detection during configuration

2021-09-16 Thread phodina
Hi Ricardo,

> phodina via help-guix@gnu.org writes:
>
> > Hi,
> >
> > what is the best way to detect the GuixSD OS during the build?
>
> Why is distro detection desirable? I often found myself trying to
>
> work around buggy distro detection.
>
> (BTW: it’s called “Guix System”, not “GuixSD”.)
>
Well it's not exactly desirable but the configure script wants to know in order 
to copy the correct files.

My idea was to create a patch with Guix System support and submit it upstream.

> > I encountered the problem during build of realmd in the
> >
> > configure.ac [1].
> >
> > Some distros have special file in /etc. So my first idea was to
> >
> > use /etc/config.scm. However, this is not visible during the
> >
> > package build.
>
> It is also not necessary to have /etc/config.scm. I, for example,
>
> have all my system configurations in a different directory.

True, I also have there just a symlink but it's not mandatory.
>
> > Therefore I went with the /gnu/store. This works but I'm
> >
> > interested if there isn't even a better option.
> >
> > [1]
> >
> > https://github.com/freedesktop/realmd/blob/master/configure.ac
>
> Guix is often used on top of other distros, so the presence of
>
> /gnu/store is not enough to be sure that the distro is Guix
>
> System.
>

Yes it can be the case it's installed on a foreign distro.
>
> 
>
> Ricardo

Well in that case I agree with you that it's not desirable to use buggy distro 
detection and the result will be therefore to keep the patch with the pkg 
definition.



GuixSD distro detection during configuration

2021-09-16 Thread phodina via
Hi,
what is the best way to detect the GuixSD OS during the build?

I encountered the problem during build of realmd in the configure.ac [1].

Some distros have special file in /etc. So my first idea was to use 
/etc/config.scm. However, this is not visible during the package build.

Therefore I went with the /gnu/store. This works but I'm interested if there 
isn't even a better option.
[1] https://github.com/freedesktop/realmd/blob/master/configure.ac

Apply patch to read-only file

2021-09-16 Thread phodina via
Hi,

I'm attempting to package realmd program. However, there seems to be an issue 
as it does not support GuixSD. Therefore I created a patch.

When I specify the patch the hunk fails as the configure.ac file is read-only.
I tried to use snippets but they seem to be applied after the patch therefore 
don't work.

Is there a way how to patch a read-only files? I got the idea from this thread 
[1]. Below is the package definition and patch.

[1] https://lists.gnu.org/archive/html/help-guix/2020-01/msg00063.html

realmd.scm
-
(define-module (realmd)
#:use-module (guix packages)
#:use-module (gnu packages)
#:use-module (gnu packages image)
#:use-module (gnu packages glib)
#:use-module (gnu packages autotools)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages polkit)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module ((guix licenses) #:prefix license:))

(define-public realmd
(package
(name "realmd")
(version "0.17.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/freedesktop/realmd";)
(commit version)))
(file-name (git-file-name name version))
(modules '((guix build utils)))
(snippet
'(begin
(delete-file "configure.ac")
;(make-file-writable "configure.ac")
#t))
(patches '("realmd-guixsd-support.patch"))
(sha256
(base32
"1c6q2a86kk2f1akzc36nh52hfwsmmc0mbp6ayyjxj4zsyk9zx5bf"
(build-system gnu-build-system)
(native-inputs `(("pkg-config" ,pkg-config)
("autoconf" ,autoconf)
("intltool" ,intltool)
("automake" ,automake)))
(inputs `(("glib" ,glib)
("polkit" ,polkit)))
(synopsis "DBus service for configuring kerberos and other online identities")
(description "Dbus system service that manages discovery and enrollment
in realms/domains like Active Directory or IPA.")
(home-page "https://www.freedesktop.org/software/realmd/";)
(license license:lgpl2.1)))
--
realmd-guixsd-support.patch ([PATCH] Add GuixSD support)
---

diff --git a/configure.ac b/configure.ac
index 4dac5a9..9e818d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,7 @@ if test -z $DISTRO; then
AC_CHECK_FILE(/etc/redhat-release, [DISTRO="redhat"])
AC_CHECK_FILE(/etc/debian_version, [DISTRO="debian"])
AC_CHECK_FILE(/etc/SuSE-release, [DISTRO="suse"])
+ AC_CHECK_FILE(/gnu/store, [DISTRO="guixsd"])

# Not customized for these yet
dnl AC_CHECK_FILE(/etc/gentoo-release, [DISTRO="gentoo"])
@@ -103,51 +104,6 @@ PKG_CHECK_MODULES(POLKIT, polkit-gobject-1)
AC_SUBST(POLKIT_CFLAGS)
AC_SUBST(POLKIT_LIBS)

-# 
-# systemd
-
-AC_MSG_CHECKING([systemd unit directory])
-AC_ARG_WITH(systemd-unit-dir,
- AS_HELP_STRING([--with-systemd-unit-dir],
- [Directory to install systemd service file]))
-
-if test "$with_systemd_unit_dir" = "" -o "$with_systemd_unit_dir" = "yes"; then
- with_systemd_unit_dir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
- if test "$with_systemd_unit_dir" = ""; then
- AC_MSG_ERROR(["Couldn't find systemd system unit directory"])
- fi
-
-elif test "$with_systemd_unit_dir" = "no"; then
- with_systemd_unit_dir=""
-
-fi
-
-SYSTEMD_UNIT_DIR="$with_systemd_unit_dir"
-AC_SUBST(SYSTEMD_UNIT_DIR)
-AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemd_unit_dir"])
-
-dbus_systemd_service=""
-if test -n "$with_systemd_unit_dir"; then
- dbus_systemd_service="SystemdService=realmd.service"
-fi
-AC_SUBST(dbus_systemd_service)
-
-AC_MSG_RESULT($with_systemd_unit_dir)
-
-AC_ARG_WITH(systemd-journal,
- AS_HELP_STRING([--with-systemd-journal],
- [Use systemd's journal for logging]))
-
-if test "$with_systemd_journal" != "no"; then
- AC_DEFINE_UNQUOTED(WITH_JOURNAL, 1, [Use systemd's journal])
- PKG_CHECK_MODULES(SYSTEMD_JOURNAL, [libsystemd],,
- [PKG_CHECK_MODULES(SYSTEMD_JOURNAL, [libsystemd-journal])])
- with_systemd_journal="yes"
-fi
-
-AC_SUBST(SYSTEMD_JOURNAL_CFLAGS)
-AC_SUBST(SYSTEMD_JOURNAL_LIBS)
-
# ---
# resolv

diff --git a/service/realmd-guixsd.conf b/service/realmd-guixsd.conf
new file mode 100644
index 000..ac4b436
--- /dev/null
+++ b/service/realmd-guixsd.conf
@@ -0,0 +1,42 @@
+# Default values for realmd
+[service]
+debug = no
+automatic-install = yes
+
+[paths]
+net = /usr/bin/net
+winbindd = /usr/sbin/winbindd
+smb.conf = /etc/smb.conf
+sssd.conf = /etc/sssd/sssd.conf
+adcli = /usr/sbin/adcli
+ipa-client-install = /usr/sbin/ipa-client-install
+pam_winbind.conf = /etc/security/pam_winbind.conf
+krb5.conf = /etc/krb5.conf
+
+[active-directory]
+default-client = sssd
+os-name =
+os-version =
+
+[providers]
+sssd = yes
+samba = yes
+example = no
+
+[samba-packages]
+
+[winbind-packages]
+
+[sssd-packages]
+
+[adcli-packages]
+
+[commands]
+
+[users]
+default-shell = /bin/bash
+default-home = 

Qt mediaplayer service issue

2021-09-07 Thread phodina via
Hi there!

I'm getting this wierd Qt message when attempting to run package with 
dependency on qtmultimedia (putting togehter the definition of the package 
itself). This is the message:

defaultServiceProvider::requestService(): no service found for - 
"org.qt-project.qt.mediaplayer"

Based on the google search I tried to add gstreamer or mpv but this didn't 
solve the issue.

Any hints how to fix the Qt error?

Service development workflow

2021-09-04 Thread phodina
Hi there,

I'm curious what development workflow do you use for implementing a service.

Here's mine:

0 define a new service in my channel services directory
1 add this new service in definition of OS
2 use guix system container to build container image with --load-path pointing 
to the local channel with the service
3 run the newly created container
4 check with the herd status the service is running
5 check and interact with the service itself
6 iterate till satisfaction
7 git & peace :-)

Petr



Guix pull fails on OS definition

2021-08-12 Thread phodina via
Hi Guix,
Till now I've used custom channel for package definition only. However, I want 
to add to the channel also the definition for the operating system.

The problem is when I run =guix pull= the command fails. The reason is probaly 
due to the newly added configuration file which returns OS as a result. Without 
such a file the commands succeeds.

Is there a way to tell Guix not to evaulate such a file?

I looked into the Guix channel and the files are there with the extension tmpl. 
That however, didn't help.

In the gnu/system.scm file there is at the end expression with note:
"This is not super elegant but we can't pass SYSTEM and TARGET to 
'operating-system-derivation'

So is this the right direction to pursue and dig little bit deeper into the 
store-lift function?

Re: Non deterministic package

2021-08-09 Thread phodina
> I've become involved in the rust packaging effort so I'll jump in with
>
> some specifics.
>
> On Wed, Aug 04, 2021 at 03:50:00PM -0400, Julien Lepiller wrote:
>
> > Le 4 août 2021 15:14:16 GMT-04:00, phodina via help-guix@gnu.org a écrit :
> >
> > > Hi,
> > >
> > > I came across a package in the Guix repository which fails to build. The 
> > > package in question here is rust-brotli-sys-0.3. So the obvious question 
> > > comes up. How does this happen?
> > >
> > > I just ran =guix build rust-brotli-sys= with the following output:
> > >
> > > ...
> > >
> > > phase `reset-gzip-timestamps' succeeded after 0.0 seconds starting phase` 
> > > compress-documentation'
> > >
> > > phase `compress-documentation' succeeded after 0.0 seconds guix build: 
> > > error: derivation` 
> > > /gnu/store/kf8kwl7yn8jqpwc9p97bw8vs5g5bvas4-rust-brotli-sys-0.3.2.drv' 
> > > may not be deterministic: output 
> > > `/gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2' 
> > > differs
> > >
> > > Also this is my guix channel:
> > >
> > > guix:
> > >
> > > repository URL: https://git.savannah.gnu.org/git/guix.git
> > >
> > > branch: master
> > >
> > > commit: b95fb85f593d377864fc1bfb3c118e54d03783be
> > >
> > > I tried to run the build with the flag --check and multiple rounds, but 
> > > got the same result.
> > >
> > > So could it be caused by not running =./pre-inst-env guix build 
> > > --rounds=2 = when submitting the patch?
> >
> > You need to use. /pre-inst-env to test your patches, otherwise you'll only 
> > run your current guix. For an added package, it will be missing, for an 
> > updated package it will not build the newer version, etc.
> >
> > > Or when somebody updates some pkg that this pkg depends on and does not 
> > > run =./pre-inst-env guix --refresh --list-dependent= and then check the 
> > > dependent pkgs?
> >
> > It can also happen when only the current day is recorded in the output: if 
> > you use —rounds=2, it is likely run on the same day, so the output will be 
> > the same (don't bother though, last time I found such an issue it was in 
> > january because only the year was recorded ^^")
> >
> > You should now use -K to keep the different version and run diffoscope to 
> > analyze the differences. Then we should be able to fix the non determinism.
> >
> > > Could also sombody please share what kind of CI pipeline is there 
> > > implemented on applying the patch on the mainter's side?
> >
> > The maentainer is responsible for testing the patch (at a minimum that it 
> > builds), and sometimes we forget to check it's reproducible. The only 
> > automated thing is to check the patch is signed.
> >
> > > Thanks
> > >
> > > Petr
> > >
> > > PS: Yes, I do have more questions regading how Guix works lately. I tried 
> > > to search the mailing list but haven't found answers to them
>
> I'm not always great with diffoscope, but it turns out this one isn't
>
> too bad to read.
>
> (ins)efraim@3900XT ~ [env]$ diffoscope 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2-check
>
> --- /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2
>
> +++ /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2-check
>
> │ --- /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2/share
>
> ├── +++ 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2-check/share
>
> │ │ --- 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2/share/cargo
>
> │ ├── +++ 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2-check/share/cargo
>
> │ │ │ --- 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2/share/cargo/registry
>
> │ │ ├── +++ 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2-check/share/cargo/registry
>
> │ │ │ │ --- 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2/share/cargo/registry/brotli-sys-0.3.2.crate
>
> │ │ │ ├── +++ 
> /gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2-check/share/cargo/registry/brotli-sys-0.3.2.crate
>
> │ │ │ │ ├── brotli-sys-0.3.2.crate-content
>
> │ │ │ │ │ ├── file list
>
> │ │ │ │ │ │ @@ -1,8 +1,8

Non deterministic package

2021-08-04 Thread phodina via
Hi,

I came across a package in the Guix repository which fails to build. The 
package in question here is rust-brotli-sys-0.3. So the obvious question comes 
up. How does this happen?

I just ran =guix build rust-brotli-sys= with the following output:

...
phase `reset-gzip-timestamps' succeeded after 0.0 seconds
starting phase `compress-documentation'
phase `compress-documentation' succeeded after 0.0 seconds
guix build: error: derivation 
`/gnu/store/kf8kwl7yn8jqpwc9p97bw8vs5g5bvas4-rust-brotli-sys-0.3.2.drv' may not 
be deterministic: output 
`/gnu/store/yrrdr6rrc1s4b9lf7wz40c2gnv5kvxff-rust-brotli-sys-0.3.2' differs
Also this is my guix channel:

guix:
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: b95fb85f593d377864fc1bfb3c118e54d03783be

I tried to run the build with the flag --check and multiple rounds, but got the 
same result.
So could it be caused by not running =./pre-inst-env guix build --rounds=2 
= when submitting the patch?

Or when somebody updates some pkg that this pkg depends on and does not run 
=./pre-inst-env guix --refresh --list-dependent= and then check the dependent 
pkgs?

Could also sombody please share what kind of CI pipeline is there implemented 
on applying the patch on the mainter's side?

Thanks
Petr

PS: Yes, I do have more questions regading how Guix works lately. I tried to 
search the mailing list but haven't found answers to them

Circular dependency python-oslo.i18n

2021-08-04 Thread phodina
Greeting,
I have a question regarding circular dependency and a package that won't build.

I wanted to send a patch with updated version of pkg python-websocket-client. 
However, as I ran =./pre-inst-env guix refresh --list-dependent 
python-websocket-client= I noticed that one of the pkgs depending on this one 
failed to build.

The reason was that pkg python-oslo.i18n failed to build - pass check phase.

In the native-inputs it misses python-bandit, python-reno and python-oslo.i18n. 
However, then I get the issue with too many heap allocations.

Digging deeper, I see that python-oslo.config depends on python-oslo.i18n.

Any recommendation on how to solve this conundrum would be appreciated!

guix:
  repository URL: https://git.savannah.gnu.org/git/guix.git
  branch: master
  commit: b95fb85f593d377864fc1bfb3c118e54d03783be

Kind regards



Defining thunderbolt service

2021-08-03 Thread phodina via
Hello,
last month I submitted a patch to add support for thunderbolt devices [1]. The 
package, however, contains also a daemon that has to run.

So the after creating the package I focused on the services. I read the section 
of GuixSD documentation [2] as well as the contents of the =gnu/services= 
directory.

Below you can review the code for the thunderbolt service. The derivation is 
successful, but the service does not start. I'm kind of stuck on this and don't 
know how to finish the service at the moment.

In the documentation nor the manual for Shepherd [3] have I found a way to 
debug it.
I thought to run the Guile REPL and run =(use-modules (thunderbolt))= but then 
I didn't know what to to next.

For the packages I can run =guix build -L   -K -v3= and I'll 
get the debug output and also the build directory stays in case of failure.

I'm missing something similar for the services - the derivation as well as 
runtime. I'm familiar with the systemd, where by running =journalctl -u 
= I get the logs.
Is something similar available? Also do I have to build the service by running 
=guix system reconfigure os.scm=?

I'm able to get basic info from =herd status =. Though, it's hard to 
know the reason the service failed to run without logs.

Also I'm not that familiar with DBUS and Polkit. Any suggestions for 
integrating the configuration files from the package into service definition 
would be appreciated!

Kind regards
Petr

[1]: https://lists.gnu.org/archive/html/guix-patches/2021-07/msg01299.html
[2]: https://guix.gnu.org/manual/en/html_node/Services.html
[3]: https://www.gnu.org/software/shepherd/manual/shepherd.html

--

(

define-module

(

bolt

)

#

:use-module

(

gnu

services

)

#

:use-module

(

gnu

services

base

)

#

:use-module

(

gnu

services

shepherd

)

#

:use-module

(

expanse

packages

thunderbolt

)

#

:use-module

(

guix

gexp

)

#

:use-module

(

guix

modules

)

#

:use-module

(

guix

records

)

#

:use-module

(

ice-9

match

)

#

:export

(

bolt-configuration

bolt-configuration?

bolt-service-type

))

(

define-record-type*



bolt-configuration

make-bolt-configuration

bolt-configuration?

(

package

bolt-configuration-package

(

default

bolt

)))

(

define

bolt-shepherd-service

(

match-lambda

((

$



package

)

(

with-imported-modules

(

source-module-closure

'

((

gnu

build

shepherd

)))

(

shepherd-service

(

documentation

"Thunderbolt daemon"

)

(

provision

'

(

thunderbolt

))

(

requirement

'

(

networking

))

(

modules

'

((

gnu

build

shepherd

)))

(

start

#

~

(

make-forkexec-constructor/container

(

list

#

$

(

file-append

package

"/libexec/boltd"

))

))

(

stop

#

~

(

make-kill-destructor

)))

(

define

bolt-udev-rule

(

match-lambda

((

$



package

)

(

file->udev-rule

"90-bolt.rules"

(

file-append

package

"/lib/udev/rules.d/90-bolt.rules"

)

(

define

bolt-service-type

(

service-type

(

name

'boltd

)

(

description

"Thunderbolt daemon"

)

(

extensions

(

list

(

service-extension

udev-service-type

(

compose

list

bolt-udev-rule

))

(

service-extension

shepherd-root-service-type

(

compose

list

bolt-shepherd-service



(

default-value

(

bolt-configuration



Re: How to add custom channels to ISO

2021-08-03 Thread phodina
Thanks Elais. This is exactly what I need.

Also you're right regarding the ISO running out of space (memory) as I ran 
=guix pull= once before the store was setup and mounted on the target system.

Also pinning the channels is useful to get "identical" os installed across the 
machines.

This might be a neat code excerpt and note in the manual perhaps. Would you 
agree?

Of course, once the system is setup then there is =guix deploy=.




‐‐‐ Original Message ‐‐‐

On Friday, July 30th, 2021 at 6:15 PM, Elais Player  wrote:

> You could add the custom channels file as an
>
> =extra-special-file=1 in the =os-configuration=.
>
> It would look something like this:
>
> #+BEGIN_SRC scheme
>
> (define %my-installation-os
>
> (operating-system
>
> (inherit installation-os)
>
> (services
>
> (cons*
>
> (extra-special-file
>
> "/etc/guix/channels.scm"
>
> (local-file "/path/to/my/channels.scm"))
>
> (operating-system-services installation-os)
>
> #+END_SRC
>
> Plus side is you now have a global channels file from which all
>
> you need to do is run =guix pull= to have all your channels up to
>
> date. You may also want to pin those channels to certain commits
>
> just in case. Down side is running =guix pull= will start filling
>
> up your disk or memory on an ISO and you can easily run out of
>
> space. (I would advise not running =guix pull= until after
>
> partitioning and setting up the target system), and this file will
>
> be added to the store (but if you're creating a channels file in
>
> =/etc= shouldn't matter honestly).
>
> phodina via help-guix@gnu.org writes:
>
> > Hello,
> >
> > I'm migrating to a newer machine and I'm taking my GuixSD
> >
> > configuration with me.
> >
> > So the first logical step I did was to create an ISO image based
> >
> > on this section 1. As I use my custom channel with modified
> >
> > packages I added them to the configuration to make them
> >
> > available on the new machine.
> >
> > Or so I thought. I booted and partitioned the new machine then
> >
> > ran
> >
> > guix system init /root/configurations.scm /mnt to install Guix
> >
> > there.
> >
> > However, after reboot turns out that the packages are not from
> >
> > my channel but from public Guix repository without
> >
> > modifications.
> >
> > Therefore my question is if it's possible to specify also
> >
> > channels in the configuration file so that they are used during
> >
> > installation?
> >
> > Reading the manual I came to a nice command guix system describe
> >
> > 2 which gives me the current configuration with the
> >
> > channels. Could that be used to build an ISO which would then
> >
> > also know about the additional channels?
> >
> > Kind regards
> >
> > Petr



How to add custom channels to ISO

2021-07-28 Thread phodina via
Hello,

I'm migrating to a newer machine and I'm taking my GuixSD configuration with me.

So the first logical step I did was to create an ISO image based on this 
section [1]. As I use my custom channel with modified packages I added them to 
the configuration to make them available on the new machine.

Or so I thought. I booted and partitioned the new machine then ran
guix system init /root/configurations.scm /mnt to install Guix there.

However, after reboot turns out that the packages are not from my channel but 
from public Guix repository without modifications.

Therefore my question is if it's possible to specify also channels in the 
configuration file so that they are used during installation?

Reading the manual I came to a nice command guix system describe [2] which 
gives me the current configuration with the channels. Could that be used to 
build an ISO which would then also know about the additional channels?
Kind regards
Petr

[1]: 
https://guix.gnu.org/manual/en/html_node/Building-the-Installation-Image.html
[2]: https://guix.gnu.org/manual/en/guix.html#Invoking-guix-describe

Re: Packaging hwinfo

2021-07-25 Thread phodina
> Petr,
>
> > Besides I also opened an issue
>
> Thanks! A good reflex, whether or not upstream cares or notices.
>

Well my point here is that the issue concerning the project itself should be 
reported e.g. what are the instructions to build it by hand.
However, when comes to the packaging then it's obvious not a problem of the 
project itself and therefore I ask on this mailing list.

> Please share packages in a form that can easily be built by others. I
>
> added missing module imports and changed a forgotten /usr/lib to /lib.
>

Good point and my apologizes for that.

> Please also place {native-,}inputs after arguments. Phases need no
>
> longer return #t.
>

Thanks. Fixed.

> > CFLAGS+="-fPIC -I$srcdir/$pkgname/src/hd -w"
>
> This does not look relevant, so I didn't add it anywhere.
>
> > starting phase `build'
> >
> > gcc -c -O2 -Wall -Wno-pointer-sign -pipe -g
> >
> > -I/tmp/guix-build-hwinfo-21.75.drv-0/source/src/hd -Lsrc hwinfo.c
> >
> > make: *** No rule to make target
> >
> > '/tmp/guix-build-hwinfo-21.75.drv-0/source/src/libhd.a', needed by
> >
> > 'hwinfo'. Stop.
> >
> > The build continues
>
> And how:
>
> make: *** Waiting for unfinished jobs
>
> make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent
>
> make rule.
>
> make[1]: Entering directory
>
> '/tmp/guix-build-hwinfo-21.75.drv-0/source/src'
>
> make[2]: Entering directory
>
> '/tmp/guix-build-hwinfo-21.75.drv-0/source/src/hd'
>
> i.e.: "Oh no, you made some mistake, I can't make libhd! Anyway, before
>
> I perish dramatically, let's chdir into this here 'src/hd' directory and
>
> make whatever's there. ¯\( ツ )/¯ I'm sure it won't be relevant lol."
>
> That's one bug that only upstream can fix. For now, set
>
> "#:parallel-build? #f" (with a detailed comment!) and you'll be on your

Turning off the parallel build fixes the issue. But it's still a bug as the 
target src/libhd.a is "not relevant". I'll update the ticket on upstream with 
the findings. Thanks Tobias.

>
> merry, slow, way. Alas:
>
> > /gnu/store/74ldv6c74gslx5irsa0a8kn54yi4gc3h-hwinfo-21.75/bin/hwinfo:
> >
> > error: depends on 'libhd.so.21', which cannot be found in RUNPATH
>
> Weird, but (search for '-Wl,-rpath' in Guix) it happens. Let's--no,
>
> wait a minute, strange things are afoot:
>
> tree /gnu/store/74ldv6c74gslx5irsa0a8kn54yi4gc3h-hwinfo-21.75
>
> ├── bin
>
> │   ├── check_hd
>
> │   ├── convert_hd
>
> │   ├── getsysinfo
>
> │   ├── hwinfo
>
> │   └── mk_isdnhwdb
>
> ├── gnu
>
> │   └── store
>
> │   └── 74ldv6c74gslx5irsa0a8kn54yi4gc3h-hwinfo-21.75
>
> │   └── lib
>
> │   ├── libhd.so -> libhd.so.21
>
> [...]
>
> Afootness intensifies:
>
> > (string-append "DESTDIR=" %output)
>
> Seeing DESTDIR= is never a good sign (I didn't check whether its use in
>
> libx86emu is warranted or not). Let's stick with hwinfo & peer into its

Nope, but then again let's create a ticket upstream with the fix.

>
> Makefile again:
>
> > ULIBDIR = $(LIBDIR)
> >
> > [...]
> >
> > install -d -m 755 $(DESTDIR)/sbin $(DESTDIR)/usr/sbin \
> >
> > $(DESTDIR)$(ULIBDIR)
>
> Really? No support for the standard $prefix variable? Cool.
>
> Making LIBDIR 'relative' works around that. Not the rpath issue, so:
>
> > "LIBDIR=/lib"
> >
> > (string-append "LDFLAGS=-Lsrc -Wl,-rpath=" %output "/lib")
>
> The "-Lsrc" is repeated from upstream, because VARIABLE+= on the make
>
> command line doesn't actually work.
>
> With that, it finally builds and runs. Some software just isn't fun to
>
> package.

It's a tedious process that often overlooked in distros where all stuff is 
already packaged.

>
> From hwinfo:
>
> > using /var/lib/hardware
>
> This might need fixing. There may be remaining issues with the
>
> package(s); I'm out of time.
>

Thanks for your time! I made the modification and now it builds. Time to 
prepare the patches.

> From the build log:
>
> > info(FRITZ!Card PCMCIA): This card has multiple drivers, some functions
> >
> > are only available on the binonly driver
>
> We'll need to make sure this package doesn't include or 'promote' binary
>
> blobs in any way.
>

What do you mean by striping binary blobs?
Don't know exactly how to spot them yet :-)



Re: How to enable Chromium DNS over HTTPS

2021-07-25 Thread phodina
> Hello! I have to fight for my freedom with Russian government that having no 
> idea how to spoil the ilfe except blocking various of web-sites doing it very 
> quickly.
>
> And I have to use VPN for visit protonmail, safe-mail .net, tutanota and even 
> prnt .sc.
>
> I bypass blocking very well in IceCat I do not know why. I only have there 
> 'DNS over HTTPS".
>
> But in Ungogled-Chromium there are troubles even using VPN.
>
> Ungogled-Chromium does not download SSL-certificates when I visit protonmail 
> (because of blocking on provider).
>
> I dug and I think dns over https will solve my problem, but under Guix this 
> flag could not be enabled:
>
> chrome://flags/#dns-over-https
>
> Secure DNS lookups
>
> Enables DNS over HTTPS. When this feature is enabled, your browser may try to 
> use a secure HTTPS
>
> connection to look up the addresses of websites and other web resources. Mac, 
> Windows, Chrome OS,
>
> Android
>
> #dns-over-https
>
> Not available on your platform.
>
> It is not available on my platform. What shoud I do? What do I need to 
> install for it?

Hi,
I use [1] dnscrypt-proxy which is a daemon listening on localhost port 53 and 
encrypting all DNS queries in HTTPS.

FIY there is also DoT (DNS over TLS) which also encrypts the DNS queries though 
directly using TLS not within an HTTPS protocol.

Both solutions have their pros and cons. Duckduckgo is your friend.

Hope it helps,
Petr

1: https://github.com/DNSCrypt/dnscrypt-proxy



Re: File not found during package build

2021-07-25 Thread phodina
Thanks Sarah.

Sure, I'll stick with the standard way to run the check phase.



Help: No matching package

2021-07-25 Thread phodina
Greetings,
I want to package a Rust crate `calculate` available on Gitlab. So I created 
the package description and defined also another one `decimal`.

Package `rust-decimal` build correctly.
However, when I want to build `calculate` package it complains that the crate 
is not available.

starting phase `build'
error: no matching package named `decimal` found

As the crate is not available on crates.io I had to substitute the dependency 
in Cargo.toml.

The crate is listed in #:cargo-inputs. I'm wondering about what I'm doing wrong?

Source code is listed below.

Kind regards
Petr

---
(define-public rust-calculate-0.7
  (package
(name "rust-calculate")
(version "9f975c504bf6d1a2bcf44992866233f49afaeb29")
(source
  (origin
(method git-fetch)
(uri (git-reference
  (url "https://gitlab.redox-os.org/redox-os/calc";)
  (commit version)))
(file-name (git-file-name name version))
(sha256
  (base32
"0vmpn2j38h2hh0rhmvbq6yhpw4ibym5370p6142ch470fbqs4jf1"
(build-system cargo-build-system)
(arguments
  `(#:cargo-inputs
(("rust-atty" ,rust-atty-0.2)
 ("rust-clap" ,rust-clap-2)
 ("rust-decimal" ,rust-decimal-2)
 ("rust-liner" ,rust-liner-0.5)
 ("rust-num" ,rust-num-0.3)
 ("rust-rand" ,rust-rand-0.7))
#:phases
 (modify-phases %standard-phases
(add-after 'unpack 'fix-decimal-dependency
   (lambda _
 (substitute* "Cargo.toml"
 (("^decimal.*") "decimal = 
\"*\"\n")))
   
(home-page
  "https://gitlab.redox-os.org/redox-os/calc";)
(synopsis
  "Rust library for parsing and processing arithmetic expressions")
(description
  "calc is a Rust library for tokenizing and evaluating arithmetic 
expressions with a command line application of the same name included.
")
(license license:expat))) ; MIT

(define-public rust-decimal-2
  (package
(name "rust-decimal")
(version "2.1.0")
(source
  (origin
(method git-fetch)
(uri (git-reference
  (url "https://github.com/alkis/decimal";)
  (commit version)))
(file-name (git-file-name name version))
(sha256
  (base32
"1g6f7vqri5cqlca9a6vcdqgymvkxsff1061cdcfia30s552876dk"
(build-system cargo-build-system)
(arguments
  `(#:cargo-inputs
 (("rust-bitflags" ,rust-bitflags-1)
  ("rust-libc" ,rust-libc-0.2)
  ("rust-ord-subset" ,rust-ord-subset-3)
  ("rust-rustc-serialize" ,rust-rustc-serialize-0.3)
  ("rust-serde" ,rust-serde-1)
  ("rust-serde-json" ,rust-serde-json-1
(home-page
  "https://github.com/alkis/decimal";)
(synopsis
  "Decimal Floating Point arithmetic for rust")
(description
  "The library provides d128 which is a 128-bit decimal floating point 
number. You can use it as other primitive numbers in Rust. All operators are 
overloaded to allow ergonomic use of this type.")
(license license:asl2.0)))



File not found during package build

2021-07-24 Thread phodina
Hi All,

during package build in the phase `check` I get a strange error regarding file 
not found.

The file in question is an executable script within the directory.

It must be present there as the chmod operation succeeds.
However, invocation of make then fails as it can't find the script.

phase `build' succeeded after 0.1 seconds
starting phase `check'
make: Entering directory '/tmp/guix-build-novaboot-20210126a.drv-0/source/tests'
./wvtool runall ./novaboot.wv ./parser.wv ./expect.wv ./server.wv ./uboot.wv
make: ./wvtool: No such file or directory
make: *** [Makefile:6: all] Error 127

---
(define-public novaboot
(package
  (name "novaboot")
  (version "20210126a")
  (source (origin
(method git-fetch)
(uri
  (git-reference
(url "https://github.com/wentasah/novaboot";)
(commit version)))
(sha256
 (base32
  "1xwgxpngjp345fg4xmacyxm21wqvx4h6n6b51wnvivvzjj9vga4z"
  (build-system gnu-build-system)
  (inputs `(("perl" ,perl) ("perl-expect" ,perl-expect)))
  (arguments
'(#:phases (modify-phases %standard-phases
(delete 'configure)
 (add-before 'build 'set-prefix-in-makefile
(lambda* (#:key outputs #:allow-other-keys)
 (let ((out (assoc-ref outputs "out")))
(substitute* "Makefile"
  (("PREFIX=.*")
   (string-append "PREFIX="
   "\n")))
(substitute* "Makefile"
 (("DESTDIR=.*")
  (string-append "DESTDIR=" out "\n"
  ))
 (replace 'check
 (lambda* (#:key outputs #:allow-other-keys)
  (chdir "tests")
 (chmod "wvtool" #o555)
 (invoke "make"))
  (synopsis "A tool that automates booting of operating systems on target 
hardware or in qemu")
  (description "Novaboot is a tool that automates booting of operating systems 
on target hardware (typically embedded boards) or in Qemu. Initially, it was 
developed to boot NOVA Microhypervisor (hence the name), but nowadays is well 
suited for booting Linux (and perhaps other OSes) too.")
  (home-page "https://github.com/wentasah/novaboot";)
  (license license:gpl2)))



Re: Packaging hwinfo

2021-07-24 Thread phodina
> Hi phodina,
>
> Do you come across this issue also while compiling by hand, rather than
>
> via the Guix daemon?
>
> Here [1], you can see the same problem tackled by Gentoo community. It
>
> was 2005 and related to another package, rather than directly hwinfo,
>
> but maybe it would be worth taking a look at the current hwinfo Gentoo
>
> recipe [2]. At some point, it says
>
> Workaround from Arch, if using source tarballs from github
> ==
>
> Here’s [3] how Arch folks do it. There’s this line
>
> CFLAGS+="-fPIC -I$srcdir/$pkgname/src/hd -w" \
>
> Could it be related to libhd?
>
> Good luck,
>
> WŻ
>
> [1]: https://bugs.gentoo.org/show_bug.cgi?id=60848#c3
>
> [2]: 
> https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-apps/hwinfo/hwinfo-21.74.ebuild
>
> [3]: 
> https://github.com/archlinux/svntogit-community/blob/packages/hwinfo/trunk/PKGBUILD

Hello Wiktor,

Yes, this is due to the libhd. I probably didn't hightlight it in the 
description.

As you suggested I already had look at Arch (previous user).

I built it successfully on Arch using the PKGBUILD.
They pass the include flag with the dir -I . Without it points to 
$(TOPDIR)/src/libhd hence the substitution of as otherwise it expands into 
-I../../src/hd

I applied this flag but the build is still failing. Besides I also opened an 
issue on [1] though nobody probably even noticed :-(

 [1]: https://github.com/openSUSE/hwinfo/issues/103



Packaging hwinfo

2021-07-24 Thread phodina
Dear All,

I'm attempting to package hwinfo which gathers HW information about the machine.
You'll find the package definition attached below together with the definition 
for libx86emu.

The issue I'm currently facing is that the libhd which is inside the repo is 
not detected by Makefile:

starting phase `build'
gcc -c -O2 -Wall -Wno-pointer-sign -pipe -g   
-I/tmp/guix-build-hwinfo-21.75.drv-0/source/src/hd  -Lsrc hwinfo.c
make: *** No rule to make target 
'/tmp/guix-build-hwinfo-21.75.drv-0/source/src/libhd.a', needed by 'hwinfo'.  
Stop.

The build continues but obviously fails when linking the final binary together. 
Does anybody have an idea how to tell make where to find the target?

Kind regards
Petr

---
(define-public libx86emu
(package
  (name "libx86emu")
  (version "3.1")
  (source (origin
(method git-fetch)
(uri
  (git-reference
(url "https://github.com/wfeldt/libx86emu";)
(commit version)))
(file-name (git-file-name name version))
(sha256
 (base32
  "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b"
  (build-system gnu-build-system)
  (native-inputs `(("git" ,git) ("perl" ,perl)))
  (arguments
`(#:tests? #f
  #:make-flags (list (string-append "CC=" ,(cc-for-target)) (string-append 
"DESTDIR=" %output) (string-append "LIBDIR=/lib"))
  #:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'fix-version-and-usr
 (lambda* (#:key inputs #:allow-other-keys)
  (delete-file "git2log")
  (let* ((file (open-file "VERSION" "a")))
(display ,version file)
(close-port file))
  (substitute* "Makefile"
   (("/usr") "/"))
   #t)
  (synopsis "x86 emulation library")
  (description "libx86emu is a small library to emulate x86 instructions. The 
focus here is not a complete emulation (go for qemu for this) but to cover 
enough for typical firmware blobs.
@enumerate
@item intercept any memory access or directly map real memory ranges
@item intercept any i/o access, map real i/o ports, or block any real i/o
@item intercept any interrupt
@item provides hook to run after each instruction
@item recognizes a special x86 instruction that can trigger logging
@item has integrated logging
@end enumerate")
  (home-page "https://github.com/wfeldt/libx86emu";)
  (license license:bsd-1)))

(define-public hwinfo
(package
  (name "hwinfo")
  (version "21.75")
  (source (origin
(method git-fetch)
(uri
  (git-reference
(url "https://github.com/openSUSE/hwinfo";)
(commit version)))
(file-name (git-file-name name version))
(sha256
 (base32
  "139bgzwi8iy1dz0g8mqpq9iig8klsmnb5c2sp0v7qgbgh7xxnqn3"
  (build-system gnu-build-system)
  (native-inputs `(("flex" ,flex) ("perl" ,perl) ("pkg-config" ,pkg-config)))
  (inputs `(("libx86emu" ,libx86emu) ("util-linux:lib" ,util-linux "lib")))
  (arguments
`(#:tests? #f
  #:make-flags (list (string-append "DESTDIR=" %output) (string-append 
"CC=" ,(cc-for-target)) (string-append "HWINFO_VERSION=" ,version) 
(string-append "LIBDIR=" (assoc-ref %outputs "out") "/usr/lib"))
  #:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'fix-sbin-and-flex
 (lambda* (#:key inputs #:allow-other-keys)
  (delete-file "git2log")
  (let* ((file (open-file "VERSION" "a")))
(display ,version file)
(close-port file))
  (substitute* "Makefile.common"
   (("-I$(TOPDIR)/src/hd") (string-append (assoc-ref 
build-inputs "source") "/src/hd")))
  (substitute* "Makefile"
   (("/sbin") "/bin")
   (("^TARGETS.*") "TARGETS = hwinfo hwinfo.pc\n")
   (("/usr") "/"))
  (substitute* "src/isdn/cdb/Makefile"
   (("lex isdn_cdb.lex") "flex isdn_cdb.lex"))
  (substitute* "hwinfo.pc.in"
   (("prefix=/usr") (string-append "prefix=" %output)))
   #t)
  (synopsis "Hardware information tool")
  (description "hwinfo/libhd are used to probe for the hardware present in the 
system. It can be used to generate a system overview log which can be later 
used for support.")
  (home-page "https://github.com/openSUSE/hwinfo";)
  (license license:gpl2)))




Re: Multiple sources

2021-07-22 Thread phodina
> Maybe you can use the first repo as the source, and use the second as
>
> an input, then have a phase to copy the files in place?
>
> You can do something like this in the inputs:
>
> (inputs
>
> `(("second-repo" ,(origin
>
> (method url-fetch)
>
> (uri ...)
>
> ...
>
> and in a phase you could do something like
>
> (with-directory-excursion "some-place"
>
> (invoke "tar" "xf" (assoc-ref inputs "second-repo")))
>
> (or copy if it's not a tar)
>
> HTH!

Thanks Julien!

This is a good way to save myself from full package definition. I now see that 
other packages define multiple sources in similar way as now I know what to 
look for.

Though my original question was more about the way the other package managers 
define sources e.g. PKGBUILD. There the sources are in one "list".
But in the end both definitions are equivalent and they alsoprovide the sums 
(if not skipped ;-)

source=(https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz
$pkgname.desktop

"git+https://gitlab.com/${pkgname}-community/browser/common.git#tag=${_common_tag}";

"git+https://gitlab.com/${pkgname}-community/settings.git#tag=${_settings_tag}";)
source_aarch64=("${pkgver}-${pkgrel}_build-arm-libopus.patch::https://raw.githubusercontent.com/archlinuxarm/PKGBUILDs/master/extra/firefox/build-arm-libopus.patch";)
sha256sums=('43a943e7d7660c6d7f5b41c95b344b7fd6a4a88ad0bb45dbd844b372ea60d58b'
'0b28ba4cc2538b7756cb38945230af52e8c4659b2006262da6f3352345a8bed2'
'SKIP'
'SKIP')
sha256sums_aarch64=('2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9')




Multiple sources

2021-07-22 Thread phodina via
Dear all,
is there a way to specify multiple sources for building a package? Or do I have 
to create for each source a package (use copy-build-system) and then use it as 
a input for the final package with custom phases?

Let me give you an example. I have a git repo with source code to build and 
then another with some scripts to run and modify the first one. Also the second 
repo is not applicable as set of patches and it can't be merged into the first 
one.

Kind regards
Petr

  1   2   >