Merge pull request #50341 from corngood/chicken-5

chicken: 4.13.0 -> 5.0.0
This commit is contained in:
Silvan Mosberger 2018-12-31 05:09:57 +01:00 committed by GitHub
commit 69ef070296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 321 additions and 13 deletions

View File

@ -0,0 +1,21 @@
{ newScope } :
let
callPackage = newScope self;
self = {
pkgs = self;
fetchegg = callPackage ./fetchegg { };
eggDerivation = callPackage ./eggDerivation.nix { };
chicken = callPackage ./chicken.nix {
bootstrap-chicken = self.chicken.override { bootstrap-chicken = null; };
};
chickenEggs = callPackage ./eggs.nix { };
egg2nix = callPackage ./egg2nix.nix { };
};
in self

View File

@ -17,9 +17,8 @@ let
in
stdenv.mkDerivation ({
name = "chicken-${name}";
propagatedBuildInputs = buildInputs ++ [ chicken ];
propagatedUserEnvPkgs = buildInputs ++ [ chicken ];
buildInputs = [ makeWrapper ];
propagatedBuildInputs = buildInputs;
buildInputs = [ makeWrapper chicken ];
CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions;

View File

@ -0,0 +1,62 @@
{ stdenv, fetchurl, makeWrapper, bootstrap-chicken ? null }:
let
version = "5.0.0";
platform = with stdenv;
if isDarwin then "macosx"
else if isCygwin then "cygwin"
else if (isFreeBSD || isOpenBSD) then "bsd"
else if isSunOS then "solaris"
else "linux"; # Should be a sane default
lib = stdenv.lib;
in
stdenv.mkDerivation {
name = "chicken-${version}";
binaryVersion = 9;
src = fetchurl {
url = "https://code.call-cc.org/releases/${version}/chicken-${version}.tar.gz";
sha256 = "15b5yrzfa8aimzba79x7v6y282f898rxqxfxrr446sjx9jwlpfd8";
};
setupHook = lib.ifEnable (bootstrap-chicken != null) ./setup-hook.sh;
buildFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib";
installFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib";
buildInputs = [
makeWrapper
] ++ (lib.ifEnable (bootstrap-chicken != null) [
bootstrap-chicken
]);
postInstall = ''
for f in $out/bin/*
do
wrapProgram $f \
--prefix PATH : ${stdenv.cc}/bin
done
mv $out/var/lib/chicken $out/lib
rmdir $out/var/lib
rmdir $out/var
'';
# TODO: Assert csi -R files -p '(pathname-file (repository-path))' == binaryVersion
meta = {
homepage = http://www.call-cc.org/;
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
platforms = stdenv.lib.platforms.linux; # Maybe other non-darwin Unix
description = "A portable compiler for the Scheme programming language";
longDescription = ''
CHICKEN is a compiler for the Scheme programming language.
CHICKEN produces portable and efficient C, supports almost all
of the R5RS Scheme language standard, and includes many
enhancements and extensions. CHICKEN runs on Linux, macOS,
Windows, and many Unix flavours.
'';
};
}

View File

@ -0,0 +1,21 @@
{ newScope } :
let
callPackage = newScope self;
self = {
pkgs = self;
fetchegg = callPackage ./fetchegg { };
eggDerivation = callPackage ./eggDerivation.nix { };
chicken = callPackage ./chicken.nix {
bootstrap-chicken = self.chicken.override { bootstrap-chicken = null; };
};
chickenEggs = callPackage ./eggs.nix { };
egg2nix = callPackage ./egg2nix.nix { };
};
in self

View File

@ -0,0 +1,29 @@
{ stdenv, eggDerivation, fetchFromGitHub, chickenEggs }:
# Note: This mostly reimplements the default.nix already contained in
# the tarball. Is there a nicer way than duplicating code?
let
version = "c5-git";
in
eggDerivation {
src = fetchFromGitHub {
owner = "corngood";
repo = "egg2nix";
rev = "chicken-5";
sha256 = "1vfnhbcnyakywgjafhs0k5kpsdnrinzvdjxpz3fkwas1jsvxq3d1";
};
name = "egg2nix-${version}";
buildInputs = with chickenEggs; [
args matchable
];
meta = {
description = "Generate nix-expression from CHICKEN scheme eggs";
homepage = https://github.com/the-kenny/egg2nix;
license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.the-kenny ];
};
}

View File

@ -0,0 +1,41 @@
{ stdenv, chicken, makeWrapper }:
{ name, src
, buildInputs ? []
, chickenInstallFlags ? []
, cscOptions ? []
, ...} @ args:
let
overrides = import ./overrides.nix;
baseName = (builtins.parseDrvName name).name;
override = if builtins.hasAttr baseName overrides
then
builtins.getAttr baseName overrides
else
{};
in
stdenv.mkDerivation ({
name = "chicken-${name}";
propagatedBuildInputs = buildInputs;
buildInputs = [ makeWrapper chicken ];
CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions;
installPhase = ''
runHook preInstall
export CHICKEN_INSTALL_PREFIX=$out
export CHICKEN_INSTALL_REPOSITORY=$out/lib/chicken/${toString chicken.binaryVersion}
chicken-install ${stdenv.lib.concatStringsSep " " chickenInstallFlags}
for f in $out/bin/*
do
wrapProgram $f \
--prefix CHICKEN_REPOSITORY_PATH : "$out/lib/chicken/${toString chicken.binaryVersion}/:$CHICKEN_REPOSITORY_PATH" \
--prefix CHICKEN_INCLUDE_PATH : "$CHICKEN_INCLUDE_PATH:$out/share/" \
--prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_PATH"
done
runHook postInstall
'';
} // (builtins.removeAttrs args ["name" "buildInputs"]) // override)

View File

@ -0,0 +1,91 @@
{ pkgs, stdenv }:
rec {
inherit (pkgs) eggDerivation fetchegg;
args = eggDerivation {
name = "args-1.6.0";
src = fetchegg {
name = "args";
version = "1.6.0";
sha256 = "1y9sznh4kxqxvhd8k44bjx0s7xspp52sx4bn8i8i0f8lwch6r2g4";
};
buildInputs = [
srfi-1
srfi-13
srfi-37
];
};
matchable = eggDerivation {
name = "matchable-1.0";
src = fetchegg {
name = "matchable";
version = "1.0";
sha256 = "01vy2ppq3sq0wirvsvl3dh0bwa5jqs1i6rdjdd7pnwj4nncxd1ga";
};
buildInputs = [
];
};
srfi-1 = eggDerivation {
name = "srfi-1-0.5";
src = fetchegg {
name = "srfi-1";
version = "0.5";
sha256 = "0gh1h406xbxwm5gvc5znc93nxp9xjbhyqf7zzga08k5y6igxrlvk";
};
buildInputs = [
];
};
srfi-13 = eggDerivation {
name = "srfi-13-0.2";
src = fetchegg {
name = "srfi-13";
version = "0.2";
sha256 = "0jazbdnn9bjm7wwxqq7xzqxc9zfvaapq565rf1czj6ayl96yvk3n";
};
buildInputs = [
srfi-14
];
};
srfi-14 = eggDerivation {
name = "srfi-14-0.2";
src = fetchegg {
name = "srfi-14";
version = "0.2";
sha256 = "13nm4nn1d52nkvhjizy26z3s6q41x1ml4zm847xzf86x1zwvymni";
};
buildInputs = [
];
};
srfi-37 = eggDerivation {
name = "srfi-37-1.4";
src = fetchegg {
name = "srfi-37";
version = "1.4";
sha256 = "17f593497n70gldkj6iab6ilgryiqar051v6azn1szhnm1lk7dwd";
};
buildInputs = [
];
};
}

View File

@ -0,0 +1,3 @@
;; Eggs used by egg2nix
args
matchable

View File

@ -0,0 +1,10 @@
source $stdenv/setup
header "exporting egg ${eggName} (version $version) into $out"
mkdir -p $out
CHICKEN_EGG_CACHE=. chicken-install -r "${eggName}:${version}"
rm ${eggName}/{STATUS,TIMESTAMP}
cp -r ${eggName}/* $out/
stopNest

View File

@ -0,0 +1,25 @@
# Fetches a chicken egg from henrietta using `chicken-install -r'
# See: http://wiki.call-cc.org/chicken-projects/egg-index-5.html
{ stdenvNoCC, chicken }:
{ name, version, md5 ? "", sha256 ? "" }:
if md5 != "" then
throw "fetchegg does not support md5 anymore, please use sha256"
else
stdenvNoCC.mkDerivation {
name = "chicken-${name}-export";
builder = ./builder.sh;
nativeBuildInputs = [ chicken ];
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
inherit version;
eggName = name;
impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
}

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,6 @@
addChickenRepositoryPath() {
addToSearchPathWithCustomDelimiter : CHICKEN_REPOSITORY_PATH "$1/lib/chicken/9/"
addToSearchPathWithCustomDelimiter : CHICKEN_INCLUDE_PATH "$1/share/"
}
addEnvHooks "$targetOffset" addChickenRepositoryPath

View File

@ -6623,17 +6623,15 @@ in
colm = callPackage ../development/compilers/colm { };
fetchegg = callPackage ../build-support/fetchegg { };
chickenPackages_4 = callPackage ../development/compilers/chicken/4 { };
chickenPackages_5 = callPackage ../development/compilers/chicken/5 { };
chickenPackages = chickenPackages_5;
eggDerivation = callPackage ../development/compilers/chicken/eggDerivation.nix { };
chicken = callPackage ../development/compilers/chicken {
bootstrap-chicken = chicken.override { bootstrap-chicken = null; };
};
egg2nix = callPackage ../development/tools/egg2nix {
chickenEggs = callPackage ../development/tools/egg2nix/chicken-eggs.nix { };
};
inherit (chickenPackages)
fetchegg
eggDerivation
chicken
egg2nix;
ccl = callPackage ../development/compilers/ccl {
inherit (buildPackages.darwin) bootstrap_cmds;