[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add external data to a package
From: |
Parnikkapore |
Subject: |
Re: Add external data to a package |
Date: |
Wed, 13 Nov 2024 16:34:58 +0800 |
User-agent: |
Evolution 3.52.3-0ubuntu1 |
A lot of objects can be ungexp-ed into a gexp to substitute in its store path.
`<origin>`s are one of them:
```scheme
(define WSRT_Measures
(origin
(method url-fetch)
(uri "[...not sure I can disclose...]/WSRT_Measures.ztar")
(sha256
(base32 "1d9qlcmkpsnw8wm7sidp17iwd2d771nsgjwwp568886g5f239a8k"))))
(define-public casacore
(package
(name "casacore")
(version "3.5.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/casacore/casacore.git")
(recursive? #t)
(commit "v3.5.0"))))
(file-name (git-file-name name version))
(sha256 (base32 "0zw70slc3681mnadg169avjg7d3jwn1x49xn0022207blcig8g2l")))
(inputs
(list fftwf fftw openblas boost gcc-toolchain git gsl lapack
gfortran-toolchain readline flex bison cfitsio wcslib python python-numpy))
(build-system cmake-build-system)
(arguments (list
#:configure-flags #~(list "-DHELLO_WHO=Guix" "-DBUILD_DYSCO=ON")
#:build-type "Release"
#:tests? #f ;; some test are failing due to lack of data that
are downloable via ftp; for now testing is disabled
#:parallel-build? #t ;; TODO : check if it makes a difference in
building time
#:phases
#~(modify-phases %standard-phases
(add-after 'install 'install-data
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(data #$WSRT_Measures) ; <- ===== See here!
================
(share-dir (string-append out
"/share/casacore/data/")))
(mkdir-p share-dir)
(invoke "tar" "-xzf" data "-C" share-dir)
#t))))))
(home-page "http://casacore.github.io/casacore/")
(synopsis "")
(description "A suite of C++ libraries for radio astronomy data processing.")
(license license:gpl2+)))
```
Yeah, this is not well-explained in the documentation right now.
(Also took the opportunity to reformat the code from the email. There seems to
be quite a few mismatching parentheses, which would've led to some very
confusing error messages... my advice is turning on the Lisp / Scheme mode of
your editor and turning on the "rainbow parentheses" option.)