about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am41
-rwxr-xr-xscripts/download-using-manifests.pl.in2
-rw-r--r--scripts/local.mk37
-rwxr-xr-xscripts/nix-reduce-build.in2
4 files changed, 39 insertions, 43 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
deleted file mode 100644
index d9f39aad1b4f..000000000000
--- a/scripts/Makefile.am
+++ /dev/null
@@ -1,41 +0,0 @@
-bin_SCRIPTS = nix-collect-garbage \
-  nix-pull nix-push nix-prefetch-url \
-  nix-install-package nix-channel nix-build \
-  nix-copy-closure nix-generate-patches
-
-noinst_SCRIPTS = nix-profile.sh \
-  find-runtime-roots.pl build-remote.pl nix-reduce-build \
-  copy-from-other-stores.pl nix-http-export.cgi
-
-profiledir = $(sysconfdir)/profile.d
-
-install-exec-local: download-using-manifests.pl copy-from-other-stores.pl download-from-binary-cache.pl find-runtime-roots.pl
-	$(INSTALL) -d $(DESTDIR)$(profiledir)
-	$(INSTALL_DATA) nix-profile.sh $(DESTDIR)$(profiledir)/nix.sh
-	$(INSTALL) -d $(DESTDIR)$(libexecdir)/nix
-	$(INSTALL_PROGRAM) find-runtime-roots.pl $(DESTDIR)$(libexecdir)/nix 
-	$(INSTALL_PROGRAM) build-remote.pl $(DESTDIR)$(libexecdir)/nix 
-	$(INSTALL) -d $(DESTDIR)$(libexecdir)/nix/substituters
-	$(INSTALL_PROGRAM) download-using-manifests.pl copy-from-other-stores.pl download-from-binary-cache.pl $(DESTDIR)$(libexecdir)/nix/substituters
-	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/nix
-	ln -sf nix-build $(DESTDIR)$(bindir)/nix-shell
-
-include ../substitute.mk
-
-EXTRA_DIST = nix-collect-garbage.in \
-  nix-pull.in nix-push.in nix-profile.sh.in \
-  nix-prefetch-url.in nix-install-package.in \
-  nix-channel.in \
-  nix-build.in \
-  download-using-manifests.pl.in \
-  copy-from-other-stores.pl.in \
-  download-from-binary-cache.pl.in \
-  nix-copy-closure.in \
-  find-runtime-roots.pl.in \
-  build-remote.pl.in \
-  nix-reduce-build.in \
-  nix-http-export.cgi.in \
-  nix-generate-patches.in
-
-clean:
-	rm -f $(bin_SCRIPTS) $(noinst_SCRIPTS)
diff --git a/scripts/download-using-manifests.pl.in b/scripts/download-using-manifests.pl.in
index 9d4b89bac9a2..b670163038e1 100755
--- a/scripts/download-using-manifests.pl.in
+++ b/scripts/download-using-manifests.pl.in
@@ -317,7 +317,7 @@ while (scalar @path > 0) {
         # Apply the patch to the NAR archive produced in step 1 (for
         # the already present path) or a later step (for patch sequences).
         print STDERR "  applying patch...\n";
-        system("$Nix::Config::libexecDir/bspatch $tmpNar $tmpNar2 $patchPath") == 0
+        system("$Nix::Config::libexecDir/nix/bspatch $tmpNar $tmpNar2 $patchPath") == 0
             or die "cannot apply patch `$patchPath' to $tmpNar\n";
 
         if ($curStep < $maxStep) {
diff --git a/scripts/local.mk b/scripts/local.mk
new file mode 100644
index 000000000000..f4c5e8097de4
--- /dev/null
+++ b/scripts/local.mk
@@ -0,0 +1,37 @@
+nix_bin_scripts := \
+  $(d)/nix-build \
+  $(d)/nix-channel \
+  $(d)/nix-collect-garbage \
+  $(d)/nix-copy-closure \
+  $(d)/nix-generate-patches \
+  $(d)/nix-install-package \
+  $(d)/nix-prefetch-url \
+  $(d)/nix-pull \
+  $(d)/nix-push
+
+bin-scripts += $(nix_bin_scripts)
+
+nix_substituters := \
+  $(d)/copy-from-other-stores.pl \
+  $(d)/download-from-binary-cache.pl \
+  $(d)/download-using-manifests.pl
+
+nix_noinst_scripts := \
+  $(d)/build-remote.pl \
+  $(d)/find-runtime-roots.pl \
+  $(d)/nix-http-export.cgi \
+  $(d)/nix-profile.sh \
+  $(d)/nix-reduce-build \
+  $(nix_substituters)
+
+noinst-scripts += $(nix_noinst_scripts)
+
+profiledir = $(sysconfdir)/profile.d
+
+$(eval $(call install-file-as, $(d)/nix-profile.sh, $(profiledir)/nix.sh, 0644))
+$(eval $(call install-program-in, $(d)/find-runtime-roots.pl, $(libexecdir)/nix))
+$(eval $(call install-program-in, $(d)/build-remote.pl, $(libexecdir)/nix))
+$(foreach prog, $(nix_substituters), $(eval $(call install-program-in, $(prog), $(libexecdir)/nix/substituters)))
+$(eval $(call install-symlink, nix-build, $(bindir)/nix-shell))
+
+clean-files += $(nix_bin_scripts) $(nix_noinst_scripts)
diff --git a/scripts/nix-reduce-build.in b/scripts/nix-reduce-build.in
index 0c33275d5eb0..50beb9d10b16 100755
--- a/scripts/nix-reduce-build.in
+++ b/scripts/nix-reduce-build.in
@@ -1,4 +1,4 @@
-#! @shell@
+#! @bash@
 
 WORKING_DIRECTORY=$(mktemp -d "${TMPDIR:-/tmp}"/nix-reduce-build-XXXXXX);
 cd "$WORKING_DIRECTORY";