Permalink
Browse files

chicken: 4.13.0 -> 5.0.0

  • Loading branch information...
corngood committed Nov 14, 2018
1 parent aac3ae3 commit 6c063ac07692589e9d1a095bee4176be46db7ba9
Showing with 322 additions and 14 deletions.
  1. 0 pkgs/development/compilers/chicken/{ → 4}/0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch
  2. 0 pkgs/development/compilers/chicken/{default.nix → 4/chicken.nix}
  3. +21 −0 pkgs/development/compilers/chicken/4/default.nix
  4. 0 pkgs/development/{tools/egg2nix/default.nix → compilers/chicken/4/egg2nix.nix}
  5. +2 −3 pkgs/development/compilers/chicken/{ → 4}/eggDerivation.nix
  6. 0 pkgs/development/{tools/egg2nix/chicken-eggs.nix → compilers/chicken/4/eggs.nix}
  7. 0 pkgs/development/{tools/egg2nix/chicken-eggs.scm → compilers/chicken/4/eggs.scm}
  8. 0 pkgs/{build-support → development/compilers/chicken/4}/fetchegg/builder.sh
  9. 0 pkgs/{build-support → development/compilers/chicken/4}/fetchegg/default.nix
  10. 0 pkgs/development/compilers/chicken/{ → 4}/overrides.nix
  11. 0 pkgs/development/compilers/chicken/{ → 4}/setup-hook.sh
  12. +62 −0 pkgs/development/compilers/chicken/5/chicken.nix
  13. +21 −0 pkgs/development/compilers/chicken/5/default.nix
  14. +29 −0 pkgs/development/compilers/chicken/5/egg2nix.nix
  15. +41 −0 pkgs/development/compilers/chicken/5/eggDerivation.nix
  16. +91 −0 pkgs/development/compilers/chicken/5/eggs.nix
  17. +3 −0 pkgs/development/compilers/chicken/5/eggs.scm
  18. +10 −0 pkgs/development/compilers/chicken/5/fetchegg/builder.sh
  19. +25 −0 pkgs/development/compilers/chicken/5/fetchegg/default.nix
  20. +2 −0 pkgs/development/compilers/chicken/5/overrides.nix
  21. +6 −0 pkgs/development/compilers/chicken/5/setup-hook.sh
  22. +9 −11 pkgs/top-level/all-packages.nix
@@ -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
@@ -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;

@@ -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.
'';
};
}
@@ -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
@@ -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 ];
};
}
@@ -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)
@@ -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 = [

];
};
}

@@ -0,0 +1,3 @@
;; Eggs used by egg2nix
args
matchable
@@ -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
@@ -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;
}

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

addEnvHooks "$targetOffset" addChickenRepositoryPath
@@ -6604,17 +6604,15 @@ in

colm = callPackage ../development/compilers/colm { };

fetchegg = callPackage ../build-support/fetchegg { };

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 { };
};
chickenPackages_4 = callPackage ../development/compilers/chicken/4 { };
chickenPackages_5 = callPackage ../development/compilers/chicken/5 { };
chickenPackages = chickenPackages_5;

inherit (chickenPackages)
fetchegg
eggDerivation
chicken
egg2nix;

ccl = callPackage ../development/compilers/ccl {
inherit (buildPackages.darwin) bootstrap_cmds;

0 comments on commit 6c063ac

Please sign in to comment.