mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 17:21:59 +03:00
Fix executable output of buildIdris nix helper (#3188)
This commit is contained in:
parent
2b5030a325
commit
da6f0b0e4e
@ -14,6 +14,13 @@ This CHANGELOG describes the merged but unreleased changes. Please see [CHANGELO
|
||||
installed with sourcecode files or not; other than that, `library`
|
||||
functionally replaces `installLibrary`.
|
||||
|
||||
* The Nix flake's `buildIdris` `executable` property (previously `build`) has
|
||||
been fixed in a few ways. It used to output a non-executable file for NodeJS
|
||||
builds (now the file has the executable bit set). It used to output the
|
||||
default Idris2 wrapper for Scheme builds which relies on utilities not
|
||||
guaranteed at runtime by the Nix derivation; now it rewraps the output to only
|
||||
depend on the directory containing Idris2's runtime support library.
|
||||
|
||||
* The Nix flake now exposes the Idris2 API package as `idris2-api` and Idris2's
|
||||
C support library as `support`.
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
buildIdris = pkgs.callPackage ./nix/buildIdris.nix {
|
||||
inherit idris2-version;
|
||||
idris2 = idris2Pkg;
|
||||
support = idris2Support;
|
||||
};
|
||||
idris2ApiPkg = buildIdris {
|
||||
src = ./.;
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, lib, idris2-version, idris2 }:
|
||||
{ stdenv, lib, idris2-version, idris2, support, makeWrapper }:
|
||||
{ src, projectName, idrisLibraries, ... }@attrs:
|
||||
|
||||
let
|
||||
@ -12,7 +12,8 @@ in rec {
|
||||
executable = stdenv.mkDerivation (drvAttrs // {
|
||||
name = projectName;
|
||||
src = src;
|
||||
nativeBuildInputs = [ idris2 ];
|
||||
buildInputs = idrisLibraries ++ attrs.buildInputs or [];
|
||||
nativeBuildInputs = [ idris2 makeWrapper ] ++ attrs.nativeBuildInputs or [];
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
export IDRIS2_PACKAGE_PATH=${lib-dirs}
|
||||
@ -26,7 +27,20 @@ in rec {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
mv build/exec/* $out/bin
|
||||
scheme_app="$(find ./build/exec -name '*_app')"
|
||||
if [ "$scheme_app" = ''' ]; then
|
||||
mv -- build/exec/* $out/bin/
|
||||
chmod +x $out/bin/*
|
||||
else
|
||||
cd build/exec/*_app
|
||||
for file in *.so; do
|
||||
bin_name="''${file%.so}"
|
||||
mv -- "$file" "$out/bin/$bin_name"
|
||||
wrapProgram "$out/bin/$bin_name" \
|
||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ support ]} \
|
||||
--prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath [ support ]}
|
||||
done
|
||||
fi
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user