gnu: rocksdb: Update to 6.26.1.

* gnu/packages/databases.scm (rocksdb): Update to 6.26.1.
[build-system]: Use cmake-build-system.
[arguments]: Disable tests for all architectures; update configure-flags to
new build system; remove build phase customization; add two phases:
'build-generically and 'patch-CMakeLists.txt.
This commit is contained in:
Ricardo Wurmus 2021-12-19 23:36:57 +01:00
parent 5828c7df1e
commit f7139ce79f
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1395,7 +1395,7 @@ including field and record folding.")
(define-public rocksdb (define-public rocksdb
(package (package
(name "rocksdb") (name "rocksdb")
(version "6.25.3") (version "6.26.1")
(source (origin (source (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
@ -1404,7 +1404,7 @@ including field and record folding.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"14150kd7hk8jjwpm28bf3a0agrhyapbq9lgnl00l385vfb73wnzl")) "0mylma106w93kxhj89g9y1ccdq7m9m94wrmv5nyr17yc1zsk87sg"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
@ -1412,70 +1412,33 @@ including field and record folding.")
(delete-file "build_tools/gnu_parallel") (delete-file "build_tools/gnu_parallel")
(substitute* "Makefile" (substitute* "Makefile"
(("build_tools/gnu_parallel") "parallel")))))) (("build_tools/gnu_parallel") "parallel"))))))
(build-system gnu-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:make-flags (list (string-append "CC=" ,(cc-for-target)) `(#:configure-flags
(string-append "PREFIX=" (assoc-ref %outputs "out")) (list "-DROCKSDB_BUILD_SHARED=1"
;; Ceph requires that RTTI is enabled. ;; Ceph requires that RTTI is enabled.
"USE_RTTI=1" "-DUSE_RTTI=1"
;; Don't pass '-march=native' to the compiler. ;; Prevent the build from passing '-march=native' to the compiler.
"PORTABLE=1" "-DPORTABLE=1")
;; Use a deterministic date stamp.
"build_date=1970-01-01"
;; Running the full test suite takes hours and require ;; Many tests fail on 32-bit platforms. There are multiple
;; a lot of disk space. Instead we only run a subset ;; reports about this upstream, but it's not going to be
;; that exercises platform-specific functionality. ;; supported any time soon. What's worse: Release builds don't
"ROCKSDBTESTS_PLATFORM_DEPENDENT=only") ;; include tests, and overriding the build system to build
#:test-target "check_some" ;; tests anyway fails with missing TEST_ symbols.
;; Many tests fail on 32-bit platforms. There are multiple reports about #:tests? #false
;; this upstream, but it's not going to be supported any time soon.
#:tests? ,(if (%current-target-system)
#f
(let ((system (%current-system)))
(or (string-prefix? "x86_64-linux" system)
(string-prefix? "aarch64-linux" system))))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'patch-Makefile (add-after 'unpack 'patch-CMakeLists.txt
(lambda _ (lambda _
(substitute* "Makefile" (substitute* "CMakeLists.txt"
;; Don't depend on the static library when installing. ;; build reproducibly
(("install: install-static") (("set\\(BUILD_DATE \"\\$\\{TS\\}\"")
"install:") "set(BUILD_DATE \"1970-01-01\""))))
(("#!/bin/sh") (string-append "#!" (which "sh")))))) (add-after 'unpack 'build-generically
(delete 'configure)
;; The default target is only needed for tests and built on demand.
(delete 'build)
(add-before 'check 'mount-tmp
;; Use the provided workspace directory for test files.
;; Otherwise, /tmp is used which is a mount namespace on /gnu/store.
;; This speeds up the build when the host /tmp is a proper tmpfs or
;; other fast filesystem, as opposed to /gnu which may be a HDD.
(lambda _ (lambda _
(let ((test-dir (string-append (getcwd) "/../test"))) (substitute* "CMakeLists.txt"
(mkdir test-dir) (("if\\(HAVE_SSE42\\)") "if(FALSE)")))))))
(setenv "TEST_TMPDIR" (canonicalize-path test-dir)))))
(add-before 'check 'disable-failing-tests
(lambda _
(substitute* "Makefile"
;; These tests reliably fail due to "Too many open files".
(("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
(("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))))
(add-after 'check 'clean
(lambda _
;; Otherwise stale objects from the tests would interfere.
(invoke "make" "clean")))
(add-after 'clean 'build
;; The default build target is a debug build for tests. The
;; install target depends on the "shared_lib" release target
;; so we build it here for clarity.
(lambda* (#:key (make-flags '()) parallel-build? #:allow-other-keys)
(apply invoke "make" "shared_lib"
`(,@(if parallel-build?
`("-j" ,(number->string (parallel-job-count)))
'())
,@make-flags)))))))
(native-inputs (native-inputs
(list parallel perl procps python which)) (list parallel perl procps python which))
(inputs (inputs