Merge master into staging-next

This commit is contained in:
Frederik Rietdijk
2018-12-31 12:00:36 +01:00
172 changed files with 2734 additions and 2541 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

@@ -0,0 +1,27 @@
{ stdenv, eggDerivation, fetchurl, chickenEggs }:
# Note: This mostly reimplements the default.nix already contained in
# the tarball. Is there a nicer way than duplicating code?
let
version = "0.5";
in
eggDerivation {
src = fetchurl {
url = "https://github.com/the-kenny/egg2nix/archive/${version}.tar.gz";
sha256 = "0adal428v4i7h9lzs7sfq75q2mxhsbf1qqwzrsjv8j41paars20y";
};
name = "egg2nix-${version}";
buildInputs = with chickenEggs; [
matchable http-client
];
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

@@ -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,296 @@
{ pkgs }:
rec {
inherit (pkgs) eggDerivation fetchegg;
base64 = eggDerivation {
name = "base64-3.3.1";
src = fetchegg {
name = "base64";
version = "3.3.1";
sha256 = "0wmldiwwg1jpcn07wb906nc53si5j7sa83wgyq643xzqcx4v4x1d";
};
buildInputs = [
];
};
blob-utils = eggDerivation {
name = "blob-utils-1.0.3";
src = fetchegg {
name = "blob-utils";
version = "1.0.3";
sha256 = "17vdn02fnxnjx5ixgqimln93lqvzyq4y9w02fw7xnbdcjzqm0xml";
};
buildInputs = [
setup-helper
string-utils
];
};
check-errors = eggDerivation {
name = "check-errors-1.13.0";
src = fetchegg {
name = "check-errors";
version = "1.13.0";
sha256 = "12a0sn82n98jybh72zb39fdddmr5k4785xglxb16750fhy8rmjwi";
};
buildInputs = [
setup-helper
];
};
defstruct = eggDerivation {
name = "defstruct-1.6";
src = fetchegg {
name = "defstruct";
version = "1.6";
sha256 = "0lsgl32nmb5hxqiii4r3292cx5vqh50kp6v062nfiyid9lhrj0li";
};
buildInputs = [
];
};
http-client = eggDerivation {
name = "http-client-0.7.1";
src = fetchegg {
name = "http-client";
version = "0.7.1";
sha256 = "1s03zgmb7kb99ld0f2ylqgicrab9qgza53fkgsqvg7bh5njmzhxr";
};
buildInputs = [
intarweb
uri-common
message-digest
md5
string-utils
sendfile
];
};
intarweb = eggDerivation {
name = "intarweb-1.3";
src = fetchegg {
name = "intarweb";
version = "1.3";
sha256 = "0izlby78c25py29bdcbc0vapb6h7xgchqrzi6i51d0rb3mnwy88h";
};
buildInputs = [
defstruct
uri-common
base64
];
};
lookup-table = eggDerivation {
name = "lookup-table-1.13.5";
src = fetchegg {
name = "lookup-table";
version = "1.13.5";
sha256 = "1nzly6rhynawlvzlyilk8z8cxz57cf9n5iv20glkhh28pz2izmrb";
};
buildInputs = [
setup-helper
check-errors
miscmacros
record-variants
synch
];
};
matchable = eggDerivation {
name = "matchable-3.3";
src = fetchegg {
name = "matchable";
version = "3.3";
sha256 = "07y3lpzgm4djiwi9y2adc796f9kwkmdr28fkfkw65syahdax8990";
};
buildInputs = [
];
};
md5 = eggDerivation {
name = "md5-3.1.0";
src = fetchegg {
name = "md5";
version = "3.1.0";
sha256 = "0bka43nx8x9b0b079qpvml2fl20km19ny0qjmhwzlh6rwmzazj2a";
};
buildInputs = [
message-digest
];
};
message-digest = eggDerivation {
name = "message-digest-3.1.0";
src = fetchegg {
name = "message-digest";
version = "3.1.0";
sha256 = "1w6bax19dwgih78vcimiws0rja7qsd8hmbm6qqg2hf9cw3vab21s";
};
buildInputs = [
setup-helper
miscmacros
check-errors
variable-item
blob-utils
string-utils
];
};
miscmacros = eggDerivation {
name = "miscmacros-2.96";
src = fetchegg {
name = "miscmacros";
version = "2.96";
sha256 = "1ajdgjrni10i2hmhcp4rawnxajjxry3kmq1krdmah4sf0kjrgajc";
};
buildInputs = [
];
};
record-variants = eggDerivation {
name = "record-variants-0.5.1";
src = fetchegg {
name = "record-variants";
version = "0.5.1";
sha256 = "15wgysxkm8m4hx9nhhw9akchzipdnqc7yj3qd3zn0z7sxg4sld1h";
};
buildInputs = [
];
};
sendfile = eggDerivation {
name = "sendfile-1.7.29";
src = fetchegg {
name = "sendfile";
version = "1.7.29";
sha256 = "1dc02cbkx5kixhbqjy26g6gs680vy7krc9qis1p1v4aa0b2lgj7k";
};
buildInputs = [
];
};
setup-helper = eggDerivation {
name = "setup-helper-1.5.4";
src = fetchegg {
name = "setup-helper";
version = "1.5.4";
sha256 = "1k644y0md2isdcvazqfm4nyc8rh3dby6b0j3r4na4w8ryspqp6gj";
};
buildInputs = [
];
};
string-utils = eggDerivation {
name = "string-utils-1.2.4";
src = fetchegg {
name = "string-utils";
version = "1.2.4";
sha256 = "07alvghg0dahilrm4jg44bndl0x69sv1zbna9l20cbdvi35i0jp1";
};
buildInputs = [
setup-helper
miscmacros
lookup-table
check-errors
];
};
synch = eggDerivation {
name = "synch-2.1.2";
src = fetchegg {
name = "synch";
version = "2.1.2";
sha256 = "1m9mnbq0m5jsxmd1a3rqpwpxj0l1b7vn1fknvxycc047pmlcyl00";
};
buildInputs = [
setup-helper
check-errors
];
};
uri-common = eggDerivation {
name = "uri-common-1.4";
src = fetchegg {
name = "uri-common";
version = "1.4";
sha256 = "01ds1gixcn4rz657x3hr4rhw2496hsjff42ninw0k39l8i1cbh7c";
};
buildInputs = [
uri-generic
defstruct
matchable
];
};
uri-generic = eggDerivation {
name = "uri-generic-2.41";
src = fetchegg {
name = "uri-generic";
version = "2.41";
sha256 = "1r5jbzjllbnmhm5n0m3fcx0g6dc2c2jzp1dcndkfmxz0cl99zxac";
};
buildInputs = [
matchable
defstruct
];
};
variable-item = eggDerivation {
name = "variable-item-1.3.1";
src = fetchegg {
name = "variable-item";
version = "1.3.1";
sha256 = "19b3mhb8kr892sz9yyzq79l0vv28dgilw9cf415kj6aq16yp4d5n";
};
buildInputs = [
setup-helper
check-errors
];
};
}

View File

@@ -0,0 +1,5 @@
;; Eggs used by egg2nix
http-client
intarweb
matchable
uri-common

View File

@@ -0,0 +1,9 @@
source $stdenv/setup
header "exporting egg ${eggName} (version $version) into $out"
mkdir -p $out
chicken-install -r "${eggName}:${version}"
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-4.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-${version}";
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,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

@@ -7,13 +7,13 @@ let
in
stdenv.mkDerivation rec {
name = "nextpnr-${version}";
version = "2018.10.17";
version = "2018.12.29";
src = fetchFromGitHub {
owner = "yosyshq";
repo = "nextpnr";
rev = "529a595157a2eef24f8529b0de0c504a40ed503b";
sha256 = "06yp89rpvb2s4zc1qkbcp76kqwkk9s8j2ckblqw547dy5ah2cl7h";
rev = "eb456ef476e8342b4709d71cbff6ef22a714d6ec";
sha256 = "1gw9r8c6wyfhbzhm3hz1xpbq8ax27qnjwlrimzcykrr9r1cykiik";
};
nativeBuildInputs = [ cmake ];

View File

@@ -4,7 +4,7 @@
}:
let
version = "0.7.1";
version = "0.7.2";
# Build a sort of "union package" with all the native dependencies we
# have: Lua (or LuaJIT), readline, etc. Then, we can depend on this
# and refer to ${urn-rt} instead of ${lua}, ${readline}, etc.
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
owner = "urn";
repo = "urn";
rev = "v${version}";
sha256 = "1vw0sljrczbwl7fl5d3frbpklb0larzyp7s7mwwprkb07b027sd5";
sha256 = "0nclr3d8ap0y5cg36i7g4ggdqci6m5q27y9f26b57km8p266kcpy";
};
buildInputs = [ makeWrapper ];