Re: Install python pacakge from `.whl` file

2021-07-10 Thread Hamzeh Nasajpour
Ok, I updated the package definition as follow:

```
(define-public python-etebase
  (package
(name "python-etebase")
(version "0.31.2")
(source (origin
 (method url-fetch)
 (uri (string-append 
"https://github.com/etesync/etebase-py/releases/download/v0.31.2/etebase-; 
version "-cp38-cp38-manylinux2010_x86_64.whl"))
 (sha256
  (base32
   "09vw2922bfb0b8s2k0hs7skcrplwxkn4vfl9bcla6hbr92paigd7"
(build-system trivial-build-system)
(arguments
 `(#:modules ((guix build utils))
   #:builder (begin
   (use-modules (guix build utils)
(srfi srfi-26))
   (let* ((source (assoc-ref %build-inputs "source"))
  (bash   (assoc-ref %build-inputs "bash"))
  (coreutils  (assoc-ref %build-inputs "coreutils"))
  (python (assoc-ref %build-inputs "python")))
 (setenv "PATH" (string-append 
  (string-append bash   "/bin:")
  (string-append coreutils  "/bin:")
  (string-append python "/bin:")))
 (invoke "python3" "-m" "pip" "install"  source
  (string-append "--prefix=" %output) 
  "--no-deps"
  (string-append "--cache-dir=" %output))
 #t
  (native-inputs `(("coreutils" ,coreutils)
("python" ,python-3)
("python-msgpack", python-msgpack)))
(inputs `(("bash" ,bash)))
(home-page "https://www.etesync.com/;)
(synopsis "A Python library for Etebase")
(description
 "This package is implemented in Rust and exposes a Python API for people 
to use.")
(license license:expat)))
```

And currently I face with this error:

```
...
building 
/gnu/store/05bf6g974sjfl5kg2xkcs6ciiv4l9y67-python-etebase-0.31.2.drv...
Processing 
/gnu/store/g12ckz8jmmzmxf8bsjqxb2zksghf0x31-etebase-0.31.2-cp38-cp38-manylinux2010_x86_64.whl
Installing collected packages: g12ckz8jmmzmxf8bsjqxb2zksghf0x31
ERROR: Exception:
Traceback (most recent call last):
  File 
"/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/cli/base_command.py",
 line 188, in main
status = self.run(options, args)
  File 
"/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/commands/install.py",
 line 398, in run
installed = install_given_reqs(
  File 
"/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/req/__init__.py",
 line 54, in install_given_reqs
requirement.install(
  File 
"/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/req/req_install.py",
 line 925, in install
self.move_wheel_files(
  File 
"/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/req/req_install.py",
 line 453, in move_wheel_files
wheel.move_wheel_files(
  File 
"/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/site-packages/pip/_internal/wheel.py",
 line 434, in move_wheel_files
assert info_dir, "%s .dist-info directory not found" % req
AssertionError: g12ckz8jmmzmxf8bsjqxb2zksghf0x31==etebase .dist-info directory 
not found
Backtrace:
   3 (primitive-load "/gnu/store/vvgbg88axkan45hc0ahvska8y37?")
In ice-9/eval.scm:
   191:35  2 (_ _)
619:8  1 (_ #(#(#(#(# ?) ?) ?) ?))
In guix/build/utils.scm:
654:6  0 (invoke _ . _)

guix/build/utils.scm:654:6: In procedure invoke:
ERROR:
  1. :
  program: "python3"
  arguments: ("-m" "pip" "install" 
"/gnu/store/g12ckz8jmmzmxf8bsjqxb2zksghf0x31-etebase-0.31.2-cp38-cp38-manylinux2010_x86_64.whl"
 "--prefix=/gnu/store/m5a2yq2pdn6xkbmz7v9s18p0qwnrnqf8-python-etebase-0.31.2" 
"--no-deps" 
"--cache-dir=/gnu/store/m5a2yq2pdn6xkbmz7v9s18p0qwnrnqf8-python-etebase-0.31.2")
  exit-status: 2
  term-signal: #f
  stop-signal: #f
```




Install python pacakge from `.whl` file

2021-07-10 Thread Hamzeh Nasajpour
Hi,

I have to package a python library via `whl` file, is it feasible? 
I took a look in the guix packages, and found something in `tensorflow` package 
to installing from `whl` file,
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/machine-learning.scm#n1784

but I get these errors when I want to install my package. I'm using the 
following lines in my package definition too:
```
...
 (invoke "python3" "-m" "pip" "install" source
   (string-append "--prefix=" %output))
...
```

Error:
```
WARNING: The directory '/homeless-shelter/.cache/pip/http' or its parent 
directory is not owned by the current user and the cache has been disabled. 
Please check the permissions and owner of that directory. If executing pip with 
sudo, you may want sudo's -H flag.
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory 
is not owned by the current user and caching wheels has been disabled. check 
the permissions and owner of that directory. If executing pip with sudo, you 
may want sudo's -H flag.
Processing 
/gnu/store/pbv52yan4xnwbi426qywcfkls681k3lg-etebase-0.31.2-cp38-cp38-manylinux2010_x86_64.whl
Collecting msgpack>=1.0.0 (from pbv52yan4xnwbi426qywcfkls681k3lg==etebase)
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError(': Failed to establish a new connection: [Errno -2] 
Name or service not known')': /simple/msgpack/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError(': Failed to establish a new connection: [Errno -2] 
Name or service not known')': /simple/msgpack/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError(': Failed to establish a new connection: [Errno -2] 
Name or service not known')': /simple/msgpack/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError(': Failed to establish a new connection: [Errno -2] 
Name or service not known')': /simple/msgpack/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError(': Failed to establish a new connection: [Errno -2] 
Name or service not known')': /simple/msgpack/
  ERROR: Could not find a version that satisfies the requirement msgpack>=1.0.0 
(from pbv52yan4xnwbi426qywcfkls681k3lg==etebase) (from versions: none)
ERROR: No matching distribution found for msgpack>=1.0.0 (from 
pbv52yan4xnwbi426qywcfkls681k3lg==etebase)
Backtrace:
   3 (primitive-load "/gnu/store/0ab4p5n88lzdlgq6jwb5qi9nw52?")
In ice-9/eval.scm:
   191:35  2 (_ #f)
619:8  1 (_ #(#(#(#(#(#(#(# ?) ?) ?) ?) ?) ?) ?))
In guix/build/utils.scm:
654:6  0 (invoke _ . _)

guix/build/utils.scm:654:6: In procedure invoke:
ERROR:
  1. :
  program: "python3"
  arguments: ("-m" "pip" "install" 
"/gnu/store/pbv52yan4xnwbi426qywcfkls681k3lg-etebase-0.31.2-cp38-cp38-manylinux2010_x86_64.whl"
 "--prefix=/gnu/store/18vg8h9yh2a3f6vlqn2kcxhbrfzrchns-python-etebase-0.31.2")
  exit-status: 1
  term-signal: #f
  stop-signal: #f

--

Hamzeh Nasajpour
PantherX Team



Re: XDG_... env variables in root

2021-07-08 Thread Hamzeh Nasajpour
Hi,

https://unix.stackexchange.com/questions/7013/why-do-we-use-su-and-not-just-su/7021#7021

>su - invokes a login shell after switching the user. A login shell resets most 
>environment variables, providing a clean base.

>su just switches the user, providing a normal shell with an environment nearly 
>the same as with the old user.


Seems that this is relevant to way of switching user which I used. I was using 
`su` for switching as `root` and just now I found that there are some 
differences between `su` and `su -`. With using of `su -` the `XDG_...` env 
paths are correct:

```
$ su -
$ printenv | grep XDG_
XDG_CONFIG_DIRS=/run/current-system/profile/etc/xdg:/root/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg
XDG_DATA_DIRS=/run/current-system/profile/share:/root/.guix-profile/share:/run/current-system/profile/share
```

Anyway I didn't know there are differences between `su` and `su -`. 

Regards,
Hamzeh



Re: XDG_... env variables in root

2021-07-07 Thread Hamzeh Nasajpour
Hi Gio,

> please can you show us only the relevant parts [1] of your bash profile
> (or other shell profile) for "user" and "root"?

This is my `/etc/profile` content:

```
# Crucial variables that could be missing in the profiles' 'etc/profile'
# because they would require combining both profiles.
# FIXME: See .
export 
MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man
export 
INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info
export XDG_DATA_DIRS=$HOME/.guix-profile/share:/run/current-system/profile/share
export 
XDG_CONFIG_DIRS=$HOME/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg

# Make sure libXcursor finds cursors installed into user or system profiles.  
See 
export 
XCURSOR_PATH=$HOME/.icons:$HOME/.guix-profile/share/icons:/run/current-system/profile/share/icons

# Ignore the default value of 'PATH'.
unset PATH

# Load the system profile's settings.
GUIX_PROFILE=/run/current-system/profile ; \
. /run/current-system/profile/etc/profile

# Since 'lshd' does not use pam_env, /etc/environment must be explicitly
# loaded when someone logs in via SSH.  See .
# We need 'PATH' to be defined here, for 'cat' and 'cut'.  Do this before
# reading the user's 'etc/profile' to allow variables to be overridden.
if [ -f /etc/environment -a -n "$SSH_CLIENT" \
 -a -z "$LINUX_MODULE_DIRECTORY" ]
then
  . /etc/environment
  export `cat /etc/environment | cut -d= -f1`
fi

# Arrange so that ~/.config/guix/current comes first.
for profile in "$HOME/.guix-profile" "$HOME/.config/guix/current"
do
  if [ -f "$profile/etc/profile" ]
  then
# Load the user profile's settings.
GUIX_PROFILE="$profile" ; \
. "$profile/etc/profile"
  else
# At least define this one so that basic things just work
# when the user installs their first package.
export PATH="$profile/bin:$PATH"
  fi
done

# Prepend setuid programs.
export PATH=/run/setuid-programs:$PATH

# Arrange so that ~/.config/guix/current/share/info comes first.
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"

# Set the umask, notably for users logging in via 'lsh'.
# See .
umask 022

# Allow Hunspell-based applications (IceCat, LibreOffice, etc.) to
# find dictionaries.
export 
DICPATH="$HOME/.guix-profile/share/hunspell:/run/current-system/profile/share/hunspell"

# Allow GStreamer-based applications to find plugins.
export GST_PLUGIN_PATH="$HOME/.guix-profile/lib/gstreamer-1.0"

if [ -n "$BASH_VERSION" -a -f /etc/bashrc ]
then
  # Load Bash-specific initialization code.
  . /etc/bashrc
fi

```



Re: XDG_... env variables in root

2021-07-07 Thread Hamzeh Nasajpour
Hi Ricardo,

Thanks for your reply.


> These are doubled because something must be adding them more than 
> once.  The generated etc/profile files generally augment existing 
> environment variables; they don’t replace them.

Yes, exactly, They are doubled, but another issue is these are env variables in 
`root`. My main issue is why these variables in `root` point to `USER` paths?

-- 

Hamzeh Nasajpour
PantherX Team



XDG_... env variables in root

2021-07-06 Thread Hamzeh Nasajpour
Hi,

I've a weird issue with all `XDG_..` env paths in the `root`. These are 
`XDG_...` env paths in `user` and `root`, exactly are same:

```
XDG_CONFIG_DIRS=/home/hamzeh/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg:/home/hamzeh/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_MENU_PREFIX=lxqt-
XDG_DATA_HOME=/home/hamzeh/.local/share
XDG_CONFIG_HOME=/home/hamzeh/.config
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=LXQt
XDG_SESSION_TYPE=x11
XDG_CURRENT_DESKTOP=LXQt
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CACHE_HOME=/home/hamzeh/.cache
XDG_SESSION_CLASS=user
XDG_DESKTOP_PORTAL_DIR=/home/hamzeh/.guix-profile/share/xdg-desktop-portal/portals
XDG_VTNR=7
XDG_SESSION_ID=c2
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/home/hamzeh/.guix-profile/share:/run/current-system/profile/share:/home/hamzeh/.guix-profile/share:/run/current-system/profile/share:/home/hamzeh/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share
p
```

Do you have any idea? Where and how can I fix them for `root`?

Regards,



hash guix after guix pull

2021-06-16 Thread Hamzeh Nasajpour
Hi,

I want to use a custom application for running `guix pull` and `reconfigure` 
after each OS start up.
I developed a python library and put it in the configuration to run it as a 
single-shot service as root.
It will be run but seems that I should update `PATH` env via `hash guix` since 
some of my packages in my custom channel won't be loaded.

```
...
no code for module (px package ...)
--

If I run my python library manually everything works fine (guix pull & 
reconfigure) but I can't run it as a service.

Do you have any idea? Is there anything in somewhere that I missed?

Regards,
Hamzeh Nasajpour
PantherX Team



Package building with gcc-10

2020-11-16 Thread Hamzeh Nasajpour
Hi guys.
I have a cpp Application that should be build with `gcc-toolchain-10.2.0`. I 
could build it in local. But seems that in package building the 
`cmake-build-system` is using the `gcc-7.5.0`. How can I set a specific version 
of gcc for building my package definition? 


```
...
/tmp/guix-build-my-cpp-app-0.1.1.drv-0/my-cpp-app/src/GUI/FileDownloader.h:27:10:
 fatal error: filesystem: No such file or directory
 #include 
  ^~~~
compilation terminated.
make[2]: *** [CMakeFiles/my-cpp-app.dir/build.make:121: 
CMakeFiles/my-cpp-app.dir/src/GUI/ContentList.cpp.o] Error 1
make[2]: Leaving directory '/tmp/guix-build-my-cpp-app-0.1.1.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:208: CMakeFiles/my-cpp-app.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs
[ 69%] Linking CXX executable test_DataAccessLayer
/gnu/store/89rj5fqcg48afgk99639ds602pgf92k4-cmake-minimal-3.16.5/bin/cmake -E 
cmake_link_script CMakeFiles/test_DataAccessLayer.dir/link.txt --verbose=1
/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin/c++   -Wall -O2 -g 
-DNDEBUG  -rdynamic 
CMakeFiles/test_DataAccessLayer.dir/test_DataAccessLayer_autogen/mocs_compilation.cpp.o
 CMakeFiles/test_DataAccessLayer.dir/tests/TestDataAccessLayer.cpp.o  -o 
test_DataAccessLayer  
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Test.so.5.14.2
 lib_my-cpp-app.a 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Widgets.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Gui.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Network.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Sql.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5DBus.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Core.so.5.14.2
 -lrec 
[ 70%] Linking CXX executable test_AsyncTaskRunner
/gnu/store/89rj5fqcg48afgk99639ds602pgf92k4-cmake-minimal-3.16.5/bin/cmake -E 
cmake_link_script CMakeFiles/test_AsyncTaskRunner.dir/link.txt --verbose=1
/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin/c++   -Wall -O2 -g 
-DNDEBUG  -rdynamic 
CMakeFiles/test_AsyncTaskRunner.dir/test_AsyncTaskRunner_autogen/mocs_compilation.cpp.o
 CMakeFiles/test_AsyncTaskRunner.dir/tests/TestAsyncTaskRunner.cpp.o  -o 
test_AsyncTaskRunner  
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Test.so.5.14.2
 lib_my-cpp-app.a 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Widgets.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Gui.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Network.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Sql.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5DBus.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Core.so.5.14.2
 -lrec 
[ 72%] Linking CXX executable test_RecDB
/gnu/store/89rj5fqcg48afgk99639ds602pgf92k4-cmake-minimal-3.16.5/bin/cmake -E 
cmake_link_script CMakeFiles/test_RecDB.dir/link.txt --verbose=1
/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin/c++   -Wall -O2 -g 
-DNDEBUG  -rdynamic 
CMakeFiles/test_RecDB.dir/test_RecDB_autogen/mocs_compilation.cpp.o 
CMakeFiles/test_RecDB.dir/tests/TestRecDB.cpp.o  -o test_RecDB  
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Test.so.5.14.2
 lib_my-cpp-app.a 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Widgets.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Gui.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Network.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Sql.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5DBus.so.5.14.2
 
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Core.so.5.14.2
 -lrec 
make[2]: Leaving directory '/tmp/guix-build-my-cpp-app-0.1.1.drv-0/build'
[ 72%] Built target test_DataAccessLayer
make[2]: Leaving directory '/tmp/guix-build-my-cpp-app-0.1.1.drv-0/build'
[ 72%] Built target test_AsyncTaskRunner
make[2]: Leaving directory '/tmp/guix-build-my-cpp-app-0.1.1.drv-0/build'
[ 72%] Built target test_RecDB
[ 74%] Linking CXX executable test_PackageManager
/gnu/store/89rj5fqcg48afgk99639ds602pgf92k4-cmake-minimal-3.16.5/bin/cmake -E 
cmake_link_script CMakeFiles/test_PackageManager.dir/link.txt --verbose=1
/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin/c++   -Wall -O2 -g 
-DNDEBUG  -rdynamic 
CMakeFiles/test_PackageManager.dir/test_PackageManager_autogen/mocs_compilation.cpp.o
 CMakeFiles/test_PackageManager.dir/tests/TestPackageManager.cpp.o  -o 
test_PackageManager  
/gnu/store/59dq1n4wj3maa3kcar6hspj2zd82as7q-qtbase-5.14.2/lib/libQt5Test.so.5.14.2
 lib_my-cpp-app.a 

Re: Error in package building : error[E0463]: can't find crate for `openssl_src`

2020-11-08 Thread Hamzeh Nasajpour
Hi guys,

Anybody has any solution?  For now I face with this error in package 
installation:
```
...
   Compiling etebase-python v0.30.0 
(/tmp/guix-build-python-etebase-py-0.30.0.drv-0/etebase-0.30.0)
error: unterminated double quote string
  --> src/lib.rs:63:44
   |
63 | include!(concat!(env!("OUT_DIR"), "/glue.rs"));
   |^

error: aborting due to previous error

error: could not compile `etebase-python`.
```

This error is related to this line: 
https://github.com/etesync/etebase-py/blob/master/src/lib.rs#L62

Quick review: 
1. I want to package `etebase-py`.
2. the build system for etebase-py tries to also build etebase-rs. 
3. It's using the `setuptools-rust` for installing the rust dependencies.
4. So I packaged `etebase-py` with `cargo` build system, then I can patch the 
build system to installing the python files. In this step I faced with the 
above errors.

This is my package definition:
```
(define-public python-etebase-py
  (package
(name "python-etebase-py")
(version "0.30.0")
(source
  (origin
(method url-fetch)
(uri (pypi-uri "etebase" version))
(sha256
  (base32
"1py635aqnxx3jy4x6zffriqi0l9gc2gk06h0ms91k4rs68h0gb0i"))
(modules '((guix build utils)))
(snippet
 '(begin
(substitute* "Cargo.toml"
  (("etebase = " all) "etebase = \"^0.1.0\" #"))
(substitute* "Cargo.toml"
  (("flapigen = " all) "flapigen = \"^0.6.0-pre7\" #"))
(substitute* "Cargo.toml"
  (("0.10.30.*") "0.10.30\" }\n"))
(substitute* "src/lib.rs"
  (("mod fixes*") "#![feature(inner_deref)]\" \nmod fixes {"))
  #t
(build-system cargo-build-system)
(arguments
  `(#:tests? #f
#:cargo-inputs
(("rust-openssl" ,rust-openssl-0.10.30)
 ("rust-cpython" ,rust-cpython-0.3)
 ("rust-log" ,rust-log-0.4)
 ("rust-etebase-rs" ,rust-etebase-rs)
 ("rust-flapigen" ,rust-flapigen-0.6)
 ("rust-env-logger" ,rust-env-logger-0.7))
#:phases
 (modify-phases %standard-phases
   (add-after 'unpack 'disable-rust-installation
(lambda* (#:key inputs #:allow-other-keys)
 (let ((openssl (assoc-ref inputs "openssl"))
   (source  (assoc-ref %build-inputs "source"))
   (libsodium (assoc-ref inputs "libsodium")))
   (setenv "RUST_BACKTRACE" "full")
   (setenv "RUSTC_BOOTSTRAP" "1")
   ;(setenv "OPENSSL_DIR" openssl)
   (setenv "SODIUM_LIB_DIR" (string-append libsodium "/lib")))
 #t))
 )))
(native-inputs
  `(("libsodium" ,libsodium)
("python-msgpack" ,python-msgpack)
("openssl" ,openssl)
("perl" ,perl)
("pkg-config" ,pkg-config)
("python-setuptools-rust" ,python-setuptools-rust)))
(inputs
  `(("python" ,python)))
(home-page "https://github.com/etesync/etebase-py;)
(synopsis "A python client library for EteSync.")
(description
  "This module provides a python API to interact with an EteSync 
server. 
It currently implements AddressBook and Calendar access, and supports two-way 
sync (both push and pull) to the server.")
(license license:gpl3)))
```


Any idea?



Re: Packaging a python package that is using setuptools_rust

2020-10-25 Thread Hamzeh Nasajpour
Thanks for your quick reply.


>   (native-inputs
>`(...
>  ("rust:cargo" ,rust "cargo")
>  ...))

Thanks this step passed, but now I face with another error in dependencies. 

```
...
phase `patch-generated-file-shebangs' succeeded after 0.0 seconds
starting phase `build'  


running "python setup.py" with command "build" and parameters ()
running build
running build_py
creating build
creating build/lib
creating build/lib/etebase
copying etebase/__init__.py -> build/lib/etebase
running build_ext
running build_rust
error: failed to load source for a dependency on `cpython`

Caused by:
  Unable to update registry `https://github.com/rust-lang/crates.io-index`

Caused by:
  failed to create directory 
`/homeless-shelter/.cargo/registry/index/github.com-1ecc6299db9ec823`

Caused by:
  Permission denied (os error 13)
Traceback (most recent call last):
  File "", line 1, in 
  File "setup.py", line 4, in 
...
```

indeed, this library is python and internally it's using a rust library. the 
`cpython` is one its dependencies that I packaged it (`rust-cpython`) and it 
needs to it. I don't know how can I add rust  dependencies here since I'm using 
python build system. I added it to inputs but not resolved.

Indeed now the problem is adding dependencies (some of them rust and some of 
them python) to this package while I'm using the python build system. Do you 
have any idea?


Regards,
Hamzeh





Re: Packaging a python package that is using setuptools_rust

2020-10-25 Thread Hamzeh Nasajpour


Hi Hartmut,

> You could validate $PATH like this: Add a phase before the
> build-phase, containing just "(pk (getenv PATH))".

This is the output of this line:
```
/gnu/store/wc4xh9wj49rlbyivxi4lsws6whhzx4ab-python-wrapper-3.8.2/bin:/gnu/store/axjq514q8gqk90hi7r7wpfbba3id6h18-rust-1.39.0/bin:/gnu/store/v6f44zccwh9z5zk3pjlywjybbi8n2hjh-tar-1.32/bin:/gnu/store/ncydgq2znms5n1d2k5yqshhf58nsixwv-gzip-1.10/bin:/gnu/store/i8h2pcxqdq07ijm3ibkka8f4smn1w48v-bzip2-1.0.8/bin:/gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-5.2.4/bin:/gnu/store/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/bin:/gnu/store/n4n560pfvvw50a9369axw5vj5rrqfj1n-diffutils-3.7/bin:/gnu/store/cd5qf3kcnlq35p9k392pjdpdzpsnds70-patch-2.7.6/bin:/gnu/store/hic7snhayfl7m6cpfqqr73nmm19bpqkg-findutils-4.7.0/bin:/gnu/store/swqdvwri9dbv6zssg6v0by7l05hd6wxp-gawk-5.0.1/bin:/gnu/store/ishk7fswcs4gkwcp8mh788z4mvvl9bxh-sed-4.8/bin:/gnu/store/bhs4rj58v8j1narb2454raan2ps38xd8-grep-3.4/bin:/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/bin:/gnu/store/hm40bxnv8jxmbc1lpb7zfimii4xm9m81-make-4.3/bin:/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin:/gnu/store/mpa04aq8lblbcviyxywxcsb1zbi0mf39-ld-wrapper-0/bin:/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkcg3m4-binutils-2.34/bin:/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin:/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin:/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/sbin:/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/bin
```

> /gnu/store/axjq514q8gqk90hi7r7wpfbba3id6h18-rust-1.39.0/bin

As you can see, the `rust` path is available in the `PATH`. I get the list of 
this path:
```
$ ls /gnu/store/axjq514q8gqk90hi7r7wpfbba3id6h18-rust-1.39.0/bin/
rustc  rustdoc  rust-gdb  rust-gdbgui  rust-lldb
```

I couldn't see the `cargo`. I also couldn't find any package for installing the 
`cargo`.


Regards,
Hamzeh



Re: Error in package building : error[E0463]: can't find crate for `openssl_src`

2020-10-25 Thread Hamzeh Nasajpour
Hi Efraim,

> I'd add in a substitution here for openssl like this (untested):
>;; Don't depend on vendored sources
>(("0.10.30.*") "0.10.30\" }\n")
> 

Thanks, I added it and this step passed and now I don't get the previous error 
in building. 

Now I faced with another issue:
```
...
   Compiling serde_bytes v0.11.5
   Compiling rmp-serde v0.14.3
   Compiling sodiumoxide v0.2.6
   Compiling reqwest v0.10.4
   Compiling etebase v0.1.0
   Compiling etebase-python v0.30.0 
(/tmp/guix-build-python-etebase-py-0.30.0.drv-0/etebase-0.30.0)
error: unterminated double quote string
  --> src/lib.rs:63:44
   |
63 | include!(concat!(env!("OUT_DIR"), "/glue.rs"));
   |^

error: aborting due to previous error

error: could not compile `etebase-python`.
```

This error is related to this line: 
https://github.com/etesync/etebase-py/blob/64bce73fe2a9a6c82923cd3cedc9210b874f5c01/src/lib.rs#L62

I don't know what's this. And what should I do? Do you have any idea?


Regards,
Hamzeh



Re: Error in package building : error[E0463]: can't find crate for `openssl_src`

2020-10-22 Thread Hamzeh Nasajpour
Hello John,

Thanks for your following up.

I put the `openssl` in `inputs` too and the problem wasn't resolved. I also I 
packaged the `openssl-src` and repackage the `openssl-sys` and this is didn't 
resolved the problem too. 

The point is with the following package definitions the `rust-openssl-sys` will 
be build/installed without any error, but in the `etebase-py` 
building/installation I get the previous error.

```
(define-public rust-openssl-src-111.0.1
  (package
(name "rust-openssl-src")
(version "111.0.1+1.1.1")
(source
 (origin
   (method url-fetch)
   (uri (crate-uri "openssl-src" version))
   (file-name
(string-append name "-" version ".tar.gz"))
   (sha256
(base32
 "1gpw4zdsi27hg7y4i9xilgfyzp9i56ch5gs64r5ab1gxi3caxvfi"
(build-system cargo-build-system)
(arguments
 `(#:skip-build? #t
   #:cargo-inputs
   (("rust-gcc" ,rust-gcc-0.3
(home-page "https://github.com/sfackler/rust-openssl;)
(synopsis "OpenSSL bindings")
(description "OpenSSL bindings.")
(license license:asl2.0)))

(define-public rust-openssl-sys-0.9
  (package
(name "rust-openssl-sys")
(version "0.9.58")
(source
  (origin
(method url-fetch)
(uri (crate-uri "openssl-sys" version))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
 (base32 "1pkq3x8w16kqvkg75g4w7nny56w9clssww0ibpzg015n153xnhm8"
(build-system cargo-build-system)
(arguments
 `(#:cargo-inputs
   (("rust-libc" ,rust-libc-0.2)
;; Build dependencies:
("rust-autocfg" ,rust-autocfg-1.0)
("rust-cc" ,rust-cc-1)
("rust-pkg-config" ,rust-pkg-config-0.3)
("rust-openssl-src" ,rust-openssl-src-111.0.1)
("rust-vcpkg" ,rust-vcpkg-0.2
(native-inputs
 `(("openssl" ,openssl)
   ("pkg-config" ,pkg-config)))
(home-page "https://github.com/sfackler/rust-openssl;)
(synopsis "FFI bindings to OpenSSL")
(description
 "This package provides FFI bindings to OpenSSL for use in rust crates.")
(license license:expat)))
```


```
phase `patch-cargo-checksums' succeeded after 69.7 seconds
starting phase `build'  


   Compiling autocfg v1.0.1
   Compiling memchr v2.3.3
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.18
   Compiling libc v0.2.71
   Compiling pkg-config v0.3.17
   Compiling cc v1.0.58
   Compiling bitflags v1.2.1
   Compiling foreign-types-shared v0.1.1
   Compiling openssl v0.10.30
   Compiling cpython v0.3.0
   Compiling cfg-if v0.1.10
   Compiling thread_local v1.0.1
   Compiling foreign-types v0.3.2
   Compiling aho-corasick v0.7.13
   Compiling num-traits v0.2.12
   Compiling regex v1.3.9
   Compiling openssl-sys v0.9.58
error[E0463]: can't find crate for `openssl_src`
 --> 
/tmp/guix-build-python-etebase-py-0.30.0.drv-0/etebase-0.30.0/guix-vendor/rust-openssl-sys-0.9.58.tar.xz/build/main.rs:6:1
  |
6 | extern crate openssl_src;
  | ^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `openssl-sys`.
warning: build failed, waiting for other jobs to finish...
error: build failed
command "cargo" "build" "--features" "" "--release" failed with status 101

```



Re: Error in package building : error[E0463]: can't find crate for `openssl_src`

2020-10-21 Thread Hamzeh Nasajpour
I'm so sorry I had a mistake in the previous package definition, I was in 
testing. Please remove these lines in the previous definition:
```
(substitute* "Cargo.toml"
  (("0.10.30\"" all) "0.10.30\"}# "))
```

It means that my package definition is:
```
(define-public python-etebase-py
  (package
(name "python-etebase-py")
(version "0.30.0")
(source
  (origin
(method url-fetch)
(uri (pypi-uri "etebase" version))
(sha256
  (base32
"1py635aqnxx3jy4x6zffriqi0l9gc2gk06h0ms91k4rs68h0gb0i"))
(modules '((guix build utils)))
(snippet
 '(begin
(substitute* "Cargo.toml"
  (("etebase = " all) "#etebase = "))
(substitute* "Cargo.toml"
  (("flapigen = " all) "flapigen = \"^0.6.0-pre7\" #"))
#t
(build-system cargo-build-system)
(arguments
  `(#:tests? #f
#:cargo-inputs
(("rust-openssl" ,rust-openssl-0.10)
 ("rust-cpython" ,rust-cpython-0.3)
 ("rust-log" ,rust-log-0.4)
 ("rust-etebase-rs" ,rust-etebase-rs)
 ("rust-flapigen" ,rust-flapigen-0.6)
 ("rust-env-logger" ,rust-env-logger-0.7))
#:phases
 (modify-phases %standard-phases
   (add-after 'unpack 'patch-env-var
(lambda* (#:key inputs #:allow-other-keys)
 (let ((openssl (assoc-ref inputs "openssl")))
   (invoke "rm" "setup.py")
   (setenv "RUST_BACKTRACE" "full")
   (setenv "OPENSSL_DIR" openssl))
 #t))
 )))
(native-inputs
  `(("openssl" ,openssl)
("python-msgpack" ,python-msgpack)
("python-setuptools-rust" ,python-setuptools-rust)))
(inputs
  `(("python" ,python)
;("rust-etebase-rs" ,rust-etebase-rs)
))
(home-page "https://github.com/etesync/etebase-rs;)
(synopsis "A python client library for EteSync.")
(description
  "This module provides a python API to interact with an EteSync 
server. 
It currently implements AddressBook and Calendar access, and supports two-way 
sync (both push and pull) to the server.")
(license license:gpl3)))
```

With above definition, I set the `OPENSSL_DIR` and add `openssl` as input but 
the problem not resolved:
```
phase `patch-cargo-checksums' succeeded after 57.8 seconds
starting phase `build'  


   Compiling autocfg v1.0.1
   Compiling memchr v2.3.3
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.18
   Compiling libc v0.2.71
   Compiling cc v1.0.58
   Compiling pkg-config v0.3.17
   Compiling bitflags v1.2.1
   Compiling openssl v0.10.30
   Compiling cpython v0.3.0
   Compiling foreign-types-shared v0.1.1
   Compiling cfg-if v0.1.10
   Compiling thread_local v1.0.1
   Compiling foreign-types v0.3.2
   Compiling aho-corasick v0.7.13
   Compiling num-traits v0.2.12
   Compiling regex v1.3.9
   Compiling openssl-sys v0.9.58
error[E0463]: can't find crate for `openssl_src`
 --> 
/tmp/guix-build-python-etebase-py-0.30.0.drv-0/etebase-0.30.0/guix-vendor/rust-openssl-sys-0.9.58.tar.xz/build/main.rs:6:1
  |
6 | extern crate openssl_src;
  | ^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `openssl-sys`.
warning: build failed, waiting for other jobs to finish...
error: build failed
```




Re: Error in package building : error[E0463]: can't find crate for `openssl_src`

2020-10-21 Thread Hamzeh Nasajpour
This is my package definition till now. The repository of the package is here:
https://github.com/etesync/etebase-py/

Also I should to say I package these (since they aren't available in the 
upstream packages):
* openssl@0.10.30
* cpython@0.3
* etebase-rs
* flapigen-0.6

I didn't attach them here for simplicity.

```
(define-public python-etebase-py
  (package
(name "python-etebase-py")
(version "0.30.0")
(source
  (origin
(method url-fetch)
(uri (pypi-uri "etebase" version))
(sha256
  (base32
"1py635aqnxx3jy4x6zffriqi0l9gc2gk06h0ms91k4rs68h0gb0i"))
(modules '((guix build utils)))
(snippet
 '(begin
(substitute* "Cargo.toml"
  (("etebase = " all) "#etebase = "))
(substitute* "Cargo.toml"
  (("flapigen = " all) "flapigen = \"^0.6.0-pre7\" #"))
(substitute* "Cargo.toml"
  (("0.10.30\"" all) "0.10.30\"}# "))
#t
(build-system cargo-build-system)
(arguments
  `(#:tests? #f
#:cargo-inputs
(("rust-openssl" ,rust-openssl-0.10)
 ("rust-cpython" ,rust-cpython-0.3)
 ("rust-log" ,rust-log-0.4)
 ("rust-etebase-rs" ,rust-etebase-rs)
 ("rust-flapigen" ,rust-flapigen-0.6)
 ("rust-env-logger" ,rust-env-logger-0.7))
#:phases
 (modify-phases %standard-phases
   (add-after 'unpack 'patch-env-var
(lambda* (#:key inputs #:allow-other-keys)
 (let ((openssl (assoc-ref inputs "openssl")))
   (invoke "rm" "setup.py")
   (setenv "RUST_BACKTRACE" "full")
   (setenv "OPENSSL_DIR" openssl))
 #t))
 )))
(native-inputs
  `(("openssl" ,openssl)
("python-msgpack" ,python-msgpack)
("python-setuptools-rust" ,python-setuptools-rust)))
(inputs
  `(("python" ,python)
;("rust-etebase-rs" ,rust-etebase-rs)
))
(home-page "https://github.com/etesync/etebase-rs;)
(synopsis "A python client library for EteSync.")
(description
  "This module provides a python API to interact with an EteSync 
server. 
It currently implements AddressBook and Calendar access, and supports two-way 
sync (both push and pull) to the server.")
(license license:gpl3)))
```



Re: Error in package building : error[E0463]: can't find crate for `openssl_src`

2020-10-21 Thread Hamzeh Nasajpour
Hello John,

Thanks for your quick reply.

But as you see in `Cargo.toml`, this feature mentioned and I think it's needed. 
In the other side setting the `OPENSSL_DIR` didn't resolve my issue.

Do you have any other suggestion?

Can I repackage `rust-openssl-sys-0.9` and remove this line in the package 
definition? (Sorry I'm not expert in rust and I don't know what's the 
`vendored` feature, but I need this package urgently - `etebasepy` )

```
  (patches (search-patches "rust-openssl-sys-no-vendor.patch"))
``` 


Regards,
Hamzeh


On Wed, Oct 21, 2020, at 4:16 PM, John Soo wrote:
> Hello Hamzeh,
> 
> Take a look at gnu/packages/crates-io.scm for other examples of 
> rust-openssl. We try to avoid vendored sources. Recent versions of 
> rust-openssl-sys also complicate this by requiring particular versions 
> of openssl.  While it’s nice that they are explicit about the 
> dependency, we don’t have them in the package set. 
> 
> Finally and probably most immediately useful to you, check out 
> gnu/packages/rust-apps.scm. You may need to set the OPENSSL_DIR 
> environment variable to the location of the openssl dependency.
> 
> I see the “vendored” feature in the Cargo.toml that makes me think this 
> may not work, but that would be where I start. 
> 
> Good luck,
> 
> John



Error in package building : error[E0463]: can't find crate for `openssl_src`

2020-10-21 Thread Hamzeh Nasajpour


Hi,

I face with an issue in one library that I'm packaging by myself. This library 
has one dependency to `rust-openssl@0.10.30`, I updated the `rust-openssl` to 
`0.10.30` and now I get this error in the package building:
```
...
patch-cargo-checksums: generate-checksums for 
guix-vendor/rust-zstd-sys-1.4.14+zstd.1.4.3.tar.gz
phase `patch-cargo-checksums' succeeded after 76.7 seconds
starting phase `build'  

  
   Compiling autocfg v1.0.1
   Compiling memchr v2.3.3
   Compiling lazy_static v1.4.0
   Compiling libc v0.2.71
   Compiling regex-syntax v0.6.18
   Compiling pkg-config v0.3.17
   Compiling cc v1.0.58
   Compiling bitflags v1.2.1
   Compiling openssl v0.10.30
   Compiling foreign-types-shared v0.1.1
   Compiling cpython v0.3.0
   Compiling cfg-if v0.1.10
   Compiling thread_local v1.0.1
   Compiling foreign-types v0.3.2
   Compiling aho-corasick v0.7.13
   Compiling num-traits v0.2.12
   Compiling regex v1.3.9
   Compiling openssl-sys v0.9.58
error[E0463]: can't find crate for `openssl_src`
 --> 
/tmp/guix-build-python-etebase-py-0.30.0.drv-0/etebase-0.30.0/guix-vendor/rust-openssl-sys-0.9.58.tar.xz/build/main.rs:6:1
  |
6 | extern crate openssl_src;
  | ^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `openssl-sys`.
warning: build failed, waiting for other jobs to finish...
error: build failed
command "cargo" "build" "--features" "" "--release" failed with status 101
builder for 
`/gnu/store/5svg5z5s850j9s7wr6dmdh2kak9947hb-python-etebase-py-0.30.0.drv' 
failed with exit code 1

```

* I'm packaging the `etebase-py` : https://github.com/etesync/etebase-py/
* The `rust-openssl` dependency defined here: 
https://github.com/etesync/etebase-py/blob/master/Cargo.toml#L22
* I also packaged the `rust-openssl-src` and add it as dependency to my package 
definition but not resolved


Any idea? 



Regards,
Hamzeh



Re: rust packaging with specific version of rust

2020-10-21 Thread Hamzeh Nasajpour
Hi,

Thanks for your quick and helpful reply.
The problem resolved.

Regards,
Hamzeh


On Mon, Oct 19, 2020, at 12:36 PM, Arun Isaac wrote:
> 
> To enable the unstable inner_deref feature, you need to add the line
> "#![feature(inner_deref)]" to the top of src/lib.rs. And, you might need
> to enable unstable features by setting the environment variable
> RUSTC_BOOTSTRAP to 1. See the rust-sourcemap package in
> gnu/package/crates-io.scm for an example.
> 
> Cheers!
> Arun
>



Packaging a python package that is using setuptools_rust

2020-10-19 Thread Hamzeh Nasajpour
Hi,

I want to package the `etebase-py` library: 
https://github.com/etesync/etebase-py/

It's using the `setuptools_rust` for build/install. Also it has some rust 
dependencies that I packaged them. And now I create a package definition by 
`guix import ...`:
```
(define-public python-etebase
  (package
(name "python-etebase")
(version "0.30.0")
(source
  (origin
(method url-fetch)
(uri (pypi-uri "etebase" version))
(sha256
  (base32
"1py635aqnxx3jy4x6zffriqi0l9gc2gk06h0ms91k4rs68h0gb0i"
(build-system python-build-system)
(native-inputs
  `(("python-msgpack" ,python-msgpack)
("python-setuptools-rust" ,python-setuptools-rust)
("rust" ,rust)))
(home-page
  "https://github.com/etesync/etebase-py;)
(synopsis "Python client library for Etebase")
(description "Python client library for Etebase")
(license #f)))
```

I faced with the following error in the package building:
```
...
etebase-0.30.0/setup.py
etebase-0.30.0/src/
etebase-0.30.0/src/lib.rs
etebase-0.30.0/src/glue.rs.in
phase `unpack' succeeded after 0.0 seconds
starting phase `ensure-no-mtimes-pre-1980'  


phase `ensure-no-mtimes-pre-1980' succeeded after 0.0 seconds
starting phase `enable-bytecode-determinism'


phase `enable-bytecode-determinism' succeeded after 0.0 seconds
starting phase `patch-usr-bin-file' 


phase `patch-usr-bin-file' succeeded after 0.0 seconds
starting phase `patch-source-shebangs'  


phase `patch-source-shebangs' succeeded after 0.0 seconds
starting phase `patch-generated-file-shebangs'  


phase `patch-generated-file-shebangs' succeeded after 0.0 seconds
starting phase `build'  


running "python setup.py" with command "build" and parameters ()
running build
running build_py
creating build
creating build/lib
creating build/lib/etebase
copying etebase/__init__.py -> build/lib/etebase
running build_ext
running build_rust
error: [Errno 2] No such file or directory: 'cargo'
command "python" "-c" "import setuptools, 
tokenize;__file__='setup.py';f=getattr(tokenize, 'open', 
open)(__file__);code=f.read().replace('\\r\\n', 
'\\n');f.close();exec(compile(code, __file__, 'exec'))" "build" failed with 
status 1
builder for 
`/gnu/store/lnwxp7sym6i2ixg4mnmz9h7ff1fg32cd-python-etebase-0.30.0.drv' failed 
with exit code 1
build of /gnu/store/lnwxp7sym6i2ixg4mnmz9h7ff1fg32cd-python-etebase-0.30.0.drv 
failed
View build log at 
'/var/log/guix/drvs/ln/wxp7sym6i2ixg4mnmz9h7ff1fg32cd-python-etebase-0.30.0.drv.bz2'.
guix build: error: build of 
`/gnu/store/lnwxp7sym6i2ixg4mnmz9h7ff1fg32cd-python-etebase-0.30.0.drv' failed
```

Do you have any idea? I should add the rust dependencies to `native-inputs` or 
`inputs` of `etebase-py`? Do you have any package definition that is used 
`setuptools_rust` as example for me?


Regards,
Hamzeh



rust packaging with specific version of rust

2020-10-19 Thread Hamzeh Nasajpour
Hi,

I'm not expert in `rust`. I need to work with a library that has some 
dependencies to rust and I had to package a few libraries in GuixSD. Anyway now 
I faced with an error in building one rust package:
```
error[E0658]: use of unstable library feature 'inner_deref': newly added
  --> src/http_client/mod.rs:54:25
   |
54 | self.auth_token.as_deref()
   | 
   |
   = note: for more information, see 
https://github.com/rust-lang/rust/issues/50264

error[E0658]: use of unstable library feature 'inner_deref': newly added
  --> src/http_client/mod.rs:68:43
   |
68 | self.imp.get(url, self.auth_token.as_deref()).as_result()
   |   
   |
   = note: for more information, see 
https://github.com/rust-lang/rust/issues/50264

error[E0658]: use of unstable library feature 'inner_deref': newly added
  --> src/http_client/mod.rs:72:44
   |
72 | self.imp.post(url, self.auth_token.as_deref(), body).as_result()
   |
   |
   = note: for more information, see 
https://github.com/rust-lang/rust/issues/50264
...
```

Based on the following document the  `as_deref()` method is available since 
rust version `1.40.0`.
https://doc.rust-lang.org/std/option/enum.Option.html#method.as_deref

Now how can I build/install my rust package with this specific version? is it 
possible? or is there anything that I forget? Please help. 


Regards,
Hamzeh



Why the static library will delete after the package installation of dlib?

2020-08-12 Thread Hamzeh Nasajpour
Hi,

I'm using `dlib` in a project and I found that the static library will be 
deleted in the `delete-static-library` phase in the package installation. Why? 

https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/machine-learning.scm#n814

Is there any problem to comment these lines for using the `dlib` as library? 
(line 814 - 817)

Regards,
Hamzeh



Re: shepherd as normal user

2019-10-04 Thread Hamzeh Nasajpour
> I believe you can add it to some shell startup files, or session startup 
> script. It depends on you environment.

I'm looking to find a way to configure the `shepherd` with `config.scm` (system 
reconfigure ...). 
The startup script is a workaround but it has some problems, for example, 
multi-login/multi instance of shepherd and so on.

Do you have any idea?


On Fri, Oct 4, 2019, at 6:49 PM, Gábor Boskovits wrote:
> Hello,
> 
> Hamzeh Nasajpour  ezt írta (időpont: 2019. 
> okt. 4., Pén 10:31):
> > Thanks for your reply.
> > 
> >  It's a good example. But my main problem is running `shepherd` as 
> normal user automatically.
> I believe you can add it to some shell startup files, or session 
> startup script. It depends on you environment.
> > 
> >  For now, I've to run it manually. 
> > 
> > 
> > 
> >  On Fri, Oct 4, 2019, at 4:28 AM, ison wrote:
> >  > On Fri, Oct 04, 2019, Hamzeh Nasajpour wrote:
> >  > > Hi,
> >  > > 
> >  > > I'm going to run `shepherd` as a normal user automatically (at 
> > startup). How can I do that?
> >  > > 
> >  > > I know the `shepherd` will be run as root with PID=1 in the init 
> > system, but I have some services that should be run by `shepherd` for 
> > normal users. 
> >  > > 
> >  > > Regards,
> >  > > Hamzeh
> >  > 
> >  > It doesn't seem to be documented anywhere I could find, but there was a
> >  > simple example posted to this mailing list a while back that helped me:
> >  > https://lists.gnu.org/archive/html/guix-devel/2019-04/msg00580.html
> >  >
> Best regards,
> g_bor



Re: shepherd as normal user

2019-10-04 Thread Hamzeh Nasajpour
Thanks for your reply.

It's a good example. But my main problem is running `shepherd` as normal user 
automatically.

For now, I've to run it manually. 



On Fri, Oct 4, 2019, at 4:28 AM, ison wrote:
> On Fri, Oct 04, 2019, Hamzeh Nasajpour wrote:
> > Hi,
> > 
> > I'm going to run `shepherd` as a normal user automatically (at startup). 
> > How can I do that?
> > 
> > I know the `shepherd` will be run as root with PID=1 in the init system, 
> > but I have some services that should be run by `shepherd` for normal users. 
> > 
> > Regards,
> > Hamzeh
> 
> It doesn't seem to be documented anywhere I could find, but there was a
> simple example posted to this mailing list a while back that helped me:
> https://lists.gnu.org/archive/html/guix-devel/2019-04/msg00580.html
>



shepherd as normal user

2019-10-03 Thread Hamzeh Nasajpour
Hi,

I'm going to run `shepherd` as a normal user automatically (at startup). How 
can I do that?

I know the `shepherd` will be run as root with PID=1 in the init system, but I 
have some services that should be run by `shepherd` for normal users. 

Regards,
Hamzeh



Re: undefined symbol error in qtbase

2019-08-12 Thread Hamzeh Nasajpour
Hi Ricardo,

Thanks for your help.

Now I repackage the `qtbase` and remove the `sqlite` from this line:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/qt.scm#n536

The problem resolved and the `trojita` installed and run successfully. 

Regards,
Hamzeh


On Thu, Aug 8, 2019, at 12:42 PM, Ricardo Wurmus wrote:
> 
> Hamzeh Nasajpour  writes:
> 
> >> The problem appears to be that qtbase contains references to both sqlite
> >> and sqlite-with-column-metadata.  It should contain references to only
> >> one of the two, preferably the one with column metadata.
> >
> > Seems that `qtbase` has only one dependency to 
> > `sqlite-with-column-metadata` here:
> > https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/qt.scm#n578
> >
> > Did you see the `qtbase` package definition? I don't see `sqlite` in it's 
> > package definition.
> 
> I wrote “references”; I meant the qtbase package closure.  When you look
> at “guix graph” for qtbase you’ll find other users of “sqlite”.
> 
> -- 
> Ricardo
> 
>



Re: undefined symbol error in qtbase

2019-08-08 Thread Hamzeh Nasajpour
Hi Ricardo,

> The problem appears to be that qtbase contains references to both sqlite
> and sqlite-with-column-metadata.  It should contain references to only
> one of the two, preferably the one with column metadata.

Seems that `qtbase` has only one dependency to `sqlite-with-column-metadata` 
here:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/qt.scm#n578

Did you see the `qtbase` package definition? I don't see `sqlite` in it's 
package definition.

Regards,
Hamzeh

On Wed, Aug 7, 2019, at 4:13 PM, Hamzeh Nasajpour wrote:
> 
> 
> On Wed, Aug 7, 2019, at 4:04 PM, Ricardo Wurmus wrote:
> > 
> > Ricardo Wurmus  writes:
> > 
> > >> This is the package definition for `trojita` […]
> > >
> > > I copied this to the bottom of qt.scm (didn’t want to have to adjust any
> > > module imports) and built it just fine.
> > >
> > > So it looks like nothing’s wrong.
> > 
> > Ah, well, the problem is with running the executable.
> > 
> > The problem appears to be that qtbase contains references to both sqlite
> > and sqlite-with-column-metadata.  It should contain references to only
> > one of the two, preferably the one with column metadata.
> > 
> > -- 
> > Ricardo
> > 
> >
> 
> Hi Ricardo,
> 
> Thanks for quick reply.
> 
> Yes, exactly, the problem is in running with this error:
> > trojita: symbol lookup error: 
> > /gnu/store/890yw9i7lcjnnxhlza8r121352xp1hi-qtbase-5.11.3/lib/qt5/plugins/sqldrivers/libqsqlite.so:
> >  undefined symbol: sqlite3_column_table_name16
> 
> What's your idea/solution for it?
> 
> Regards,
> Hamzeh
> 
>



Re: undefined symbol error in qtbase

2019-08-07 Thread Hamzeh Nasajpour



On Wed, Aug 7, 2019, at 4:04 PM, Ricardo Wurmus wrote:
> 
> Ricardo Wurmus  writes:
> 
> >> This is the package definition for `trojita` […]
> >
> > I copied this to the bottom of qt.scm (didn’t want to have to adjust any
> > module imports) and built it just fine.
> >
> > So it looks like nothing’s wrong.
> 
> Ah, well, the problem is with running the executable.
> 
> The problem appears to be that qtbase contains references to both sqlite
> and sqlite-with-column-metadata.  It should contain references to only
> one of the two, preferably the one with column metadata.
> 
> -- 
> Ricardo
> 
>

Hi Ricardo,

Thanks for quick reply.

Yes, exactly, the problem is in running with this error:
> trojita: symbol lookup error: 
> /gnu/store/890yw9i7lcjnnxhlza8r121352xp1hi-qtbase-5.11.3/lib/qt5/plugins/sqldrivers/libqsqlite.so:
>  undefined symbol: sqlite3_column_table_name16

What's your idea/solution for it?

Regards,
Hamzeh



Re: undefined symbol error in qtbase

2019-08-07 Thread Hamzeh Nasajpour
Hi, 

Thank you for follow up. This is the package definition for `trojita`. 
(inspired from 
https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/mailreaders/trojita/default.nix)


```
(define-public trojita
  (package
(name "trojita")
(version "0.7.0.1")
(source
 (origin
   (method git-fetch)
   (uri (git-reference
 (url "https://github.com/KDE/trojita;)
 (commit "c5b39f51693ab5616e61e2e9454a526287b7df8d")))
   (sha256
(base32 "1g3mbpb8m6hivyj6pmgqxqvms3bizdwiiy4fagn4kqrspl9r"))
   ))
(build-system cmake-build-system)
(arguments
  `(#:tests? #f))
(inputs `(
  ("qtbase", qtbase)
  ("qtwebkit", qtwebkit)
  ("qtsvg" ,qtsvg)))
(native-inputs `(
  ("pkg-config", pkg-config)
  ("qttools",qttools)))
(home-page "http://trojita.flaska.net;)
(synopsis "A Qt IMAP e-mail client")
(description "A Qt IMAP e-mail client")
    (license license:gpl2)))
```

On Wed, Aug 7, 2019, at 1:32 AM, swedebugia wrote:
> hi!
> 
> On 2019-08-06 13:58, Hamzeh Nasajpour wrote:
> > Hi,
> >
> > I want to package `trojita` for GuixSD. I created a package definition and 
> > it was build and installed successfully. When I run it I get the following 
> > error:
> >
> > ```
> > /gnu/store/890yw9i7lcjnnxhlza8r121352xp1hi-qtbase-5.11.3/lib/qt5/plugins/sqldrivers/libqsqlite.so:
> >  undefined symbol: sqlite3_column_table_name16
> >
> > ```
> >
> > `trojita` is a mail client application that has a dependency to `qtbase`. I 
> > see that in `qtbase` package definition there is 
> > `sqlite-with-column-metadata` as a dependency, Apparently all is ok but I 
> > don't know the reason of this error. Do you have any idea?
> >
> > Links:
> > * `qtbase` package definition : 
> > https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/qt.scm#n578
> > * `trojita` mail application : https://cgit.kde.org/trojita.git
> > *  `sqlite` additional methods/apis : 
> > https://www.sqlite.org/c3ref/column_database_name.html
> > *  `sqlite` package definition :  
> > https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/sqlite.scm#n107
> 
> Could you share your package definition also?
> 
> 
> -- 
> Cheers Swedebugia
>



undefined symbol error in qtbase

2019-08-06 Thread Hamzeh Nasajpour
Hi,

I want to package `trojita` for GuixSD. I created a package definition and it 
was build and installed successfully. When I run it I get the following error:

```
/gnu/store/890yw9i7lcjnnxhlza8r121352xp1hi-qtbase-5.11.3/lib/qt5/plugins/sqldrivers/libqsqlite.so:
 undefined symbol: sqlite3_column_table_name16

```

`trojita` is a mail client application that has a dependency to `qtbase`. I see 
that in `qtbase` package definition there is `sqlite-with-column-metadata` as a 
dependency, Apparently all is ok but I don't know the reason of this error. Do 
you have any idea?

Links:
* `qtbase` package definition : 
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/qt.scm#n578
* `trojita` mail application : https://cgit.kde.org/trojita.git
*  `sqlite` additional methods/apis : 
https://www.sqlite.org/c3ref/column_database_name.html
*  `sqlite` package definition :  
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/sqlite.scm#n107


Regards,
Hamzeh



`scm` file parsing(read/write/modify)

2019-01-06 Thread Hamzeh Nasajpour


Hi,
I have a configuration file that written based on `scm` file like as `guixSD` 
config.scm file.
https://www.gnu.org/software/guix/manual/en/html_node/User-Accounts.html#User-Accounts


I want to read/write/modify this config file in python or C/C++.
Do you know any `scm` file parsing  or any other solution for my needed? In 
fact I want to add/remove/modify parameters of this config file.

Regards,
Hamzeh