From adfd54a8f21aec69556b8cf45b3125306769d7ea Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Sun, 28 Apr 2019 16:54:32 +0200 Subject: [PATCH] idrisPackages.build-idris-package: Install binaries --- .../idris-modules/build-idris-package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/idris-modules/build-idris-package.nix b/pkgs/development/idris-modules/build-idris-package.nix index 5e1288685a7e..c67d53f8d9c2 100644 --- a/pkgs/development/idris-modules/build-idris-package.nix +++ b/pkgs/development/idris-modules/build-idris-package.nix @@ -53,8 +53,20 @@ stdenv.mkDerivation ({ installPhase = '' runHook preInstall + idris --install ${ipkgName}.ipkg --ibcsubdir $out/libs + IDRIS_DOC_PATH=$out/doc idris --installdoc ${ipkgName}.ipkg || true + + # If the ipkg file defines an executable, install that + executable=$(grep -Po '^executable = \K.*' ${ipkgName}.ipkg || true) + # $executable intentionally not quoted because it must be quoted correctly + # in the ipkg file already + if [ ! -z "$executable" ] && [ -f $executable ]; then + mkdir -p $out/bin + mv $executable $out/bin/$executable + fi + runHook postInstall '';