Merge branch 'master' into improved-make-overridable
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
# Build one of the packages that come with idris
|
||||
# name: The name of the package
|
||||
# deps: The dependencies of the package
|
||||
{ idris, build-idris-package, lib }: name: deps: build-idris-package {
|
||||
inherit name;
|
||||
{ idris, build-idris-package, lib }: name: deps:
|
||||
let
|
||||
inherit (builtins.parseDrvName idris.name) version;
|
||||
in
|
||||
build-idris-package {
|
||||
name = "${name}-${version}";
|
||||
|
||||
propagatedBuildInputs = deps;
|
||||
|
||||
inherit (idris) src;
|
||||
|
||||
postUnpack = ''
|
||||
mv $sourceRoot/libs/${name} $IDRIS_LIBRARY_PATH
|
||||
sourceRoot=$IDRIS_LIBRARY_PATH/${name}
|
||||
sourceRoot=$sourceRoot/libs/${name}
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
sed -i ${name}.ipkg -e "/^opts/ s|-i \\.\\./|-i $IDRIS_LIBRARY_PATH/|g"
|
||||
'';
|
||||
|
||||
meta = idris.meta // {
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
# name and src.
|
||||
{ stdenv, idris, gmp }: args: stdenv.mkDerivation ({
|
||||
preHook = ''
|
||||
mkdir idris-libs
|
||||
# Library import path
|
||||
export IDRIS_LIBRARY_PATH=$PWD/idris-libs
|
||||
mkdir -p $IDRIS_LIBRARY_PATH
|
||||
|
||||
# Library install path
|
||||
export IBCSUBDIR=$out/lib/${idris.name}
|
||||
mkdir -p $IBCSUBDIR
|
||||
|
||||
addIdrisLibs () {
|
||||
if [ -d $1/lib/${idris.name} ]; then
|
||||
@@ -16,10 +21,6 @@
|
||||
envHooks+=(addIdrisLibs)
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
export TARGET=$out/lib/${idris.name}
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
${idris}/bin/idris --build *.ipkg
|
||||
'';
|
||||
@@ -33,7 +34,7 @@
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
${idris}/bin/idris --install *.ipkg
|
||||
${idris}/bin/idris --install *.ipkg --ibcsubdir $IBCSUBDIR
|
||||
'';
|
||||
|
||||
buildInputs = [ gmp ];
|
||||
|
||||
Reference in New Issue
Block a user