mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 13:54:20 +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;
|
||||
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:
|
||||
import ./pkgs/ge-additions/cross.nix env;
|
||||
|
||||
urcrypt = env:
|
||||
import ./pkgs/urcrypt/cross.nix env;
|
||||
|
||||
libaes_siv = env:
|
||||
import ./pkgs/libaes_siv/cross.nix env;
|
||||
|
||||
|
@ -6,14 +6,26 @@ PREFIX ?= ./out
|
||||
|
||||
.PHONY: all test install clean
|
||||
|
||||
all: urcrypt.c urcrypt.h
|
||||
$(CC) $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 -c urcrypt.c
|
||||
$(AR) rcs liburcrypt.a urcrypt.o
|
||||
CFLAGS := $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99
|
||||
SOURCES = urcrypt.c urcrypt.h
|
||||
|
||||
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
|
||||
@mkdir -p $(PREFIX)/lib/
|
||||
@mkdir -p $(PREFIX)/include/
|
||||
cp liburcrypt.a $(PREFIX)/lib/
|
||||
cp liburcrypt.so $(PREFIX)/lib/
|
||||
cp urcrypt.h $(PREFIX)/include/
|
||||
|
||||
clean:
|
||||
|
Loading…
Reference in New Issue
Block a user