mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-05 05:45:46 +03:00
one working function in so
This commit is contained in:
parent
d7287d2114
commit
74d06deb1b
@ -1,12 +0,0 @@
|
|||||||
{ env_name, env, deps }:
|
|
||||||
|
|
||||||
env.make_derivation rec {
|
|
||||||
name = "urcrypt";
|
|
||||||
builder = ./release.sh;
|
|
||||||
src = ../../../pkg/urcrypt;
|
|
||||||
|
|
||||||
cross_inputs = [ deps.ed25519 deps.ge-additions ];
|
|
||||||
|
|
||||||
CC = "${env.host}-gcc";
|
|
||||||
AR = "${env.host}-ar";
|
|
||||||
}
|
|
@ -5,5 +5,5 @@ pkgs.stdenv.mkDerivation rec {
|
|||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
src = ../../../pkg/urcrypt;
|
src = ../../../pkg/urcrypt;
|
||||||
|
|
||||||
nativeBuildInputs = [ ed25519 ge-additions ];
|
buildInputs = [ ed25519 ge-additions ];
|
||||||
}
|
}
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
source $setup
|
|
||||||
|
|
||||||
cp -r $src ./src
|
|
||||||
chmod -R u+w ./src
|
|
||||||
cd ./src
|
|
||||||
|
|
||||||
for dep in $cross_inputs; do
|
|
||||||
export CFLAGS="${CFLAGS-} -I$dep/include"
|
|
||||||
export LDFLAGS="${LDFLAGS-} -L$dep/lib"
|
|
||||||
done
|
|
||||||
|
|
||||||
PREFIX=$out make install
|
|
||||||
|
|
@ -19,9 +19,6 @@ let
|
|||||||
ge-additions = env:
|
ge-additions = env:
|
||||||
import ./pkgs/ge-additions/cross.nix env;
|
import ./pkgs/ge-additions/cross.nix env;
|
||||||
|
|
||||||
urcrypt = env:
|
|
||||||
import ./pkgs/urcrypt/cross.nix env;
|
|
||||||
|
|
||||||
libaes_siv = env:
|
libaes_siv = env:
|
||||||
import ./pkgs/libaes_siv/cross.nix env;
|
import ./pkgs/libaes_siv/cross.nix env;
|
||||||
|
|
||||||
|
@ -6,14 +6,26 @@ PREFIX ?= ./out
|
|||||||
|
|
||||||
.PHONY: all test install clean
|
.PHONY: all test install clean
|
||||||
|
|
||||||
all: urcrypt.c urcrypt.h
|
CFLAGS := $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99
|
||||||
$(CC) $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 -c urcrypt.c
|
SOURCES = urcrypt.c urcrypt.h
|
||||||
$(AR) rcs liburcrypt.a urcrypt.o
|
|
||||||
|
liburcrypt.a: $(SOURCES)
|
||||||
|
$(CC) $(CFLAGS) -c urcrypt.c -o urcrypt-static.o
|
||||||
|
$(AR) rcs liburcrypt.a urcrypt-static.o
|
||||||
|
|
||||||
|
liburcrypt.so: $(SOURCES)
|
||||||
|
$(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o
|
||||||
|
$(CC) -shared urcrypt-shared.o -o liburcrypt.so \
|
||||||
|
-led25519 -lge-additions \
|
||||||
|
-Wl,--no-undefined
|
||||||
|
|
||||||
|
all: liburcrypt.a liburcrypt.so
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
@mkdir -p $(PREFIX)/lib/
|
@mkdir -p $(PREFIX)/lib/
|
||||||
@mkdir -p $(PREFIX)/include/
|
@mkdir -p $(PREFIX)/include/
|
||||||
cp liburcrypt.a $(PREFIX)/lib/
|
cp liburcrypt.a $(PREFIX)/lib/
|
||||||
|
cp liburcrypt.so $(PREFIX)/lib/
|
||||||
cp urcrypt.h $(PREFIX)/include/
|
cp urcrypt.h $(PREFIX)/include/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
Loading…
Reference in New Issue
Block a user