aboutsummaryrefslogtreecommitdiff
path: root/gn/packages/datastructures.scm
diff options
context:
space:
mode:
authorShepherd on Tux022024-06-20 08:37:15 -0500
committerShepherd on Tux022024-06-20 08:37:15 -0500
commitfe5fd5cb23907f8e37edafda96bafa608a3e0e7f (patch)
tree0b4cec2038dde07fe26f1c6882369f36a9545a19 /gn/packages/datastructures.scm
parentf0f8dc84eca7088177797f84db05314537615c77 (diff)
parent0362ee068a39ce9a5fd6f0fba9cd5586211f07f1 (diff)
downloadguix-bioinformatics-fe5fd5cb23907f8e37edafda96bafa608a3e0e7f.tar.gz
Merge branch 'master' of /home/git/public/guix-bioinformatics
Diffstat (limited to 'gn/packages/datastructures.scm')
-rw-r--r--gn/packages/datastructures.scm117
1 files changed, 117 insertions, 0 deletions
diff --git a/gn/packages/datastructures.scm b/gn/packages/datastructures.scm
new file mode 100644
index 0000000..1744420
--- /dev/null
+++ b/gn/packages/datastructures.scm
@@ -0,0 +1,117 @@
+;; Datastructures module
+
+(define-module (gn packages datastructures)
+ #:use-module (guix packages)
+ #:use-module (guix gexp)
+ #:use-module (guix utils)
+ #:use-module (gnu packages datastructures))
+
+(define sdsl-lite-x86-64-v2
+ (package/inherit sdsl-lite
+ (name "sdsl-lite-x86-64-v2")
+ (arguments
+ (substitute-keyword-arguments (package-arguments sdsl-lite)
+ ((#:configure-flags flags #~'())
+ #~(append (list "-DCMAKE_CXX_FLAGS=-march=x86-64-v2"
+ "-DCMAKE_INSTALL_LIBDIR=lib/glibc-hwcaps/x86-64-v2"
+ (string-append "-DCMAKE_INSTALL_RPATH=" #$output
+ "/lib/glibc-hwcaps/x86-64-v2"))
+ #$flags))
+ ;; The building machine can't necessarily run the code produced.
+ ((#:tests? _ #t) #f)
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'remove-extra-files
+ (lambda _
+ (delete-file-recursively (string-append #$output "/include"))))
+ (replace 'install-static-library
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((lib "/lib/glibc-hwcaps/x86-64-v2/libsdsl.a"))
+ (mkdir-p (dirname (string-append #$output:static lib)))
+ (copy-file "lib/libsdsl_static.a"
+ (string-append #$output:static lib)))))))))
+ (supported-systems '("x86_64-linux"))
+ (properties `((hidden? . #t)))))
+
+(define sdsl-lite-x86-64-v3
+ (package/inherit sdsl-lite
+ (name "sdsl-lite-x86-64-v3")
+ (arguments
+ (substitute-keyword-arguments (package-arguments sdsl-lite)
+ ((#:configure-flags flags #~'())
+ #~(append (list "-DCMAKE_CXX_FLAGS=-march=x86-64-v3"
+ "-DCMAKE_INSTALL_LIBDIR=lib/glibc-hwcaps/x86-64-v3"
+ (string-append "-DCMAKE_INSTALL_RPATH=" #$output
+ "/lib/glibc-hwcaps/x86-64-v3"))
+ #$flags))
+ ;; The building machine can't necessarily run the code produced.
+ ((#:tests? _ #t) #f)
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'remove-extra-files
+ (lambda _
+ (delete-file-recursively (string-append #$output "/include"))))
+ (replace 'install-static-library
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((lib "/lib/glibc-hwcaps/x86-64-v3/libsdsl.a"))
+ (mkdir-p (dirname (string-append #$output:static lib)))
+ (copy-file "lib/libsdsl_static.a"
+ (string-append #$output:static lib)))))))))
+ (supported-systems '("x86_64-linux"))
+ (properties `((hidden? . #t)))))
+
+(define sdsl-lite-x86-64-v4
+ (package/inherit sdsl-lite
+ (name "sdsl-lite-x86-64-v4")
+ (arguments
+ (substitute-keyword-arguments (package-arguments sdsl-lite)
+ ((#:configure-flags flags #~'())
+ #~(append (list "-DCMAKE_CXX_FLAGS=-march=x86-64-v4"
+ "-DCMAKE_INSTALL_LIBDIR=lib/glibc-hwcaps/x86-64-v4"
+ (string-append "-DCMAKE_INSTALL_RPATH=" #$output
+ "/lib/glibc-hwcaps/x86-64-v4"))
+ #$flags))
+ ;; The building machine can't necessarily run the code produced.
+ ((#:tests? _ #t) #f)
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'remove-extra-files
+ (lambda _
+ (delete-file-recursively (string-append #$output "/include"))))
+ (replace 'install-static-library
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((lib "/lib/glibc-hwcaps/x86-64-v4/libsdsl.a"))
+ (mkdir-p (dirname (string-append #$output:static lib)))
+ (copy-file "lib/libsdsl_static.a"
+ (string-append #$output:static lib)))))))))
+ (supported-systems '("x86_64-linux"))
+ (properties `((hidden? . #t)))))
+
+(define-public sdsl-lite-hwcaps
+ (package/inherit sdsl-lite
+ (name "sdsl-lite-hwcaps")
+ (arguments
+ (substitute-keyword-arguments (package-arguments sdsl-lite)
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'install-optimized-libraries
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((hwcaps "/lib/glibc-hwcaps"))
+ (copy-recursively
+ (string-append (assoc-ref inputs "sdsl-lite-x86-64-v2")
+ hwcaps "/x86-64-v2")
+ (string-append #$output hwcaps "/x86-64-v2"))
+ (copy-recursively
+ (string-append (assoc-ref inputs "sdsl-lite-x86-64-v3")
+ hwcaps "/x86-64-v3")
+ (string-append #$output hwcaps "/x86-64-v3"))
+ (copy-recursively
+ (string-append (assoc-ref inputs "sdsl-lite-x86-64-v4")
+ hwcaps "/x86-64-v4")
+ (string-append #$output hwcaps "/x86-64-v4")))))))))
+ (native-inputs
+ (modify-inputs (package-native-inputs sdsl-lite)
+ (append sdsl-lite-x86-64-v2
+ sdsl-lite-x86-64-v3
+ sdsl-lite-x86-64-v4)))
+ (properties `((tunable? . #f)))))