Add jasmin as submodule because my branch cannot be build using nix-build

This commit is contained in:
2024-04-04 16:23:20 +02:00
parent bde0131ea7
commit fc6f82731e
4 changed files with 29 additions and 22 deletions

3
.gitmodules vendored
View File

@@ -1,3 +1,6 @@
[submodule "libjade"]
path = libjade
url = https://github.com/Rixxc/libjade.git
[submodule "jasmin"]
path = jasmin
url = https://github.com/Rixxc/jasmin.git

View File

@@ -1,8 +1,8 @@
JC ?= jasminc
JC ?= jasmin/compiler/jasminc
CC ?= gcc
MAKE ?= make
.PHONY: clean run
.PHONY: clean run $(JC)
all: build
@true
@@ -16,5 +16,8 @@ build/%.o: build/%.S
clean:
rm build/* 2> /dev/null || true
build/%.S: src/%.jazz
$(JC):
nix-shell jasmin/default.nix --command 'make -C jasmin/compiler CIL -j$(nproc) && make -C jasmin/compiler'
build/%.S: src/%.jazz $(JC)
JASMINPATH="Jade=libjade/src/" $(JC) $< -o $@

View File

@@ -1,15 +1,15 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
jasmin-src = fetchFromGitHub {
owner = "jasmin-lang";
repo = "jasmin";
rev = "9bb6340fe0e3c5d78ea3957f6c5c3564c3424770";
hash = "sha256-EVwnD6dZLTy9MgR6gdymhg3Ipudpj1mchDlMpCAdITE=";
};
jasmin = callPackage "${jasmin-src}/default.nix" { inherit pkgs; };
in
# let
# jasmin-src = fetchFromGitHub {
# owner = "jasmin-lang";
# repo = "jasmin";
# rev = "9bb6340fe0e3c5d78ea3957f6c5c3564c3424770";
# hash = "sha256-EVwnD6dZLTy9MgR6gdymhg3Ipudpj1mchDlMpCAdITE=";
# };
#
# jasmin = callPackage "${jasmin-src}/default.nix" { inherit pkgs; };
# in
stdenv.mkDerivation {
name = "x25519-agent";
src = nix-gitignore.gitignoreSource [ ] ./.;
@@ -17,15 +17,15 @@ stdenv.mkDerivation {
nativeBuildInputs = [
gnumake
gcc
jasmin
# jasmin
];
configurePhase = ''
mkdir build
'';
installPhase = ''
mkdir -p $out/lib
cp build/libagent.a $out/lib
'';
# configurePhase = ''
# mkdir build
# '';
#
# installPhase = ''
# mkdir -p $out/lib
# cp build/libagent.a $out/lib
# '';
}

1
jasmin Submodule

Submodule jasmin added at 244d42d2a8