diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-05-17 10:56:54 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-05-17 10:56:54 +0000 |
commit | c1d22074139ab0d048a05b5e5116265d099114d6 (patch) | |
tree | 97977009422d675f8930f97c309b010481289e72 /nixpkgs/pkgs/development/libraries/libsnark | |
parent | 4dc8afe4fd6b18437150129e0a1ecc23c6a1c0b9 (diff) | |
parent | bc9df0f66110039e495b6debe3a6cda4a1bb0fed (diff) | |
download | nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.gz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.bz2 nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.lz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.xz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.zst nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.zip |
Merge commit 'bc9df0f66110039e495b6debe3a6cda4a1bb0fed'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libsnark')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch | 41 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libsnark/default.nix | 2 |
2 files changed, 0 insertions, 43 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch b/nixpkgs/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch deleted file mode 100644 index 2eee84d1c4b8..000000000000 --- a/nixpkgs/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch +++ /dev/null @@ -1,41 +0,0 @@ -Adapted from https://github.com/zcash/libsnark/pull/10 - -diff --git a/depends/libff/libff/common/profiling.cpp b/depends/libff/libff/common/profiling.cpp -index f2a1985..319149c 100755 ---- a/depends/libff/libff/common/profiling.cpp -+++ b/depends/libff/libff/common/profiling.cpp -@@ -27,6 +27,13 @@ - #include <proc/readproc.h> - #endif - -+#ifdef __MACH__ -+#include <time.h> -+#include <sys/time.h> -+#include <mach/clock.h> -+#include <mach/mach.h> -+#endif -+ - namespace libff { - - long long get_nsec_time() -@@ -42,10 +49,20 @@ long long get_nsec_cpu_time() - return 0; - #else - ::timespec ts; -+#ifdef __MACH__ -+ clock_serv_t cclock; -+ mach_timespec_t mts; -+ host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); -+ clock_get_time(cclock, &mts); -+ mach_port_deallocate(mach_task_self(), cclock); -+ ts.tv_sec = mts.tv_sec; -+ ts.tv_nsec = mts.tv_nsec; -+#else - if ( ::clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) ) - throw ::std::runtime_error("clock_gettime(CLOCK_PROCESS_CPUTIME_ID) failed"); - // If we expected this to work, don't silently ignore failures, because that would hide the problem and incur an unnecessarily system-call overhead. So if we ever observe this exception, we should probably add a suitable #ifdef . - //TODO: clock_gettime(CLOCK_PROCESS_CPUTIME_ID) is not supported by native Windows. What about Cygwin? Should we #ifdef on CLOCK_PROCESS_CPUTIME_ID or on __linux__? -+#endif - return ts.tv_sec * 1000000000ll + ts.tv_nsec; - #endif - } diff --git a/nixpkgs/pkgs/development/libraries/libsnark/default.nix b/nixpkgs/pkgs/development/libraries/libsnark/default.nix index 4ea2209160f8..15d8169f1024 100644 --- a/nixpkgs/pkgs/development/libraries/libsnark/default.nix +++ b/nixpkgs/pkgs/development/libraries/libsnark/default.nix @@ -19,8 +19,6 @@ in stdenv.mkDerivation rec { fetchSubmodules = true; }; - patches = [ ./darwin-fix-clock-gettime.patch ]; - enableParallelBuilding = true; meta = with stdenv.lib; { |