diff options
Diffstat (limited to 'system/nix')
-rw-r--r-- | system/nix/fix_nix_DIR_in_doc_local_mk.patch | 57 | ||||
-rw-r--r-- | system/nix/nix.SlackBuild | 35 |
2 files changed, 87 insertions, 5 deletions
diff --git a/system/nix/fix_nix_DIR_in_doc_local_mk.patch b/system/nix/fix_nix_DIR_in_doc_local_mk.patch new file mode 100644 index 0000000000000..375864b0814c9 --- /dev/null +++ b/system/nix/fix_nix_DIR_in_doc_local_mk.patch @@ -0,0 +1,57 @@ +Subject: Fix build phase depending on installed binary +Author: Thomas Koch <thomas@koch.ro> +Bug: https://github.com/NixOS/nix/issues/5781 +Forwarded: https://github.com/NixOS/nix/pull/6015 + +--- a/doc/manual/local.mk ++++ b/doc/manual/local.mk +@@ -20,7 +20,7 @@ dummy-env = env -i \ + NIX_STATE_DIR=/dummy \ + NIX_CONFIG='cores = 0' + +-nix-eval = $(dummy-env) $(bindir)/nix eval --experimental-features nix-command -I nix/corepkgs=corepkgs --store dummy:// --impure --raw ++nix-eval = $(dummy-env) $(nix_DIR)/nix eval --experimental-features nix-command -I nix/corepkgs=corepkgs --store dummy:// --impure --raw + + $(d)/%.1: $(d)/src/command-ref/%.md + @printf "Title: %s\n\n" "$$(basename $@ .1)" > $^.tmp +@@ -44,31 +44,31 @@ $(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md + $(trace-gen) cat doc/manual/src/SUMMARY.md.in | while IFS= read line; do if [[ $$line = @manpages@ ]]; then cat doc/manual/src/command-ref/new-cli/SUMMARY.md; else echo "$$line"; fi; done > $@.tmp + @mv $@.tmp $@ + +-$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/generate-manpage.nix $(bindir)/nix ++$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/generate-manpage.nix $(nix_DIR)/nix + @rm -rf $@ + $(trace-gen) $(nix-eval) --write-to $@ --expr 'import doc/manual/generate-manpage.nix { command = builtins.readFile $<; renderLinks = true; }' + +-$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.nix $(d)/src/command-ref/conf-file-prefix.md $(bindir)/nix ++$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.nix $(d)/src/command-ref/conf-file-prefix.md $(nix_DIR)/nix + @cat doc/manual/src/command-ref/conf-file-prefix.md > $@.tmp + $(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-options.nix (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp + @mv $@.tmp $@ + +-$(d)/nix.json: $(bindir)/nix +- $(trace-gen) $(dummy-env) $(bindir)/nix __dump-args > $@.tmp ++$(d)/nix.json: $(nix_DIR)/nix ++ $(trace-gen) $(dummy-env) $(nix_DIR)/nix __dump-args > $@.tmp + @mv $@.tmp $@ + +-$(d)/conf-file.json: $(bindir)/nix +- $(trace-gen) $(dummy-env) $(bindir)/nix show-config --json --experimental-features nix-command > $@.tmp ++$(d)/conf-file.json: $(nix_DIR)/nix ++ $(trace-gen) $(dummy-env) $(nix_DIR)/nix show-config --json --experimental-features nix-command > $@.tmp + @mv $@.tmp $@ + +-$(d)/src/expressions/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/expressions/builtins-prefix.md $(bindir)/nix ++$(d)/src/expressions/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/expressions/builtins-prefix.md $(nix_DIR)/nix + @cat doc/manual/src/expressions/builtins-prefix.md > $@.tmp + $(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp + @cat doc/manual/src/expressions/builtins-suffix.md >> $@.tmp + @mv $@.tmp $@ + +-$(d)/builtins.json: $(bindir)/nix +- $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp ++$(d)/builtins.json: $(nix_DIR)/nix ++ $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(nix_DIR)/nix __dump-builtins > $@.tmp + @mv $@.tmp $@ + + # Generate the HTML manual. diff --git a/system/nix/nix.SlackBuild b/system/nix/nix.SlackBuild index fadde41fae736..54e57fd2fd563 100644 --- a/system/nix/nix.SlackBuild +++ b/system/nix/nix.SlackBuild @@ -23,6 +23,26 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20220325 bkw: Modified by SlackBuilds.org: fix multiple issues: +# - on 64-bit, /usr/bin/nix and some /usr/lib64/libnix*.so files +# were being written to the real root partition (this happened +# during "make", not "make install"). added a patch from Debian +# that prevents this. +# - on 32-bit, the same thing happened, plus the build failed. the +# same patch fixes that. +# - get rid of empty gzipped file usr/man/man1/nix3-manpages.gz. +# +# Note: this defeats ccache by default (it uses +# e.g. x86_64-slackware-linux-gcc instead of just gcc). If you want +# cacheable builds, export CC=gcc and CXX=g++ in the environment. +# +# Note: during the build, we get "warning: you don't have Internet +# access; disabling some network-dependent features" when building +# with network access disabled (e.g. in a container). I have no +# idea if this is a problem, but it's something the maintainer might +# want to look into. SlackBuilds aren't supposed to require network +# access to run. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=nix @@ -39,9 +59,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -76,9 +93,14 @@ cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ + -o -perm 511 \) -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ + +# 20220325 bkw: patch from Debian, stops nix from installing +# /usr/bin/nix and its libraries during "make". spamming the real +# root partition is bad, m'kay? +patch -p1 < $CWD/fix_nix_DIR_in_doc_local_mk.patch autoreconf -vfim autoheader @@ -111,6 +133,9 @@ rm -fR $PKG/usr/lib${LIBDIRSUFFIX}/systemd find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +# 20220325 bkw: this isn't even named correctly for a man page... +rm -f $PKG/usr/man/man1/nix3-manpages.gz + if [ "$ARCH" = "x86_64" ]; then rm -rf $PKG/usr/lib fi |