mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
e4a6ea6032
56e79fe683d36c1944e52326fae3bcc4cb7deec7 guix: use --build={arch}-guix-linux-gnu in cross toolchain (fanquake) Pull request description: Technically we are always cross-compiling when Guix building, so make that explicit. `{arch}-guix-linux-gnu` is not a triplet that should be used in any other capacity, but here it serves the purpose of ensuring, that by setting `--build` to something other than `--host/--target`, we are always cross-compiling (in the eyes of autoconf etc) when building our cross toolchains. It looks like `x86_64-linux-gnu` on `x86_64-linux-gnu` currently works because of the triplet canonicalisation, i.e `x86_64-linux-gnu` becomes `x86_64-pc-linux-gnu`, and GCCs configure thinking it's cross-compiling, whereas the same canonicalisation doesn't happen for `aarch64-linux-gnu` so we don't get a cross-compile when building on aarch64. Fixes: #22458. Guix Build (x86_64): ```bash e590e67d2b151e7d079f50393c61cacf9e65f5e3fdddc10bffd5dbb59cd9f5e3 guix-build-56e79fe683d3/output/aarch64-linux-gnu/SHA256SUMS.part 9222a733209dc73168722ee0f290831d1723f7ed55abc1e243dd3892ef9733f1 guix-build-56e79fe683d3/output/aarch64-linux-gnu/bitcoin-56e79fe683d3-aarch64-linux-gnu-debug.tar.gz a4ec01411195412e9a483397554d98b2db161a6be8aceee2dac78f0015f2a8e5 guix-build-56e79fe683d3/output/aarch64-linux-gnu/bitcoin-56e79fe683d3-aarch64-linux-gnu.tar.gz a4ff8f2538c1b3a63a3e7c92699c18164b2c4954ebd72c4a854bf7844e6131b6 guix-build-56e79fe683d3/output/arm-linux-gnueabihf/SHA256SUMS.part ac6e4dffcf6f49dac73d3677f3fe5edb08ee1127648bc7ec24b217f48a3a4d21 guix-build-56e79fe683d3/output/arm-linux-gnueabihf/bitcoin-56e79fe683d3-arm-linux-gnueabihf-debug.tar.gz ab26467fce9732596b1713179618eee20c2bd44875dc1c39f9afd68f135e8ce4 guix-build-56e79fe683d3/output/arm-linux-gnueabihf/bitcoin-56e79fe683d3-arm-linux-gnueabihf.tar.gz f44108d818d53ee7e70b44361cb3cc6841b7aecbe4fade1fa289263718620824 guix-build-56e79fe683d3/output/arm64-apple-darwin/SHA256SUMS.part 29adfb2d575be8b5a7092b2aff888af2084ad5783bdc74ae3de4b2dd84da7a26 guix-build-56e79fe683d3/output/arm64-apple-darwin/bitcoin-56e79fe683d3-arm64-apple-darwin-unsigned.dmg 3d7640f604bd27cb1ae47853d70378a7631aa436b5c027eae31fa06d4dd20d4a guix-build-56e79fe683d3/output/arm64-apple-darwin/bitcoin-56e79fe683d3-arm64-apple-darwin-unsigned.tar.gz 3f8d8fc49cf722a7a13640872762d045c14efd610fba908f0acc99a99032b903 guix-build-56e79fe683d3/output/arm64-apple-darwin/bitcoin-56e79fe683d3-arm64-apple-darwin.tar.gz b8df097e10e7acded8556a5681da2b0132c0d509b200792f5584c186b8dcaf24 guix-build-56e79fe683d3/output/dist-archive/bitcoin-56e79fe683d3.tar.gz 1a605c563038107b88e8d859fa045ca3087241340264eb7125e97b3af36874db guix-build-56e79fe683d3/output/powerpc64-linux-gnu/SHA256SUMS.part d10be89a816ee2f47bf778ef4aaa8a7b548403c123a4b4b3aa0470ee7b9472d2 guix-build-56e79fe683d3/output/powerpc64-linux-gnu/bitcoin-56e79fe683d3-powerpc64-linux-gnu-debug.tar.gz 839dd079d677c87a91ccc28f6c423657d98212350d3693ae2facb92082d10c88 guix-build-56e79fe683d3/output/powerpc64-linux-gnu/bitcoin-56e79fe683d3-powerpc64-linux-gnu.tar.gz 200d7a72a7901b6788e70aa1c6fbbe16144e9dac29beb06242a9dcfe1e88acbe guix-build-56e79fe683d3/output/powerpc64le-linux-gnu/SHA256SUMS.part 3d207bb57dc45f234d804a9ee615001aa28ac4b59b530a1e7d16d0a72c2ea514 guix-build-56e79fe683d3/output/powerpc64le-linux-gnu/bitcoin-56e79fe683d3-powerpc64le-linux-gnu-debug.tar.gz 16a789c98409d36bd6b69a5ca38cd8886979f50f845265dc0b005c92286a3e4f guix-build-56e79fe683d3/output/powerpc64le-linux-gnu/bitcoin-56e79fe683d3-powerpc64le-linux-gnu.tar.gz e48f6fae9c2ffeb2bf02ffc073ac69648b2ce4ba87e0ad7a3a5059abf33b8ce2 guix-build-56e79fe683d3/output/riscv64-linux-gnu/SHA256SUMS.part fa8d66af5f202e0c8968114af4dcd6d88099eb91d197dfaaa0144f8ae6b12f4a guix-build-56e79fe683d3/output/riscv64-linux-gnu/bitcoin-56e79fe683d3-riscv64-linux-gnu-debug.tar.gz 86cffa62687f4272c899897ff6c1a86e1a7bdbbb7ab09a085b7b1122d3a1f1b2 guix-build-56e79fe683d3/output/riscv64-linux-gnu/bitcoin-56e79fe683d3-riscv64-linux-gnu.tar.gz e42a7c33da6ea4be5d0826df097bdc7e919c9fd6642e7d59fe3d45a97d9009fa guix-build-56e79fe683d3/output/x86_64-apple-darwin/SHA256SUMS.part 2f9faa88fa0025b9bfade83177b1f50833dc6c3be1ef26c4d5881aa165bcc537 guix-build-56e79fe683d3/output/x86_64-apple-darwin/bitcoin-56e79fe683d3-x86_64-apple-darwin-unsigned.dmg fdfe560968c85500dc886d4e12b851cd27a76de860b8cbf1fb6aac95ccd0582e guix-build-56e79fe683d3/output/x86_64-apple-darwin/bitcoin-56e79fe683d3-x86_64-apple-darwin-unsigned.tar.gz c3c75560befd72a9f13f5626ddf39c63ad25fb9753a4d941e48830b7e06f143e guix-build-56e79fe683d3/output/x86_64-apple-darwin/bitcoin-56e79fe683d3-x86_64-apple-darwin.tar.gz 38100946ec1469fdd31aa8ea9e471b317dc278c298c106289c119016c2c0caa0 guix-build-56e79fe683d3/output/x86_64-linux-gnu/SHA256SUMS.part 67890771aad89dc0d20b8dcdc6b29bd838ace310e8bcbbc0d16d7afc87d3a474 guix-build-56e79fe683d3/output/x86_64-linux-gnu/bitcoin-56e79fe683d3-x86_64-linux-gnu-debug.tar.gz a9772b40c8b9d3c1a0bf9c9db2a60050415bf6a9bd4a19cfd8a038f4a1e712e3 guix-build-56e79fe683d3/output/x86_64-linux-gnu/bitcoin-56e79fe683d3-x86_64-linux-gnu.tar.gz 01da0561f2c3a268c28615b1573dfdecb6346bf3f8eba7a052488191234ac1d6 guix-build-56e79fe683d3/output/x86_64-w64-mingw32/SHA256SUMS.part 71324ac0f6fc8163e41031b2fd2d38d2e15bfd5ef4efe4cb45d7974fad474394 guix-build-56e79fe683d3/output/x86_64-w64-mingw32/bitcoin-56e79fe683d3-win64-debug.zip 219b58281d3c79b2ed7e9085b1e15d7e021fd3899ef07a6ad747058b43d64443 guix-build-56e79fe683d3/output/x86_64-w64-mingw32/bitcoin-56e79fe683d3-win64-setup-unsigned.exe fe838d32587c2f942fcd9f9a0b3735611b686a867e2d2040cf3a8aa6a43d09fe guix-build-56e79fe683d3/output/x86_64-w64-mingw32/bitcoin-56e79fe683d3-win64-unsigned.tar.gz 13b537217a13293b93afd7c588b3733955c3188f79a3249b363fb4e885b74b32 guix-build-56e79fe683d3/output/x86_64-w64-mingw32/bitcoin-56e79fe683d3-win64.zip ``` Guix Build (arm64): ```bash e590e67d2b151e7d079f50393c61cacf9e65f5e3fdddc10bffd5dbb59cd9f5e3 guix-build-56e79fe683d3/output/aarch64-linux-gnu/SHA256SUMS.part 9222a733209dc73168722ee0f290831d1723f7ed55abc1e243dd3892ef9733f1 guix-build-56e79fe683d3/output/aarch64-linux-gnu/bitcoin-56e79fe683d3-aarch64-linux-gnu-debug.tar.gz a4ec01411195412e9a483397554d98b2db161a6be8aceee2dac78f0015f2a8e5 guix-build-56e79fe683d3/output/aarch64-linux-gnu/bitcoin-56e79fe683d3-aarch64-linux-gnu.tar.gz a4ff8f2538c1b3a63a3e7c92699c18164b2c4954ebd72c4a854bf7844e6131b6 guix-build-56e79fe683d3/output/arm-linux-gnueabihf/SHA256SUMS.part ac6e4dffcf6f49dac73d3677f3fe5edb08ee1127648bc7ec24b217f48a3a4d21 guix-build-56e79fe683d3/output/arm-linux-gnueabihf/bitcoin-56e79fe683d3-arm-linux-gnueabihf-debug.tar.gz ab26467fce9732596b1713179618eee20c2bd44875dc1c39f9afd68f135e8ce4 guix-build-56e79fe683d3/output/arm-linux-gnueabihf/bitcoin-56e79fe683d3-arm-linux-gnueabihf.tar.gz f44108d818d53ee7e70b44361cb3cc6841b7aecbe4fade1fa289263718620824 guix-build-56e79fe683d3/output/arm64-apple-darwin/SHA256SUMS.part 29adfb2d575be8b5a7092b2aff888af2084ad5783bdc74ae3de4b2dd84da7a26 guix-build-56e79fe683d3/output/arm64-apple-darwin/bitcoin-56e79fe683d3-arm64-apple-darwin-unsigned.dmg 3d7640f604bd27cb1ae47853d70378a7631aa436b5c027eae31fa06d4dd20d4a guix-build-56e79fe683d3/output/arm64-apple-darwin/bitcoin-56e79fe683d3-arm64-apple-darwin-unsigned.tar.gz 3f8d8fc49cf722a7a13640872762d045c14efd610fba908f0acc99a99032b903 guix-build-56e79fe683d3/output/arm64-apple-darwin/bitcoin-56e79fe683d3-arm64-apple-darwin.tar.gz b8df097e10e7acded8556a5681da2b0132c0d509b200792f5584c186b8dcaf24 guix-build-56e79fe683d3/output/dist-archive/bitcoin-56e79fe683d3.tar.gz 1a605c563038107b88e8d859fa045ca3087241340264eb7125e97b3af36874db guix-build-56e79fe683d3/output/powerpc64-linux-gnu/SHA256SUMS.part d10be89a816ee2f47bf778ef4aaa8a7b548403c123a4b4b3aa0470ee7b9472d2 guix-build-56e79fe683d3/output/powerpc64-linux-gnu/bitcoin-56e79fe683d3-powerpc64-linux-gnu-debug.tar.gz 839dd079d677c87a91ccc28f6c423657d98212350d3693ae2facb92082d10c88 guix-build-56e79fe683d3/output/powerpc64-linux-gnu/bitcoin-56e79fe683d3-powerpc64-linux-gnu.tar.gz 200d7a72a7901b6788e70aa1c6fbbe16144e9dac29beb06242a9dcfe1e88acbe guix-build-56e79fe683d3/output/powerpc64le-linux-gnu/SHA256SUMS.part 3d207bb57dc45f234d804a9ee615001aa28ac4b59b530a1e7d16d0a72c2ea514 guix-build-56e79fe683d3/output/powerpc64le-linux-gnu/bitcoin-56e79fe683d3-powerpc64le-linux-gnu-debug.tar.gz 16a789c98409d36bd6b69a5ca38cd8886979f50f845265dc0b005c92286a3e4f guix-build-56e79fe683d3/output/powerpc64le-linux-gnu/bitcoin-56e79fe683d3-powerpc64le-linux-gnu.tar.gz e48f6fae9c2ffeb2bf02ffc073ac69648b2ce4ba87e0ad7a3a5059abf33b8ce2 guix-build-56e79fe683d3/output/riscv64-linux-gnu/SHA256SUMS.part fa8d66af5f202e0c8968114af4dcd6d88099eb91d197dfaaa0144f8ae6b12f4a guix-build-56e79fe683d3/output/riscv64-linux-gnu/bitcoin-56e79fe683d3-riscv64-linux-gnu-debug.tar.gz 86cffa62687f4272c899897ff6c1a86e1a7bdbbb7ab09a085b7b1122d3a1f1b2 guix-build-56e79fe683d3/output/riscv64-linux-gnu/bitcoin-56e79fe683d3-riscv64-linux-gnu.tar.gz e42a7c33da6ea4be5d0826df097bdc7e919c9fd6642e7d59fe3d45a97d9009fa guix-build-56e79fe683d3/output/x86_64-apple-darwin/SHA256SUMS.part 2f9faa88fa0025b9bfade83177b1f50833dc6c3be1ef26c4d5881aa165bcc537 guix-build-56e79fe683d3/output/x86_64-apple-darwin/bitcoin-56e79fe683d3-x86_64-apple-darwin-unsigned.dmg fdfe560968c85500dc886d4e12b851cd27a76de860b8cbf1fb6aac95ccd0582e guix-build-56e79fe683d3/output/x86_64-apple-darwin/bitcoin-56e79fe683d3-x86_64-apple-darwin-unsigned.tar.gz c3c75560befd72a9f13f5626ddf39c63ad25fb9753a4d941e48830b7e06f143e guix-build-56e79fe683d3/output/x86_64-apple-darwin/bitcoin-56e79fe683d3-x86_64-apple-darwin.tar.gz 38100946ec1469fdd31aa8ea9e471b317dc278c298c106289c119016c2c0caa0 guix-build-56e79fe683d3/output/x86_64-linux-gnu/SHA256SUMS.part 67890771aad89dc0d20b8dcdc6b29bd838ace310e8bcbbc0d16d7afc87d3a474 guix-build-56e79fe683d3/output/x86_64-linux-gnu/bitcoin-56e79fe683d3-x86_64-linux-gnu-debug.tar.gz a9772b40c8b9d3c1a0bf9c9db2a60050415bf6a9bd4a19cfd8a038f4a1e712e3 guix-build-56e79fe683d3/output/x86_64-linux-gnu/bitcoin-56e79fe683d3-x86_64-linux-gnu.tar.gz 01da0561f2c3a268c28615b1573dfdecb6346bf3f8eba7a052488191234ac1d6 guix-build-56e79fe683d3/output/x86_64-w64-mingw32/SHA256SUMS.part 71324ac0f6fc8163e41031b2fd2d38d2e15bfd5ef4efe4cb45d7974fad474394 guix-build-56e79fe683d3/output/x86_64-w64-mingw32/bitcoin-56e79fe683d3-win64-debug.zip 219b58281d3c79b2ed7e9085b1e15d7e021fd3899ef07a6ad747058b43d64443 guix-build-56e79fe683d3/output/x86_64-w64-mingw32/bitcoin-56e79fe683d3-win64-setup-unsigned.exe fe838d32587c2f942fcd9f9a0b3735611b686a867e2d2040cf3a8aa6a43d09fe guix-build-56e79fe683d3/output/x86_64-w64-mingw32/bitcoin-56e79fe683d3-win64-unsigned.tar.gz 13b537217a13293b93afd7c588b3733955c3188f79a3249b363fb4e885b74b32 guix-build-56e79fe683d3/output/x86_64-w64-mingw32/bitcoin-56e79fe683d3-win64.zip ``` ACKs for top commit: hebasto: ACK 56e79fe683d36c1944e52326fae3bcc4cb7deec7 Tree-SHA512: 628ab6cda80069ad277107639bef21b44a8417198862e9ec89b45a2c41741d29aeb79aa58c5a90283fb96cf707494ae948ac790abde809bb18c86b14af999200
639 lines
25 KiB
Scheme
639 lines
25 KiB
Scheme
(use-modules (gnu)
|
|
(gnu packages)
|
|
(gnu packages autotools)
|
|
(gnu packages base)
|
|
(gnu packages bash)
|
|
(gnu packages certs)
|
|
(gnu packages cdrom)
|
|
(gnu packages check)
|
|
(gnu packages cmake)
|
|
(gnu packages commencement)
|
|
(gnu packages compression)
|
|
(gnu packages cross-base)
|
|
(gnu packages curl)
|
|
(gnu packages file)
|
|
(gnu packages gawk)
|
|
(gnu packages gcc)
|
|
(gnu packages gnome)
|
|
(gnu packages image)
|
|
(gnu packages imagemagick)
|
|
(gnu packages installers)
|
|
(gnu packages linux)
|
|
(gnu packages llvm)
|
|
(gnu packages mingw)
|
|
(gnu packages moreutils)
|
|
(gnu packages perl)
|
|
(gnu packages pkg-config)
|
|
(gnu packages python)
|
|
(gnu packages python-web)
|
|
(gnu packages shells)
|
|
(gnu packages bison)
|
|
(gnu packages tls)
|
|
(gnu packages version-control)
|
|
(guix build-system font)
|
|
(guix build-system gnu)
|
|
(guix build-system python)
|
|
(guix build-system trivial)
|
|
(guix download)
|
|
(guix gexp)
|
|
(guix git-download)
|
|
((guix licenses) #:prefix license:)
|
|
(guix packages)
|
|
(guix profiles)
|
|
(guix utils))
|
|
|
|
(define-syntax-rule (search-our-patches file-name ...)
|
|
"Return the list of absolute file names corresponding to each
|
|
FILE-NAME found in ./patches relative to the current file."
|
|
(parameterize
|
|
((%patch-path (list (string-append (dirname (current-filename)) "/patches"))))
|
|
(list (search-patch file-name) ...)))
|
|
|
|
(define (make-ssp-fixed-gcc xgcc)
|
|
"Given a XGCC package, return a modified package that uses the SSP function
|
|
from glibc instead of from libssp.so. Our `symbol-check' script will complain if
|
|
we link against libssp.so, and thus will ensure that this works properly.
|
|
|
|
Taken from:
|
|
http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
|
|
(package
|
|
(inherit xgcc)
|
|
(arguments
|
|
(substitute-keyword-arguments (package-arguments xgcc)
|
|
((#:make-flags flags)
|
|
`(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
|
|
|
|
(define (make-gcc-rpath-link xgcc)
|
|
"Given a XGCC package, return a modified package that replace each instance of
|
|
-rpath in the default system spec that's inserted by Guix with -rpath-link"
|
|
(package
|
|
(inherit xgcc)
|
|
(arguments
|
|
(substitute-keyword-arguments (package-arguments xgcc)
|
|
((#:phases phases)
|
|
`(modify-phases ,phases
|
|
(add-after 'pre-configure 'replace-rpath-with-rpath-link
|
|
(lambda _
|
|
(substitute* (cons "gcc/config/rs6000/sysv4.h"
|
|
(find-files "gcc/config"
|
|
"^gnu-user.*\\.h$"))
|
|
(("-rpath=") "-rpath-link="))
|
|
#t))))))))
|
|
|
|
(define building-on (string-append (list-ref (string-split (%current-system) #\-) 0) "-guix-linux-gnu"))
|
|
|
|
(define (explicit-cross-configure package)
|
|
(package-with-extra-configure-variable package "--build" building-on))
|
|
|
|
(define (make-cross-toolchain target
|
|
base-gcc-for-libc
|
|
base-kernel-headers
|
|
base-libc
|
|
base-gcc)
|
|
"Create a cross-compilation toolchain package for TARGET"
|
|
(let* ((xbinutils (cross-binutils target))
|
|
;; 1. Build a cross-compiling gcc without targeting any libc, derived
|
|
;; from BASE-GCC-FOR-LIBC
|
|
(xgcc-sans-libc (explicit-cross-configure (cross-gcc target
|
|
#:xgcc base-gcc-for-libc
|
|
#:xbinutils xbinutils)))
|
|
;; 2. Build cross-compiled kernel headers with XGCC-SANS-LIBC, derived
|
|
;; from BASE-KERNEL-HEADERS
|
|
(xkernel (cross-kernel-headers target
|
|
base-kernel-headers
|
|
xgcc-sans-libc
|
|
xbinutils))
|
|
;; 3. Build a cross-compiled libc with XGCC-SANS-LIBC and XKERNEL,
|
|
;; derived from BASE-LIBC
|
|
(xlibc (explicit-cross-configure (cross-libc target
|
|
base-libc
|
|
xgcc-sans-libc
|
|
xbinutils
|
|
xkernel)))
|
|
;; 4. Build a cross-compiling gcc targeting XLIBC, derived from
|
|
;; BASE-GCC
|
|
(xgcc (explicit-cross-configure (cross-gcc target
|
|
#:xgcc base-gcc
|
|
#:xbinutils xbinutils
|
|
#:libc xlibc))))
|
|
;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and
|
|
;; XGCC
|
|
(package
|
|
(name (string-append target "-toolchain"))
|
|
(version (package-version xgcc))
|
|
(source #f)
|
|
(build-system trivial-build-system)
|
|
(arguments '(#:builder (begin (mkdir %output) #t)))
|
|
(propagated-inputs
|
|
`(("binutils" ,xbinutils)
|
|
("libc" ,xlibc)
|
|
("libc:static" ,xlibc "static")
|
|
("gcc" ,xgcc)
|
|
("gcc-lib" ,xgcc "lib")))
|
|
(synopsis (string-append "Complete GCC tool chain for " target))
|
|
(description (string-append "This package provides a complete GCC tool
|
|
chain for " target " development."))
|
|
(home-page (package-home-page xgcc))
|
|
(license (package-license xgcc)))))
|
|
|
|
(define base-gcc
|
|
(package-with-extra-patches gcc-8
|
|
(search-our-patches "gcc-8-sort-libtool-find-output.patch")))
|
|
|
|
;; Building glibc with stack smashing protector first landed in glibc 2.25, use
|
|
;; this function to disable for older glibcs
|
|
;;
|
|
;; From glibc 2.25 changelog:
|
|
;;
|
|
;; * Most of glibc can now be built with the stack smashing protector enabled.
|
|
;; It is recommended to build glibc with --enable-stack-protector=strong.
|
|
;; Implemented by Nick Alcock (Oracle).
|
|
(define (make-glibc-without-ssp xglibc)
|
|
(package-with-extra-configure-variable
|
|
(package-with-extra-configure-variable
|
|
xglibc "libc_cv_ssp" "no")
|
|
"libc_cv_ssp_strong" "no"))
|
|
|
|
(define* (make-bitcoin-cross-toolchain target
|
|
#:key
|
|
(base-gcc-for-libc gcc-7)
|
|
(base-kernel-headers linux-libre-headers-4.9)
|
|
(base-libc (make-glibc-without-ssp glibc-2.24))
|
|
(base-gcc (make-gcc-rpath-link base-gcc)))
|
|
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
|
|
desirable for building Dash Core release binaries."
|
|
(make-cross-toolchain target
|
|
base-gcc-for-libc
|
|
base-kernel-headers
|
|
base-libc
|
|
base-gcc))
|
|
|
|
(define (make-gcc-with-pthreads gcc)
|
|
(package-with-extra-configure-variable gcc "--enable-threads" "posix"))
|
|
|
|
(define (make-mingw-pthreads-cross-toolchain target)
|
|
"Create a cross-compilation toolchain package for TARGET"
|
|
(let* ((xbinutils (cross-binutils target))
|
|
(pthreads-xlibc mingw-w64-x86_64-winpthreads)
|
|
(pthreads-xgcc (make-gcc-with-pthreads
|
|
(cross-gcc target
|
|
#:xgcc (make-ssp-fixed-gcc base-gcc)
|
|
#:xbinutils xbinutils
|
|
#:libc pthreads-xlibc))))
|
|
;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and
|
|
;; XGCC
|
|
(package
|
|
(name (string-append target "-posix-toolchain"))
|
|
(version (package-version pthreads-xgcc))
|
|
(source #f)
|
|
(build-system trivial-build-system)
|
|
(arguments '(#:builder (begin (mkdir %output) #t)))
|
|
(propagated-inputs
|
|
`(("binutils" ,xbinutils)
|
|
("libc" ,pthreads-xlibc)
|
|
("gcc" ,pthreads-xgcc)
|
|
("gcc-lib" ,pthreads-xgcc "lib")))
|
|
(synopsis (string-append "Complete GCC tool chain for " target))
|
|
(description (string-append "This package provides a complete GCC tool
|
|
chain for " target " development."))
|
|
(home-page (package-home-page pthreads-xgcc))
|
|
(license (package-license pthreads-xgcc)))))
|
|
|
|
(define (make-nsis-with-sde-support base-nsis)
|
|
(package-with-extra-patches base-nsis
|
|
(search-our-patches "nsis-SConstruct-sde-support.patch")))
|
|
|
|
(define-public font-tuffy
|
|
(package
|
|
(name "font-tuffy")
|
|
(version "20120614")
|
|
(source
|
|
(origin
|
|
(method url-fetch)
|
|
(uri (string-append "http://tulrich.com/fonts/tuffy-" version ".tar.gz"))
|
|
(file-name (string-append name "-" version ".tar.gz"))
|
|
(sha256
|
|
(base32
|
|
"02vf72bgrp30vrbfhxjw82s115z27dwfgnmmzfb0n9wfhxxfpyf6"))))
|
|
(build-system font-build-system)
|
|
(home-page "http://tulrich.com/fonts/")
|
|
(synopsis "The Tuffy Truetype Font Family")
|
|
(description
|
|
"Thatcher Ulrich's first outline font design. He started with the goal of producing a neutral, readable sans-serif text font. There are lots of \"expressive\" fonts out there, but he wanted to start with something very plain and clean, something he might want to actually use. ")
|
|
(license license:public-domain)))
|
|
|
|
(define osslsigncode
|
|
(package
|
|
(name "osslsigncode")
|
|
(version "2.0")
|
|
(source (origin
|
|
(method url-fetch)
|
|
(uri (string-append "https://github.com/mtrojnar/"
|
|
name "/archive/" version ".tar.gz"))
|
|
(sha256
|
|
(base32
|
|
"0byri6xny770wwb2nciq44j5071122l14bvv65axdd70nfjf0q2s"))))
|
|
(build-system gnu-build-system)
|
|
(native-inputs
|
|
`(("pkg-config" ,pkg-config)
|
|
("autoconf" ,autoconf)
|
|
("automake" ,automake)
|
|
("libtool" ,libtool)))
|
|
(inputs
|
|
`(("openssl" ,openssl)))
|
|
(arguments
|
|
`(#:configure-flags
|
|
`("--without-gsf"
|
|
"--without-curl"
|
|
"--disable-dependency-tracking")))
|
|
(home-page "https://github.com/mtrojnar/osslsigncode")
|
|
(synopsis "Authenticode signing and timestamping tool")
|
|
(description "osslsigncode is a small tool that implements part of the
|
|
functionality of the Microsoft tool signtool.exe - more exactly the Authenticode
|
|
signing and timestamping. But osslsigncode is based on OpenSSL and cURL, and
|
|
thus should be able to compile on most platforms where these exist.")
|
|
(license license:gpl3+))) ; license is with openssl exception
|
|
|
|
(define-public python-asn1crypto
|
|
(package
|
|
(name "python-asn1crypto")
|
|
(version "1.4.0")
|
|
(source
|
|
(origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://github.com/wbond/asn1crypto")
|
|
(commit version)))
|
|
(file-name (git-file-name name version))
|
|
(sha256
|
|
(base32
|
|
"19abibn6jw20mzi1ln4n9jjvpdka8ygm4m439hplyrdfqbvgm01r"))))
|
|
(build-system python-build-system)
|
|
(arguments
|
|
'(#:phases
|
|
(modify-phases %standard-phases
|
|
(replace 'check
|
|
(lambda _
|
|
(invoke "python" "run.py" "tests"))))))
|
|
(home-page "https://github.com/wbond/asn1crypto")
|
|
(synopsis "ASN.1 parser and serializer in Python")
|
|
(description "asn1crypto is an ASN.1 parser and serializer with definitions
|
|
for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7,
|
|
PKCS#8, PKCS#12, PKCS#5, X.509 and TSP.")
|
|
(license license:expat)))
|
|
|
|
(define-public python-elfesteem
|
|
(let ((commit "87bbd79ab7e361004c98cc8601d4e5f029fd8bd5"))
|
|
(package
|
|
(name "python-elfesteem")
|
|
(version (git-version "0.1" "1" commit))
|
|
(source
|
|
(origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://github.com/LRGH/elfesteem")
|
|
(commit commit)))
|
|
(file-name (git-file-name name commit))
|
|
(sha256
|
|
(base32
|
|
"1nyvjisvyxyxnd0023xjf5846xd03lwawp5pfzr8vrky7wwm5maz"))))
|
|
(build-system python-build-system)
|
|
;; There are no tests, but attempting to run python setup.py test leads to
|
|
;; PYTHONPATH problems, just disable the test
|
|
(arguments '(#:tests? #f))
|
|
(home-page "https://github.com/LRGH/elfesteem")
|
|
(synopsis "ELF/PE/Mach-O parsing library")
|
|
(description "elfesteem parses ELF, PE and Mach-O files.")
|
|
(license license:lgpl2.1))))
|
|
|
|
(define-public python-oscrypto
|
|
(package
|
|
(name "python-oscrypto")
|
|
(version "1.2.1")
|
|
(source
|
|
(origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://github.com/wbond/oscrypto")
|
|
(commit version)))
|
|
(file-name (git-file-name name version))
|
|
(sha256
|
|
(base32
|
|
"1d4d8s4z340qhvb3g5m5v3436y3a71yc26wk4749q64m09kxqc3l"))
|
|
(patches (search-our-patches "oscrypto-hard-code-openssl.patch"))))
|
|
(build-system python-build-system)
|
|
(native-search-paths
|
|
(list (search-path-specification
|
|
(variable "SSL_CERT_FILE")
|
|
(file-type 'regular)
|
|
(separator #f) ;single entry
|
|
(files '("etc/ssl/certs/ca-certificates.crt")))))
|
|
|
|
(propagated-inputs
|
|
`(("python-asn1crypto" ,python-asn1crypto)
|
|
("openssl" ,openssl)))
|
|
(arguments
|
|
`(#:phases
|
|
(modify-phases %standard-phases
|
|
(add-after 'unpack 'hard-code-path-to-libscrypt
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
(let ((openssl (assoc-ref inputs "openssl")))
|
|
(substitute* "oscrypto/__init__.py"
|
|
(("@GUIX_OSCRYPTO_USE_OPENSSL@")
|
|
(string-append openssl "/lib/libcrypto.so" "," openssl "/lib/libssl.so")))
|
|
#t)))
|
|
(add-after 'unpack 'disable-broken-tests
|
|
(lambda _
|
|
;; This test is broken as there is no keyboard interrupt.
|
|
(substitute* "tests/test_trust_list.py"
|
|
(("^(.*)class TrustListTests" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
(substitute* "tests/test_tls.py"
|
|
(("^(.*)class TLSTests" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
#t))
|
|
(replace 'check
|
|
(lambda _
|
|
(invoke "python" "run.py" "tests")
|
|
#t)))))
|
|
(home-page "https://github.com/wbond/oscrypto")
|
|
(synopsis "Compiler-free Python crypto library backed by the OS")
|
|
(description "oscrypto is a compilation-free, always up-to-date encryption library for Python.")
|
|
(license license:expat)))
|
|
|
|
(define-public python-oscryptotests
|
|
(package (inherit python-oscrypto)
|
|
(name "python-oscryptotests")
|
|
(arguments
|
|
`(#:tests? #f
|
|
#:phases
|
|
(modify-phases %standard-phases
|
|
(add-after 'unpack 'hard-code-path-to-libscrypt
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
(chdir "tests")
|
|
#t)))))))
|
|
|
|
(define-public python-certvalidator
|
|
(let ((commit "e5bdb4bfcaa09fa0af355eb8867d00dfeecba08c"))
|
|
(package
|
|
(name "python-certvalidator")
|
|
(version (git-version "0.1" "1" commit))
|
|
(source
|
|
(origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://github.com/achow101/certvalidator")
|
|
(commit commit)))
|
|
(file-name (git-file-name name commit))
|
|
(sha256
|
|
(base32
|
|
"18pvxkvpkfkzgvfylv0kx65pmxfcv1hpsg03cip93krfvrrl4c75"))))
|
|
(build-system python-build-system)
|
|
(propagated-inputs
|
|
`(("python-asn1crypto" ,python-asn1crypto)
|
|
("python-oscrypto" ,python-oscrypto)
|
|
("python-oscryptotests", python-oscryptotests))) ;; certvalidator tests import oscryptotests
|
|
(arguments
|
|
`(#:phases
|
|
(modify-phases %standard-phases
|
|
(add-after 'unpack 'disable-broken-tests
|
|
(lambda _
|
|
(substitute* "tests/test_certificate_validator.py"
|
|
(("^(.*)class CertificateValidatorTests" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
(substitute* "tests/test_crl_client.py"
|
|
(("^(.*)def test_fetch_crl" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
(substitute* "tests/test_ocsp_client.py"
|
|
(("^(.*)def test_fetch_ocsp" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
(substitute* "tests/test_registry.py"
|
|
(("^(.*)def test_build_paths" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
(substitute* "tests/test_validate.py"
|
|
(("^(.*)def test_revocation_mode_hard" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
(substitute* "tests/test_validate.py"
|
|
(("^(.*)def test_revocation_mode_soft" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
#t))
|
|
(replace 'check
|
|
(lambda _
|
|
(invoke "python" "run.py" "tests")
|
|
#t)))))
|
|
(home-page "https://github.com/wbond/certvalidator")
|
|
(synopsis "Python library for validating X.509 certificates and paths")
|
|
(description "certvalidator is a Python library for validating X.509
|
|
certificates or paths. Supports various options, including: validation at a
|
|
specific moment in time, whitelisting and revocation checks.")
|
|
(license license:expat))))
|
|
|
|
(define-public python-requests-2.25.1
|
|
(package (inherit python-requests)
|
|
(version "2.25.1")
|
|
(source (origin
|
|
(method url-fetch)
|
|
(uri (pypi-uri "requests" version))
|
|
(sha256
|
|
(base32
|
|
"015qflyqsgsz09gnar69s6ga74ivq5kch69s4qxz3904m7a3v5r7"))))))
|
|
|
|
(define-public python-altgraph
|
|
(package
|
|
(name "python-altgraph")
|
|
(version "0.17")
|
|
(source
|
|
(origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://github.com/ronaldoussoren/altgraph")
|
|
(commit (string-append "v" version))))
|
|
(file-name (git-file-name name version))
|
|
(sha256
|
|
(base32
|
|
"09sm4srvvkw458pn48ga9q7ykr4xlz7q8gh1h9w7nxpf001qgpwb"))))
|
|
(build-system python-build-system)
|
|
(home-page "https://github.com/ronaldoussoren/altgraph")
|
|
(synopsis "Python graph (network) package")
|
|
(description "altgraph is a fork of graphlib: a graph (network) package for
|
|
constructing graphs, BFS and DFS traversals, topological sort, shortest paths,
|
|
etc. with graphviz output.")
|
|
(license license:expat)))
|
|
|
|
|
|
(define-public python-macholib
|
|
(package
|
|
(name "python-macholib")
|
|
(version "1.14")
|
|
(source
|
|
(origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://github.com/ronaldoussoren/macholib")
|
|
(commit (string-append "v" version))))
|
|
(file-name (git-file-name name version))
|
|
(sha256
|
|
(base32
|
|
"0aislnnfsza9wl4f0vp45ivzlc0pzhp9d4r08700slrypn5flg42"))))
|
|
(build-system python-build-system)
|
|
(propagated-inputs
|
|
`(("python-altgraph" ,python-altgraph)))
|
|
(arguments
|
|
'(#:phases
|
|
(modify-phases %standard-phases
|
|
(add-after 'unpack 'disable-broken-tests
|
|
(lambda _
|
|
;; This test is broken as there is no keyboard interrupt.
|
|
(substitute* "macholib_tests/test_command_line.py"
|
|
(("^(.*)class TestCmdLine" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line)))
|
|
(substitute* "macholib_tests/test_dyld.py"
|
|
(("^(.*)def test_\\S+_find" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line))
|
|
(("^(.*)def testBasic" line indent)
|
|
(string-append indent
|
|
"@unittest.skip(\"Disabled by Guix\")\n"
|
|
line))
|
|
)
|
|
#t)))))
|
|
(home-page "https://github.com/ronaldoussoren/macholib")
|
|
(synopsis "Python library for analyzing and editing Mach-O headers")
|
|
(description "macholib is a Macho-O header analyzer and editor. It's
|
|
typically used as a dependency analysis tool, and also to rewrite dylib
|
|
references in Mach-O headers to be @executable_path relative. Though this tool
|
|
targets a platform specific file format, it is pure python code that is platform
|
|
and endian independent.")
|
|
(license license:expat)))
|
|
|
|
(define-public python-signapple
|
|
(let ((commit "b084cbbf44d5330448ffce0c7d118f75781b64bd"))
|
|
(package
|
|
(name "python-signapple")
|
|
(version (git-version "0.1" "1" commit))
|
|
(source
|
|
(origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://github.com/achow101/signapple")
|
|
(commit commit)))
|
|
(file-name (git-file-name name commit))
|
|
(sha256
|
|
(base32
|
|
"0k7inccl2mzac3wq4asbr0kl8s4cghm8982z54kfascqg45shv01"))))
|
|
(build-system python-build-system)
|
|
(propagated-inputs
|
|
`(("python-asn1crypto" ,python-asn1crypto)
|
|
("python-oscrypto" ,python-oscrypto)
|
|
("python-certvalidator" ,python-certvalidator)
|
|
("python-elfesteem" ,python-elfesteem)
|
|
("python-requests" ,python-requests-2.25.1)
|
|
("python-macholib" ,python-macholib)
|
|
("libcrypto" ,openssl)))
|
|
;; There are no tests, but attempting to run python setup.py test leads to
|
|
;; problems, just disable the test
|
|
(arguments '(#:tests? #f))
|
|
(home-page "https://github.com/achow101/signapple")
|
|
(synopsis "Mach-O binary signature tool")
|
|
(description "signapple is a Python tool for creating, verifying, and
|
|
inspecting signatures in Mach-O binaries.")
|
|
(license license:expat))))
|
|
|
|
(define-public glibc-2.24
|
|
(package
|
|
(inherit glibc)
|
|
(version "2.24")
|
|
(source (origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://sourceware.org/git/glibc.git")
|
|
(commit "0d7f1ed30969886c8dde62fbf7d2c79967d4bace")))
|
|
(file-name (git-file-name "glibc" "0d7f1ed30969886c8dde62fbf7d2c79967d4bace"))
|
|
(sha256
|
|
(base32
|
|
"0g5hryia5v1k0qx97qffgwzrz4lr4jw3s5kj04yllhswsxyjbic3"))
|
|
(patches (search-our-patches "glibc-ldd-x86_64.patch"
|
|
"glibc-versioned-locpath.patch"
|
|
"glibc-2.24-elfm-loadaddr-dynamic-rewrite.patch"
|
|
"glibc-2.24-no-build-time-cxx-header-run.patch"))))))
|
|
|
|
(define glibc-2.27/bitcoin-patched
|
|
(package-with-extra-patches glibc-2.27
|
|
(search-our-patches "glibc-2.27-riscv64-Use-__has_include__-to-include-asm-syscalls.h.patch")))
|
|
|
|
(packages->manifest
|
|
(append
|
|
(list ;; The Basics
|
|
bash
|
|
which
|
|
coreutils
|
|
util-linux
|
|
;; File(system) inspection
|
|
file
|
|
grep
|
|
diffutils
|
|
findutils
|
|
;; File transformation
|
|
patch
|
|
gawk
|
|
sed
|
|
moreutils
|
|
;; Compression and archiving
|
|
tar
|
|
bzip2
|
|
gzip
|
|
xz
|
|
zlib
|
|
(list zlib "static")
|
|
;; Build tools
|
|
gnu-make
|
|
libtool
|
|
autoconf
|
|
automake
|
|
pkg-config
|
|
bison
|
|
;; Scripting
|
|
perl
|
|
python-3
|
|
;; Git
|
|
git
|
|
;; Native gcc 7 toolchain
|
|
gcc-toolchain-7
|
|
(list gcc-toolchain-7 "static"))
|
|
(let ((target (getenv "HOST")))
|
|
(cond ((string-suffix? "-mingw32" target)
|
|
;; Windows
|
|
(list zip
|
|
(make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
|
|
(make-nsis-with-sde-support nsis-x86_64)
|
|
osslsigncode))
|
|
((string-contains target "-linux-")
|
|
(list (cond ((string-contains target "riscv64-")
|
|
(make-bitcoin-cross-toolchain target
|
|
#:base-libc glibc-2.27/bitcoin-patched
|
|
#:base-kernel-headers linux-libre-headers-4.19))
|
|
(else
|
|
(make-bitcoin-cross-toolchain target)))))
|
|
((string-contains target "darwin")
|
|
(list clang-toolchain-10 binutils imagemagick libtiff librsvg font-tuffy cmake xorriso python-signapple))
|
|
(else '())))))
|