Fixed broken linking
ci/woodpecker/push/woodpecker Pipeline was successful Details

pull/14/head
Jef Roosens 2022-01-12 18:54:13 +01:00
parent 49e7b9de5d
commit cfcca90dfc
Signed by: Jef Roosens
GPG Key ID: 955C0660072F691F
4 changed files with 32 additions and 6 deletions

3
.gitignore vendored
View File

@ -1,6 +1,7 @@
*.c
data/
vieter/vieter
vieter.exe
vieter-prod.exe
# Ignore testing files
*.pkg*

View File

@ -4,8 +4,20 @@ LARCHIVE_DIR := libarchive-$(LARCHIVE_VER)
LARCHIVE_LIB := $(LARCHIVE_DIR)/.libs/libarchive.a
# Custom V command for linking libarchive
V := LD_FLAGS=$(PWD)/$(LARCHIVE_LIB) v -cflags -I$(PWD)/$(LARCHIVE_DIR)
V := LDFLAGS=$(PWD)/$(LARCHIVE_LIB) v -cflags -I$(PWD)/$(LARCHIVE_DIR)
# =====COMPILATION=====
.PHONY: vieter
vieter:
$(V) -cg -o vieter.exe vieter
.PHONY: prod
prod:
$(V) -o vieter-prod.exe -prod vieter
# =====EXECUTION=====
# Run the server in the default 'data' directory
.PHONY: run
run: libarchive
@ -16,6 +28,8 @@ run: libarchive
watch: libarchive
API_KEY=test REPO_DIR=data LOG_LEVEL=DEBUG $(V) watch run vieter
# =====OTHER=====
# Format the V codebase
.PHONY: fmt
fmt:
@ -31,6 +45,8 @@ customv:
https://github.com/ChewingBever/v jjr-v
'$(MAKE)' -C jjr-v
# =====LIBARCHIVE=====
.PHONY: libarchive
libarchive: $(LARCHIVE_LIB)
$(LARCHIVE_LIB):

13
vieter/archive.v 100644
View File

@ -0,0 +1,13 @@
module archive
#include "libarchive/archive.h"
#include "libarchive/archive_entry.h"
struct C.archive {}
struct C.archive_entry {}
fn C.archive_read_new() &C.archive
pub fn list_filenames() {
a := C.archive_read_new()
}

View File

@ -2,10 +2,6 @@ module repo
import os
#include "libarchive/archive.h"
struct C.archive {}
const pkgs_subpath = 'pkgs'
// Dummy struct to work around the fact that you can only share structs, maps &