Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: make: Support Nix and Guix with reproducible builds #29

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions common/clojure.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ifdef w
export WARN_ON_REFLECTION := 1
endif

LEIN := $(BUILD_BIN)/lein
LEIN ?= $(BUILD_BIN)/lein
LEIN_URL := https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein

LEIN_COMMANDS := \
Expand Down Expand Up @@ -52,7 +52,7 @@ clean::
distclean:: nrepl-stop
$(RM) -r .calva/ .clj-kondo/ .cpcache/ .lsp/ .vscode/ .portal/

$(LEIN): $(BUILD_BIN) $(GRAALVM_INSTALLED)
$(LEIN): | $(BUILD_BIN) $(GRAALVM_INSTALLED)
ifeq (,$(CURL))
$(error *** 'curl' is required but not installed)
endif
Expand All @@ -76,7 +76,7 @@ force:
$(YAMLSCRIPT_LANG_INSTALLED): $(YAMLSCRIPT_CORE_SRC)
$(MAKE) -C ../core install

$(GRAALVM_INSTALLED): $(GRAALVM_DOWNLOAD)
$(GRAALVM_INSTALLED): | $(GRAALVM_DOWNLOAD)
tar xzf $<
mv graalvm-* $(GRAALVM_PATH)
touch $@
Expand Down
18 changes: 7 additions & 11 deletions common/vars.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BUILD_BIN := /tmp/yamlscript/bin
BUILD_BIN ?= /tmp/yamlscript/bin

COMMON := $(ROOT)/common

Expand All @@ -13,8 +13,8 @@ ifdef v
export TEST_VERBOSE := 1
endif

ostype := $(shell /bin/bash -c 'echo $$OSTYPE')
machtype := $(shell /bin/bash -c 'echo $$MACHTYPE')
ostype := $(shell echo $${OSTYPE})
machtype := $(shell echo $${MACHTYPE})

ifneq (,$(findstring linux,$(ostype)))
IS_LINUX := true
Expand All @@ -37,13 +37,9 @@ ifeq (0,$(shell id -u))
endif
endif

LIBZ := false
ifeq (true,$(IS_MACOS))
LIBZ := true
else
ifneq (,$(shell ldconfig -p | grep $$'^\tlibz.$(SO) '))
LIBZ := true
endif
LIBZ ?= $(IS_MACOS)
ifeq (false,$(IS_MACOS))
LIBZ := $(shell pkg-config --exists zlib && echo true || echo false)
endif

CURL := $(shell command -v curl)
Expand Down Expand Up @@ -117,7 +113,7 @@ GRAALVM_PATH ?= /tmp/graalvm-ce-$(GRAALVM_VER)
endif

GRAALVM_HOME := $(GRAALVM_PATH)$(GRAALVM_SUBDIR)
GRAALVM_DOWNLOAD := /tmp/$(GRAALVM_TAR)
GRAALVM_DOWNLOAD ?= /tmp/$(GRAALVM_TAR)
GRAALVM_INSTALLED := $(GRAALVM_HOME)/release

GRAALVM_O ?= 1
Expand Down