From 1382f00db69c523b37c1c5b6d1480b772e33cc44 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 7 Jan 2022 22:22:17 +0530 Subject: Move to `guix shell' friendly manifest.scm. * guix.scm: Rename to manifest.scm. Replace `guix environment -l guix.scm' with `guix shell'. * README.org (Build): Replace `guix environment -l guix.scm' with `guix shell'. --- README.org | 5 +-- guix.scm | 139 ----------------------------------------------------------- manifest.scm | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 142 deletions(-) delete mode 100644 guix.scm create mode 100644 manifest.scm diff --git a/README.org b/README.org index 609300b..758545f 100644 --- a/README.org +++ b/README.org @@ -13,11 +13,10 @@ Build dependencies are - [[https://www.gnu.org/software/gsl/][GNU Scientific Library]] (for vector and scientific functions) - [[https://gnu.org/software/guile][GNU Guile]] (for the scheme wrappers) -The easiest way to install these dependencies is to use a [[https://guix.gnu.org/][guix]] -environment. +The easiest way to install these dependencies is to use [[https://guix.gnu.org/][GNU Guix]]. #+BEGIN_SRC shell - $ guix environment -l guix.scm + $ guix shell #+END_SRC To build, run the following commands. diff --git a/guix.scm b/guix.scm deleted file mode 100644 index ccebd8f..0000000 --- a/guix.scm +++ /dev/null @@ -1,139 +0,0 @@ -;;; Run the following command to enter a development environment for -;;; nsmc: -;;; -;;; $ guix environment -l guix.scm - -(use-modules (guix build-system cmake) - (guix build-system guile) - (guix build-system python) - (guix download) - (guix gexp) - (guix git-download) - ((guix licenses) #:prefix license:) - (guix packages) - (guix utils) - (gnu packages bash) - (gnu packages check) - (gnu packages code) - (gnu packages guile) - (gnu packages guile-xyz) - (gnu packages maths) - (gnu packages pkg-config) - (gnu packages python) - (gnu packages python-science) - (gnu packages python-xyz)) - -(define %source-dir (dirname (current-filename))) - -;; TODO: Contribute upstream to Guix and delete. -(define sph-lib - (package - (name "sph-lib") - (version "2021-01-05") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/sph-mn/sph-lib") - (commit "2b0474218e51c1debb4de7b932a0e1c8bff4577c"))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0yz8igkv725ddjlss4jhzzwam3p4zkw38z45pydsdv4q912qjxml")))) - (build-system guile-build-system) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'fix-build-errors - (lambda _ - (substitute* "modules/sph/documentation.scm" - (("\\(define output-format-markdown" all) - (string-append "(define default-format-arguments)\n" all))) - (chdir "modules") - (delete-file "sph/documentation/itpn.scm") - (delete-file-recursively "test")))))) - (inputs - `(("guile" ,guile-3.0) - ("guile-fibers" ,guile-fibers) - ("guile-reader" ,guile-reader))) - (home-page "https://github.com/sph-mn/sph-lib") - (synopsis "Collection of guile scheme libraries") - (description "Collection of guile scheme libraries") - (license license:gpl3+))) - -;; TODO: Contribute upstream to Guix and delete. -(define sph-sc - (package - (name "sph-sc") - (version "2021-02-02") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/sph-mn/sph-sc") - (commit "42c992737a5a1a176706c9a3c30c32ca3828476c"))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0f3nssnqpqbm5wfv53lg8wi3dcpc0l9qyysd9r1bvig343gs79lm")))) - (build-system guile-build-system) - (inputs - `(("bash" ,bash) - ("guile" ,guile-3.0) - ("sph-lib" ,sph-lib))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'build 'fix-build-errors - (lambda* (#:key outputs #:allow-other-keys) - (copy-recursively "other/sc-format/modules" "modules") - (chdir "modules") - (delete-file-recursively "test"))) - (add-after 'install 'install-executables - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (string-append (assoc-ref outputs "out"))) - (bin (string-append out "/bin")) - (version ,(version-major+minor (package-version guile-3.0))) - (scm (string-append out "/share/guile/site/" version)) - (go (string-append out "/share/guile/" version "/site-ccache"))) - (mkdir bin) - (for-each (lambda (executable) - (let ((installed-executable (string-append bin "/" (basename executable)))) - (copy-file executable installed-executable) - (wrap-program installed-executable - `("GUILE_LOAD_PATH" ":" prefix - (,scm ,(getenv "GUILE_LOAD_PATH"))) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix - (,go ,(getenv "GUILE_LOAD_COMPILED_PATH")))))) - (list "../exe/sc" - "../other/sc-format/exe/sc-format")))))))) - (home-page "https://github.com/sph-mn/sph-sc") - (synopsis "Compile scheme-like S-expressions to C") - (description "Compile scheme-like S-expressions to C") - (license license:gpl3+))) - -(define python-sambal - (package - (name "python-sambal") - (version "0.1.0") - (home-page "https://git.systemreboot.net/sambal") - (source - (origin - (method url-fetch) - (uri (pypi-uri "sambal" version)) - (sha256 - (base32 "0isna596k2cdp54c48gi988z51w49kix1k12vp1f5629ysy9rmrz")))) - (build-system python-build-system) - (native-inputs - `(("python-pytest" ,python-pytest) - ("python-scipy" ,python-scipy))) ; scipy is only required for - ; tests. - (propagated-inputs - `(("python-numpy" ,python-numpy))) - (synopsis "Sample balls, spheres, spherical caps") - (description "Sample balls, spheres, spherical caps") - (license license:gpl3+))) - -(packages->manifest - (list gsl guile-3.0 indent pkg-config sph-sc - python python-matplotlib python-numpy python-sambal python-scipy)) diff --git a/manifest.scm b/manifest.scm new file mode 100644 index 0000000..b65e55f --- /dev/null +++ b/manifest.scm @@ -0,0 +1,139 @@ +;;; Run the following command to enter a development environment for +;;; nsmc: +;;; +;;; $ guix shell + +(use-modules (guix build-system cmake) + (guix build-system guile) + (guix build-system python) + (guix download) + (guix gexp) + (guix git-download) + ((guix licenses) #:prefix license:) + (guix packages) + (guix utils) + (gnu packages bash) + (gnu packages check) + (gnu packages code) + (gnu packages guile) + (gnu packages guile-xyz) + (gnu packages maths) + (gnu packages pkg-config) + (gnu packages python) + (gnu packages python-science) + (gnu packages python-xyz)) + +(define %source-dir (dirname (current-filename))) + +;; TODO: Contribute upstream to Guix and delete. +(define sph-lib + (package + (name "sph-lib") + (version "2021-01-05") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sph-mn/sph-lib") + (commit "2b0474218e51c1debb4de7b932a0e1c8bff4577c"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0yz8igkv725ddjlss4jhzzwam3p4zkw38z45pydsdv4q912qjxml")))) + (build-system guile-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-build-errors + (lambda _ + (substitute* "modules/sph/documentation.scm" + (("\\(define output-format-markdown" all) + (string-append "(define default-format-arguments)\n" all))) + (chdir "modules") + (delete-file "sph/documentation/itpn.scm") + (delete-file-recursively "test")))))) + (inputs + `(("guile" ,guile-3.0) + ("guile-fibers" ,guile-fibers) + ("guile-reader" ,guile-reader))) + (home-page "https://github.com/sph-mn/sph-lib") + (synopsis "Collection of guile scheme libraries") + (description "Collection of guile scheme libraries") + (license license:gpl3+))) + +;; TODO: Contribute upstream to Guix and delete. +(define sph-sc + (package + (name "sph-sc") + (version "2021-02-02") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sph-mn/sph-sc") + (commit "42c992737a5a1a176706c9a3c30c32ca3828476c"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0f3nssnqpqbm5wfv53lg8wi3dcpc0l9qyysd9r1bvig343gs79lm")))) + (build-system guile-build-system) + (inputs + `(("bash" ,bash) + ("guile" ,guile-3.0) + ("sph-lib" ,sph-lib))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'build 'fix-build-errors + (lambda* (#:key outputs #:allow-other-keys) + (copy-recursively "other/sc-format/modules" "modules") + (chdir "modules") + (delete-file-recursively "test"))) + (add-after 'install 'install-executables + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (string-append (assoc-ref outputs "out"))) + (bin (string-append out "/bin")) + (version ,(version-major+minor (package-version guile-3.0))) + (scm (string-append out "/share/guile/site/" version)) + (go (string-append out "/share/guile/" version "/site-ccache"))) + (mkdir bin) + (for-each (lambda (executable) + (let ((installed-executable (string-append bin "/" (basename executable)))) + (copy-file executable installed-executable) + (wrap-program installed-executable + `("GUILE_LOAD_PATH" ":" prefix + (,scm ,(getenv "GUILE_LOAD_PATH"))) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix + (,go ,(getenv "GUILE_LOAD_COMPILED_PATH")))))) + (list "../exe/sc" + "../other/sc-format/exe/sc-format")))))))) + (home-page "https://github.com/sph-mn/sph-sc") + (synopsis "Compile scheme-like S-expressions to C") + (description "Compile scheme-like S-expressions to C") + (license license:gpl3+))) + +(define python-sambal + (package + (name "python-sambal") + (version "0.1.0") + (home-page "https://git.systemreboot.net/sambal") + (source + (origin + (method url-fetch) + (uri (pypi-uri "sambal" version)) + (sha256 + (base32 "0isna596k2cdp54c48gi988z51w49kix1k12vp1f5629ysy9rmrz")))) + (build-system python-build-system) + (native-inputs + `(("python-pytest" ,python-pytest) + ("python-scipy" ,python-scipy))) ; scipy is only required for + ; tests. + (propagated-inputs + `(("python-numpy" ,python-numpy))) + (synopsis "Sample balls, spheres, spherical caps") + (description "Sample balls, spheres, spherical caps") + (license license:gpl3+))) + +(packages->manifest + (list gsl guile-3.0 indent pkg-config sph-sc + python python-matplotlib python-numpy python-sambal python-scipy)) -- cgit v1.2.3