Skip to content

Commit

Permalink
system/nix: Updated to 2.15.3.
Browse files Browse the repository at this point in the history
Signed-off-by: Pouria Rezaei <[email protected]>
  • Loading branch information
RSKYS committed Jul 1, 2024
1 parent 0408cc5 commit 2993a3f
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 40 deletions.
115 changes: 80 additions & 35 deletions system/nix/fix_nix_options.patch
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
diff --git a/doc/manual/local.mk b/doc/manual/local.mk
index f43510b..1e1e62d 100644
index 63e7e61..e131bde 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
@@ -24,7 +24,7 @@ dummy-env = env -i \
@@ -31,7 +31,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
@@ -48,29 +48,29 @@ $(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md.in $(d)/src/command-ref/new-cli
$(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 > [email protected]
@mv [email protected] $@
# re-implement mdBook's include directive to make it usable for terminal output and for proper @docroot@ substitution
define process-includes
@@ -89,46 +89,46 @@ $(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md.in $(d)/src/command-ref/new-cli $(d)/sr
@cp $< $@
@$(call process-includes,$@,$@)

-$(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 [email protected] --expr 'import doc/manual/generate-manpage.nix { toplevel = builtins.readFile $<; }'
@# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
$(trace-gen) sed -i [email protected]/*.md -e 's^@docroot@^../..^g'
-$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(bindir)/nix
+$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(nix_DIR)/nix
@rm -rf $@ [email protected]
$(trace-gen) $(nix-eval) --write-to [email protected] --expr 'import doc/manual/generate-manpage.nix (builtins.readFile $<)'
@mv [email protected] $@

-$(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
-$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/src/command-ref/conf-file-prefix.md $(d)/src/command-ref/experimental-features-shortlist.md $(bindir)/nix
+$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/src/command-ref/conf-file-prefix.md $(d)/src/command-ref/experimental-features-shortlist.md $(nix_DIR)/nix
@cat doc/manual/src/command-ref/conf-file-prefix.md > [email protected]
@# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-options.nix (builtins.fromJSON (builtins.readFile $<))' \
| sed -e 's^@docroot@^..^g'>> [email protected]
$(trace-gen) $(nix-eval) --expr '(import doc/manual/utils.nix).showSettings { useAnchors = true; } (builtins.fromJSON (builtins.readFile $<))' >> [email protected];
@mv [email protected] $@

-$(d)/nix.json: $(bindir)/nix
- $(trace-gen) $(dummy-env) $(bindir)/nix __dump-args > [email protected]
- $(trace-gen) $(dummy-env) $(bindir)/nix __dump-cli > [email protected]
+$(d)/nix.json: $(nix_DIR)/nix
+ $(trace-gen) $(dummy-env) $(nix_DIR)/nix __dump-args > [email protected]
+ $(trace-gen) $(dummy-env) $(nix_DIR)/nix __dump-cli > [email protected]
@mv [email protected] $@

-$(d)/conf-file.json: $(bindir)/nix
Expand All @@ -43,12 +39,28 @@ index f43510b..1e1e62d 100644
+ $(trace-gen) $(dummy-env) $(nix_DIR)/nix show-config --json --experimental-features nix-command > [email protected]
@mv [email protected] $@

-$(d)/src/contributing/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(bindir)/nix
+$(d)/src/contributing/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(nix_DIR)/nix
@rm -rf $@ [email protected]
$(trace-gen) $(nix-eval) --write-to [email protected] --expr 'import doc/manual/generate-xp-features.nix (builtins.fromJSON (builtins.readFile $<))'
@mv [email protected] $@

-$(d)/src/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(bindir)/nix
+$(d)/src/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(nix_DIR)/nix
@rm -rf $@ [email protected]
$(trace-gen) $(nix-eval) --write-to [email protected] --expr 'import doc/manual/generate-xp-features-shortlist.nix (builtins.fromJSON (builtins.readFile $<))'
@mv [email protected] $@

-$(d)/xp-features.json: $(bindir)/nix
- $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-xp-features > [email protected]
+$(d)/xp-features.json: $(nix_DIR)/nix
+ $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(nix_DIR)/nix __dump-xp-features > [email protected]
@mv [email protected] $@

-$(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(bindir)/nix
+$(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(nix_DIR)/nix
@cat doc/manual/src/language/builtins-prefix.md > [email protected]
@# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' \
@@ -78,8 +78,8 @@ $(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' >> [email protected];
@cat doc/manual/src/language/builtins-suffix.md >> [email protected]
@mv [email protected] $@

Expand All @@ -60,42 +72,62 @@ index f43510b..1e1e62d 100644

# Generate the HTML manual.
diff --git a/doc/manual/local.mk b/doc/manual/local.mk
index 1e1e62d..3978847 100644
index e131bde..ba2460d 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
@@ -109,12 +109,12 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
@@ -161,22 +161,22 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
@touch $@

$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md
$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/contributing/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md
- $(trace-gen) \
- set -euo pipefail; \
- RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
- | { grep -Fv "because fragment resolution isn't implemented" || :; }
- tmp="$$(mktemp -d)"; \
- cp -r doc/manual "$$tmp"; \
- find "$$tmp" -name '*.md' | while read -r file; do \
- $(call process-includes,$$file,$$file); \
- done; \
- find "$$tmp" -name '*.md' | while read -r file; do \
- docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
- sed -i "s,@docroot@,$$docroot,g" "$$file"; \
- done; \
- set -euo pipefail; \
- RUST_LOG=warn mdbook build "$$tmp/manual" -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
- | { grep -Fv "because fragment resolution isn't implemented" || :; }; \
- rm -rf "$$tmp/manual"
- @rm -rf $(DESTDIR)$(docdir)/manual
- @mv $(DESTDIR)$(docdir)/manual.tmp/html $(DESTDIR)$(docdir)/manual
- @rm -rf $(DESTDIR)$(docdir)/manual.tmp
+ # $(trace-gen) \
+ # set -euo pipefail; \
+ # RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
+ # | { grep -Fv "because fragment resolution isn't implemented" || :; }
+ # tmp="$$(mktemp -d)"; \
+ # cp -r doc/manual "$$tmp"; \
+ # find "$$tmp" -name '*.md' | while read -r file; do \
+ # $(call process-includes,$$file,$$file); \
+ # done; \
+ # find "$$tmp" -name '*.md' | while read -r file; do \
+ # docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
+ # sed -i "s,@docroot@,$$docroot,g" "$$file"; \
+ # done; \
+ # set -euo pipefail; \
+ # RUST_LOG=warn mdbook build "$$tmp/manual" -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
+ # | { grep -Fv "because fragment resolution isn't implemented" || :; }; \
+ # rm -rf "$$tmp/manual"
+ # @rm -rf $(DESTDIR)$(docdir)/manual
+ # @mv $(DESTDIR)$(docdir)/manual.tmp/html $(DESTDIR)$(docdir)/manual
+ # @rm -rf $(DESTDIR)$(docdir)/manual.tmp

endif
diff --git a/Makefile b/Makefile
index c1a1ce2..3ec1423 100644
index d6b4947..aead461 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,8 @@ else
@@ -42,6 +42,8 @@ else
GLOBAL_CXXFLAGS += -O0 -U_FORTIFY_SOURCE
endif

+GLOBAL_CFLAGS += $(CPPFLAGS)
+
include mk/lib.mk

GLOBAL_CXXFLAGS += -g -Wall -include config.h -std=c++17 -I src
GLOBAL_CXXFLAGS += -g -Wall -include config.h -std=c++2a -I src
diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc
index 871f2f3..21897d0 100644
--- a/src/libstore/sqlite.cc
Expand All @@ -109,3 +141,16 @@ index 871f2f3..21897d0 100644

auto path = sqlite3_db_filename(db, nullptr);
auto errMsg = sqlite3_errmsg(db);
diff --git a/src/libcmd/local.mk b/src/libcmd/local.mk
index 541a7d2..9029af5 100644
--- a/src/libcmd/local.mk
+++ b/src/libcmd/local.mk
@@ -8,7 +8,7 @@ libcmd_SOURCES := $(wildcard $(d)/*.cc)

libcmd_CXXFLAGS += -I src/libutil -I src/libstore -I src/libexpr -I src/libmain -I src/libfetchers

-libcmd_LDFLAGS = $(EDITLINE_LIBS) $(LOWDOWN_LIBS) -pthread
+libcmd_LDFLAGS = $(EDITLINE_LIBS) $(LOWDOWN_LIBS) -lbsd -pthread

libcmd_LIBS = libstore libutil libexpr libmain libfetchers

4 changes: 3 additions & 1 deletion system/nix/nix.SlackBuild
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=nix
VERSION=${VERSION:-2.13.6}
VERSION=${VERSION:-2.15.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
Expand Down Expand Up @@ -105,6 +105,8 @@ find -L . \
# - Added global CFLAGS
# - Changed to ignore offset, since function hasn't still implemented
# in Slackware 15's sqlite.
# - Declared libbsd dependency on lowdown to resolve unknown refrence
# error.
patch -p1 < $CWD/fix_nix_options.patch

autoreconf -vfim
Expand Down
8 changes: 4 additions & 4 deletions system/nix/nix.info
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PRGNAM="nix"
VERSION="2.13.6"
VERSION="2.15.3"
HOMEPAGE="http://nixos.org/nix"
DOWNLOAD="https://github.com/NixOS/nix/archive/2.13.6/nix-2.13.6.tar.gz"
MD5SUM="8fd7108b28c2716e87bbac8797de46a1"
DOWNLOAD="https://github.com/NixOS/nix/archive/2.15.3/nix-2.15.3.tar.gz"
MD5SUM="2b5404f762f40f116fb57226001a7933"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="graphviz gtest jq libeditline lowdown libcpuid nlohmann_json"
REQUIRES="graphviz gtest jq libbsd libcpuid libeditline librapidcheck lowdown nlohmann_json"
MAINTAINER="Pouria Rezaei"
EMAIL="[email protected]"

0 comments on commit 2993a3f

Please sign in to comment.