uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
110
pkgs/development/compilers/gerbil/build.nix
Normal file
110
pkgs/development/compilers/gerbil/build.nix
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
{ pkgs, gccStdenv, lib, coreutils,
|
||||
openssl, zlib, sqlite, libxml2, libyaml, libmysqlclient, lmdb, leveldb, postgresql,
|
||||
version, git-version,
|
||||
gambit-support,
|
||||
gambit ? pkgs.gambit, gambit-params ? pkgs.gambit-support.stable-params, src }:
|
||||
|
||||
# We use Gambit, that works 10x better with GCC than Clang. See ../gambit/build.nix
|
||||
let stdenv = gccStdenv; in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gerbil";
|
||||
inherit version;
|
||||
inherit src;
|
||||
|
||||
buildInputs_libraries = [ openssl zlib sqlite libxml2 libyaml libmysqlclient lmdb leveldb postgresql ];
|
||||
|
||||
# TODO: either fix all of Gerbil's dependencies to provide static libraries,
|
||||
# or give up and delete all tentative support for static libraries.
|
||||
#buildInputs_staticLibraries = map makeStaticLibraries buildInputs_libraries;
|
||||
|
||||
buildInputs = [ gambit ]
|
||||
++ buildInputs_libraries; # ++ buildInputs_staticLibraries;
|
||||
|
||||
# disable stackprotector on aarch64-darwin for now
|
||||
# build error:
|
||||
# ```
|
||||
# /private/tmp/nix-build-gerbil-unstable-2020-11-05.drv-0/ccjyhWKi.s:326:15: error: index must be an integer in range [-256, 255].
|
||||
# ldr x2, [x2, ___stack_chk_guard];momd
|
||||
# ^
|
||||
# ```
|
||||
hardeningDisable = lib.optionals (gccStdenv.isAarch64 && gccStdenv.isDarwin) [ "stackprotector" ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql";
|
||||
|
||||
postPatch = ''
|
||||
echo '(define (gerbil-version-string) "v${git-version}")' > src/gerbil/runtime/gx-version.scm ;
|
||||
patchShebangs . ;
|
||||
grep -Fl '#!/usr/bin/env' `find . -type f -executable` | while read f ; do
|
||||
substituteInPlace "$f" --replace '#!/usr/bin/env' '#!${coreutils}/bin/env' ;
|
||||
done ;
|
||||
'';
|
||||
|
||||
## TODO: make static compilation work.
|
||||
## For that, get all the packages below to somehow expose static libraries,
|
||||
## so we can offer users the option to statically link them into Gambit and/or Gerbil.
|
||||
## Then add the following to the postPatch script above:
|
||||
# cat > etc/gerbil_static_libraries.sh <<EOF
|
||||
# OPENSSL_LIBCRYPTO=${makeStaticLibraries openssl}/lib/libcrypto.a # MISSING!
|
||||
# OPENSSL_LIBSSL=${makeStaticLibraries openssl}/lib/libssl.a # MISSING!
|
||||
# ZLIB=${makeStaticLibraries zlib}/lib/libz.a
|
||||
# SQLITE=${makeStaticLibraries sqlite}/lib/sqlite.a # MISSING!
|
||||
# LIBXML2=${makeStaticLibraries libxml2}/lib/libxml2.a # MISSING!
|
||||
# YAML=${makeStaticLibraries libyaml}/lib/libyaml.a # MISSING!
|
||||
# MYSQL=${makeStaticLibraries libmysqlclient}/lib/mariadb/libmariadb.a
|
||||
# LMDB=${makeStaticLibraries lmdb}/lib/mysql/libmysqlclient_r.a # MISSING!
|
||||
# LEVELDB=${makeStaticLibraries leveldb}/lib/libleveldb.a
|
||||
# EOF
|
||||
|
||||
configurePhase = ''
|
||||
(cd src && ./configure \
|
||||
--prefix=$out/gerbil \
|
||||
--with-gambit=${gambit}/gambit \
|
||||
--enable-libxml \
|
||||
--enable-libyaml \
|
||||
--enable-zlib \
|
||||
--enable-sqlite \
|
||||
--enable-mysql \
|
||||
--enable-lmdb \
|
||||
--enable-leveldb)
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# gxprof testing uses $HOME/.cache/gerbil/gxc
|
||||
export HOME=$PWD
|
||||
export GERBIL_BUILD_CORES=$NIX_BUILD_CORES
|
||||
export GERBIL_GXC=$PWD/bin/gxc
|
||||
export GERBIL_BASE=$PWD
|
||||
export GERBIL_HOME=$PWD
|
||||
export GERBIL_PATH=$PWD/lib
|
||||
export PATH=$PWD/bin:$PATH
|
||||
${gambit-support.export-gambopt gambit-params}
|
||||
|
||||
# Build, replacing make by build.sh
|
||||
( cd src && sh build.sh )
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/gerbil $out/bin
|
||||
(cd src; ./install)
|
||||
(cd $out/bin ; ln -s ../gerbil/bin/* .)
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
meta = {
|
||||
description = "Gerbil Scheme";
|
||||
homepage = "https://github.com/vyzo/gerbil";
|
||||
license = lib.licenses.lgpl21; # also asl20, like Gambit
|
||||
# NB regarding platforms: regularly tested on Linux, only occasionally on macOS.
|
||||
# Please report success and/or failure to fare.
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ fare ];
|
||||
};
|
||||
}
|
||||
12
pkgs/development/compilers/gerbil/default.nix
Normal file
12
pkgs/development/compilers/gerbil/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ callPackage, fetchFromGitHub }:
|
||||
|
||||
callPackage ./build.nix rec {
|
||||
version = "0.16";
|
||||
git-version = version;
|
||||
src = fetchFromGitHub {
|
||||
owner = "vyzo";
|
||||
repo = "gerbil";
|
||||
rev = "v${version}";
|
||||
sha256 = "0vng0kxpnwsg8jbjdpyn4sdww36jz7zfpfbzayg9sdpz6bjxjy0f";
|
||||
};
|
||||
}
|
||||
27
pkgs/development/compilers/gerbil/gerbil-crypto.nix
Normal file
27
pkgs/development/compilers/gerbil/gerbil-crypto.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }:
|
||||
|
||||
gerbil-support.gerbilPackage {
|
||||
pname = "gerbil-crypto";
|
||||
version = "unstable-2020-08-01";
|
||||
git-version = "0.0-6-ga228862";
|
||||
gerbil-package = "clan/crypto";
|
||||
gerbil = gerbil-unstable;
|
||||
gerbilInputs = [gerbil-support.gerbilPackages-unstable.gerbil-utils];
|
||||
buildInputs = [pkgs.secp256k1 pkgs.pkg-config];
|
||||
gambit-params = gambit-support.unstable-params;
|
||||
version-path = "version";
|
||||
softwareName = "Gerbil-crypto";
|
||||
src = fetchFromGitHub {
|
||||
owner = "fare";
|
||||
repo = "gerbil-crypto";
|
||||
rev = "a22886260849ec92c3a34bfeedc1574e41e49e33";
|
||||
sha256 = "0qbanw2vnw2ymmr4pr1jap29cyc3icbhyq0apibpfnj2znns7w47";
|
||||
};
|
||||
meta = {
|
||||
description = "Gerbil Crypto: Extra Cryptographic Primitives for Gerbil";
|
||||
homepage = "https://github.com/fare/gerbil-crypto";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ fare ];
|
||||
};
|
||||
}
|
||||
28
pkgs/development/compilers/gerbil/gerbil-ethereum.nix
Normal file
28
pkgs/development/compilers/gerbil/gerbil-ethereum.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }:
|
||||
|
||||
gerbil-support.gerbilPackage {
|
||||
pname = "gerbil-ethereum";
|
||||
version = "unstable-2020-10-18";
|
||||
git-version = "0.0-26-gf27ada8";
|
||||
gerbil-package = "mukn/ethereum";
|
||||
gerbil = gerbil-unstable;
|
||||
gerbilInputs = with gerbil-support.gerbilPackages-unstable;
|
||||
[gerbil-utils gerbil-crypto gerbil-poo gerbil-persist];
|
||||
buildInputs = [];
|
||||
gambit-params = gambit-support.unstable-params;
|
||||
version-path = "version";
|
||||
softwareName = "Gerbil-ethereum";
|
||||
src = fetchFromGitHub {
|
||||
owner = "fare";
|
||||
repo = "gerbil-ethereum";
|
||||
rev = "f27ada8e7f4de4f8fbdfede9fe055914b254d8e7";
|
||||
sha256 = "1lykjqim6a44whj1r8kkpiz68wghkfqx5vjlrc2ldxlmgd4r9gvd";
|
||||
};
|
||||
meta = {
|
||||
description = "Gerbil Ethereum: a Scheme alternative to web3.js";
|
||||
homepage = "https://github.com/fare/gerbil-ethereum";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ fare ];
|
||||
};
|
||||
}
|
||||
27
pkgs/development/compilers/gerbil/gerbil-libp2p.nix
Normal file
27
pkgs/development/compilers/gerbil/gerbil-libp2p.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }:
|
||||
|
||||
gerbil-support.gerbilPackage {
|
||||
pname = "gerbil-libp2p";
|
||||
version = "unstable-2018-12-27";
|
||||
git-version = "2376b3f";
|
||||
gerbil-package = "vyzo";
|
||||
gerbil = gerbil-unstable;
|
||||
gerbilInputs = [];
|
||||
buildInputs = []; # Note: at *runtime*, depends on go-libp2p-daemon
|
||||
gambit-params = gambit-support.unstable-params;
|
||||
version-path = "version";
|
||||
softwareName = "Gerbil-libp2p";
|
||||
src = fetchFromGitHub {
|
||||
owner = "vyzo";
|
||||
repo = "gerbil-libp2p";
|
||||
rev = "2376b3f39cee04dd4ec455c8ea4e5faa93c2bf88";
|
||||
sha256 = "0jcy7hfg953078msigyfwp2g4ii44pi6q7vcpmq01cbbvxpxz6zw";
|
||||
};
|
||||
meta = {
|
||||
description = "Gerbil libp2p: use libp2p from Gerbil";
|
||||
homepage = "https://github.com/vyzo/gerbil-libp2p";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ fare ];
|
||||
};
|
||||
}
|
||||
27
pkgs/development/compilers/gerbil/gerbil-persist.nix
Normal file
27
pkgs/development/compilers/gerbil/gerbil-persist.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }:
|
||||
|
||||
gerbil-support.gerbilPackage {
|
||||
pname = "gerbil-persist";
|
||||
version = "unstable-2020-08-31";
|
||||
git-version = "0.0-8-gd211390";
|
||||
gerbil-package = "clan/persist";
|
||||
gerbil = gerbil-unstable;
|
||||
gerbilInputs = with gerbil-support.gerbilPackages-unstable; [gerbil-utils gerbil-crypto gerbil-poo];
|
||||
buildInputs = [];
|
||||
gambit-params = gambit-support.unstable-params;
|
||||
version-path = "version";
|
||||
softwareName = "Gerbil-persist";
|
||||
src = fetchFromGitHub {
|
||||
owner = "fare";
|
||||
repo = "gerbil-persist";
|
||||
rev = "d211390c8a199cf2b8c7400cd98977524e960015";
|
||||
sha256 = "13s6ws8ziwalfp23nalss41qnz667z2712lr3y123sypm5n5axk7";
|
||||
};
|
||||
meta = {
|
||||
description = "Gerbil Persist: Persistent data and activities";
|
||||
homepage = "https://github.com/fare/gerbil-persist";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ fare ];
|
||||
};
|
||||
}
|
||||
27
pkgs/development/compilers/gerbil/gerbil-poo.nix
Normal file
27
pkgs/development/compilers/gerbil/gerbil-poo.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }:
|
||||
|
||||
gerbil-support.gerbilPackage {
|
||||
pname = "gerbil-ethereum";
|
||||
version = "unstable-2020-10-17";
|
||||
git-version = "0.0-35-g44d490d";
|
||||
gerbil-package = "clan/poo";
|
||||
gerbil = gerbil-unstable;
|
||||
gerbilInputs = with gerbil-support.gerbilPackages-unstable; [gerbil-utils gerbil-crypto];
|
||||
buildInputs = [];
|
||||
gambit-params = gambit-support.unstable-params;
|
||||
version-path = "version";
|
||||
softwareName = "Gerbil-POO";
|
||||
src = fetchFromGitHub {
|
||||
owner = "fare";
|
||||
repo = "gerbil-poo";
|
||||
rev = "44d490d95b9d1b5d54eaedf2602419af8e086837";
|
||||
sha256 = "082ndpy281saybcnp3bdidcibkk2ih6glrkbb5fdj1524ban4d0k";
|
||||
};
|
||||
meta = {
|
||||
description = "Gerbil POO: Prototype Object Orientation for Gerbil Scheme";
|
||||
homepage = "https://github.com/fare/gerbil-poo";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ fare ];
|
||||
};
|
||||
}
|
||||
76
pkgs/development/compilers/gerbil/gerbil-support.nix
Normal file
76
pkgs/development/compilers/gerbil/gerbil-support.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{ pkgs, lib, gccStdenv, callPackage, fetchFromGitHub }:
|
||||
# See ../gambit/build.nix regarding gccStdenv
|
||||
|
||||
rec {
|
||||
# Gerbil libraries
|
||||
gerbilPackages-unstable = {
|
||||
gerbil-libp2p = callPackage ./gerbil-libp2p.nix { };
|
||||
gerbil-utils = callPackage ./gerbil-utils.nix { };
|
||||
gerbil-crypto = callPackage ./gerbil-crypto.nix { };
|
||||
gerbil-poo = callPackage ./gerbil-poo.nix { };
|
||||
gerbil-persist = callPackage ./gerbil-persist.nix { };
|
||||
gerbil-ethereum = callPackage ./gerbil-ethereum.nix { };
|
||||
smug-gerbil = callPackage ./smug-gerbil.nix { };
|
||||
};
|
||||
|
||||
# Use this function in any package that uses Gerbil libraries, to define the GERBIL_LOADPATH.
|
||||
gerbilLoadPath =
|
||||
gerbilInputs : builtins.concatStringsSep ":" (map (x : x + "/gerbil/lib") gerbilInputs);
|
||||
|
||||
# Use this function to create a Gerbil library. See gerbil-utils as an example.
|
||||
gerbilPackage = {
|
||||
pname, version, src, meta, gerbil-package,
|
||||
git-version ? "", version-path ? "",
|
||||
gerbil ? pkgs.gerbil-unstable,
|
||||
gambit-params ? pkgs.gambit-support.stable-params,
|
||||
gerbilInputs ? [],
|
||||
buildInputs ? [],
|
||||
buildScript ? "./build.ss",
|
||||
softwareName ? ""} :
|
||||
let buildInputs_ = buildInputs; in
|
||||
gccStdenv.mkDerivation rec {
|
||||
inherit src meta pname version;
|
||||
passthru = { inherit gerbil-package version-path ;};
|
||||
buildInputs = [ gerbil ] ++ gerbilInputs ++ buildInputs_;
|
||||
postPatch = ''
|
||||
set -e ;
|
||||
if [ -n "${version-path}.ss" ] ; then
|
||||
echo -e '(import :clan/versioning${builtins.concatStringsSep ""
|
||||
(map (x : lib.optionalString (x.passthru.version-path != "")
|
||||
" :${x.passthru.gerbil-package}/${x.passthru.version-path}")
|
||||
gerbilInputs)
|
||||
})\n(register-software "${softwareName}" "v${git-version}")\n' > "${passthru.version-path}.ss"
|
||||
fi
|
||||
patchShebangs . ;
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
export GERBIL_BUILD_CORES=$NIX_BUILD_CORES
|
||||
export GERBIL_PATH=$PWD/.build
|
||||
export GERBIL_LOADPATH=${gerbilLoadPath gerbilInputs}
|
||||
${pkgs.gambit-support.export-gambopt gambit-params}
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
${buildScript}
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/gerbil/lib
|
||||
cp -fa .build/lib $out/gerbil/
|
||||
bins=(.build/bin/*)
|
||||
if [ 0 -lt ''${#bins} ] ; then
|
||||
cp -fa .build/bin $out/gerbil/
|
||||
mkdir $out/bin
|
||||
cd $out/bin
|
||||
ln -s ../gerbil/bin/* .
|
||||
fi
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
dontFixup = true;
|
||||
};
|
||||
}
|
||||
25
pkgs/development/compilers/gerbil/gerbil-utils.nix
Normal file
25
pkgs/development/compilers/gerbil/gerbil-utils.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }:
|
||||
|
||||
gerbil-support.gerbilPackage {
|
||||
pname = "gerbil-utils";
|
||||
version = "unstable-2020-10-18";
|
||||
git-version = "0.2-36-g8b481b7";
|
||||
gerbil-package = "clan";
|
||||
gerbil = gerbil-unstable;
|
||||
gambit-params = gambit-support.unstable-params;
|
||||
version-path = "version";
|
||||
softwareName = "Gerbil-utils";
|
||||
src = fetchFromGitHub {
|
||||
owner = "fare";
|
||||
repo = "gerbil-utils";
|
||||
rev = "8b481b787e13e07e14d0718d670aab016131a090";
|
||||
sha256 = "0br8k5b2wcv4wcp65r2bfhji3af2qgqjspf41syqslq9awx47f3m";
|
||||
};
|
||||
meta = {
|
||||
description = "Gerbil Clan: Community curated Collection of Common Utilities";
|
||||
homepage = "https://github.com/fare/gerbil-utils";
|
||||
license = lib.licenses.lgpl21;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ fare ];
|
||||
};
|
||||
}
|
||||
30
pkgs/development/compilers/gerbil/smug-gerbil.nix
Normal file
30
pkgs/development/compilers/gerbil/smug-gerbil.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ pkgs, lib, fetchFromGitHub, gerbil-unstable, gerbil-support, gambit-support }:
|
||||
|
||||
gerbil-support.gerbilPackage {
|
||||
pname = "smug-gerbil";
|
||||
version = "unstable-2019-12-24";
|
||||
git-version = "95d60d4";
|
||||
gerbil-package = "drewc/smug";
|
||||
gerbil = gerbil-unstable;
|
||||
gerbilInputs = [];
|
||||
buildInputs = [];
|
||||
gambit-params = gambit-support.unstable-params;
|
||||
version-path = ""; #"version";
|
||||
softwareName = "Smug-Gerbil";
|
||||
src = fetchFromGitHub {
|
||||
owner = "drewc";
|
||||
repo = "smug-gerbil";
|
||||
rev = "95d60d486c1603743c6d3c525e6d5f5761b984e5";
|
||||
sha256 = "0ys07z78gq60z833si2j7xa1scqvbljlx1zb32vdf32f1b27c04j";
|
||||
};
|
||||
meta = {
|
||||
description = "Super Monadic Über Go-into : Parsers and Gerbil Scheme";
|
||||
homepage = "https://github.com/drewc/smug-gerbil";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ fare ];
|
||||
};
|
||||
buildScript = ''
|
||||
for i in primitive simple tokens smug ; do gxc -O $i.ss ; done
|
||||
'';
|
||||
}
|
||||
15
pkgs/development/compilers/gerbil/unstable.nix
Normal file
15
pkgs/development/compilers/gerbil/unstable.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ callPackage, fetchFromGitHub, gambit-unstable, gambit-support }:
|
||||
|
||||
callPackage ./build.nix rec {
|
||||
version = "unstable-2020-11-05";
|
||||
git-version = "0.16-152-g808929ae";
|
||||
src = fetchFromGitHub {
|
||||
owner = "vyzo";
|
||||
repo = "gerbil";
|
||||
rev = "808929aeb8823959191f35df53bc0c0150911b4b";
|
||||
sha256 = "0d9k2gkrs9qvlnk7xa3gjzs3gln3ydds7yd2313pvbw4q2lcz8iw";
|
||||
};
|
||||
inherit gambit-support;
|
||||
gambit = gambit-unstable;
|
||||
gambit-params = gambit-support.unstable-params;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue