gnu: hdf-java: Adjust indentation.

* gnu/packages/maths.scm (hdf-java): Adjust indentation.
This commit is contained in:
Ricardo Wurmus 2019-03-27 10:47:34 +01:00
parent 64dc8b0bfd
commit 2a509880d4
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -886,130 +886,130 @@ (define-public hdf5-1.10
(define-public hdf-java (define-public hdf-java
(package (package
(name "hdf-java") (name "hdf-java")
(version "3.3.2") (version "3.3.2")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
"http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-" "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
version "/src/CMake-hdfjava-" version ".tar.gz")) version "/src/CMake-hdfjava-" version ".tar.gz"))
(sha256 (sha256
(base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr")) (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet ; Make sure we don't use the bundled sources and binaries. (snippet ; Make sure we don't use the bundled sources and binaries.
`(begin `(begin
(for-each delete-file (for-each delete-file
(list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz" (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
"HDF4.tar.gz" "HDF5.tar.gz")) "HDF4.tar.gz" "HDF5.tar.gz"))
(delete-file-recursively ,(string-append "hdfjava-" version "/lib")) (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
#t)))) #t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs
`(("jdk" ,icedtea "jdk") `(("jdk" ,icedtea "jdk")
("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'. ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
;; For tests: ;; For tests:
("hamcrest-core" ,java-hamcrest-core) ("hamcrest-core" ,java-hamcrest-core)
("junit" ,java-junit) ("junit" ,java-junit)
("slf4j-simple" ,java-slf4j-simple))) ("slf4j-simple" ,java-slf4j-simple)))
(inputs (inputs
`(("hdf4" ,hdf4) `(("hdf4" ,hdf4)
("hdf5" ,hdf5) ("hdf5" ,hdf5)
("zlib" ,zlib) ("zlib" ,zlib)
("libjpeg" ,libjpeg) ("libjpeg" ,libjpeg)
("slf4j-api" ,java-slf4j-api))) ("slf4j-api" ,java-slf4j-api)))
(arguments (arguments
`(#:configure-flags `(#:configure-flags
(list (string-append "--target=" ,(or (%current-target-system) (%current-system))) (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
(string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include," (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
(assoc-ref %build-inputs "jdk") "/lib" ) (assoc-ref %build-inputs "jdk") "/lib" )
(string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib") (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
(string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib")) (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
#:make-flags #:make-flags
(list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib") (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
(string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib") (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
(string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so") (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
(string-append "JPEGLIB=" (string-append "JPEGLIB="
(assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so") (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
"LLEXT=so") "LLEXT=so")
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-before 'configure 'chdir-to-source (add-before 'configure 'chdir-to-source
(lambda _ (chdir ,(string-append "hdfjava-" version)) #t)) (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
(add-before 'configure 'patch-build (add-before 'configure 'patch-build
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(substitute* "configure" (substitute* "configure"
(("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
(("/bin/cat") (which "cat"))) (("/bin/cat") (which "cat")))
;; Set classpath for compilation ;; Set classpath for compilation
(substitute* '("hdf/hdf5lib/Makefile.in" (substitute* '("hdf/hdf5lib/Makefile.in"
"hdf/hdf5lib/exceptions/Makefile.in" "hdf/hdf5lib/exceptions/Makefile.in"
"hdf/hdflib/Makefile.in") "hdf/hdflib/Makefile.in")
(("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar") (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
(string-append (assoc-ref inputs "slf4j-api") (string-append (assoc-ref inputs "slf4j-api")
"/share/java/slf4j-api.jar"))) "/share/java/slf4j-api.jar")))
;; Replace outdated config.sub and config.guess: ;; Replace outdated config.sub and config.guess:
(with-directory-excursion "config" (with-directory-excursion "config"
(for-each (lambda (file) (for-each (lambda (file)
(install-file (install-file
(string-append (assoc-ref inputs "automake") (string-append (assoc-ref inputs "automake")
"/share/automake-" "/share/automake-"
,(version-major+minor (package-version automake)) ,(version-major+minor (package-version automake))
"/" file) ".")) "/" file) "."))
'("config.sub" "config.guess"))) '("config.sub" "config.guess")))
;; Fix embedded version number ;; Fix embedded version number
(let ((hdf5version (list ,@(string-split (package-version hdf5) #\.)))) (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
(substitute* "hdf/hdf5lib/H5.java" (substitute* "hdf/hdf5lib/H5.java"
(("1, 8, 19") (("1, 8, 19")
(string-join hdf5version ", ")))) (string-join hdf5version ", "))))
(mkdir-p (string-append (assoc-ref outputs "out"))) (mkdir-p (string-append (assoc-ref outputs "out")))
;; Set classpath for tests ;; Set classpath for tests
(let* ((build-dir (getcwd)) (let* ((build-dir (getcwd))
(lib (string-append build-dir "/lib")) (lib (string-append build-dir "/lib"))
(jhdf (string-append lib "/jhdf.jar")) (jhdf (string-append lib "/jhdf.jar"))
(jhdf5 (string-append lib "/jhdf5.jar")) (jhdf5 (string-append lib "/jhdf5.jar"))
(testjars (testjars
(map (lambda (i) (map (lambda (i)
(string-append (assoc-ref inputs i) (string-append (assoc-ref inputs i)
"/share/java/" i ".jar")) "/share/java/" i ".jar"))
'("junit" "hamcrest-core" "slf4j-api" "slf4j-simple"))) '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
(class-path (class-path
(string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":"))) (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
(substitute* '("test/hdf5lib/Makefile.in" (substitute* '("test/hdf5lib/Makefile.in"
"test/hdf5lib/junit.sh.in" "test/hdf5lib/junit.sh.in"
"examples/runExample.sh.in") "examples/runExample.sh.in")
(("/usr/bin/test") (("/usr/bin/test")
(string-append (assoc-ref inputs "coreutils") (string-append (assoc-ref inputs "coreutils")
"/bin/test")) "/bin/test"))
(("/usr/bin/uname") (("/usr/bin/uname")
(string-append (assoc-ref inputs "coreutils") (string-append (assoc-ref inputs "coreutils")
"/bin/uname")) "/bin/uname"))
(("CLASSPATH=[^\n]*") (("CLASSPATH=[^\n]*")
(string-append "CLASSPATH=" class-path))) (string-append "CLASSPATH=" class-path)))
(setenv "CLASSPATH" class-path)) (setenv "CLASSPATH" class-path))
#t)) #t))
(add-before 'check 'build-examples (add-before 'check 'build-examples
(lambda _ (lambda _
(apply invoke `("javac" (apply invoke `("javac"
,@(find-files "examples" ".*\\.java")))))) ,@(find-files "examples" ".*\\.java"))))))
#:parallel-build? #f #:parallel-build? #f
#:parallel-tests? #f )) #:parallel-tests? #f ))
(home-page "https://support.hdfgroup.org/products/java") (home-page "https://support.hdfgroup.org/products/java")
(synopsis "Java interface for the HDF4 and HDF5 libraries") (synopsis "Java interface for the HDF4 and HDF5 libraries")
(description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
implemented in C.") implemented in C.")
;; BSD-style license: ;; BSD-style license:
(license (license:x11-style (license (license:x11-style
"https://support.hdfgroup.org/ftp/HDF5/hdf-java\ "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
/current/src/unpacked/COPYING")))) /current/src/unpacked/COPYING"))))
(define-public hdf-eos2 (define-public hdf-eos2