OCJRP6THMZC4KUQLZ6GQHBVKR5ZQGSJ7I6YDLZ5J23LHUGTDRBQAC
YSUN5ESQNV7M4SNBPGWYVMEQ6BUEWJPJFMCO4QGPCWEYM5GNJYOAC
RXCY7LD6ZRIOIKZEYKLMCYPMQPXF4DOEEFBDLVR2B22BXLZJFFBQC
A3TVGLVHSVLMEHLHB3TPBSD3QGNVGX3DIK6BEBDTTHWBNW4ALMRAC
CHVUM5ZYAVKV5SIGQAWJ6U3KN7XUTTYRIZ47QBFG4GMHUQ2QNBCAC
BIUOOCG24Z5XTSVBECUHR2RWVFQBS7IX42J4566W6MFJODCLUULQC
GFADTRREUCYL4L72MWLPGEYCAXDAZ6B5ZRI3FMQTZDEORVDQKYNAC
U4P5W2PXWYHBQC4I47VDAXRELERNVKO446NL5WF55XI5SBY62PNAC
JKMUUTI3UKS5CAYIAVKHEEELUW25FF4TNMC26XPCVFQ2KNV5TBNAC
R5ISDU53MC2AWB4OCRVH2IJJHSMXPAE3YUYPL5S2O3JG5TC2KKOAC
QOU4QVOOW7LESDZS6EB643CRFXXSLOLGCEQCA32YEH3NEPO6N77QC
ZYDYKZEOUTZM53UUBPKK3Q6BDLWHSW7S765JYNSRJRQPBG3S4NUAC
url = https://github.com/fwoar-greenhouse/emacs-overlay/archive/0ea22343cebd4ee1ac69858ee8462c04676951b6.tar.gz;
sha256 = "0z9ivq4nl2733kzffrbjy9ngcdnxznxpmxnm2qmixwx6r3ggsira";
url = https://github.com/fwoar-greenhouse/emacs-overlay/archive/0ea22343cebd4ee1ac69858ee8462c04676951b6.tar.gz;
sha256 = "0z9ivq4nl2733kzffrbjy9ngcdnxznxpmxnm2qmixwx6r3ggsira";
{ stdenv, fetchurl, writeText, sbclBootstrap, lib
, sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit"
, threadSupport ? (stdenv.isi686 || stdenv.isx86_64 || "aarch64-linux" == stdenv.hostPlatform.system)
, disableImmobileSpace ? false
# Meant for sbcl used for creating binaries portable to non-NixOS via save-lisp-and-die.
# Note that the created binaries still need `patchelf --set-interpreter ...`
# to get rid of ${glibc} dependency.
, purgeNixReferences ? false
, texinfo
, version
, sha
}:
let
{
stdenv,
fetchurl,
writeText,
sbclBootstrap,
lib,
sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit",
threadSupport ? (stdenv.isi686 || stdenv.isx86_64 || "aarch64-linux" == stdenv.hostPlatform.system),
disableImmobileSpace ? false,
# Meant for sbcl used for creating binaries portable to non-NixOS via save-lisp-and-die.
# Note that the created binaries still need `patchelf --set-interpreter ...`
# to get rid of ${glibc} dependency.
purgeNixReferences ? false,
texinfo,
version,
sha,
}: let
buildInputs = [texinfo];
patchPhase = ''
echo '"${version}.nixos"' > version.lisp-expr
pwd
# SBCL checks whether files are up-to-date in many places..
# Unfortunately, same timestamp is not good enough
sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp
#sed -e '/(date)/i((= date 2208988801) 2208988800)' -i contrib/asdf/asdf.lisp
sed -i src/cold/slam.lisp -e \
'/file-write-date input/a)'
sed -i src/cold/slam.lisp -e \
'/file-write-date output/i(or (and (= 2208988801 (file-write-date output)) (= 2208988801 (file-write-date input)))'
sed -i src/code/target-load.lisp -e \
'/date defaulted-fasl/a)'
sed -i src/code/target-load.lisp -e \
'/date defaulted-source/i(or (and (= 2208988801 (file-write-date defaulted-source-truename)) (= 2208988801 (file-write-date defaulted-fasl-truename)))'
# Fix the tests
sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp
sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp
# Use whatever `cc` the stdenv provides
substituteInPlace src/runtime/Config.x86-64-darwin --replace gcc cc
substituteInPlace src/runtime/Config.x86-64-darwin \
--replace mmacosx-version-min=10.4 mmacosx-version-min=10.5
''
+ (if purgeNixReferences
then
# This is the default location to look for the core; by default in $out/lib/sbcl
''
sed 's@^\(#define SBCL_HOME\) .*$@\1 "/no-such-path"@' \
-i src/runtime/runtime.c
''
else
# Fix software version retrieval
patchPhase =
sed -e "s@/bin/uname@$(command -v uname)@g" -i src/code/*-os.lisp \
src/code/run-program.lisp
echo '"${version}.nixos"' > version.lisp-expr
pwd
# SBCL checks whether files are up-to-date in many places..
# Unfortunately, same timestamp is not good enough
sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp
#sed -e '/(date)/i((= date 2208988801) 2208988800)' -i contrib/asdf/asdf.lisp
sed -i src/cold/slam.lisp -e \
'/file-write-date input/a)'
sed -i src/cold/slam.lisp -e \
'/file-write-date output/i(or (and (= 2208988801 (file-write-date output)) (= 2208988801 (file-write-date input)))'
sed -i src/code/target-load.lisp -e \
'/date defaulted-fasl/a)'
sed -i src/code/target-load.lisp -e \
'/date defaulted-source/i(or (and (= 2208988801 (file-write-date defaulted-source-truename)) (= 2208988801 (file-write-date defaulted-fasl-truename)))'
# Fix the tests
sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp
sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp
# Use whatever `cc` the stdenv provides
substituteInPlace src/runtime/Config.x86-64-darwin --replace gcc cc
substituteInPlace src/runtime/Config.x86-64-darwin \
--replace mmacosx-version-min=10.4 mmacosx-version-min=10.5
+ (
if purgeNixReferences
then
# This is the default location to look for the core; by default in $out/lib/sbcl
''
sed 's@^\(#define SBCL_HOME\) .*$@\1 "/no-such-path"@' \
-i src/runtime/runtime.c
''
else
# Fix software version retrieval
''
sed -e "s@/bin/uname@$(command -v uname)@g" -i src/code/*-os.lisp \
src/code/run-program.lisp
''
enableFeatures = with lib;
optional threadSupport "sb-thread" ++
optional stdenv.isAarch32 "arm";
disableFeatures = with lib;
optional (!threadSupport) "sb-thread"
++ optionals disableImmobileSpace ["immobile-space" "immobile-code" "compact-instance-header"];
disableFeatures = with lib;
optional (!threadSupport) "sb-thread" ++
optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ];
buildPhase = ''
sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}" ${
lib.concatStringsSep " "
(builtins.map (x: "--with-${x}") enableFeatures ++
builtins.map (x: "--without-${x}") disableFeatures)
}
(cd doc/manual ; make info)
'';
buildPhase = ''
sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}" ${
lib.concatStringsSep " "
(builtins.map (x: "--with-${x}") enableFeatures
++ builtins.map (x: "--without-${x}") disableFeatures)
}
(cd doc/manual ; make info)
'';
cp -r src $out/lib/sbcl
cp -r contrib $out/lib/sbcl
cat >$out/lib/sbcl/sbclrc <<EOF
(setf (logical-pathname-translations "SYS")
'(("SYS:SRC;**;*.*.*" #P"$out/lib/sbcl/src/**/*.*")
("SYS:CONTRIB;**;*.*.*" #P"$out/lib/sbcl/contrib/**/*.*")))
EOF
cp -r src $out/lib/sbcl
cp -r contrib $out/lib/sbcl
cat >$out/lib/sbcl/sbclrc <<EOF
(setf (logical-pathname-translations "SYS")
'(("SYS:SRC;**;*.*.*" #P"$out/lib/sbcl/src/**/*.*")
("SYS:CONTRIB;**;*.*.*" #P"$out/lib/sbcl/contrib/**/*.*")))
EOF
setupHook = lib.optional purgeNixReferences (writeText "setupHook.sh" ''
addEnvHooks "$targetOffset" _setSbclHome
_setSbclHome() {
export SBCL_HOME='@out@/lib/sbcl/'
}
'');
setupHook = lib.optional purgeNixReferences (writeText "setupHook.sh" ''
addEnvHooks "$targetOffset" _setSbclHome
_setSbclHome() {
export SBCL_HOME='@out@/lib/sbcl/'
}
'');
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib, stdenv ? pkgs.stdenv , fetchurl ? pkgs.fetchurl , perl ? pkgs.perl }:
{
pkgs ? import <nixpkgs> {},
lib ? pkgs.lib,
stdenv ? pkgs.stdenv,
fetchurl ? pkgs.fetchurl,
perl ? pkgs.perl,
}:
boost brotli capnproto cctz clang_9 double-conversion
icu jemalloc libcpuid libxml2 lld_9 llvm_9 lz4 libmysqlclient openssl perl
poco protobuf python3 rapidjson re2 rdkafka readline sparsehash unixODBC
xxHash zstd
boost
brotli
capnproto
cctz
clang_9
double-conversion
icu
jemalloc
libcpuid
libxml2
lld_9
llvm_9
lz4
libmysqlclient
openssl
perl
poco
protobuf
python3
rapidjson
re2
rdkafka
readline
sparsehash
unixODBC
xxHash
zstd