Skip to content

Commit

Permalink
Makefile dependency fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Dec 9, 2024
1 parent e7e03d7 commit b38bcd7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
38 changes: 26 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,38 @@ all: deps build
git clone https://github.com/stefan-hoeck/idris2-elab-util.git && \
cd idris2-elab-util && \
$(IDRIS) --build elab-util.ipkg && \
cp -R ./build/ttc ../../../depends/elab-util/
cp -R ./build/ttc ../../../depends/elab-util-0/

./depends/idris2-parser:
mkdir -p ./build/deps
mkdir -p ./depends
cd ./build/deps && \
git clone https://github.com/stefan-hoeck/idris2-parser.git && \
cd idris2-parser && \
$(IDRIS) --build parser.ipkg && \
cp -R ./build/ttc ../../../depends/parser/

IDRIS2_PACKAGE_PATH=../../../depends $(IDRIS) --build parser.ipkg && \
cp -R ./build/ttc ../../../depends/parser-0/

# parser-json depends on elab-util directly but it does not specify it
# because elab-util is indirectly depended upon via parser already. I have
# not figured out why, but my Makefile invocation of idris2 needs it defined
# as a direct dependency even though pack does not.
define PATCH
5c5,6
< depends = parser
---
> depends = elab-util
> , parser
endef

export PATCH
./depends/idris2-parser/json:
mkdir -p ./build/deps
mkdir -p ./depends
cd ./build/deps && \
cd idris2-parser/json && \
$(IDRIS) --build parser-json.ipkg && \
cp -R ./build/ttc ../../../../depends/json/
echo "$$PATCH" | patch parser-json.ipkg - && \
IDRIS2_PACKAGE_PATH=../../../../depends $(IDRIS) --build parser-json.ipkg && \
cp -R ./build/ttc ../../../../depends/parser-json-0/

deps: ./depends/${INDEXED_RELATIVE_DIR} ./depends/idris2-elab-util ./depends/idris2-parser ./depends/idris2-parser/json

Expand All @@ -63,17 +77,17 @@ install:
$(IDRIS) --install $(PACKAGE)
mkdir -p $(IDRIS_LIB_DIR)/${INDEXED_RELATIVE_DIR} && \
cp -R ./depends/${INDEXED_RELATIVE_DIR} $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/elab-util/ $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/parser/ $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/json/ $(IDRIS_LIB_DIR)/
cp -R ./depends/elab-util-0/ $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/parser-0/ $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/parser-json-0/ $(IDRIS_LIB_DIR)/

install-with-src:
$(IDRIS) --install-with-src $(PACKAGE)
mkdir -p $(IDRIS_LIB_DIR)/${INDEXED_RELATIVE_DIR} && \
cp -R ./depends/${INDEXED_RELATIVE_DIR} $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/elab-util/ $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/parser/ $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/json/ $(IDRIS_LIB_DIR)/
cp -R ./depends/elab-util-0/ $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/parser-0/ $(IDRIS_LIB_DIR)/ && \
cp -R ./depends/parser-json-0/ $(IDRIS_LIB_DIR)/

test:
cd tests && \
Expand Down
1 change: 1 addition & 0 deletions pg-idris.ipkg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ modules = Postgres
, Postgres.Result

depends = indexed >= 0.0.9
, parser
, parser-json

prebuild = "TARGET_VERSION=0.0.7 make -C support"
Expand Down
2 changes: 2 additions & 0 deletions tests/pg-idris-tests.ipkg
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ depends = contrib >= 0.6.0
, indexed >= 0.0.9
, pg-idris == 0.0.7
, test >= 0.6.0
, parser
, parser-json

0 comments on commit b38bcd7

Please sign in to comment.