unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Help: Packaging Bottles
@ 2022-04-25 11:33 phodina via
  2022-04-25 13:23 ` Luis Felipe
  2022-04-25 20:32 ` phodina
  0 siblings, 2 replies; 3+ messages in thread
From: phodina via @ 2022-04-25 11:33 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

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 <module>
from bottles import main
File "/gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/share/bottles/bottles/main.py", line 28, in <module>
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?

----
Petr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-bottles.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-bottles.patch, Size: 5194 bytes --]

From 07286c8d74380a750c7b489f73bb5affbcc3dc7a Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
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 <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; 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
+                         `(,glib "bin")
+                         gobject-introspection
+                         `(,gtk+ "bin")
+                         pkg-config))
+    (inputs (list bash-minimal
+                  dconf
+                  gtk+
+                  gtksourceview
+                  hicolor-icon-theme
+                  libhandy
+                  p7zip
+                  patool
+                  python
+                  python-pygobject
+                  python-requests
+                  python-pyyaml
+                  python-markdown
+                  wine
+                  cabextract
+                  webkitgtk
+                  xdpyinfo))
+    (synopsis "Easily manage wine and proton prefix")
+    (home-page "https://usebottles.com/")
+    (description "This package allows to easily manage wine and proton prefix.")
+    (license license:gpl3+)))
+
 (define-public wine
   (package
     (name "wine")
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Help: Packaging Bottles
  2022-04-25 11:33 Help: Packaging Bottles phodina via
@ 2022-04-25 13:23 ` Luis Felipe
  2022-04-25 20:32 ` phodina
  1 sibling, 0 replies; 3+ messages in thread
From: Luis Felipe @ 2022-04-25 13:23 UTC (permalink / raw)
  To: phodina; +Cc: help-guix


[-- Attachment #1.1: Type: text/plain, Size: 1231 bytes --]

Hi,

On Monday, April 25th, 2022 at 11:33 AM, phodina via <help-guix@gnu.org> 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 <module>
> 

> from bottles import main
> File "/gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/share/bottles/bottles/main.py", line 28, in <module>
> 

> 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?

It seems like the same problem I came across recently with gfeeds (see https://issues.guix.gnu.org/55085). 


I fixed this by making the program require WebKit 4.1 instead of 4.0, but I'm not sure if that's the right way to do it.

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Help: Packaging Bottles
  2022-04-25 11:33 Help: Packaging Bottles phodina via
  2022-04-25 13:23 ` Luis Felipe
@ 2022-04-25 20:32 ` phodina
  1 sibling, 0 replies; 3+ messages in thread
From: phodina @ 2022-04-25 20:32 UTC (permalink / raw)
  To: phodina; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2539 bytes --]

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 <help-guix@gnu.org> 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 <module>
>
> from bottles import main
> File "/gnu/store/a9h7l5g0zcvfsx8vi7yq3wc4k72i3i49-bottles-2022.4.14/share/bottles/bottles/main.py", line 28, in <module>
>
> 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?
>
> ----
> Petr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v2-0001-gnu-Add-bottles.patch --]
[-- Type: text/x-patch; name=v2-0001-gnu-Add-bottles.patch, Size: 5617 bytes --]

From 5ce3a3c4869622cd53e9941d40a57fcbaa0b985b Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
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 <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; 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 (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 #:glib-or-gtk? #t
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'fix-webkit
+                 (lambda* _
+                   (substitute* "src/main.py"
+                     (("WebKit2', '4.0") "WebKit2', '4.1"))))
+               (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))
+                                   `("GSETTINGS_SCHEMA_DIR" =
+                                     (,(string-append #$output
+                                        "/share/glib-2.0/schemas/")))
+                                   `("GI_TYPELIB_PATH" ":" prefix
+                                     (,(getenv "GI_TYPELIB_PATH"))))))))))
+    (native-inputs (list cmake
+                         desktop-file-utils
+                         gettext-minimal
+                         `(,glib "bin")
+                         gobject-introspection
+                         `(,gtk+ "bin")
+                         pkg-config))
+    (inputs (list bash-minimal
+                  dconf
+                  gtk+
+                  gtksourceview
+                  hicolor-icon-theme
+                  libhandy
+                  p7zip
+                  patool
+                  python
+                  python-pygobject
+                  python-requests
+                  python-pyyaml
+                  python-markdown
+                  wine
+                  cabextract
+                  webkitgtk
+                  xdpyinfo))
+    (synopsis "Easily manage wine and proton prefix")
+    (home-page "https://usebottles.com/")
+    (description
+     "This package allows to easily manage wine and proton prefix.")
+    (license license:gpl3+)))
+
 (define-public wine
   (package
     (name "wine")
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-25 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 11:33 Help: Packaging Bottles phodina via
2022-04-25 13:23 ` Luis Felipe
2022-04-25 20:32 ` phodina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).