From ada35de38f6b04bbc3c5d0bed198cf22e5fa22d9 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 13 Aug 2022 14:28:50 +0200 Subject: [PATCH] gnu: scons: Move to (gnu packages build-tools). * gnu/packages/python-xyz.scm (scons, scons-python2): Move from here ... * gnu/packages/build-tools.scm (scons, scons-python2): ... to here. * gnu/packages/direct-connect.scm, gnu/packages/disk.scm, gnu/packages/game-development.scm, gnu/packages/gps.scm, gnu/packages/image.scm, gnu/packages/installers.scm, gnu/packages/web.scm, gnu/packages/xdisorg.scm: Adjust module imports accordingly. * guix/build-system/scons.scm (default-scons): Likewise. --- gnu/packages/build-tools.scm | 45 +++++++++++++++++++++++++++++++ gnu/packages/direct-connect.scm | 2 +- gnu/packages/disk.scm | 1 + gnu/packages/game-development.scm | 1 + gnu/packages/gps.scm | 1 + gnu/packages/image.scm | 1 + gnu/packages/installers.scm | 2 +- gnu/packages/python-xyz.scm | 45 ------------------------------- gnu/packages/web.scm | 1 + gnu/packages/xdisorg.scm | 1 + guix/build-system/scons.scm | 4 +-- 11 files changed, 55 insertions(+), 49 deletions(-) diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm index 38a7ee2783..45f3ec559a 100644 --- a/gnu/packages/build-tools.scm +++ b/gnu/packages/build-tools.scm @@ -384,6 +384,51 @@ other lower-level build files.") scripted definition of a software project and outputs @file{Makefile}s or other lower-level build files."))) +(define-public scons + (package + (name "scons") + (version "3.0.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/SCons/scons") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1xy8jrwz87y589ihcld4hv7wn122sjbz914xn8h50ww77wbhk8hn")))) + (build-system python-build-system) + (arguments + `(#:use-setuptools? #f ; still relies on distutils + #:tests? #f ; no 'python setup.py test' command + #:phases + (modify-phases %standard-phases + (add-before 'build 'bootstrap + (lambda _ + (substitute* "src/engine/SCons/compat/__init__.py" + (("sys.modules\\[new\\] = imp.load_module\\(old, \\*imp.find_module\\(old\\)\\)") + "sys.modules[new] = __import__(old)")) + (substitute* "src/engine/SCons/Platform/__init__.py" + (("mod = imp.load_module\\(full_name, file, path, desc\\)") + "mod = __import__(full_name)")) + (invoke "python" "bootstrap.py" "build/scons" "DEVELOPER=guix") + (chdir "build/scons") + #t))))) + (home-page "https://scons.org/") + (synopsis "Software construction tool written in Python") + (description + "SCons is a software construction tool. Think of SCons as an improved, +cross-platform substitute for the classic Make utility with integrated +functionality similar to autoconf/automake and compiler caches such as ccache. +In short, SCons is an easier, more reliable and faster way to build +software.") + (license license:x11))) + +(define-public scons-python2 + (package + (inherit (package-with-python2 scons)) + (name "scons-python2"))) + (define-public tup (package (name "tup") diff --git a/gnu/packages/direct-connect.scm b/gnu/packages/direct-connect.scm index d342537122..4898c7a038 100644 --- a/gnu/packages/direct-connect.scm +++ b/gnu/packages/direct-connect.scm @@ -25,12 +25,12 @@ #:use-module (guix download) #:use-module (gnu packages) #:use-module (gnu packages boost) + #:use-module (gnu packages build-tools) #:use-module (gnu packages compression) #:use-module (gnu packages gettext) #:use-module (gnu packages gnome) #:use-module (gnu packages gtk) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages python-xyz) #:use-module (gnu packages tls) #:use-module (gnu packages version-control)) diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm index 69c02347c3..60605417a9 100644 --- a/gnu/packages/disk.scm +++ b/gnu/packages/disk.scm @@ -45,6 +45,7 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages build-tools) #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 661e1c0e07..b3a54798d4 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -63,6 +63,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages boost) + #:use-module (gnu packages build-tools) #:use-module (gnu packages compression) #:use-module (gnu packages check) #:use-module (gnu packages curl) diff --git a/gnu/packages/gps.scm b/gnu/packages/gps.scm index e528807de7..91e0ee12ac 100644 --- a/gnu/packages/gps.scm +++ b/gnu/packages/gps.scm @@ -34,6 +34,7 @@ #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages base) + #:use-module (gnu packages build-tools) #:use-module (gnu packages compression) #:use-module (gnu packages docbook) #:use-module (gnu packages glib) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index d0ac192774..e679a73f9d 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -58,6 +58,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages boost) + #:use-module (gnu packages build-tools) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages cpp) diff --git a/gnu/packages/installers.scm b/gnu/packages/installers.scm index 30cd0e4e6c..79738598cb 100644 --- a/gnu/packages/installers.scm +++ b/gnu/packages/installers.scm @@ -19,9 +19,9 @@ (define-module (gnu packages installers) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) + #:use-module (gnu packages build-tools) #:use-module (gnu packages compression) #:use-module (gnu packages cross-base) - #:use-module (gnu packages python-xyz) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system scons) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index f7971b75fa..30645fc4a0 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -3047,51 +3047,6 @@ user configuration files. It does not have support for serializing into YAML and is not compatible with JSON.") (license license:expat))) -(define-public scons - (package - (name "scons") - (version "3.0.4") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/SCons/scons") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1xy8jrwz87y589ihcld4hv7wn122sjbz914xn8h50ww77wbhk8hn")))) - (build-system python-build-system) - (arguments - `(#:use-setuptools? #f ; still relies on distutils - #:tests? #f ; no 'python setup.py test' command - #:phases - (modify-phases %standard-phases - (add-before 'build 'bootstrap - (lambda _ - (substitute* "src/engine/SCons/compat/__init__.py" - (("sys.modules\\[new\\] = imp.load_module\\(old, \\*imp.find_module\\(old\\)\\)") - "sys.modules[new] = __import__(old)")) - (substitute* "src/engine/SCons/Platform/__init__.py" - (("mod = imp.load_module\\(full_name, file, path, desc\\)") - "mod = __import__(full_name)")) - (invoke "python" "bootstrap.py" "build/scons" "DEVELOPER=guix") - (chdir "build/scons") - #t))))) - (home-page "https://scons.org/") - (synopsis "Software construction tool written in Python") - (description - "SCons is a software construction tool. Think of SCons as an improved, -cross-platform substitute for the classic Make utility with integrated -functionality similar to autoconf/automake and compiler caches such as ccache. -In short, SCons is an easier, more reliable and faster way to build -software.") - (license license:x11))) - -(define-public scons-python2 - (package - (inherit (package-with-python2 scons)) - (name "scons-python2"))) - (define-public python-exceptiongroup (package (name "python-exceptiongroup") diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 49afdbd54a..aac6bdd5eb 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -107,6 +107,7 @@ #:use-module (gnu packages bison) #:use-module (gnu packages bittorrent) #:use-module (gnu packages boost) + #:use-module (gnu packages build-tools) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index 8360708445..7be995a438 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -93,6 +93,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages bison) + #:use-module (gnu packages build-tools) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages documentation) diff --git a/guix/build-system/scons.scm b/guix/build-system/scons.scm index 74901b3478..e38213e8e0 100644 --- a/guix/build-system/scons.scm +++ b/guix/build-system/scons.scm @@ -45,8 +45,8 @@ (define (default-scons) "Return the default SCons package." ;; Lazily resolve the binding to avoid a circular dependency. - (let ((python (resolve-interface '(gnu packages python-xyz)))) - (module-ref python 'scons))) + (let ((build-tools (resolve-interface '(gnu packages build-tools)))) + (module-ref build-tools 'scons))) (define* (lower name #:key source inputs native-inputs outputs system target