From 7bca3a86cf294886733847f5411aea0693f8f926 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Fri, 2 Oct 2020 09:08:56 -0700 Subject: [PATCH] obliterate ge-additions package, move to urcrypt --- nix/deps-env.nix | 2 +- nix/pkgs/default.nix | 11 +++------- nix/pkgs/ge-additions/builder.sh | 7 ------- nix/pkgs/ge-additions/cross.nix | 12 ----------- nix/pkgs/ge-additions/default.nix | 9 -------- nix/pkgs/ge-additions/release.sh | 13 ------------ nix/pkgs/urbit/default.nix | 4 ++-- nix/pkgs/urbit/release.nix | 3 +-- nix/pkgs/urbit/shell.nix | 2 +- nix/pkgs/urcrypt/default.nix | 4 ++-- nix/release.nix | 5 ----- pkg/ge-additions/Makefile | 20 ------------------ pkg/urbit/configure | 2 +- pkg/urcrypt/Makefile | 21 +++++++++++++------ pkg/{ => urcrypt}/ge-additions/LICENSE | 0 pkg/{ => urcrypt}/ge-additions/README.md | 0 pkg/{ => urcrypt}/ge-additions/ge-additions.c | 0 pkg/{ => urcrypt}/ge-additions/ge-additions.h | 0 pkg/urcrypt/urcrypt.c | 2 +- 19 files changed, 27 insertions(+), 90 deletions(-) delete mode 100644 nix/pkgs/ge-additions/builder.sh delete mode 100644 nix/pkgs/ge-additions/cross.nix delete mode 100644 nix/pkgs/ge-additions/default.nix delete mode 100644 nix/pkgs/ge-additions/release.sh delete mode 100644 pkg/ge-additions/Makefile rename pkg/{ => urcrypt}/ge-additions/LICENSE (100%) rename pkg/{ => urcrypt}/ge-additions/README.md (100%) rename pkg/{ => urcrypt}/ge-additions/ge-additions.c (100%) rename pkg/{ => urcrypt}/ge-additions/ge-additions.h (100%) diff --git a/nix/deps-env.nix b/nix/deps-env.nix index 7935da6ba..12cb9b8f4 100644 --- a/nix/deps-env.nix +++ b/nix/deps-env.nix @@ -20,7 +20,7 @@ let vendor = with deps; - [ argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ent ge-additions urcrypt ivory-header ca-header ]; + [ argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ent urcrypt ivory-header ca-header ]; in diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 7a51f3187..35b8053d8 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -9,24 +9,19 @@ let arvo-ropsten = import ./arvo-ropsten { inherit pkgs; }; herb = import ../../pkg/herb { inherit pkgs; }; - ge-additions = import ./ge-additions { - inherit pkgs; - inherit (deps) ed25519; - }; - libaes_siv = import ./libaes_siv { inherit pkgs; }; urcrypt = import ./urcrypt { - inherit ge-additions libaes_siv; + inherit libaes_siv; inherit (pkgs) stdenv openssl gmp; inherit (deps) ed25519 argon2 secp256k1; }; mkUrbit = { debug }: import ./urbit { - inherit pkgs ent debug ge-additions urcrypt libaes_siv; + inherit pkgs ent debug urcrypt libaes_siv; inherit (deps) argon2 murmur3 uv ed25519 scrypt softfloat3; inherit (deps) secp256k1 h2o ivory-header ca-header; }; @@ -36,4 +31,4 @@ let in -{ inherit ent ge-additions urcrypt libaes_siv arvo arvo-ropsten herb urbit urbit-debug; } +{ inherit ent urcrypt libaes_siv arvo arvo-ropsten herb urbit urbit-debug; } diff --git a/nix/pkgs/ge-additions/builder.sh b/nix/pkgs/ge-additions/builder.sh deleted file mode 100644 index 5a0404377..000000000 --- a/nix/pkgs/ge-additions/builder.sh +++ /dev/null @@ -1,7 +0,0 @@ -source $stdenv/setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -PREFIX=$out make install diff --git a/nix/pkgs/ge-additions/cross.nix b/nix/pkgs/ge-additions/cross.nix deleted file mode 100644 index f16afad0b..000000000 --- a/nix/pkgs/ge-additions/cross.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ env_name, env, deps }: - -env.make_derivation rec { - name = "ge-additions"; - builder = ./release.sh; - src = ../../../pkg/ge-additions; - - cross_inputs = [ deps.ed25519 ]; - - CC = "${env.host}-gcc"; - AR = "${env.host}-ar"; -} diff --git a/nix/pkgs/ge-additions/default.nix b/nix/pkgs/ge-additions/default.nix deleted file mode 100644 index e77098cff..000000000 --- a/nix/pkgs/ge-additions/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ed25519 }: - -pkgs.stdenv.mkDerivation rec { - name = "ge-additions"; - builder = ./builder.sh; - src = ../../../pkg/ge-additions; - - nativeBuildInputs = [ ed25519 ]; -} diff --git a/nix/pkgs/ge-additions/release.sh b/nix/pkgs/ge-additions/release.sh deleted file mode 100644 index aaa54b5e1..000000000 --- a/nix/pkgs/ge-additions/release.sh +++ /dev/null @@ -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 - diff --git a/nix/pkgs/urbit/default.nix b/nix/pkgs/urbit/default.nix index b808d0afb..2aee0514c 100644 --- a/nix/pkgs/urbit/default.nix +++ b/nix/pkgs/urbit/default.nix @@ -1,7 +1,7 @@ { pkgs, debug, - argon2, ed25519, ent, ge-additions, urcrypt, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header + argon2, ed25519, ent, urcrypt, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header }: let @@ -26,7 +26,7 @@ let [ curl gmp sigseg openssl zlib lmdb ]; vendor = - [ argon2 softfloat3 ed25519 ent ge-additions urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; + [ argon2 softfloat3 ed25519 ent urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; urbit = pkgs.stdenv.mkDerivation { inherit name meta; diff --git a/nix/pkgs/urbit/release.nix b/nix/pkgs/urbit/release.nix index 411be8868..b1b823104 100644 --- a/nix/pkgs/urbit/release.nix +++ b/nix/pkgs/urbit/release.nix @@ -4,7 +4,6 @@ ent, name ? "urbit", debug ? false, - ge-additions, libaes_siv }: @@ -16,7 +15,7 @@ let vendor = with deps; - [ argon2 softfloat3 ed25519 ge-additions urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; + [ argon2 softfloat3 ed25519 urcrypt libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; in diff --git a/nix/pkgs/urbit/shell.nix b/nix/pkgs/urbit/shell.nix index 9e5d781af..81392a9f3 100644 --- a/nix/pkgs/urbit/shell.nix +++ b/nix/pkgs/urbit/shell.nix @@ -10,7 +10,7 @@ import ./default.nix { inherit pkgs; debug = false; inherit (tlon) - ent ge-additions urcrypt libaes_siv; + ent urcrypt libaes_siv; inherit (deps) argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ivory-header ca-header; } diff --git a/nix/pkgs/urcrypt/default.nix b/nix/pkgs/urcrypt/default.nix index 739d05005..f2e390274 100644 --- a/nix/pkgs/urcrypt/default.nix +++ b/nix/pkgs/urcrypt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, openssl, gmp, ed25519, secp256k1, ge-additions, argon2, libaes_siv }: +{ stdenv, openssl, gmp, ed25519, secp256k1, argon2, libaes_siv }: stdenv.mkDerivation rec { name = "urcrypt"; @@ -6,6 +6,6 @@ stdenv.mkDerivation rec { src = ../../../pkg/urcrypt; buildInputs = [ - openssl gmp ed25519 secp256k1 argon2 ge-additions libaes_siv + openssl gmp ed25519 secp256k1 argon2 libaes_siv ]; } diff --git a/nix/release.nix b/nix/release.nix index 2ccd1098b..083e3b2e7 100644 --- a/nix/release.nix +++ b/nix/release.nix @@ -16,9 +16,6 @@ let ent = env: import ./pkgs/ent/cross.nix env; - ge-additions = env: - import ./pkgs/ge-additions/cross.nix env; - libaes_siv = env: import ./pkgs/libaes_siv/cross.nix env; @@ -27,7 +24,6 @@ let inherit debug; name = if debug then "urbit-debug" else "urbit"; ent = ent env; - ge-additions = ge-additions env; libaes_siv = libaes_siv env; }; @@ -36,7 +32,6 @@ let inherit (plat.env) curl libgmp libsigsegv openssl zlib lmdb; inherit (plat.env) cmake_toolchain; ent = ent plat; - ge-additions = ge-additions plat; libaes_siv = libaes_siv plat; urbit = urbit { env = plat; debug = false; }; urbit-debug = urbit { env = plat; debug = true; }; diff --git a/pkg/ge-additions/Makefile b/pkg/ge-additions/Makefile deleted file mode 100644 index 719e76a2c..000000000 --- a/pkg/ge-additions/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -CC ?= cc -AR ?= ar -PREFIX ?= ./out - -################################################################################ - -.PHONY: all test install clean - -all: ge-additions.c ge-additions.h - $(CC) $(CFLAGS) -O3 -Wall -Werror -pedantic -std=gnu99 -c ge-additions.c - $(AR) rcs libge-additions.a ge-additions.o - -install: all - @mkdir -p $(PREFIX)/lib/ - @mkdir -p $(PREFIX)/include/ - cp libge-additions.a $(PREFIX)/lib/ - cp ge-additions.h $(PREFIX)/include/ - -clean: - rm -rf ./out diff --git a/pkg/urbit/configure b/pkg/urbit/configure index d496a86c0..a0758fcf0 100755 --- a/pkg/urbit/configure +++ b/pkg/urbit/configure @@ -6,7 +6,7 @@ URBIT_VERSION="0.10.8" deps=" \ curl gmp sigsegv argon2 ed25519 ent h2o scrypt uv murmur3 secp256k1 \ - softfloat3 ssl crypto z lmdb ge-additions aes_siv urcrypt pthread \ + softfloat3 ssl crypto z lmdb aes_siv urcrypt pthread \ " headers=" \ diff --git a/pkg/urcrypt/Makefile b/pkg/urcrypt/Makefile index 2c3d294ad..c9c9fa2cf 100644 --- a/pkg/urcrypt/Makefile +++ b/pkg/urcrypt/Makefile @@ -9,14 +9,23 @@ PREFIX ?= ./out CFLAGS := $(CFLAGS) -g -O3 -Wall -Werror -pedantic -std=gnu99 SOURCES = urcrypt.c urcrypt.h -liburcrypt.a: $(SOURCES) - $(CC) $(CFLAGS) -D URCRYPT_STATIC -c urcrypt.c -o urcrypt-static.o - $(AR) rcs liburcrypt.a urcrypt-static.o +GEO = ge-additions/ge-additions.o -liburcrypt.so: $(SOURCES) +$(GEO): ge-additions/ge-additions.c ge-additions/ge-additions.h + $(CC) $(CFLAGS) -c ge-additions/ge-additions.c -o $(GEO) + +urcrypt-static.o: $(SOURCES) $(GEO) + $(CC) $(CFLAGS) -D URCRYPT_STATIC -c urcrypt.c -o urcrypt-static.o + +liburcrypt.a: urcrypt-static.o $(GEO) + $(AR) rcs liburcrypt.a urcrypt-static.o $(GEO) + +urcrypt-shared.o: $(SOURCES) $(GEO) $(CC) $(CFLAGS) -fPIC -c urcrypt.c -o urcrypt-shared.o - $(CC) -shared urcrypt-shared.o -o liburcrypt.so \ - -led25519 -lge-additions -lssl -largon2 -laes_siv -lgmp -lsecp256k1 \ + +liburcrypt.so: urcrypt-shared.o + $(CC) -shared urcrypt-shared.o $(GEO) -o liburcrypt.so \ + -led25519 -lssl -largon2 -laes_siv -lgmp -lsecp256k1 \ -Wl,--no-undefined all: liburcrypt.a liburcrypt.so diff --git a/pkg/ge-additions/LICENSE b/pkg/urcrypt/ge-additions/LICENSE similarity index 100% rename from pkg/ge-additions/LICENSE rename to pkg/urcrypt/ge-additions/LICENSE diff --git a/pkg/ge-additions/README.md b/pkg/urcrypt/ge-additions/README.md similarity index 100% rename from pkg/ge-additions/README.md rename to pkg/urcrypt/ge-additions/README.md diff --git a/pkg/ge-additions/ge-additions.c b/pkg/urcrypt/ge-additions/ge-additions.c similarity index 100% rename from pkg/ge-additions/ge-additions.c rename to pkg/urcrypt/ge-additions/ge-additions.c diff --git a/pkg/ge-additions/ge-additions.h b/pkg/urcrypt/ge-additions/ge-additions.h similarity index 100% rename from pkg/ge-additions/ge-additions.h rename to pkg/urcrypt/ge-additions/ge-additions.h diff --git a/pkg/urcrypt/urcrypt.c b/pkg/urcrypt/urcrypt.c index a908b5f6c..bae6239cc 100644 --- a/pkg/urcrypt/urcrypt.c +++ b/pkg/urcrypt/urcrypt.c @@ -1,8 +1,8 @@ #include "urcrypt.h" +#include "ge-additions/ge-additions.h" #include #include -#include #include #include