3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #36273 from timokau/sage-fat-binary

sage: Make build more platform independant
This commit is contained in:
Michael Raskin 2018-03-04 00:46:25 +00:00 committed by GitHub
commit cf1b51aba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,7 @@
, texinfo , texinfo
, hevea , hevea
, buildDocs ? false , buildDocs ? false
, optimize ? false # optimize sage to the current system (obviously impure)
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -139,7 +140,6 @@ stdenv.mkDerivation rec {
configureFlags = stdenv.lib.optionals(buildDocs) [ "--docdir=$(doc)" ]; configureFlags = stdenv.lib.optionals(buildDocs) [ "--docdir=$(doc)" ];
preConfigure = '' preConfigure = ''
export SAGE_NUM_THREADS="$NIX_BUILD_CORES" export SAGE_NUM_THREADS="$NIX_BUILD_CORES"
export SAGE_ATLAS_ARCH=fast
export HOME=/tmp/sage-home export HOME=/tmp/sage-home
export SAGE_ROOT="$PWD" export SAGE_ROOT="$PWD"
@ -160,6 +160,9 @@ stdenv.mkDerivation rec {
mkdir -p "$doc" mkdir -p "$doc"
export SAGE_DOC="$doc" export SAGE_DOC="$doc"
export SAGE_DOCBUILD_OPTS="--no-pdf-links -k" export SAGE_DOCBUILD_OPTS="--no-pdf-links -k"
''
+ stdenv.lib.optionalString (!optimize) ''
export SAGE_FAT_BINARY=yes
''; '';
buildFlags = if (buildDocs) then "doc" else "build"; buildFlags = if (buildDocs) then "doc" else "build";