| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 |
|
| 39 | (define-module (gnu packages boost)
|
| 40 | #:use-module ((guix licenses) #:prefix license:)
|
| 41 | #:use-module (guix utils)
|
| 42 | #:use-module (guix gexp)
|
| 43 | #:use-module (guix packages)
|
| 44 | #:use-module (guix download)
|
| 45 | #:use-module (guix git-download)
|
| 46 | #:use-module (guix build-system gnu)
|
| 47 | #:use-module (guix build-system pyproject)
|
| 48 | #:use-module (guix build-system trivial)
|
| 49 | #:use-module (gnu packages)
|
| 50 | #:use-module (gnu packages autotools)
|
| 51 | #:use-module (gnu packages compression)
|
| 52 | #:use-module (gnu packages icu4c)
|
| 53 | #:use-module (gnu packages llvm)
|
| 54 | #:use-module (gnu packages perl)
|
| 55 | #:use-module (gnu packages pkg-config)
|
| 56 | #:use-module (gnu packages python)
|
| 57 | #:use-module (gnu packages python-xyz)
|
| 58 | #:use-module (gnu packages shells)
|
| 59 | #:use-module (gnu packages mpi))
|
| 60 |
|
| 61 | (define (version-with-underscores version)
|
| 62 | (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))
|
| 63 |
|
| 64 | (define (boost-patch name version hash)
|
| 65 | (origin
|
| 66 | (method url-fetch)
|
| 67 | (uri (string-append "https://www.boost.org/patches/"
|
| 68 | (version-with-underscores version) "/" name))
|
| 69 | (file-name (string-append "boost-" name))
|
| 70 | (sha256 (base32 hash))))
|
| 71 |
|
| 72 | (define-public boost
|
| 73 | (package
|
| 74 | (name "boost")
|
| 75 | (version "1.89.0")
|
| 76 | (source (origin
|
| 77 | (method url-fetch)
|
| 78 | (uri (string-append "https://archives.boost.io/release/"
|
| 79 | version "/source/boost_"
|
| 80 | (version-with-underscores version) ".tar.bz2"))
|
| 81 | (sha256
|
| 82 | (base32
|
| 83 | "0yhcb8dn7g5k9dfr54j99wpd4qwk59g1lpp8z0ag7d114si3z8w5"))))
|
| 84 | (build-system gnu-build-system)
|
| 85 | (arguments
|
| 86 | (list
|
| 87 | #:tests? #f
|
| 88 | #:configure-flags
|
| 89 | #~(let ((icu (dirname (dirname (search-input-file
|
| 90 | %build-inputs "bin/uconv")))))
|
| 91 | (list
|
| 92 | |
| 93 | |
| 94 | (string-append "--with-icu=" icu)
|
| 95 | |
| 96 | |
| 97 | |
| 98 | #$@(force
|
| 99 | (if (or (%current-target-system)
|
| 100 | (not (this-package-input "python-minimal-wrapper")))
|
| 101 | (delay
|
| 102 | #~())
|
| 103 | (delay
|
| 104 | #~((let ((python (dirname (dirname (search-input-file
|
| 105 | %build-inputs
|
| 106 | "bin/python")))))
|
| 107 | (string-append "--with-python-root=" python)
|
| 108 | (string-append "--with-python=" python
|
| 109 | "/bin/python")
|
| 110 | (string-append "--with-python-version="
|
| 111 | #$(version-major+minor
|
| 112 | (package-version
|
| 113 | (this-package-input
|
| 114 | "python-minimal-wrapper")))))))))
|
| 115 | "--with-toolset=gcc"))
|
| 116 | #:make-flags
|
| 117 | #~(list "threading=multi" "link=shared"
|
| 118 |
|
| 119 | |
| 120 | (string-append "linkflags=-Wl,-rpath="
|
| 121 | #$output "/lib")
|
| 122 | #$@(if (%current-target-system)
|
| 123 | #~("--user-config=user-config.jam"
|
| 124 | |
| 125 | "--without-python"
|
| 126 | "binary-format=elf"
|
| 127 | "target-os=linux"
|
| 128 | #$@(cond
|
| 129 | ((string-prefix? "x86_64" (%current-target-system))
|
| 130 | #~()) |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | ((string-prefix? "arm" (%current-target-system))
|
| 150 | #~("abi=aapcs"
|
| 151 | "address-model=32"
|
| 152 | "architecture=arm"
|
| 153 | |
| 154 | |
| 155 | "boost.stacktrace.from_exception=off"))
|
| 156 | ((string-prefix? "aarch64" (%current-target-system))
|
| 157 | #~("abi=aapcs"
|
| 158 | "address-model=64"
|
| 159 | "architecture=arm"
|
| 160 | |
| 161 | |
| 162 | "boost.stacktrace.from_exception=off"))
|
| 163 | (else
|
| 164 | |
| 165 | |
| 166 | #~("boost.stacktrace.from_exception=off"))))
|
| 167 | |
| 168 | #~(#$@(cond
|
| 169 | ((string-suffix? "mingw32" (%current-system))
|
| 170 | #~()) |
| 171 | ((string-prefix? "x86_64" (%current-system))
|
| 172 | #~()) |
| 173 | (else
|
| 174 | |
| 175 | |
| 176 | #~("boost.stacktrace.from_exception=off"))))))
|
| 177 | #:phases
|
| 178 | #~(modify-phases %standard-phases
|
| 179 | (add-after 'unpack 'patch-shells
|
| 180 | (lambda _
|
| 181 | (substitute* '("libs/config/configure"
|
| 182 | "libs/spirit/classic/phoenix/test/runtest.sh"
|
| 183 | "tools/build/src/engine/execunix.cpp")
|
| 184 | (("/bin/sh") (which "sh")))))
|
| 185 | (delete 'bootstrap)
|
| 186 | (replace 'configure
|
| 187 | (lambda* (#:key (configure-flags ''()) #:allow-other-keys)
|
| 188 | (setenv "SHELL" (which "sh"))
|
| 189 | (setenv "CONFIG_SHELL" (which "sh"))
|
| 190 |
|
| 191 | #$@(if (%current-target-system)
|
| 192 | #~((call-with-output-file "user-config.jam"
|
| 193 | (lambda (port)
|
| 194 | (format port
|
| 195 | "using gcc : cross : ~a-c++ ;"
|
| 196 | #$(%current-target-system)))))
|
| 197 | #~())
|
| 198 |
|
| 199 | (apply invoke "./bootstrap.sh"
|
| 200 | (string-append "--prefix=" #$output)
|
| 201 | configure-flags)))
|
| 202 | (replace 'build
|
| 203 | (lambda* (#:key make-flags #:allow-other-keys)
|
| 204 | (apply invoke "./b2"
|
| 205 | (format #f "-j~a" (parallel-job-count))
|
| 206 | make-flags)))
|
| 207 | (replace 'install
|
| 208 | (lambda* (#:key make-flags #:allow-other-keys)
|
| 209 | (apply invoke "./b2" "install" make-flags)))
|
| 210 | #$@(force |
| 211 | (if (or (%current-target-system)
|
| 212 | (not (this-package-input "python-minimal-wrapper")))
|
| 213 | (delay
|
| 214 | #~())
|
| 215 | (delay
|
| 216 | #~((add-after 'install 'provide-libboost_python
|
| 217 | (lambda* (#:key make-flags inputs outputs
|
| 218 | #:allow-other-keys)
|
| 219 | (let* ((static? (member "link=static" make-flags))
|
| 220 | (ext (if static? ".a" ".so"))
|
| 221 | (python (dirname
|
| 222 | (dirname (search-input-file
|
| 223 | inputs "bin/python"))))
|
| 224 | (python-version
|
| 225 | #$(version-major+minor
|
| 226 | (package-version
|
| 227 | (this-package-input
|
| 228 | "python-minimal-wrapper"))))
|
| 229 | (NN (string-join (string-split
|
| 230 | python-version #\.)
|
| 231 | ""))
|
| 232 | (libboost_pythonNN
|
| 233 | (string-append "libboost_python" NN ext))
|
| 234 | (major (string-take python-version 1)))
|
| 235 | (with-directory-excursion
|
| 236 | (string-append #$output "/lib")
|
| 237 | (symlink libboost_pythonNN
|
| 238 | (string-append "libboost_python" ext))
|
| 239 | |
| 240 | (symlink libboost_pythonNN
|
| 241 | (string-append "libboost_python"
|
| 242 | major ext)))))))))))))
|
| 243 | (inputs
|
| 244 | (append
|
| 245 | (list icu4c zlib)
|
| 246 | (if (%current-target-system)
|
| 247 | '()
|
| 248 | (list python-minimal-wrapper))))
|
| 249 | (native-inputs
|
| 250 | (list perl tcsh))
|
| 251 | (home-page "https://www.boost.org")
|
| 252 | (synopsis "Peer-reviewed portable C++ source libraries")
|
| 253 | (description
|
| 254 | "A collection of libraries intended to be widely useful, and usable
|
| 255 | across a broad spectrum of applications.")
|
| 256 | (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
|
| 257 | "Some components have other similar licences."))))
|
| 258 |
|
| 259 | (define-public boost-1.88
|
| 260 | (package
|
| 261 | (inherit boost)
|
| 262 | (name "boost")
|
| 263 | (version "1.88.0")
|
| 264 | (source (origin
|
| 265 | (inherit (package-source boost))
|
| 266 | (uri (string-append
|
| 267 | "https://archives.boost.io/release/"
|
| 268 | version "/source/boost_"
|
| 269 | (version-with-underscores version) ".tar.bz2"))
|
| 270 | (sha256
|
| 271 | (base32
|
| 272 | "0yrgn6syk260ckq9ld44vjv1bl6bamhy3jbp10kikcipcv0d5na6"))))))
|
| 273 |
|
| 274 | (define-public boost-1.83
|
| 275 | (package
|
| 276 | (inherit boost)
|
| 277 | (name "boost")
|
| 278 | (version "1.83.0")
|
| 279 | (source (origin
|
| 280 | (method url-fetch)
|
| 281 | (uri (string-append "https://archives.boost.io/release/"
|
| 282 | version "/source/boost_"
|
| 283 | (version-with-underscores version) ".tar.bz2"))
|
| 284 | (patches
|
| 285 | (list (boost-patch
|
| 286 | "0001-unordered-fix-copy-assign.patch" version
|
| 287 | "0l520lqh2vxdlyzvpki6hy2ylqimag8v18n2sdbmliifxiiha4gl")))
|
| 288 | (patch-flags '("-p2"))
|
| 289 | (sha256
|
| 290 | (base32
|
| 291 | "13iviiwk1srpw9dmiwabkxv56v0pl0zggjp8zxy1419k5zzfsy34"))))
|
| 292 | (arguments
|
| 293 | (substitute-keyword-arguments arguments
|
| 294 | ((#:make-flags _ #f)
|
| 295 | #~(list "threading=multi" "link=shared"
|
| 296 | |
| 297 | (string-append "linkflags=-Wl,-rpath="
|
| 298 | #$output "/lib")
|
| 299 | #$@(if (%current-target-system)
|
| 300 | #~("--user-config=user-config.jam"
|
| 301 | |
| 302 | "--without-python"
|
| 303 | "binary-format=elf"
|
| 304 | "target-os=linux"
|
| 305 | #$@(cond
|
| 306 | ((string-prefix? "arm" (%current-target-system))
|
| 307 | #~("abi=aapcs"
|
| 308 | "address-model=32"
|
| 309 | "architecture=arm"))
|
| 310 | ((string-prefix? "aarch64" (%current-target-system))
|
| 311 | #~("abi=aapcs"
|
| 312 | "address-model=64"
|
| 313 | "architecture=arm"))
|
| 314 | (else
|
| 315 | #~())))
|
| 316 | |
| 317 | #~())))))))
|
| 318 |
|
| 319 | (define-public boost-static
|
| 320 | (package
|
| 321 | (inherit boost)
|
| 322 | (name "boost-static")
|
| 323 | (arguments
|
| 324 | (substitute-keyword-arguments arguments
|
| 325 | ((#:make-flags flags)
|
| 326 | #~(cons "link=static" (delete "link=shared" #$flags)))))))
|
| 327 |
|
| 328 | (define-public boost-for-mysql
|
| 329 | |
| 330 | (package
|
| 331 | (inherit boost)
|
| 332 | (version "1.59.0")
|
| 333 | (source (origin
|
| 334 | (method url-fetch)
|
| 335 | (uri (string-append "https://archives.boost.io/release/"
|
| 336 | version "/source/boost_"
|
| 337 | (version-with-underscores version) ".tar.bz2"))
|
| 338 | (sha256
|
| 339 | (base32
|
| 340 | "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj"))))
|
| 341 | (arguments
|
| 342 | (substitute-keyword-arguments arguments
|
| 343 | ((#:configure-flags _ #~'())
|
| 344 | #~(let ((icu (dirname (dirname (search-input-file
|
| 345 | %build-inputs "bin/uconv")))))
|
| 346 | (list
|
| 347 | |
| 348 | |
| 349 | (string-append "--with-icu=" icu)
|
| 350 | "--with-toolset=gcc")))
|
| 351 | ((#:phases phases)
|
| 352 | #~(modify-phases #$phases
|
| 353 | (add-after 'unpack 'apply-gcc-14-patch
|
| 354 | (lambda _
|
| 355 | (substitute* "tools/build/src/engine/build.sh"
|
| 356 | (("=gcc")
|
| 357 | "=\"gcc -Wno-error=implicit-function-declaration\""))
|
| 358 | (substitute* "tools/build/src/engine/build.jam"
|
| 359 | ((": -pedantic -fno-strict-aliasing" all)
|
| 360 | (string-append
|
| 361 | all
|
| 362 | " -Wno-error=implicit-function-declaration")))))
|
| 363 | (replace 'patch-shells
|
| 364 | (lambda _
|
| 365 | (substitute* (append
|
| 366 | (find-files "tools/build/src/engine/" "execunix\\.c.*")
|
| 367 | '("libs/config/configure"
|
| 368 | "libs/spirit/classic/phoenix/test/runtest.sh"
|
| 369 | "tools/build/doc/bjam.qbk"
|
| 370 | "tools/build/src/engine/Jambase"))
|
| 371 | (("/bin/sh") (which "sh")))))
|
| 372 | (delete 'provide-libboost_python)))
|
| 373 | ((#:make-flags make-flags)
|
| 374 | #~(cons* "--without-python" #$make-flags))))
|
| 375 | (inputs
|
| 376 | (modify-inputs inputs
|
| 377 | (delete "python-minimal-wrapper")))
|
| 378 | (properties '((hidden? . #t)))))
|
| 379 |
|
| 380 | (define-public boost-numpy
|
| 381 | (package
|
| 382 | (inherit boost-1.83)
|
| 383 | (name "boost-numpy")
|
| 384 | (native-inputs
|
| 385 | (modify-inputs native-inputs
|
| 386 | (append python-numpy-1)))))
|
| 387 |
|
| 388 | (define-public boost-with-numpy
|
| 389 | (package
|
| 390 | (inherit boost)
|
| 391 | (name "boost-with-numpy")
|
| 392 | (native-inputs
|
| 393 | (modify-inputs native-inputs
|
| 394 | (append python-numpy)))
|
| 395 | (synopsis "Boost C++ libraries with inclusion of Boost.NumPy")))
|
| 396 |
|
| 397 | (define-public boost-sync
|
| 398 | (let ((commit "e690de2d30e2f1649ff500c9a6f3539814994b1c")
|
| 399 | (version "1.55")
|
| 400 | (revision "2"))
|
| 401 | (package
|
| 402 | (name "boost-sync")
|
| 403 | (version (git-version version revision commit))
|
| 404 | (source (origin
|
| 405 | (method git-fetch)
|
| 406 | (uri (git-reference
|
| 407 | (url "https://github.com/boostorg/sync")
|
| 408 | (commit commit)))
|
| 409 | (file-name (git-file-name name version))
|
| 410 | (sha256
|
| 411 | (base32
|
| 412 | "0473hb15affjq2804xa99ikk4y1gzi46rygd9zhncl28ib7mnn26"))))
|
| 413 | (build-system trivial-build-system)
|
| 414 | (arguments
|
| 415 | `(#:modules ((guix build utils))
|
| 416 | #:builder
|
| 417 | (begin
|
| 418 | (use-modules (guix build utils))
|
| 419 | (let ((source (assoc-ref %build-inputs "source")))
|
| 420 | (copy-recursively (string-append source "/include")
|
| 421 | (string-append %output "/include"))))))
|
| 422 | (home-page "https://github.com/boostorg/sync")
|
| 423 | (synopsis "Boost.Sync library")
|
| 424 | (description "The Boost.Sync library provides mutexes, semaphores, locks
|
| 425 | and events and other thread related facilities. Boost.Sync originated from
|
| 426 | Boost.Thread.")
|
| 427 | (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))))
|
| 428 |
|
| 429 | (define-public boost-signals2
|
| 430 | |
| 431 | (let ((commit "2ecf1b53bc970dd2b5e5d0f36fe8adf5d2181638")
|
| 432 | (revision "0"))
|
| 433 | (package
|
| 434 | (name "boost-signals2")
|
| 435 | (version (git-version (package-version boost) revision commit))
|
| 436 | (source
|
| 437 | (origin
|
| 438 | (method git-fetch)
|
| 439 | (uri (git-reference
|
| 440 | (url "https://github.com/boostorg/signals2")
|
| 441 | (commit commit)))
|
| 442 | (file-name (git-file-name name version))
|
| 443 | (sha256
|
| 444 | (base32 "101ayw7dz4gdvva2yzyrfad69w4xbvv3man83xwqjbkib3a92ca8"))))
|
| 445 | (build-system trivial-build-system)
|
| 446 | (arguments
|
| 447 | (list
|
| 448 | #:modules '((guix build utils))
|
| 449 | #:builder
|
| 450 | #~(begin
|
| 451 | (use-modules (guix build utils))
|
| 452 | (let ((source (assoc-ref %build-inputs "source")))
|
| 453 | (copy-recursively (string-append source "/include")
|
| 454 | (string-append %output "/include"))))))
|
| 455 | (home-page "https://github.com/boostorg/signals2")
|
| 456 | (synopsis "Boost.Signals2 library")
|
| 457 | (description "The Boost.Signals2 library is an implementation of a managed
|
| 458 | signals and slots system.")
|
| 459 | (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))))
|
| 460 |
|
| 461 |
|
| 462 | (define-public boost-mpi
|
| 463 | (package
|
| 464 | (inherit boost)
|
| 465 | (name "boost-mpi")
|
| 466 | (inputs
|
| 467 | (modify-inputs inputs
|
| 468 | (append openmpi)))
|
| 469 | (arguments
|
| 470 | (substitute-keyword-arguments arguments
|
| 471 | ((#:phases phases)
|
| 472 | #~(modify-phases #$phases
|
| 473 | (add-after 'configure 'update-jam
|
| 474 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 475 | (let ((output-port (open-file "project-config.jam" "a")))
|
| 476 | (display "using mpi ;" output-port)
|
| 477 | (newline output-port)
|
| 478 | (close output-port))))))))
|
| 479 | (home-page "https://www.boost.org")
|
| 480 | (synopsis "Boost C++ libraries with inclusion of Boost.MPI")))
|
| 481 |
|
| 482 | (define-public boost-mpi-numpy
|
| 483 | (package
|
| 484 | (inherit boost-mpi)
|
| 485 | (name "boost-mpi-numpy")
|
| 486 | (inputs
|
| 487 | (modify-inputs inputs
|
| 488 | (append python-numpy)))
|
| 489 | (synopsis "Boost C++ libraries with inclusion of Boost.MPI and Boost.NumPy")))
|
| 490 |
|
| 491 | (define-public mdds
|
| 492 | (package
|
| 493 | (name "mdds")
|
| 494 | (version "3.2.1")
|
| 495 | (source (origin
|
| 496 | (method git-fetch)
|
| 497 | (uri (git-reference
|
| 498 | (url "https://gitlab.com/mdds/mdds")
|
| 499 | (commit version)))
|
| 500 | (file-name (git-file-name name version))
|
| 501 | (sha256
|
| 502 | (base32
|
| 503 | "0p6k281cymfa9ndkjl82xh6yp4brnlx80sqknsq9c92b4v72fg9c"))))
|
| 504 | (build-system gnu-build-system)
|
| 505 | (native-inputs (list autoconf automake pkg-config))
|
| 506 | (propagated-inputs
|
| 507 | (list boost-1.83)) |
| 508 | (home-page "https://gitlab.com/mdds/mdds")
|
| 509 | (synopsis "Multi-dimensional C++ data structures and indexing algorithms")
|
| 510 | (description "Mdds (multi-dimensional data structure) provides a
|
| 511 | collection of multi-dimensional data structures and indexing algorithms
|
| 512 | for C++. It includes flat segment trees, segment trees, rectangle sets,
|
| 513 | point quad trees, multi-type vectors and multi-type matrices.")
|
| 514 | (license license:expat)))
|