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"] [submodule "libjade"]
path = libjade path = libjade
url = https://github.com/Rixxc/libjade.git 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 CC ?= gcc
MAKE ?= make MAKE ?= make
.PHONY: clean run .PHONY: clean run $(JC)
all: build all: build
@true @true
@@ -16,5 +16,8 @@ build/%.o: build/%.S
clean: clean:
rm build/* 2> /dev/null || true 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 $@ JASMINPATH="Jade=libjade/src/" $(JC) $< -o $@

View File

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

1
jasmin Submodule

Submodule jasmin added at 244d42d2a8