-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
urbit: 0.7.3 -> 1.15 #208483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urbit: 0.7.3 -> 1.15 #208483
Changes from all commits
223e0c4
182b5a6
80c68ce
4ffdccc
c24afac
9da7de7
afcbbb1
713177b
8aa7b75
8751552
a397b9e
0c41362
8d95edc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { runCommandLocal, xxd, cacert }: | ||
|
|
||
| runCommandLocal "ca-bundle" {} '' | ||
| mkdir include | ||
|
|
||
| cat ${cacert}/etc/ssl/certs/ca-bundle.crt > include/ca-bundle.crt | ||
| ${xxd}/bin/xxd -i include/ca-bundle.crt > ca-bundle.h | ||
|
|
||
| mkdir -p $out/include | ||
|
|
||
| mv ca-bundle.h $out/include | ||
| '' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,77 @@ | ||
| { lib, stdenv, fetchFromGitHub, curl, git, gmp, libsigsegv, meson, ncurses, ninja | ||
| , openssl, pkg-config, re2c, zlib | ||
| }: | ||
| { lib | ||
| , pkgs | ||
| , fetchFromGitHub | ||
| , curlMinimal | ||
| , openssl | ||
| , h2o | ||
| , libsigsegv | ||
| , lmdb | ||
| , zlib | ||
| , stdenv | ||
| }: let | ||
|
|
||
| stdenv.mkDerivation rec { | ||
| pname = "urbit"; | ||
| version = "0.7.3"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| urbit-src = fetchFromGitHub { | ||
| owner = "urbit"; | ||
| repo = "urbit"; | ||
| rev = "v${version}"; | ||
| sha256 = "192843pjzh8z55fd0x70m3l1vncmixljia3nphgn7j7x4976xkp2"; | ||
| fetchSubmodules = true; | ||
| rev = "urbit-v1.15"; | ||
| hash = "sha256-YHl4aPJglUIQ6mrLWSUU7gNJn9DjeCwNBCCUkDfX2iw="; | ||
| }; | ||
|
|
||
| nativeBuildInputs = [ pkg-config ninja meson ]; | ||
| buildInputs = [ curl git gmp libsigsegv ncurses openssl re2c zlib ]; | ||
| callPackage = lib.callPackageWith ( pkgs // urbitPackages); | ||
|
|
||
| urbitPackages = { | ||
|
|
||
| fetchGitHubLFS = callPackage ./fetch-github-lfs.nix {}; | ||
|
|
||
| ca-bundle = callPackage ./ca-bundle.nix {}; | ||
|
|
||
| ent = callPackage ./ent.nix { | ||
| inherit urbit-src; | ||
| }; | ||
|
|
||
| libaes_siv = callPackage ./libaes_siv {}; | ||
|
|
||
| murmur3 = callPackage ./murmur3.nix {}; | ||
|
|
||
| postPatch = '' | ||
| patchShebangs . | ||
| ''; | ||
| ivory-header = callPackage ./ivory-header.nix { | ||
| inherit urbit-src; | ||
| }; | ||
|
|
||
| meta = with lib; { | ||
| description = "An operating function"; | ||
| homepage = "https://urbit.org"; | ||
| license = licenses.mit; | ||
| maintainers = with maintainers; [ mudri ]; | ||
| platforms = with platforms; linux; | ||
| softfloat3 = callPackage ./softfloat3.nix {}; | ||
|
|
||
| h2o-stable = h2o.overrideAttrs (_attrs: { | ||
| version = "v2.2.6"; | ||
| src = fetchFromGitHub { | ||
| owner = "h2o"; | ||
| repo = "h2o"; | ||
| rev = "v2.2.6"; | ||
| sha256 = "0qni676wqvxx0sl0pw9j0ph7zf2krrzqc1zwj73mgpdnsr8rsib7"; | ||
| }; | ||
| outputs = [ "out" "dev" "lib" ]; | ||
| meta.platforms = lib.platforms.unix; | ||
| }); | ||
|
|
||
| libsigsegv_patched = libsigsegv.overrideAttrs (oldAttrs: { | ||
| patches = (lib.lists.optionals (oldAttrs.patches != null) oldAttrs.patches) ++ [ | ||
| ./libsigsegv/disable-stackvma_fault-linux-arm.patch | ||
| ./libsigsegv/disable-stackvma_fault-linux-i386.patch | ||
| ]; | ||
| }); | ||
|
|
||
| lmdb_patched = lmdb.overrideAttrs (oldAttrs: { | ||
| patches = | ||
| oldAttrs.patches or [] ++ lib.optionals stdenv.isDarwin [ | ||
| ./lmdb/darwin-fsync.patch | ||
| ]; | ||
| }); | ||
|
|
||
| urbit = callPackage ./urbit.nix { | ||
| inherit urbit-src; | ||
| }; | ||
|
|
||
| urcrypt = callPackage ./urcrypt.nix { | ||
| inherit urbit-src; | ||
| }; | ||
| }; | ||
| } | ||
|
|
||
| in urbitPackages.urbit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { urbit-src, lib, stdenv }: | ||
|
|
||
| stdenv.mkDerivation { | ||
| pname = "ent"; | ||
| version = urbit-src.rev; | ||
| src = lib.cleanSource "${urbit-src}/pkg/ent"; | ||
|
|
||
| postPatch = '' | ||
| patchShebangs ./configure | ||
| ''; | ||
|
|
||
| installFlags = [ "PREFIX=$(out)" ]; | ||
|
|
||
| enableParallelBuilding = true; | ||
|
|
||
| meta = { | ||
| description = "Cross-platform wrapper around getentropy"; | ||
| homepage = "https://github.com/urbit/urbit"; | ||
| license = lib.licenses.free; | ||
| maintainers = [ lib.maintainers.uningan ]; | ||
| platforms = lib.platforms.unix; | ||
| }; | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,104 @@ | ||||||||
| { lib, stdenvNoCC, runCommandLocal, cacert, curl, jq }: | ||||||||
|
|
||||||||
| { src | ||||||||
| # `name` shouldn't use `baseNameOf` otherwise we'll | ||||||||
| # get `is not allowed to refer to a store path` errors. | ||||||||
| , name ? baseNameOf src, owner ? "urbit", repo ? "urbit" | ||||||||
|
||||||||
| , preferLocalBuild ? true }: | ||||||||
|
||||||||
| , preferLocalBuild ? true }: | |
| }: |
There is no reason to enforce this here
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use lib.importJSON
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| downloadUrl = | |
| "https://github.com/${owner}/${repo}.git/info/lfs/objects/batch"; | |
| downloadUrl = "https://github.com/${owner}/${repo}.git/info/lfs/objects/batch"; |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phases should not be overwritten. I would suggest to use runCommand here
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { urbit-src | ||
| , runCommandLocal | ||
| , fetchGitHubLFS | ||
| , xxd | ||
| }: let | ||
| lfs = fetchGitHubLFS { | ||
| src = "${urbit-src}/bin/ivory.pill"; | ||
| }; | ||
| in runCommandLocal "ivory-header" {} '' | ||
| mkdir -p $out/include | ||
| cat ${lfs} > u3_Ivory.pill | ||
| ${xxd}/bin/xxd -i u3_Ivory.pill > $out/include/ivory_impl.h | ||
| '' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -5,6 +5,8 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "") | ||
| set(CMAKE_BUILD_TYPE Release) | ||
| endif("${CMAKE_BUILD_TYPE}" STREQUAL "") | ||
|
|
||
| +option(BUILD_SHARED_LIBS "Build shared libraries" ON) | ||
| + | ||
| include(GNUInstallDirs) | ||
|
|
||
| # Warning: don't use the UB sanitizer in production builds. It can introduce timing side-channels | ||
| @@ -31,10 +33,12 @@ endif(NOT DISABLE_DOCS) | ||
| configure_file(config.h.in config.h) | ||
| include_directories(${CMAKE_CURRENT_BINARY_DIR}) | ||
|
|
||
| +if(BUILD_SHARED_LIBS) | ||
| add_library(aes_siv SHARED aes_siv.c) | ||
| target_include_directories(aes_siv PUBLIC ${OPENSSL_INCLUDE_DIR}) | ||
| target_link_libraries(aes_siv ${OPENSSL_CRYPTO_LIBRARY}) | ||
| set_target_properties(aes_siv PROPERTIES VERSION "1.0.1" SOVERSION 1) | ||
| +endif() | ||
|
|
||
| add_library(aes_siv_static STATIC aes_siv.c) | ||
| target_include_directories(aes_siv_static PUBLIC ${OPENSSL_INCLUDE_DIR}) | ||
| @@ -63,7 +67,9 @@ endif(ENABLE_SANITIZER) | ||
| add_executable(bench EXCLUDE_FROM_ALL bench.c) | ||
| target_link_libraries(bench aes_siv_static) | ||
|
|
||
| +if(BUILD_SHARED_LIBS) | ||
| install(TARGETS aes_siv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
| +endif() | ||
| install(TARGETS aes_siv_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
| install(FILES aes_siv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { stdenv | ||
| , lib | ||
| , cmake | ||
| , openssl | ||
| , fetchFromGitHub | ||
| }: | ||
| stdenv.mkDerivation { | ||
| pname = "libaes_siv"; | ||
| version = "9681279cfaa6e6399bb7ca3afbbc27fc2e19df4b"; | ||
| src = fetchFromGitHub { | ||
| owner = "dfoxfranke"; | ||
| repo = "libaes_siv"; | ||
| rev = "9681279cfaa6e6399bb7ca3afbbc27fc2e19df4b"; | ||
| sha256 = "1g4wy0m5wpqx7z6nillppkh5zki9fkx9rdw149qcxh7mc5vlszzi"; | ||
| }; | ||
|
|
||
| patches = [ ./cmakefiles_static.patch ]; | ||
|
|
||
| nativeBuildInputs = [ cmake ]; | ||
| buildInputs = [ openssl ]; | ||
|
|
||
| cmakeFlags = [ | ||
| "-DBUILD_SHARED_LIBS=OFF" | ||
| ]; | ||
|
|
||
| meta = { | ||
| description = "An RFC5297-compliant C implementation of AES-SIV"; | ||
| homepage = "https://github.com/dfoxfranke/libaes_siv"; | ||
| license = lib.licenses.asl20; | ||
| maintainers = [ lib.maintainers.uningan ]; | ||
| platforms = lib.platforms.unix; | ||
| }; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- a/src/fault-linux-arm.h | ||
| +++ b/src/fault-linux-arm.h | ||
| @@ -17,6 +17,8 @@ | ||
|
|
||
| #include "fault-posix-ucontext.h" | ||
|
|
||
| +#define HAVE_STACKVMA 0 | ||
| + | ||
| #if defined(__aarch64__) || defined(__ARM_64BIT_STATE) || defined(__ARM_PCS_AAPCS64) /* 64-bit */ | ||
|
|
||
| /* See glibc/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- a/src/fault-linux-i386.h | ||
| +++ b/src/fault-linux-i386.h | ||
| @@ -18,6 +18,8 @@ | ||
|
|
||
| #include "fault-posix-ucontext.h" | ||
|
|
||
| +#define HAVE_STACKVMA 0 | ||
| + | ||
| #if defined __x86_64__ | ||
| /* 64 bit registers */ | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c | ||
| index fe65e30..0070215 100644 | ||
| --- a/libraries/liblmdb/mdb.c | ||
| +++ b/libraries/liblmdb/mdb.c | ||
| @@ -2526,7 +2526,7 @@ mdb_env_sync(MDB_env *env, int force) | ||
| rc = ErrCode(); | ||
| } else | ||
| #endif | ||
| - if (MDB_FDATASYNC(env->me_fd)) | ||
| + if (fcntl(env->me_fd, F_FULLFSYNC, 0)) | ||
| rc = ErrCode(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { lib | ||
| , stdenv | ||
| , fetchFromGitHub | ||
| }: | ||
| stdenv.mkDerivation { | ||
| pname = "murmur3"; | ||
| version = "71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca"; | ||
| src = fetchFromGitHub { | ||
| owner = "urbit"; | ||
| repo = "murmur3"; | ||
| rev = "71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca"; | ||
| sha256 = "0k7jq2nb4ad9ajkr6wc4w2yy2f2hkwm3nkbj2pklqgwsg6flxzwg"; | ||
| }; | ||
|
|
||
| buildPhase = '' | ||
| $CC -fPIC -O3 -o murmur3.o -c $src/murmur3.c | ||
| ''; | ||
|
|
||
| installPhase = '' | ||
| mkdir -p $out/{lib,include} | ||
| $AR rcs $out/lib/libmurmur3.a murmur3.o | ||
| cp $src/*.h $out/include/ | ||
| ''; | ||
|
|
||
| meta = { | ||
| description = "C port of Murmur3 hash"; | ||
| homepage = "https://github.com/urbit/murmur3"; | ||
| license = lib.licenses.mit; | ||
| maintainers = [ lib.maintainers.uningan ]; | ||
| platforms = lib.platforms.unix; | ||
| }; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rather expand fetchFromGitHub or make a generic top-level fetcher instead.