From 679dcb403e31c4f7ebec0edbef1ed5690ae79cab Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 3 May 2023 21:25:15 -0400 Subject: [PATCH] gnu: python-wxpython: Use gexps. * gnu/packages/wxwidgets.scm (python-wxpython) [arguments]: Use gexps. Provide the '--use_syswx' build option via the WXPYTHON_BUILD_ARGS environment variable. --- gnu/packages/wxwidgets.scm | 43 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm index cf0fc5b91f..130e695385 100644 --- a/gnu/packages/wxwidgets.scm +++ b/gnu/packages/wxwidgets.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2022 Marius Bakke ;;; Copyright © 2023 Andreas Enge ;;; Copyright © 2023 Malte Frank Gerdes +;;; Copyright © 2023 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -282,27 +283,27 @@ (define-public python-wxpython (patches (search-patches "python-wxwidgets-type-errors.patch")))) (build-system python-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'build 'configure - (lambda* (#:key inputs #:allow-other-keys) - (setenv "WXWIN" (assoc-ref inputs "wxwidgets")) - ;; Copy the waf executable to the source directory since it needs - ;; to be in a writable directory. - (copy-file (search-input-file inputs "/bin/waf") - "bin/waf") - (setenv "WAF" "bin/waf") - ;; The build script tries to copy license files from the - ;; wxwidgets source tree. Prevent it. - (substitute* "wscript" - (("updateLicenseFiles\\(cfg\\)" all) - (string-append "#" all))) - ;; The build script tries to write to demo/version.py. So, we set - ;; correct write permissions. - (chmod "demo/version.py" #o644) - ;; Build only the python bindings, not wxwidgets also. - (substitute* "setup.py" - (("'build']") "'build_py', '--use_syswx']"))))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'configure + (lambda* (#:key inputs #:allow-other-keys) + ;; Configure the build options provided to the 'build.py' build + ;; script. + (setenv "WXPYTHON_BUILD_ARGS" "--use_syswx") ;use system wxwidgets + (setenv "WXWIN" #$(this-package-input "wxwidgets")) + ;; Copy the waf executable to the source directory since it needs + ;; to be in a writable directory. + (copy-file (search-input-file inputs "/bin/waf") "bin/waf") + (setenv "WAF" "bin/waf") + ;; The build script tries to copy license files from the + ;; wxwidgets source tree. Prevent it. + (substitute* "wscript" + (("updateLicenseFiles\\(cfg\\)" all) + (string-append "#" all))) + ;; The build script tries to write to demo/version.py. So, we set + ;; correct write permissions. + (chmod "demo/version.py" #o644)))))) (inputs (list gtk+ wxwidgets)) (native-inputs