::printObjectUnwindSection(bool showFunctionNames)
- {
-- printf("Arch: %s, Section: __LD,__compact_unwind (size=0x%08llX, => %lld entries)\n",
-+ printf("Arch: %s, Section: __LD,__compact_unwind (size=0x%08lX, => %ld entries)\n",
- archName(), fUnwindSection->size(), fUnwindSection->size() / sizeof(macho_compact_unwind_entry));
-
- const macho_compact_unwind_entry
* const entriesStart = (macho_compact_unwind_entry
*)((uint8_t*)fHeader + fUnwindSection->offset());
- const macho_compact_unwind_entry
* const entriesEnd = (macho_compact_unwind_entry
*)((uint8_t*)fHeader + fUnwindSection->offset() + fUnwindSection->size());
- for (const macho_compact_unwind_entry
* entry=entriesStart; entry < entriesEnd; ++entry) {
- uint64_t entryAddress = ((char*)entry - (char*)entriesStart) + fUnwindSection->addr();
-- printf("0x%08llX:\n", entryAddress);
-+ printf("0x%08lX:\n", entryAddress);
- const char* functionNameStr;
- pint_t funcAddress;
- uint32_t offsetInFunction;
-@@ -923,11 +923,11 @@
- funcAddress = entry->codeStart();
- }
- if ( offsetInFunction == 0 )
-- printf(" start: 0x%08llX %s\n", (uint64_t)funcAddress, functionNameStr);
-+ printf(" start: 0x%08lX %s\n", (uint64_t)funcAddress, functionNameStr);
- else
-- printf(" start: 0x%08llX %s+0x%X\n", (uint64_t)funcAddress+offsetInFunction, functionNameStr, offsetInFunction);
-+ printf(" start: 0x%08lX %s+0x%X\n", (uint64_t)funcAddress+offsetInFunction, functionNameStr, offsetInFunction);
-
-- printf(" end: 0x%08llX (len=0x%08X)\n", (uint64_t)(funcAddress+offsetInFunction+entry->codeLen()), entry->codeLen());
-+ printf(" end: 0x%08lX (len=0x%08X)\n", (uint64_t)(funcAddress+offsetInFunction+entry->codeLen()), entry->codeLen());
-
- char encodingString[200];
- this->decode(entry->compactUnwindInfo(), ((const uint8_t*)fHeader), encodingString);
-@@ -947,9 +947,9 @@
- uint32_t lsdaOffset;
- const char* lsdaName = this->functionName(entry->lsda(), &lsdaOffset);
- if ( lsdaOffset == 0 )
-- printf(" lsda: 0x%08llX %s\n", (uint64_t)entry->lsda(), lsdaName);
-+ printf(" lsda: 0x%08lX %s\n", (uint64_t)entry->lsda(), lsdaName);
- else
-- printf(" lsda: 0x%08llX %s+0x%X\n", (uint64_t)entry->lsda(), lsdaName, lsdaOffset);
-+ printf(" lsda: 0x%08lX %s+0x%X\n", (uint64_t)entry->lsda(), lsdaName, lsdaOffset);
- }
- }
- }
-@@ -962,7 +962,7 @@
- const uint8_t* sectionContent = (uint8_t*)fHeader + fUnwindSection->offset();
- macho_unwind_info_section_header
* sectionHeader = (macho_unwind_info_section_header
*)(sectionContent);
-
-- printf("Arch: %s, Section: __TEXT,__unwind_info (addr=0x%08llX, size=0x%08llX, fileOffset=0x%08X)\n",
-+ printf("Arch: %s, Section: __TEXT,__unwind_info (addr=0x%08lX, size=0x%08lX, fileOffset=0x%08X)\n",
- archName(), fUnwindSection->addr(), fUnwindSection->size(), fUnwindSection->offset());
- printf("\tversion=0x%08X\n", sectionHeader->version());
- printf("\tcommonEncodingsArraySectionOffset=0x%08X\n", sectionHeader->commonEncodingsArraySectionOffset());
-diff -ur cctools-port-c1cc758/cctools/libstuff/ofile.c cctools-port-format/cctools/libstuff/ofile.c
---- cctools-port-c1cc758/cctools/libstuff/ofile.c 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-format/cctools/libstuff/ofile.c 2017-11-10 19:38:34.511211634 -0800
-@@ -3108,7 +3108,7 @@
- }
- if(offset %
- (1 << align) != 0){
-- error("fat file: %s offset: %llu for cputype (%d) cpusubtype "
-+ error("fat file: %s offset: %lu for cputype (%d) cpusubtype "
- "(%d)) not aligned on it's alignment (2^%u)",
- ofile->file_name, offset, cputype,
- cpusubtype & ~CPU_SUBTYPE_MASK, align);
-@@ -3210,7 +3210,7 @@
- return(CHECK_BAD);
- }
- if(offset % (1 << align) != 0){
-- archive_member_error(ofile, "fat file's offset: %llu for "
-+ archive_member_error(ofile, "fat file's offset: %lu for "
- "cputype (%d) cpusubtype (%d) not aligned on it's "
- "alignment (2^%u)", offset, cputype,
- cpusubtype & ~CPU_SUBTYPE_MASK, align);
-diff -ur cctools-port-c1cc758/cctools/libstuff/writeout.c cctools-port-format/cctools/libstuff/writeout.c
---- cctools-port-c1cc758/cctools/libstuff/writeout.c 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-format/cctools/libstuff/writeout.c 2017-11-10 19:40:56.792695079 -0800
-@@ -421,7 +421,7 @@
- if((r = vm_allocate(mach_task_self(), (vm_address_t *)&file,
- file_size, TRUE)) != KERN_SUCCESS)
- mach_fatal(r, "can't vm_allocate() buffer for output file: %s of "
-- "size %llu", filename, file_size);
-+ "size %lu", filename, file_size);
-
- /*
- * If there is more than one architecture then fill in the fat file
-@@ -460,7 +460,7 @@
- if(offset > UINT32_MAX && archs[i].fat_arch64 == NULL){
- error("file too large to create as a fat file because "
- "offset field in struct fat_arch is only 32-bits and "
-- "offset (%llu) to architecture %s exceeds that",
-+ "offset (%lu) to architecture %s exceeds that",
- offset, archs[i].fat_arch_name);
- return;
- }
-diff -ur cctools-port-c1cc758/cctools/misc/libtool.c cctools-port-format/cctools/misc/libtool.c
---- cctools-port-c1cc758/cctools/misc/libtool.c 2017-11-10 19:22:01.790476705 -0800
-+++ cctools-port-format/cctools/misc/libtool.c 2017-11-10 19:24:48.435607249 -0800
-@@ -2545,7 +2545,7 @@
- if((r = vm_allocate(mach_task_self(), (vm_address_t *)&library,
- library_size, TRUE)) != KERN_SUCCESS)
- mach_fatal(r, "can't vm_allocate() buffer for output file: %s "
-- "of size %llu", output, library_size);
-+ "of size %lu", output, library_size);
-
-
- /* put in the archive magic string in the buffer */
-@@ -2581,7 +2581,7 @@
- if((r = vm_allocate(mach_task_self(), (vm_address_t *)&library,
- library_size, TRUE)) != KERN_SUCCESS)
- mach_fatal(r, "can't vm_allocate() buffer for output file: %s of "
-- "size %llu", output, library_size);
-+ "size %lu", output, library_size);
-
- /*
- * Create the output file. The unlink() is done to handle the problem
-@@ -2635,7 +2635,7 @@
- if(cmd_flags.fat64 == FALSE && offset > UINT32_MAX)
- error("file too large to create as a fat file because "
- "offset field in struct fat_arch is only 32-bits and "
-- "offset (%llu) to architecture %s exceeds that",
-+ "offset (%lu) to architecture %s exceeds that",
- offset, archs[i].arch_flag.name);
- if(archs[i].arch_flag.cputype & CPU_ARCH_ABI64){
- if(cmd_flags.fat64 == TRUE)
-@@ -2660,7 +2660,7 @@
- if(cmd_flags.fat64 == FALSE && archs[i].size > UINT32_MAX)
- error("file too large to create as a fat file because "
- "size field in struct fat_arch is only 32-bits and "
-- "size (%llu) of architecture %s exceeds that",
-+ "size (%lu) of architecture %s exceeds that",
- archs[i].size, archs[i].arch_flag.name);
- if(cmd_flags.fat64 == TRUE)
- fat_arch64[i].size = archs[i].size;
-@@ -3043,15 +3043,15 @@
- return;
-
- if(offset + size > library_size)
-- fatal("internal error: output_flush(offset = %llu, size = %llu) "
-- "out of range for library_size = %llu", offset, size,
-+ fatal("internal error: output_flush(offset = %lu, size = %lu) "
-+ "out of range for library_size = %lu", offset, size,
- library_size);
-
- #ifdef DEBUG
- if(cmd_flags.debug & (1 << 2))
- print_block_list();
- if(cmd_flags.debug & (1 << 1))
-- printf("output_flush(offset = %llu, size %llu)", offset, size);
-+ printf("output_flush(offset = %lu, size %lu)", offset, size);
- #endif /* DEBUG */
-
- if(size == 0){
-@@ -3087,9 +3087,9 @@
- */
- if(before != NULL){
- if(before->offset + before->size > offset){
-- warning("internal error: output_flush(offset = %llu, size = "
-- "%llu) overlaps with flushed block(offset = %llu, "
-- "size = %llu)", offset, size, before->offset,
-+ warning("internal error: output_flush(offset = %lu, size = "
-+ "%lu) overlaps with flushed block(offset = %lu, "
-+ "size = %lu)", offset, size, before->offset,
- before->size);
- printf("calling abort()\n");
- abort();
-@@ -3097,9 +3097,9 @@
- }
- if(after != NULL){
- if(offset + size > after->offset){
-- warning("internal error: output_flush(offset = %llu, size = "
-- "%llu) overlaps with flushed block(offset = %llu, "
-- "size = %llu)", offset, size, after->offset,
-+ warning("internal error: output_flush(offset = %lu, size = "
-+ "%lu) overlaps with flushed block(offset = %lu, "
-+ "size = %lu)", offset, size, after->offset,
- after->size);
- printf("calling abort()\n");
- abort();
diff --git a/nix/nixcrpkgs/macos/cctools-ld64-registers.patch b/nix/nixcrpkgs/macos/cctools-ld64-registers.patch
deleted file mode 100644
index 70963e253..000000000
--- a/nix/nixcrpkgs/macos/cctools-ld64-registers.patch
+++ /dev/null
@@ -1,299 +0,0 @@
-diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/parsers/libunwind/Registers.hpp cctools-port-patched/cctools/ld64/src/ld/parsers/libunwind/Registers.hpp
---- cctools-port-c1cc758/cctools/ld64/src/ld/parsers/libunwind/Registers.hpp 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-patched/cctools/ld64/src/ld/parsers/libunwind/Registers.hpp 2017-10-29 10:12:23.150301208 -0700
-@@ -72,22 +72,22 @@
- const char* getRegisterName(int num);
- void jumpto();
-
-- uint32_t getSP() const { return fRegisters.__esp; }
-- void setSP(uint32_t value) { fRegisters.__esp = value; }
-- uint32_t getIP() const { return fRegisters.__eip; }
-- void setIP(uint32_t value) { fRegisters.__eip = value; }
-- uint32_t getEBP() const { return fRegisters.__ebp; }
-- void setEBP(uint32_t value) { fRegisters.__ebp = value; }
-- uint32_t getEBX() const { return fRegisters.__ebx; }
-- void setEBX(uint32_t value) { fRegisters.__ebx = value; }
-- uint32_t getECX() const { return fRegisters.__ecx; }
-- void setECX(uint32_t value) { fRegisters.__ecx = value; }
-- uint32_t getEDX() const { return fRegisters.__edx; }
-- void setEDX(uint32_t value) { fRegisters.__edx = value; }
-- uint32_t getESI() const { return fRegisters.__esi; }
-- void setESI(uint32_t value) { fRegisters.__esi = value; }
-- uint32_t getEDI() const { return fRegisters.__edi; }
-- void setEDI(uint32_t value) { fRegisters.__edi = value; }
-+ uint32_t getSP() const { return fRegisters.esp; }
-+ void setSP(uint32_t value) { fRegisters.esp = value; }
-+ uint32_t getIP() const { return fRegisters.eip; }
-+ void setIP(uint32_t value) { fRegisters.eip = value; }
-+ uint32_t getEBP() const { return fRegisters.ebp; }
-+ void setEBP(uint32_t value) { fRegisters.ebp = value; }
-+ uint32_t getEBX() const { return fRegisters.ebx; }
-+ void setEBX(uint32_t value) { fRegisters.ebx = value; }
-+ uint32_t getECX() const { return fRegisters.ecx; }
-+ void setECX(uint32_t value) { fRegisters.ecx = value; }
-+ uint32_t getEDX() const { return fRegisters.edx; }
-+ void setEDX(uint32_t value) { fRegisters.edx = value; }
-+ uint32_t getESI() const { return fRegisters.esi; }
-+ void setESI(uint32_t value) { fRegisters.esi = value; }
-+ uint32_t getEDI() const { return fRegisters.edi; }
-+ void setEDI(uint32_t value) { fRegisters.edi = value; }
-
- private:
- i386_thread_state_t fRegisters;
-@@ -122,25 +122,25 @@
- {
- switch ( regNum ) {
- case UNW_REG_IP:
-- return fRegisters.__eip;
-+ return fRegisters.eip;
- case UNW_REG_SP:
-- return fRegisters.__esp;
-+ return fRegisters.esp;
- case UNW_X86_EAX:
-- return fRegisters.__eax;
-+ return fRegisters.eax;
- case UNW_X86_ECX:
-- return fRegisters.__ecx;
-+ return fRegisters.ecx;
- case UNW_X86_EDX:
-- return fRegisters.__edx;
-+ return fRegisters.edx;
- case UNW_X86_EBX:
-- return fRegisters.__ebx;
-+ return fRegisters.ebx;
- case UNW_X86_EBP:
-- return fRegisters.__ebp;
-+ return fRegisters.ebp;
- case UNW_X86_ESP:
-- return fRegisters.__esp;
-+ return fRegisters.esp;
- case UNW_X86_ESI:
-- return fRegisters.__esi;
-+ return fRegisters.esi;
- case UNW_X86_EDI:
-- return fRegisters.__edi;
-+ return fRegisters.edi;
- }
- ABORT("unsupported x86 register");
- }
-@@ -149,34 +149,34 @@
- {
- switch ( regNum ) {
- case UNW_REG_IP:
-- fRegisters.__eip = value;
-+ fRegisters.eip = value;
- return;
- case UNW_REG_SP:
-- fRegisters.__esp = value;
-+ fRegisters.esp = value;
- return;
- case UNW_X86_EAX:
-- fRegisters.__eax = value;
-+ fRegisters.eax = value;
- return;
- case UNW_X86_ECX:
-- fRegisters.__ecx = value;
-+ fRegisters.ecx = value;
- return;
- case UNW_X86_EDX:
-- fRegisters.__edx = value;
-+ fRegisters.edx = value;
- return;
- case UNW_X86_EBX:
-- fRegisters.__ebx = value;
-+ fRegisters.ebx = value;
- return;
- case UNW_X86_EBP:
-- fRegisters.__ebp = value;
-+ fRegisters.ebp = value;
- return;
- case UNW_X86_ESP:
-- fRegisters.__esp = value;
-+ fRegisters.esp = value;
- return;
- case UNW_X86_ESI:
-- fRegisters.__esi = value;
-+ fRegisters.esi = value;
- return;
- case UNW_X86_EDI:
-- fRegisters.__edi = value;
-+ fRegisters.edi = value;
- return;
- }
- ABORT("unsupported x86 register");
-@@ -253,22 +253,22 @@
- void setVectorRegister(int num, v128 value);
- const char* getRegisterName(int num);
- void jumpto();
-- uint64_t getSP() const { return fRegisters.__rsp; }
-- void setSP(uint64_t value) { fRegisters.__rsp = value; }
-- uint64_t getIP() const { return fRegisters.__rip; }
-- void setIP(uint64_t value) { fRegisters.__rip = value; }
-- uint64_t getRBP() const { return fRegisters.__rbp; }
-- void setRBP(uint64_t value) { fRegisters.__rbp = value; }
-- uint64_t getRBX() const { return fRegisters.__rbx; }
-- void setRBX(uint64_t value) { fRegisters.__rbx = value; }
-- uint64_t getR12() const { return fRegisters.__r12; }
-- void setR12(uint64_t value) { fRegisters.__r12 = value; }
-- uint64_t getR13() const { return fRegisters.__r13; }
-- void setR13(uint64_t value) { fRegisters.__r13 = value; }
-- uint64_t getR14() const { return fRegisters.__r14; }
-- void setR14(uint64_t value) { fRegisters.__r14 = value; }
-- uint64_t getR15() const { return fRegisters.__r15; }
-- void setR15(uint64_t value) { fRegisters.__r15 = value; }
-+ uint64_t getSP() const { return fRegisters.rsp; }
-+ void setSP(uint64_t value) { fRegisters.rsp = value; }
-+ uint64_t getIP() const { return fRegisters.rip; }
-+ void setIP(uint64_t value) { fRegisters.rip = value; }
-+ uint64_t getRBP() const { return fRegisters.rbp; }
-+ void setRBP(uint64_t value) { fRegisters.rbp = value; }
-+ uint64_t getRBX() const { return fRegisters.rbx; }
-+ void setRBX(uint64_t value) { fRegisters.rbx = value; }
-+ uint64_t getR12() const { return fRegisters.r12; }
-+ void setR12(uint64_t value) { fRegisters.r12 = value; }
-+ uint64_t getR13() const { return fRegisters.r13; }
-+ void setR13(uint64_t value) { fRegisters.r13 = value; }
-+ uint64_t getR14() const { return fRegisters.r14; }
-+ void setR14(uint64_t value) { fRegisters.r14 = value; }
-+ uint64_t getR15() const { return fRegisters.r15; }
-+ void setR15(uint64_t value) { fRegisters.r15 = value; }
- private:
- x86_thread_state64_t fRegisters;
- };
-@@ -302,41 +302,41 @@
- {
- switch ( regNum ) {
- case UNW_REG_IP:
-- return fRegisters.__rip;
-+ return fRegisters.rip;
- case UNW_REG_SP:
-- return fRegisters.__rsp;
-+ return fRegisters.rsp;
- case UNW_X86_64_RAX:
-- return fRegisters.__rax;
-+ return fRegisters.rax;
- case UNW_X86_64_RDX:
-- return fRegisters.__rdx;
-+ return fRegisters.rdx;
- case UNW_X86_64_RCX:
-- return fRegisters.__rcx;
-+ return fRegisters.rcx;
- case UNW_X86_64_RBX:
-- return fRegisters.__rbx;
-+ return fRegisters.rbx;
- case UNW_X86_64_RSI:
-- return fRegisters.__rsi;
-+ return fRegisters.rsi;
- case UNW_X86_64_RDI:
-- return fRegisters.__rdi;
-+ return fRegisters.rdi;
- case UNW_X86_64_RBP:
-- return fRegisters.__rbp;
-+ return fRegisters.rbp;
- case UNW_X86_64_RSP:
-- return fRegisters.__rsp;
-+ return fRegisters.rsp;
- case UNW_X86_64_R8:
-- return fRegisters.__r8;
-+ return fRegisters.r8;
- case UNW_X86_64_R9:
-- return fRegisters.__r9;
-+ return fRegisters.r9;
- case UNW_X86_64_R10:
-- return fRegisters.__r10;
-+ return fRegisters.r10;
- case UNW_X86_64_R11:
-- return fRegisters.__r11;
-+ return fRegisters.r11;
- case UNW_X86_64_R12:
-- return fRegisters.__r12;
-+ return fRegisters.r12;
- case UNW_X86_64_R13:
-- return fRegisters.__r13;
-+ return fRegisters.r13;
- case UNW_X86_64_R14:
-- return fRegisters.__r14;
-+ return fRegisters.r14;
- case UNW_X86_64_R15:
-- return fRegisters.__r15;
-+ return fRegisters.r15;
- }
- ABORT("unsupported x86_64 register");
- }
-@@ -345,58 +345,58 @@
- {
- switch ( regNum ) {
- case UNW_REG_IP:
-- fRegisters.__rip = value;
-+ fRegisters.rip = value;
- return;
- case UNW_REG_SP:
-- fRegisters.__rsp = value;
-+ fRegisters.rsp = value;
- return;
- case UNW_X86_64_RAX:
-- fRegisters.__rax = value;
-+ fRegisters.rax = value;
- return;
- case UNW_X86_64_RDX:
-- fRegisters.__rdx = value;
-+ fRegisters.rdx = value;
- return;
- case UNW_X86_64_RCX:
-- fRegisters.__rcx = value;
-+ fRegisters.rcx = value;
- return;
- case UNW_X86_64_RBX:
-- fRegisters.__rbx = value;
-+ fRegisters.rbx = value;
- return;
- case UNW_X86_64_RSI:
-- fRegisters.__rsi = value;
-+ fRegisters.rsi = value;
- return;
- case UNW_X86_64_RDI:
-- fRegisters.__rdi = value;
-+ fRegisters.rdi = value;
- return;
- case UNW_X86_64_RBP:
-- fRegisters.__rbp = value;
-+ fRegisters.rbp = value;
- return;
- case UNW_X86_64_RSP:
-- fRegisters.__rsp = value;
-+ fRegisters.rsp = value;
- return;
- case UNW_X86_64_R8:
-- fRegisters.__r8 = value;
-+ fRegisters.r8 = value;
- return;
- case UNW_X86_64_R9:
-- fRegisters.__r9 = value;
-+ fRegisters.r9 = value;
- return;
- case UNW_X86_64_R10:
-- fRegisters.__r10 = value;
-+ fRegisters.r10 = value;
- return;
- case UNW_X86_64_R11:
-- fRegisters.__r11 = value;
-+ fRegisters.r11 = value;
- return;
- case UNW_X86_64_R12:
-- fRegisters.__r12 = value;
-+ fRegisters.r12 = value;
- return;
- case UNW_X86_64_R13:
-- fRegisters.__r13 = value;
-+ fRegisters.r13 = value;
- return;
- case UNW_X86_64_R14:
-- fRegisters.__r14 = value;
-+ fRegisters.r14 = value;
- return;
- case UNW_X86_64_R15:
-- fRegisters.__r15 = value;
-+ fRegisters.r15 = value;
- return;
- }
- ABORT("unsupported x86_64 register");
diff --git a/nix/nixcrpkgs/macos/cctools-libstuff-no-error.patch b/nix/nixcrpkgs/macos/cctools-libstuff-no-error.patch
deleted file mode 100644
index 6be415388..000000000
--- a/nix/nixcrpkgs/macos/cctools-libstuff-no-error.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-diff -ur cctools-port-c1cc758/cctools/include/stuff/errors.h cctools-port-libstuff-no-error/cctools/include/stuff/errors.h
---- cctools-port-c1cc758/cctools/include/stuff/errors.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-libstuff-no-error/cctools/include/stuff/errors.h 2017-11-10 21:52:54.172522281 -0800
-@@ -40,7 +40,7 @@
- __attribute__ ((format (printf, 1, 2)))
- #endif
- __attribute__((visibility("hidden")));
--extern void error(
-+extern void errorf(
- const char *format, ...)
- #ifdef __GNUC__
- __attribute__ ((format (printf, 1, 2)))
-diff -ur cctools-port-c1cc758/cctools/libstuff/errors.c cctools-port-libstuff-no-error/cctools/libstuff/errors.c
---- cctools-port-c1cc758/cctools/libstuff/errors.c 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-libstuff-no-error/cctools/libstuff/errors.c 2017-11-10 21:52:42.795730237 -0800
-@@ -57,7 +57,7 @@
- */
- __private_extern__
- void
--error(
-+errorf(
- const char *format,
- ...)
- {
-diff -ur cctools-port-c1cc758/cctools/libstuff/ofile.c cctools-port-libstuff-no-error/cctools/libstuff/ofile.c
---- cctools-port-c1cc758/cctools/libstuff/ofile.c 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-libstuff-no-error/cctools/libstuff/ofile.c 2017-11-10 21:54:20.156803208 -0800
-@@ -115,6 +115,8 @@
- };
- #endif /* !defined(OTOOL) */
-
-+#define error errorf
-+
- static enum bool ofile_specific_arch(
- struct ofile *ofile,
- uint32_t narch);
-diff -ur cctools-port-c1cc758/cctools/libstuff/swap_headers.c cctools-port-libstuff-no-error/cctools/libstuff/swap_headers.c
---- cctools-port-c1cc758/cctools/libstuff/swap_headers.c 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-libstuff-no-error/cctools/libstuff/swap_headers.c 2017-11-10 21:54:49.873797374 -0800
-@@ -50,6 +50,8 @@
- #include "stuff/bytesex.h"
- #include "stuff/errors.h"
-
-+#define error errorf
-+
- /*
- * swap_object_headers() swaps the object file headers from the host byte sex
- * into the non-host byte sex. It returns TRUE if it can and did swap the
-diff -ur cctools-port-c1cc758/cctools/libstuff/SymLoc.c cctools-port-libstuff-no-error/cctools/libstuff/SymLoc.c
---- cctools-port-c1cc758/cctools/libstuff/SymLoc.c 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-libstuff-no-error/cctools/libstuff/SymLoc.c 2017-11-10 21:53:06.199321490 -0800
-@@ -118,7 +118,7 @@
- if(fclose(file) != 0)
- system_error("fclose() failed");
- if (!*viewPath) {
-- error("symLocForDylib(): Can't locate view path for release %s",
-+ errorf("symLocForDylib(): Can't locate view path for release %s",
- releaseName);
- return NULL;
- }
-@@ -252,7 +252,7 @@
- // process return value
- if (!c) {
- if(no_error_if_missing == FALSE)
-- error("Can't find project that builds %s", installName);
-+ errorf("Can't find project that builds %s", installName);
- return NULL;
- } else {
- *found_project = TRUE;
-diff -ur cctools-port-c1cc758/cctools/libstuff/version_number.c cctools-port-libstuff-no-error/cctools/libstuff/version_number.c
---- cctools-port-c1cc758/cctools/libstuff/version_number.c 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-libstuff-no-error/cctools/libstuff/version_number.c 2017-11-10 21:55:18.674114769 -0800
-@@ -27,6 +27,8 @@
- #include "stuff/allocate.h"
- #include "stuff/errors.h"
-
-+#define error errorf
-+
- /*
- * get_version_number() converts an ascii version number string of the form:
- * X[.Y[.Z]]
-diff -ur cctools-port-c1cc758/cctools/libstuff/writeout.c cctools-port-libstuff-no-error/cctools/libstuff/writeout.c
---- cctools-port-c1cc758/cctools/libstuff/writeout.c 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-libstuff-no-error/cctools/libstuff/writeout.c 2017-11-10 21:55:43.537722114 -0800
-@@ -37,6 +37,8 @@
- #include "stuff/lto.h"
- #endif /* LTO_SUPPORT */
-
-+#define error errorf
-+
- static void copy_new_symbol_info(
- char *p,
- uint32_t *size,
diff --git a/nix/nixcrpkgs/macos/cctools-private-extern.patch b/nix/nixcrpkgs/macos/cctools-private-extern.patch
deleted file mode 100644
index ce0f099fd..000000000
--- a/nix/nixcrpkgs/macos/cctools-private-extern.patch
+++ /dev/null
@@ -1,271 +0,0 @@
-diff -ur cctools-port-c1cc758/cctools/include/foreign/extern.h cctools-port-private-extern/cctools/include/foreign/extern.h
---- cctools-port-c1cc758/cctools/include/foreign/extern.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/foreign/extern.h 2017-11-10 18:32:37.035890924 -0800
-@@ -1 +1,2 @@
-+#pragma once
- #define __private_extern__ __attribute__((visibility("hidden")))
-diff -ur cctools-port-c1cc758/cctools/include/mach-o/dyld.h cctools-port-private-extern/cctools/include/mach-o/dyld.h
---- cctools-port-c1cc758/cctools/include/mach-o/dyld.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/mach-o/dyld.h 2017-11-10 18:32:37.035890924 -0800
-@@ -27,9 +27,7 @@
- extern "C" {
- #endif /* __cplusplus */
-
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+#include
-
- #include
- #include
-diff -ur cctools-port-c1cc758/cctools/include/stuff/allocate.h cctools-port-private-extern/cctools/include/stuff/allocate.h
---- cctools-port-c1cc758/cctools/include/stuff/allocate.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/allocate.h 2017-11-10 18:33:52.006780029 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- /* defined in allocate.c */
-
-diff -ur cctools-port-c1cc758/cctools/include/stuff/arch.h cctools-port-private-extern/cctools/include/stuff/arch.h
---- cctools-port-c1cc758/cctools/include/stuff/arch.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/arch.h 2017-11-10 18:34:36.487305108 -0800
-@@ -23,9 +23,8 @@
- #ifndef _STUFF_ARCH_H_
- #define _STUFF_ARCH_H_
-
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+#include
-+
- /*
- * This file contains the current known set of flags and constants for the
- * known architectures.
-diff -ur cctools-port-c1cc758/cctools/include/stuff/best_arch.h cctools-port-private-extern/cctools/include/stuff/best_arch.h
---- cctools-port-c1cc758/cctools/include/stuff/best_arch.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/best_arch.h 2017-11-10 18:34:48.764116432 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- #include
- #include
-diff -ur cctools-port-c1cc758/cctools/include/stuff/breakout.h cctools-port-private-extern/cctools/include/stuff/breakout.h
---- cctools-port-c1cc758/cctools/include/stuff/breakout.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/breakout.h 2017-11-10 18:35:04.334299743 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- #import "stuff/ofile.h"
-
-diff -ur cctools-port-c1cc758/cctools/include/stuff/bytesex.h cctools-port-private-extern/cctools/include/stuff/bytesex.h
---- cctools-port-c1cc758/cctools/include/stuff/bytesex.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/bytesex.h 2017-11-10 18:35:12.637730768 -0800
-@@ -29,9 +29,7 @@
- #ifndef _STUFF_BYTESEX_H_
- #define _STUFF_BYTESEX_H_
-
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+#include
-
- #include
- #include
-diff -ur cctools-port-c1cc758/cctools/include/stuff/execute.h cctools-port-private-extern/cctools/include/stuff/execute.h
---- cctools-port-c1cc758/cctools/include/stuff/execute.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/execute.h 2017-11-10 18:35:34.417986815 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- /*
- * execute() does an execvp using the argv passed to it. If the parameter
-diff -ur cctools-port-c1cc758/cctools/include/stuff/guess_short_name.h cctools-port-private-extern/cctools/include/stuff/guess_short_name.h
---- cctools-port-c1cc758/cctools/include/stuff/guess_short_name.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/guess_short_name.h 2017-11-10 18:40:11.801171715 -0800
-@@ -22,6 +22,8 @@
- */
- #include "stuff/bool.h"
-
-+#include
-+
- __private_extern__ char * guess_short_name(
- char *name,
- enum bool *is_framework,
-diff -ur cctools-port-c1cc758/cctools/include/stuff/hash_string.h cctools-port-private-extern/cctools/include/stuff/hash_string.h
---- cctools-port-c1cc758/cctools/include/stuff/hash_string.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/hash_string.h 2017-11-10 18:35:43.698095826 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- __private_extern__ int32_t hash_string(
- char *key);
-diff -ur cctools-port-c1cc758/cctools/include/stuff/hppa.h cctools-port-private-extern/cctools/include/stuff/hppa.h
---- cctools-port-c1cc758/cctools/include/stuff/hppa.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/hppa.h 2017-11-10 18:36:01.414970472 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- __private_extern__ void calc_hppa_HILO(
- uint32_t base,
-diff -ur cctools-port-c1cc758/cctools/include/stuff/lto.h cctools-port-private-extern/cctools/include/stuff/lto.h
---- cctools-port-c1cc758/cctools/include/stuff/lto.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/lto.h 2017-11-10 18:40:27.811342692 -0800
-@@ -3,6 +3,8 @@
-
- #include "stuff/arch.h"
-
-+#include
-+
- #ifdef LTO_SUPPORT
-
- __private_extern__ int is_llvm_bitcode_from_memory(
-diff -ur cctools-port-c1cc758/cctools/include/stuff/macosx_deployment_target.h cctools-port-private-extern/cctools/include/stuff/macosx_deployment_target.h
---- cctools-port-c1cc758/cctools/include/stuff/macosx_deployment_target.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/macosx_deployment_target.h 2017-11-10 18:39:47.814249693 -0800
-@@ -22,6 +22,8 @@
- */
- #include
-
-+#include
-+
- struct macosx_deployment_target {
- uint32_t major; /* major version */
- uint32_t minor; /* minor version (if any or zero) */
-diff -ur cctools-port-c1cc758/cctools/include/stuff/ofile.h cctools-port-private-extern/cctools/include/stuff/ofile.h
---- cctools-port-c1cc758/cctools/include/stuff/ofile.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/ofile.h 2017-11-10 18:36:14.268454589 -0800
-@@ -24,9 +24,7 @@
- #ifndef _STUFF_OFILE_H_
- #define _STUFF_OFILE_H_
-
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+#include
-
- #import
- #ifndef AR_EFMT1
-diff -ur cctools-port-c1cc758/cctools/include/stuff/print.h cctools-port-private-extern/cctools/include/stuff/print.h
---- cctools-port-c1cc758/cctools/include/stuff/print.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/print.h 2017-11-10 18:36:24.805244801 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- #import
-
-diff -ur cctools-port-c1cc758/cctools/include/stuff/reloc.h cctools-port-private-extern/cctools/include/stuff/reloc.h
---- cctools-port-c1cc758/cctools/include/stuff/reloc.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/reloc.h 2017-11-10 18:36:31.878661041 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- #import
- #import "stuff/bool.h"
-diff -ur cctools-port-c1cc758/cctools/include/stuff/rnd.h cctools-port-private-extern/cctools/include/stuff/rnd.h
---- cctools-port-c1cc758/cctools/include/stuff/rnd.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/rnd.h 2017-11-10 18:36:39.068745293 -0800
-@@ -27,9 +27,7 @@
- */
- #include
-
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+#include
-
- /*
- * rnd() rounds v to a multiple of r.
-diff -ur cctools-port-c1cc758/cctools/include/stuff/symbol_list.h cctools-port-private-extern/cctools/include/stuff/symbol_list.h
---- cctools-port-c1cc758/cctools/include/stuff/symbol_list.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/symbol_list.h 2017-11-10 18:37:11.605792928 -0800
-@@ -23,6 +23,8 @@
- #include
- #include
-
-+#include
-+
- /*
- * Data structures to perform selective stripping of symbol table entries.
- */
-diff -ur cctools-port-c1cc758/cctools/include/stuff/unix_standard_mode.h cctools-port-private-extern/cctools/include/stuff/unix_standard_mode.h
---- cctools-port-c1cc758/cctools/include/stuff/unix_standard_mode.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/unix_standard_mode.h 2017-11-10 18:37:42.596155389 -0800
-@@ -22,5 +22,7 @@
- */
- #include "stuff/bool.h"
-
-+#include
-+
- __private_extern__ enum bool get_unix_standard_mode(
- void);
-diff -ur cctools-port-c1cc758/cctools/include/stuff/vm_flush_cache.h cctools-port-private-extern/cctools/include/stuff/vm_flush_cache.h
---- cctools-port-c1cc758/cctools/include/stuff/vm_flush_cache.h 2017-10-01 13:47:04.000000000 -0700
-+++ cctools-port-private-extern/cctools/include/stuff/vm_flush_cache.h 2017-11-10 18:37:59.973025145 -0800
-@@ -20,9 +20,8 @@
- *
- * @APPLE_LICENSE_HEADER_END@
- */
--#if defined(__MWERKS__) && !defined(__private_extern__)
--#define __private_extern__ __declspec(private_extern)
--#endif
-+
-+#include
-
- #import
- __private_extern__ kern_return_t vm_flush_cache(
diff --git a/nix/nixcrpkgs/macos/clang_builder.sh b/nix/nixcrpkgs/macos/clang_builder.sh
deleted file mode 100644
index 2afa96bb9..000000000
--- a/nix/nixcrpkgs/macos/clang_builder.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-source $setup
-
-tar -xf $llvm_src
-mv llvm-* llvm
-
-tar -xf $lld_src
-mv lld-* lld
-mv lld llvm/tools/
-
-tar -xf $src
-mv cfe-* clang
-cd clang
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-cd ..
-mv clang llvm/projects/
-
-mkdir build
-cd build
-
-cmake ../llvm -GNinja -DDEFAULT_SYSROOT=$out -DCMAKE_INSTALL_PREFIX=$out $cmake_flags
-
-ninja
-
-ninja install
-
-# clang-tblgen is supposed to be an internal tool, but tapi needs it
-cp bin/clang-tblgen $out/bin
diff --git a/nix/nixcrpkgs/macos/clang_megapatch.patch b/nix/nixcrpkgs/macos/clang_megapatch.patch
deleted file mode 100644
index b5941e2c3..000000000
--- a/nix/nixcrpkgs/macos/clang_megapatch.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff -ur cfe-5.0.0.src.orig/lib/Driver/ToolChains/Gnu.cpp cfe-5.0.0.src/lib/Driver/ToolChains/Gnu.cpp
---- cfe-5.0.0.src.orig/lib/Driver/ToolChains/Gnu.cpp 2017-09-13 07:15:52.419093088 -0700
-+++ cfe-5.0.0.src/lib/Driver/ToolChains/Gnu.cpp 2017-09-13 07:21:58.892639000 -0700
-@@ -493,10 +493,6 @@
- CmdArgs.push_back("-export-dynamic");
-
- if (!Args.hasArg(options::OPT_shared)) {
-- const std::string Loader =
-- D.DyldPrefix + ToolChain.getDynamicLinker(Args);
-- CmdArgs.push_back("-dynamic-linker");
-- CmdArgs.push_back(Args.MakeArgString(Loader));
- }
- }
-
-diff -ur cfe-5.0.0.src.orig/lib/Driver/ToolChains/Linux.cpp cfe-5.0.0.src/lib/Driver/ToolChains/Linux.cpp
---- cfe-5.0.0.src.orig/lib/Driver/ToolChains/Linux.cpp 2017-09-13 07:15:52.419093088 -0700
-+++ cfe-5.0.0.src/lib/Driver/ToolChains/Linux.cpp 2017-09-13 07:17:58.530311694 -0700
-@@ -195,18 +195,7 @@
- llvm::Triple::ArchType Arch = Triple.getArch();
- std::string SysRoot = computeSysRoot();
-
-- // Cross-compiling binutils and GCC installations (vanilla and openSUSE at
-- // least) put various tools in a triple-prefixed directory off of the parent
-- // of the GCC installation. We use the GCC triple here to ensure that we end
-- // up with tools that support the same amount of cross compiling as the
-- // detected GCC installation. For example, if we find a GCC installation
-- // targeting x86_64, but it is a bi-arch GCC installation, it can also be
-- // used to target i386.
-- // FIXME: This seems unlikely to be Linux-specific.
-- ToolChain::path_list &PPaths = getProgramPaths();
-- PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
-- GCCInstallation.getTriple().str() + "/bin")
-- .str());
-+ // Removed some code here that found programs like ld in "/..//bin"
-
- Distro Distro(D.getVFS());
-
diff --git a/nix/nixcrpkgs/macos/default.nix b/nix/nixcrpkgs/macos/default.nix
deleted file mode 100644
index c82f42d5b..000000000
--- a/nix/nixcrpkgs/macos/default.nix
+++ /dev/null
@@ -1,192 +0,0 @@
-# Note: To reduce clutter here, it might be nice to move clang to
-# `native`, and also make `native` provide a function for building
-# binutils. So clang and binutils recipes could be shared by the
-# different platforms we targets.
-
-{ osx_sdk, native }:
-let
- nixpkgs = native.nixpkgs;
-
- arch = "x86_64";
-
- # was darwin15, changed to darwin so that lld guesses flavor=Darwin correctly
- darwin_name = "darwin15";
-
- macos_version_min = "10.11";
-
- host = "${arch}-apple-${darwin_name}";
-
- os = "macos";
-
- compiler = "clang";
-
- exe_suffix = "";
-
- clang = native.make_derivation rec {
- name = "clang";
-
- version = "5.0.0";
-
- src = nixpkgs.fetchurl {
- url = "https://llvm.org/releases/${version}/cfe-${version}.src.tar.xz";
- sha256 = "0w09s8fn3lkn6i04nj0cisgp821r815fk5b5fjn97xrd371277q1";
- };
-
- llvm_src = nixpkgs.fetchurl {
- url = "https://llvm.org/releases/${version}/llvm-${version}.src.tar.xz";
- sha256 = "1nin64vz21hyng6jr19knxipvggaqlkl2l9jpd5czbc4c2pcnpg3";
- };
-
- # Note: We aren't actually using lld for anything yet.
- lld_src = nixpkgs.fetchurl {
- url = "http://releases.llvm.org/${version}/lld-${version}.src.tar.xz";
- sha256 = "15rqsmfw0jlsri7hszbs8l0j7v1030cy9xvvdb245397llh7k6ir";
- };
-
- patches = [ ./clang_megapatch.patch ];
-
- builder = ./clang_builder.sh;
-
- native_inputs = [ nixpkgs.python2 ];
-
- cmake_flags =
- "-DCMAKE_BUILD_TYPE=Release " +
- # "-DCMAKE_BUILD_TYPE=Debug " +
- "-DLLVM_TARGETS_TO_BUILD=X86\;ARM " +
- "-DLLVM_ENABLE_RTTI=ON " + # ld64 uses dynamic_cast, requiring rtti
- "-DLLVM_ENABLE_ASSERTIONS=OFF";
- };
-
- # Note: There is an alternative version we could use, but it
- # has a copy of LLVM in it: https://github.com/tpoechtrager/apple-libtapi
- tapi = native.make_derivation rec {
- name = "tapi";
- version = "${version0}.${version1}.${version2}";
- version0 = "2";
- version1 = "0";
- version2 = "0";
- src = nixpkgs.fetchurl {
- url = "https://github.com/DavidEGrayson/tapi/archive/f98d0c3.tar.gz";
- sha256 = "0jibz0fsyh47q8y3w6f0qspjh6fhs164rkhjg7x6k7qhlawcdy6g";
- };
- builder = ./tapi_builder.sh;
- native_inputs = [ clang ];
- inherit clang;
- };
-
- cctools_commit = "c1cc758";
- cctools_apple_version = "274.2"; # from README.md
- cctools_port_src = nixpkgs.fetchurl {
- url = "https://github.com/tpoechtrager/cctools-port/archive/${cctools_commit}.tar.gz";
- sha256= "11bfcndzbdmjp2piabyqs34da617fh5fhirqvb9w87anfan15ffa";
- };
-
- ld = native.make_derivation rec {
- name = "cctools-ld64";
- apple_version = cctools_apple_version;
- src = cctools_port_src;
- patches = [
- ./cctools-format.patch
- ./cctools-ld64-registers.patch
- ];
- builder = ./ld_builder.sh;
- native_inputs = [ tapi ];
- inherit host;
- };
-
- ranlib = native.make_derivation rec {
- name = "cctools-ranlib";
- apple_version = cctools_apple_version;
- src = ld.src;
- builder = ./ranlib_builder.sh;
- patches = [
- ./cctools-format.patch
- ./cctools-bytesex.patch
- ];
- inherit host;
- };
-
- ar = native.make_derivation rec {
- name = "cctools-ar";
- apple_version = cctools_apple_version;
- src = cctools_port_src;
- builder = ./ar_builder.sh;
- patches = [
- ./cctools-format.patch
- ./cctools-libstuff-no-error.patch
- ];
- inherit host ranlib;
- };
-
- strip = native.make_derivation rec {
- name = "cctools-strip";
- apple_version = cctools_apple_version;
- src = cctools_port_src;
- builder = ./strip_builder.sh;
- patches = [
- ./cctools-format.patch
- ];
- inherit host;
- };
-
- # TODO: add instructions for building the SDK tarball, probably want a copy of
- # the script from osxcross.
- sdk = native.make_derivation rec {
- name = "macos-sdk";
- builder = ./sdk_builder.sh;
- src = osx_sdk;
- };
-
- toolchain = native.make_derivation rec {
- name = "macos-toolchain";
- builder = ./toolchain_builder.sh;
- src_file = ./wrapper.cpp;
- inherit host clang ld ranlib ar strip sdk;
-
- CXXFLAGS =
- "-std=c++11 " +
- "-Wall " +
- "-I. " +
- "-O2 -g " +
- "-DWRAPPER_OS_VERSION_MIN=\\\"${macos_version_min}\\\" " +
- "-DWRAPPER_HOST=\\\"${host}\\\" " +
- "-DWRAPPER_ARCH=\\\"${arch}\\\" " +
- "-DWRAPPER_SDK_PATH=\\\"${sdk}\\\" " +
- "-DWRAPPER_LINKER_VERSION=\\\"${ld.apple_version}\\\"";
- };
-
- cmake_toolchain = import ../cmake_toolchain {
- cmake_system_name = "Darwin";
- inherit nixpkgs host;
- };
-
- crossenv = {
- is_cross = true;
-
- # Build tools available on the PATH for every derivation.
- default_native_inputs = native.default_native_inputs
- ++ [ clang toolchain native.wrappers ];
-
- # Target info environment variables.
- inherit host arch os compiler exe_suffix macos_version_min;
-
- # CMake toolchain file.
- inherit cmake_toolchain;
-
- # A wide variety of programs and build tools.
- inherit nixpkgs;
-
- # Some native build tools made by nixcrpkgs.
- inherit native;
-
- # License information that should be shipped with any software
- # compiled by this environment.
- global_license_set = { };
-
- # Make it easy to build or refer to the build tools.
- inherit clang tapi ld ranlib ar sdk toolchain strip;
-
- make_derivation = import ../make_derivation.nix crossenv;
- };
-in
- crossenv
diff --git a/nix/nixcrpkgs/macos/gen_sdk_package.sh b/nix/nixcrpkgs/macos/gen_sdk_package.sh
deleted file mode 100755
index 843171ba6..000000000
--- a/nix/nixcrpkgs/macos/gen_sdk_package.sh
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-#
-# Package the OS X SDKs into a tar file to be used by `build.sh`.
-#
-
-# This file comes from the osxcross project and is licensed under the GNU GPLv2.
-# For more information, see the `COPYING` file from:
-# https://github.com/tpoechtrager/osxcross/tree/1a1733a773fe26e7b6c93b16fbf9341f22fac831
-
-export LC_ALL=C
-
-function set_xcode_dir()
-{
- local tmp=$(ls $1 2>/dev/null | grep "^Xcode.*.app" | grep -v "beta" | head -n1)
-
- if [ -z "$tmp" ]; then
- tmp=$(ls $1 2>/dev/null | grep "^Xcode.*.app" | head -n1)
- fi
-
- if [ -n "$tmp" ]; then
- XCODEDIR="$1/$tmp"
- fi
-}
-
-if [ $(uname -s) != "Darwin" ]; then
- if [ -z "$XCODEDIR" ]; then
- echo "This script must be run on OS X" 1>&2
- echo "... Or with XCODEDIR=... on Linux" 1>&2
- exit 1
- else
- case $XCODEDIR in
- /*) ;;
- *) XCODEDIR="$PWD/$XCODEDIR" ;;
- esac
- set_xcode_dir $XCODEDIR
- fi
-else
- set_xcode_dir $(echo /Volumes/Xcode* | tr ' ' '\n' | grep -v "beta" | head -n1)
-
- if [ -z "$XCODEDIR" ]; then
- set_xcode_dir /Applications
-
- if [ -z "$XCODEDIR" ]; then
- set_xcode_dir $(echo /Volumes/Xcode* | tr ' ' '\n' | head -n1)
-
- if [ -z "$XCODEDIR" ]; then
- echo "please mount Xcode.dmg" 1>&2
- exit 1
- fi
- fi
- fi
-fi
-
-if [ ! -d $XCODEDIR ]; then
- echo "cannot find Xcode (XCODEDIR=$XCODEDIR)" 1>&2
- exit 1
-fi
-
-echo -e "found Xcode: $XCODEDIR"
-
-WDIR=$(pwd)
-
-which gnutar &>/dev/null
-
-if [ $? -eq 0 ]; then
- TAR=gnutar
-else
- TAR=tar
-fi
-
-which xz &>/dev/null
-
-if [ $? -eq 0 ]; then
- COMPRESSOR=xz
- PKGEXT="tar.xz"
-else
- COMPRESSOR=bzip2
- PKGEXT="tar.bz2"
-fi
-
-set -e
-
-pushd $XCODEDIR &>/dev/null
-
-if [ -d "Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" ]; then
- pushd "Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" &>/dev/null
-else
- if [ -d "../Packages" ]; then
- pushd "../Packages" &>/dev/null
- elif [ -d "Packages" ]; then
- pushd "Packages" &>/dev/null
- else
- if [ $? -ne 0 ]; then
- echo "Xcode (or this script) is out of date" 1>&2
- echo "trying some magic to find the SDKs anyway ..." 1>&2
-
- SDKDIR=$(find . -name SDKs -type d | grep MacOSX | head -n1)
-
- if [ -z "$SDKDIR" ]; then
- echo "cannot find SDKs!" 1>&2
- exit 1
- fi
-
- pushd $SDKDIR &>/dev/null
- fi
- fi
-fi
-
-SDKS=$(ls | grep "^MacOSX10.*" | grep -v "Patch")
-
-if [ -z "$SDKS" ]; then
- echo "No SDK found" 1>&2
- exit 1
-fi
-
-# Xcode 5
-LIBCXXDIR1="Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1"
-
-# Xcode 6
-LIBCXXDIR2="Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"
-
-# Manual directory
-MANDIR="Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man"
-
-for SDK in $SDKS; do
- echo -n "packaging $(echo "$SDK" | sed -E "s/(.sdk|.pkg)//g") SDK "
- echo "(this may take several minutes) ..."
-
- if [[ $SDK == *.pkg ]]; then
- cp $SDK $WDIR
- continue
- fi
-
- TMP=$(mktemp -d /tmp/XXXXXXXXXXX)
- cp -r $SDK $TMP &>/dev/null || true
-
- pushd $XCODEDIR &>/dev/null
-
- # libc++ headers for C++11/C++14
- if [ -d $LIBCXXDIR1 ]; then
- cp -rf $LIBCXXDIR1 "$TMP/$SDK/usr/include/c++"
- elif [ -d $LIBCXXDIR2 ]; then
- cp -rf $LIBCXXDIR2 "$TMP/$SDK/usr/include/c++"
- fi
-
- if [ -d $MANDIR ]; then
- mkdir -p $TMP/$SDK/usr/share/man
- cp -rf $MANDIR/* $TMP/$SDK/usr/share/man
- fi
-
- popd &>/dev/null
-
- pushd $TMP &>/dev/null
- $TAR -cf - * | $COMPRESSOR -9 -c - > "$WDIR/$SDK.$PKGEXT"
- popd &>/dev/null
-
- rm -rf $TMP
-done
-
-popd &>/dev/null
-popd &>/dev/null
-
-echo ""
-ls -lh | grep MacOSX
diff --git a/nix/nixcrpkgs/macos/ld_builder.sh b/nix/nixcrpkgs/macos/ld_builder.sh
deleted file mode 100644
index 29453d31c..000000000
--- a/nix/nixcrpkgs/macos/ld_builder.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-source $setup
-
-tar -xf $src
-mv cctools-port-* cctools-port
-
-cd cctools-port
-
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-
-# Similar to but not the same as the other _structs.h.
-rm cctools/include/foreign/mach/i386/_structs.h
-
-cd ..
-
-mv cctools-port/cctools/ld64 ld64
-mv cctools-port/cctools/include include
-rm -r cctools-port
-rm -r ld64/src/other
-
-mkdir build
-cd build
-
-CFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-result -Werror -Wfatal-errors -O2 -g -I../ld64/src -I../ld64/src/ld -I../ld64/src/ld/parsers -I../ld64/src/abstraction -I../ld64/src/3rd -I../ld64/src/3rd/include -I../ld64/src/3rd/BlocksRuntime -I../include -I../include/foreign -DTAPI_SUPPORT -DPROGRAM_PREFIX=\\\"$host-\\\" -D__LITTLE_ENDIAN__ -D__private_extern__= $(pkg-config --cflags libtapi)"
-
-CXXFLAGS="-std=gnu++11 $CFLAGS"
-
-LDFLAGS="$(pkg-config --libs libtapi) -ldl -lpthread"
-
-for f in ../ld64/src/ld/*.c ../ld64/src/3rd/*.c; do
- echo "compiling $f"
- eval "gcc -c $CFLAGS $f -o $(basename $f).o"
-done
-
-for f in $(find ../ld64/src -name \*.cpp); do
- echo "compiling $f"
- eval "g++ -c $CXXFLAGS $f -o $(basename $f).o"
-done
-
-g++ *.o $LDFLAGS -o $host-ld
-
-mkdir -p $out/bin
-cp $host-ld $out/bin
diff --git a/nix/nixcrpkgs/macos/ranlib_builder.sh b/nix/nixcrpkgs/macos/ranlib_builder.sh
deleted file mode 100644
index 15c0bd206..000000000
--- a/nix/nixcrpkgs/macos/ranlib_builder.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-source $setup
-
-tar -xf $src
-mv cctools-port-* cctools-port
-
-cd cctools-port
-
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-
-# Similar to but not the same as the other _structs.h.
-rm cctools/include/foreign/mach/i386/_structs.h
-
-# Causes a troublesome undefined reference.
-rm cctools/libstuff/vm_flush_cache.c
-
-cd ..
-
-mv cctools-port/cctools/misc .
-mv cctools-port/cctools/include .
-mv cctools-port/cctools/libstuff .
-rm -r cctools-port
-
-mkdir build
-cd build
-
-CFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-result -Wno-format-overflow -Werror -Wfatal-errors -O2 -g -I../include -I../include/foreign -DPROGRAM_PREFIX=\\\"$host-\\\" -D__LITTLE_ENDIAN__ -D__private_extern__= -D__DARWIN_UNIX03 -DPACKAGE_NAME=\\\"cctools\\\" -DPACKAGE_VERSION=\\\"$apple_version\\\" -DEMULATED_HOST_CPU_TYPE=16777223 -DEMULATED_HOST_CPU_SUBTYPE=3"
-
-CXXFLAGS="-std=gnu++11 $CFLAGS"
-
-LDFLAGS="-ldl"
-
-for f in ../libstuff/*.c ; do
- echo "compiling $f"
- eval "gcc -c $CFLAGS $f -o $(basename $f).o"
-done
-
-eval "gcc $CFLAGS ../misc/libtool.c *.o $LDFLAGS -o $host-libtool"
-eval "gcc $CFLAGS -DRANLIB ../misc/libtool.c *.o $LDFLAGS -o $host-ranlib"
-
-mkdir -p $out/bin
-cp $host-libtool $host-ranlib $out/bin/
-
diff --git a/nix/nixcrpkgs/macos/sdk_builder.sh b/nix/nixcrpkgs/macos/sdk_builder.sh
deleted file mode 100644
index 8a0f872e0..000000000
--- a/nix/nixcrpkgs/macos/sdk_builder.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-source $setup
-
-tar -xf $src
-mv MacOSX*.sdk $out
diff --git a/nix/nixcrpkgs/macos/strip_builder.sh b/nix/nixcrpkgs/macos/strip_builder.sh
deleted file mode 100644
index e69a12949..000000000
--- a/nix/nixcrpkgs/macos/strip_builder.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-source $setup
-
-tar -xf $src
-mv cctools-port-* cctools-port
-
-cd cctools-port
-
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-
-# Similar to but not the same as the other _structs.h.
-rm cctools/include/foreign/mach/i386/_structs.h
-
-# Causes a troublesome undefined reference.
-rm cctools/libstuff/vm_flush_cache.c
-
-cd ..
-
-mv cctools-port/cctools/misc .
-mv cctools-port/cctools/include .
-mv cctools-port/cctools/libstuff .
-rm -r cctools-port
-
-mkdir build
-cd build
-
-CFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-result -Werror -Wfatal-errors -O2 -g -I../include -I../include/foreign -DPROGRAM_PREFIX=\\\"$host-\\\" -D__LITTLE_ENDIAN__ -D__private_extern__= -D__DARWIN_UNIX03 -DPACKAGE_NAME=\\\"cctools\\\" -DPACKAGE_VERSION=\\\"$apple_version\\\" -DEMULATED_HOST_CPU_TYPE=16777223 -DEMULATED_HOST_CPU_SUBTYPE=3"
-
-CXXFLAGS="-std=gnu++11 $CFLAGS"
-
-LDFLAGS="-ldl -lpthread"
-
-for f in ../misc/strip.c ../libstuff/*.c; do
- echo "compiling $f"
- eval "gcc -c $CFLAGS $f -o $(basename $f).o"
-done
-
-gcc *.o $LDFLAGS -o $host-strip
-
-mkdir -p $out/bin
-cp $host-strip $out/bin/
diff --git a/nix/nixcrpkgs/macos/tapi_builder.sh b/nix/nixcrpkgs/macos/tapi_builder.sh
deleted file mode 100644
index d8c15a6a1..000000000
--- a/nix/nixcrpkgs/macos/tapi_builder.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-source $setup
-
-tar -xf $src
-mv tapi-* tapi
-
-mkdir build
-cd build
-
-mkdir -p include/tapi/{Core,Driver}
-cat > include/tapi/Core/ArchitectureConfig.h < include/tapi/Version.inc < $out/lib/pkgconfig/libtapi.pc <
-#include
-#include
-#include
-#include
-#include
-
-int do_exec(const std::string & compiler_name,
- const std::vector & args)
-{
- char ** exec_args = new char *[args.size() + 1];
- size_t i = 0;
- for (const std::string & arg : args)
- {
- exec_args[i++] = (char *)arg.c_str();
- }
- exec_args[i] = nullptr;
-
- execvp(compiler_name.c_str(), exec_args);
-
- int result = errno;
- std::cerr << "execvp failed: " << compiler_name << ": "
- << strerror(result) << std::endl;
- return 1;
-}
-
-int compiler_main(int argc, char ** argv,
- const std::string & compiler_name)
-{
- std::vector args;
-
- args.push_back(compiler_name);
-
- args.push_back("-target");
- args.push_back(WRAPPER_HOST);
-
- args.push_back("-mmacosx-version-min=" WRAPPER_OS_VERSION_MIN);
-
- // The ld64 linker will just assume sdk_version is the same as
- // macosx-version-min if we don't supply it. That probably will not
- // do any harm.
- // args.push_back("-Wl,-sdk_version," WRAPPER_SDK_VERSION);
-
- // Suppress warnings about the -Wl arguments not being used when we're just
- // compiling and not linking.
- args.push_back("-Wno-unused-command-line-argument");
-
- args.push_back("--sysroot");
- args.push_back(WRAPPER_SDK_PATH);
-
- // Causes clang to pass -demangle, -lto_library, -no_deduplicate, and other
- // options that could be useful. Version 274.2 is the version number used here:
- // https://github.com/tpoechtrager/osxcross/blob/474f359/build.sh#L140
- if (WRAPPER_LINKER_VERSION[0])
- {
- args.push_back("-mlinker-version=" WRAPPER_LINKER_VERSION);
- }
-
- if (compiler_name == "clang++")
- {
- args.push_back("-stdlib=libc++");
- args.push_back("-cxx-isystem");
- args.push_back(WRAPPER_SDK_PATH "/usr/include/c++/v1");
- }
-
- for (int i = 1; i < argc; ++i)
- {
- args.push_back(argv[i]);
- }
-
- return do_exec(compiler_name, args);
-}
-
-int c_compiler_main(int argc, char ** argv)
-{
- return compiler_main(argc, argv, "clang");
-}
-
-int cxx_compiler_main(int argc, char ** argv)
-{
- return compiler_main(argc, argv, "clang++");
-}
-
-int wrapper_main(int argc, char ** argv)
-{
- std::cout <<
- "host: " WRAPPER_HOST "\n"
- "path: " WRAPPER_PATH "\n"
- "sdk_path: " WRAPPER_SDK_PATH "\n";
- return 0;
-}
-
-struct {
- const char * name;
- int (*main_func)(int argc, char ** argv);
-} prgms[] = {
- { WRAPPER_HOST "-gcc", c_compiler_main },
- { WRAPPER_HOST "-cc", c_compiler_main },
- { WRAPPER_HOST "-clang", c_compiler_main },
- { WRAPPER_HOST "-g++", cxx_compiler_main },
- { WRAPPER_HOST "-c++", cxx_compiler_main },
- { WRAPPER_HOST "-clang++", cxx_compiler_main },
- { WRAPPER_HOST "-wrapper", wrapper_main },
- { nullptr, nullptr },
-};
-
-const char * get_program_name(const char * path)
-{
- const char * p = strrchr(path, '/');
- if (p) { path = p + 1; }
- return path;
-}
-
-int main(int argc, char ** argv)
-{
- // We only want this wrapper and the compiler it invokes to access a certain
- // set of tools that are determined at build time. Ignore whatever is on the
- // user's path and use the path specified by our Nix expression instead.
- int result = setenv("PATH", WRAPPER_PATH, 1);
- if (result)
- {
- std::cerr << "wrapper failed to set PATH" << std::endl;
- return 1;
- }
-
- std::string program_name = get_program_name(argv[0]);
-
- for (auto * p = prgms; p->name; p++)
- {
- if (program_name == p->name)
- {
- return p->main_func(argc, argv);
- }
- }
-
- std::cerr << "compiler wrapper invoked with unknown program name: "
- << argv[0] << std::endl;
- return 1;
-}
diff --git a/nix/nixcrpkgs/make_derivation.nix b/nix/nixcrpkgs/make_derivation.nix
deleted file mode 100644
index af74ee91f..000000000
--- a/nix/nixcrpkgs/make_derivation.nix
+++ /dev/null
@@ -1,91 +0,0 @@
-env: attrs:
-
-let
- nixpkgs = env.nixpkgs;
-
- native_inputs =
- (attrs.native_inputs or [])
- ++ env.default_native_inputs;
-
- cross_inputs = (attrs.cross_inputs or []);
-
- path_join = builtins.concatStringsSep ":";
-
- path_map = dir: inputs: (map (i: "${i}" + dir) inputs);
-
- # We can't just set PATH in our derivation because nix-shell will make the
- # derivation's PATH override the system PATH, meaning we can't use utilities
- # like "git" or "which" form the host system. So we set _PATH instead, and we
- # use a setup script ($setup) that copies _PATH to PATH. And we provide
- # $stdenv/setup so that nix-shell can find our setup script.
- #
- # nixcrpkgs does not expose its users to this mess. The user can specify a
- # PATH if they want, and it will be automatically moved to _PATH in the
- # derivation.
- filtered_attrs = nixpkgs.lib.filterAttrs (n: v: n != "PATH") attrs;
-
- path_attrs = {
- _PATH = path_join (
- (if attrs ? PATH then [attrs.PATH] else []) ++
- (path_map "/bin" native_inputs)
- );
- };
-
- default_attrs = {
- system = builtins.currentSystem;
-
- SHELL = "${nixpkgs.bashInteractive}/bin/bash";
-
- setup = ./pretend_stdenv/setup;
-
- # This allows nix-shell to find our setup script.
- stdenv = ./pretend_stdenv;
-
- PKG_CONFIG_PATH = path_join (
- (if attrs ? PKG_CONFIG_PATH then [attrs.PKG_CONFIG_PATH] else []) ++
- (path_map "/lib/pkgconfig" native_inputs)
- );
- };
-
- cross_attrs = if !env.is_cross then {} else {
- NIXCRPKGS = true;
-
- inherit (env) host arch os exe_suffix;
- inherit (env) cmake_toolchain;
-
- PKG_CONFIG_CROSS_PATH = path_join (
- (if attrs ? PKG_CONFIG_CROSS_PATH then [attrs.PKG_CONFIG_CROSS_PATH] else []) ++
- (path_map "/lib/pkgconfig" cross_inputs)
- );
-
- CMAKE_CROSS_PREFIX_PATH = path_join (
- (if attrs ? CMAKE_CROSS_PREFIX_PATH then [attrs.CMAKE_CROSS_PREFIX_PATH] else []) ++
- cross_inputs
- );
- };
-
- name_attrs = {
- name = (attrs.name or "package")
- + (if env.is_cross then "-${env.host}" else "");
- };
-
- builder_attrs =
- if builtins.isAttrs attrs.builder then
- if attrs.builder ? ruby then
- {
- builder = "${nixpkgs.ruby}/bin/ruby";
- args = [attrs.builder.ruby];
- }
- else
- attrs.builder
- else
- rec {
- builder = "${nixpkgs.bashInteractive}/bin/bash";
- args = ["-ue" attrs.builder];
- };
-
- drv_attrs = default_attrs // cross_attrs
- // filtered_attrs // name_attrs // builder_attrs // path_attrs;
-
-in
- derivation drv_attrs
diff --git a/nix/nixcrpkgs/mingw-w64/binutils/builder.sh b/nix/nixcrpkgs/mingw-w64/binutils/builder.sh
deleted file mode 100644
index 8795ea0ce..000000000
--- a/nix/nixcrpkgs/mingw-w64/binutils/builder.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-source $stdenv/setup
-
-unset CC CXX CFLAGS LDFLAGS LD AR AS RANLIB SIZE STRINGS NM STRIP OBJCOPY
-
-tar -xf $src
-
-cd binutils-$version
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-
-# Clear the default library search path (noSysDirs)
-echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt
-
-cd ..
-
-mkdir build
-cd build
-
-../binutils-$version/configure --prefix=$out $configure_flags
-
-make
-
-make install
-
diff --git a/nix/nixcrpkgs/mingw-w64/binutils/default.nix b/nix/nixcrpkgs/mingw-w64/binutils/default.nix
deleted file mode 100644
index 1a52fd226..000000000
--- a/nix/nixcrpkgs/mingw-w64/binutils/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ native, host }:
-
-native.make_derivation rec {
- name = "binutils-${version}-${host}";
-
- version = "2.27";
-
- src = native.nixpkgs.fetchurl {
- url = "mirror://gnu/binutils/binutils-${version}.tar.bz2";
- sha256 = "125clslv17xh1sab74343fg6v31msavpmaa1c1394zsqa773g5rn";
- };
-
- patches = [
- ./deterministic.patch
- ];
-
- build_inputs = [ native.nixpkgs.bison native.nixpkgs.zlib ];
-
- configure_flags =
- "--target=${host} " +
- "--enable-shared " +
- "--enable-deterministic-archives " +
- "--disable-werror ";
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/mingw-w64/binutils/deterministic.patch b/nix/nixcrpkgs/mingw-w64/binutils/deterministic.patch
deleted file mode 100644
index 0a264b35c..000000000
--- a/nix/nixcrpkgs/mingw-w64/binutils/deterministic.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Make binutils output deterministic by default.
---- orig/ld/ldlang.c
-+++ new/ld/ldlang.c
-@@ -3095,6 +3095,8 @@
- ldfile_output_machine))
- einfo (_("%P%F:%s: can not set architecture: %E\n"), name);
-
-+ link_info.output_bfd->flags |= BFD_DETERMINISTIC_OUTPUT;
-+
- link_info.hash = bfd_link_hash_table_create (link_info.output_bfd);
- if (link_info.hash == NULL)
- einfo (_("%P%F: can not create hash table: %E\n"));
diff --git a/nix/nixcrpkgs/mingw-w64/builder.sh b/nix/nixcrpkgs/mingw-w64/builder.sh
deleted file mode 100644
index 65c9e68e3..000000000
--- a/nix/nixcrpkgs/mingw-w64/builder.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-source $setup
-
-cp -r $src mingw-w64
-chmod -R u+w mingw-w64
-
-cd mingw-w64
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-cd ..
-
-if [ -n "$just_headers" ]; then
- mkdir build_headers
- cd build_headers
- ../mingw-w64/mingw-w64-headers/configure --prefix=$out $configure_flags
- make
- make install
- cd ..
-else
- mkdir build_crt_and_headers
- cd build_crt_and_headers
- ../mingw-w64/configure --prefix=$out $configure_flags
- make
- make install
- cd ..
-
- mkdir build_winpthreads
- cd build_winpthreads
- LDFLAGS="-L${out}/lib" ../mingw-w64/mingw-w64-libraries/winpthreads/configure \
- --host=$host --prefix=$out --disable-shared --enable-static
- make
- make install
- cd ..
-fi
diff --git a/nix/nixcrpkgs/mingw-w64/default.nix b/nix/nixcrpkgs/mingw-w64/default.nix
deleted file mode 100644
index 691c27154..000000000
--- a/nix/nixcrpkgs/mingw-w64/default.nix
+++ /dev/null
@@ -1,106 +0,0 @@
-{ native, arch }:
-
-let
- nixpkgs = native.nixpkgs;
-
- host = "${arch}-w64-mingw32";
-
- binutils = import ./binutils { inherit native host; };
-
- mingw-w64_info = rec {
- name = "mingw-w64-${version}";
- version = "2017-08-03";
- src = nixpkgs.fetchgit {
- url = "git://git.code.sf.net/p/mingw-w64/mingw-w64";
- rev = "6de0055f99ed447ec63c1a650a3830f266a808bd";
- sha256 = "1830rcd0vsbvpr5m1lrabcqh12qrw1flq333b8xrs5b3n542xy2i";
- };
- patches = [
- ./usb.patch
- ./guid-selectany.patch
- ];
- configure_flags = "--enable-secure-api --enable-idl";
- };
-
- mingw-w64_headers = native.make_derivation {
- name = "${mingw-w64_info.name}-headers";
- inherit host;
- inherit (mingw-w64_info) src patches configure_flags;
- builder = ./builder.sh;
- just_headers = true;
- };
-
- gcc_stage_1 = import ./gcc {
- stage = 1;
- libc = mingw-w64_headers;
- inherit native arch binutils;
- };
-
- mingw-w64_full = native.make_derivation {
- name = "${mingw-w64_info.name}-${host}";
- inherit host;
- inherit (mingw-w64_info) version src patches;
- configure_flags =
- "--host=${host} " +
- "--disable-shared --enable-static " +
- mingw-w64_info.configure_flags;
- native_inputs = [ binutils gcc_stage_1 ];
- builder = ./builder.sh;
- just_headers = false;
- };
-
- gcc = import ./gcc {
- libc = mingw-w64_full;
- inherit native arch binutils;
- };
-
- license = native.make_derivation {
- name = "${mingw-w64_info.name}-license";
- inherit (mingw-w64_info) version src;
- gcc_src = gcc.src;
- builder = ./license_builder.sh;
- };
-
- global_license_set = { _global = license; };
-
- cmake_toolchain = import ../cmake_toolchain {
- cmake_system_name = "Windows";
- inherit nixpkgs host;
- };
-
- os = "windows";
-
- compiler = "gcc";
-
- exe_suffix = ".exe";
-
- crossenv = {
- is_cross = true;
-
- default_native_inputs = native.default_native_inputs
- ++ [ gcc binutils native.pkgconf native.wrappers ];
-
- # Target info variables.
- inherit host arch os compiler exe_suffix;
-
- # CMake toolchain file.
- inherit cmake_toolchain;
-
- # A wide variety of programs and build tools.
- inherit nixpkgs;
-
- # Some native build tools made by nixcrpkgs.
- inherit native;
-
- # License information that should be shipped with any software compiled by
- # this environment.
- inherit global_license_set;
-
- # Make it easy to build or refer to the build tools.
- inherit gcc binutils mingw-w64_full mingw-w64_info mingw-w64_headers gcc_stage_1;
- mingw-w64 = mingw-w64_full;
-
- make_derivation = import ../make_derivation.nix crossenv;
- };
-in
- crossenv
diff --git a/nix/nixcrpkgs/mingw-w64/gcc/builder.sh b/nix/nixcrpkgs/mingw-w64/gcc/builder.sh
deleted file mode 100644
index ae8462f8d..000000000
--- a/nix/nixcrpkgs/mingw-w64/gcc/builder.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-source $setup
-
-tar -xf $src
-
-cd gcc-$version
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-
-# Prevents a name collision with mingw-w64 headers.
-# See: https://gcc.gnu.org/ml/gcc-help/2017-05/msg00121.html
-cd libstdc++-v3
-sed -i 's/\b__in\b/___in/g' \
- include/ext/random.tcc \
- include/ext/vstring.tcc \
- include/std/utility \
- include/std/tuple \
- include/std/istream \
- include/tr2/bool_set.tcc \
- include/tr2/bool_set \
- include/bits/basic_string.h \
- include/bits/basic_string.tcc \
- include/bits/locale_facets.h \
- include/bits/istream.tcc \
- include/tr1/utility \
- include/tr1/tuple
-sed -i 's/\b__out\b/___out/g' \
- include/ext/random.tcc \
- include/ext/algorithm \
- include/ext/pb_ds/detail/debug_map_base.hpp \
- include/std/ostream \
- include/std/thread \
- include/tr2/bool_set \
- include/bits/ostream.tcc \
- include/bits/regex.tcc \
- include/bits/stl_algo.h \
- include/bits/locale_conv.h \
- include/bits/regex.h \
- include/bits/ostream_insert.h \
- include/tr1/regex \
- include/parallel/algo.h \
- include/parallel/set_operations.h \
- include/parallel/multiway_merge.h \
- include/parallel/unique_copy.h \
- include/experimental/algorithm \
- config/locale/dragonfly/c_locale.h \
- config/locale/generic/c_locale.h \
- config/locale/gnu/c_locale.h
-
-cd ../..
-
-mkdir build
-cd build
-
-../gcc-$version/configure --prefix=$out $configure_flags
-
-make $make_flags
-
-make $install_targets
-
-# Remove "install-tools" so we don't have a reference to bash.
-rm -r "$out/libexec/gcc/$target/$version/install-tools/"
diff --git a/nix/nixcrpkgs/mingw-w64/gcc/cppdefault.patch b/nix/nixcrpkgs/mingw-w64/gcc/cppdefault.patch
deleted file mode 100644
index adc979e68..000000000
--- a/nix/nixcrpkgs/mingw-w64/gcc/cppdefault.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-cppdefault.c If CROSS_DIRECTORY_STRUCTURE is defined, don't use the native
-system header dir; use CROSS_INCLUDE_DIR instead if it is defined.
-
-This just makes GCC's behavior match the documentation for the
-"--with-sysroot" configure option, which corresponds to
-TARGET_SYSTEM_ROOT. The documentation says that if you specify
-directories with --with-sysroot and --with-native-system-header-dir,
-then the compilter will concatenate the the two together (with the
-sysroot coming first) and search that directory instead of the default
-/usr/include.
-
-The concatenation is done with this line in configure.ac:
-
- CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
-
-Then Makefile.in sets the preprocessor macro CROSS_INCLUDE_DIR equal to
-CROSS_SYSTEM_HEADER_DIR.
-
-This patch reverts one of the changes from Daniel Jacobowitz on 2013-02-13.
-https://github.com/gcc-mirror/gcc/commit/17acc97af91fbd116659301b0b7d4965ecc1631d
-
---- gcc-5.4.0/gcc/cppdefault.c
-+++ gcc-5.4.0/gcc/cppdefault.c
-@@ -28,9 +28,9 @@
- #define NATIVE_SYSTEM_HEADER_COMPONENT 0
- #endif
-
--#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
-+#if defined (CROSS_DIRECTORY_STRUCTURE)
- # undef LOCAL_INCLUDE_DIR
- # undef NATIVE_SYSTEM_HEADER_DIR
- #else
- # undef CROSS_INCLUDE_DIR
- #endif
-
diff --git a/nix/nixcrpkgs/mingw-w64/gcc/default.nix b/nix/nixcrpkgs/mingw-w64/gcc/default.nix
deleted file mode 100644
index 8a5a46b7b..000000000
--- a/nix/nixcrpkgs/mingw-w64/gcc/default.nix
+++ /dev/null
@@ -1,103 +0,0 @@
-{ native, arch, stage ? 2, binutils, libc }:
-
-let
- nixpkgs = native.nixpkgs;
- isl = nixpkgs.isl_0_14;
- inherit (nixpkgs) stdenv lib fetchurl;
- inherit (nixpkgs) gettext gmp libmpc libelf mpfr texinfo which zlib;
-
- stageName = if stage == 1 then "-stage1"
- else assert stage == 2; "";
-in
-
-native.make_derivation rec {
- name = "gcc-${version}-${target}${stageName}";
-
- target = "${arch}-w64-mingw32";
-
- version = "6.3.0";
-
- src = fetchurl {
- url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
- sha256 = "17xjz30jb65hcf714vn9gcxvrrji8j20xm7n33qg1ywhyzryfsph";
- };
-
- builder = ./builder.sh;
-
- patches = [
- # TODO: combine three of these patches into one called search-dirs.patch
- ./mingw-search-paths.patch
- ./use-source-date-epoch.patch
- ./libstdc++-target.patch
- ./no-sys-dirs.patch
- ./cppdefault.patch
-
- # Fix a compiler error in GCC's ubsan.c: ISO C++ forbids comparison
- # between pointer and integer.
- ./ubsan.patch
- ];
-
- # TODO: can probably remove libelf here, and might as well remove
- # the libraries that are given to GCC as configure flags
- # TODO: just let GCC use its own gettext (intl)
- native_inputs = [
- binutils gettext libelf texinfo which zlib
- ];
-
- configure_flags =
- "--target=${arch}-w64-mingw32 " +
- "--with-sysroot=${libc} " +
- "--with-native-system-header-dir=/include " +
- "--with-gnu-as " +
- "--with-gnu-ld " +
- "--with-as=${binutils}/bin/${arch}-w64-mingw32-as " +
- "--with-ld=${binutils}/bin/${arch}-w64-mingw32-ld " +
- "--with-isl=${isl} " +
- "--with-gmp-include=${gmp.dev}/include " +
- "--with-gmp-lib=${gmp.out}/lib " +
- "--with-mpfr-include=${mpfr.dev}/include " +
- "--with-mpfr-lib=${mpfr.out}/lib " +
- "--with-mpc=${libmpc} " +
- "--with-zlib-include=${zlib.dev}/include " +
- "--with-zlib-lib=${zlib.out}/lib " +
- "--enable-lto " +
- "--enable-plugin " +
- "--enable-static " +
- "--enable-sjlj-exceptions " +
- "--enable-__cxa_atexit " +
- "--enable-long-long " +
- "--with-dwarf2 " +
- "--enable-fully-dynamic-string " +
- (if stage == 1 then
- "--enable-languages=c " +
- "--enable-threads=win32 "
- else
- "--enable-languages=c,c++ " +
- "--enable-threads=posix "
- ) +
- "--without-included-gettext " +
- "--disable-libstdcxx-pch " +
- "--disable-nls " +
- "--disable-shared " +
- "--disable-multilib " +
- "--disable-libssp " +
- "--disable-win32-registry " +
- "--disable-bootstrap"; # TODO: not needed, --disable-bootstrap
- # only applies to native builds
-
- make_flags =
- if stage == 1 then
- ["all-gcc" "all-target-libgcc"]
- else
- [];
-
- install_targets =
- if stage == 1 then
- ["install-gcc install-target-libgcc"]
- else
- ["install-strip"];
-
- hardeningDisable = [ "format" ];
-}
-
-# TODO: why is GCC providing a fixed limits.h?
diff --git a/nix/nixcrpkgs/mingw-w64/gcc/libstdc++-target.patch b/nix/nixcrpkgs/mingw-w64/gcc/libstdc++-target.patch
deleted file mode 100644
index fb622b395..000000000
--- a/nix/nixcrpkgs/mingw-w64/gcc/libstdc++-target.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Patch to make the target libraries 'configure' scripts find the proper CPP.
-I noticed that building the mingw32 cross compiler.
-Looking at the build script for mingw in archlinux, I think that only nixos
-needs this patch. I don't know why.
-diff --git a/Makefile.in b/Makefile.in
-index 93f66b6..d691917 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -266,6 +266,7 @@ BASE_TARGET_EXPORTS = \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
-+ CPP="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
- CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-@@ -291,11 +292,13 @@ BASE_TARGET_EXPORTS = \
- RAW_CXX_TARGET_EXPORTS = \
- $(BASE_TARGET_EXPORTS) \
- CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-- CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
-+ CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
-+ CXXCPP="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
-
- NORMAL_TARGET_EXPORTS = \
- $(BASE_TARGET_EXPORTS) \
-- CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
-+ CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
-+ CXXCPP="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
-
- # Where to find GMP
- HOST_GMPLIBS = @gmplibs@
diff --git a/nix/nixcrpkgs/mingw-w64/gcc/mingw-search-paths.patch b/nix/nixcrpkgs/mingw-w64/gcc/mingw-search-paths.patch
deleted file mode 100644
index c79730e10..000000000
--- a/nix/nixcrpkgs/mingw-w64/gcc/mingw-search-paths.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Make it so GCC does not force us to have a "mingw" symlink.
-
---- gcc-6.3.0-orig/gcc/config/i386/mingw32.h
-+++ gcc-6.3.0/gcc/config/i386/mingw32.h
-@@ -163,3 +163,3 @@
- #ifndef STANDARD_STARTFILE_PREFIX_1
--#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/"
-+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
- #endif
-@@ -172,3 +172,3 @@
- #undef NATIVE_SYSTEM_HEADER_DIR
--#define NATIVE_SYSTEM_HEADER_DIR "/mingw/include"
-+#define NATIVE_SYSTEM_HEADER_DIR "/include"
-
diff --git a/nix/nixcrpkgs/mingw-w64/gcc/no-sys-dirs.patch b/nix/nixcrpkgs/mingw-w64/gcc/no-sys-dirs.patch
deleted file mode 100644
index 36df51904..000000000
--- a/nix/nixcrpkgs/mingw-w64/gcc/no-sys-dirs.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -ru -x '*~' gcc-4.8.3-orig/gcc/cppdefault.c gcc-4.8.3/gcc/cppdefault.c
---- gcc-4.8.3-orig/gcc/cppdefault.c 2013-01-10 21:38:27.000000000 +0100
-+++ gcc-4.8.3/gcc/cppdefault.c 2014-08-18 16:20:32.893944536 +0200
-@@ -35,6 +35,8 @@
- # undef CROSS_INCLUDE_DIR
- #endif
-
-+#undef LOCAL_INCLUDE_DIR
-+
- const struct default_include cpp_include_defaults[]
- #ifdef INCLUDE_DEFAULTS
- = INCLUDE_DEFAULTS;
-diff -ru -x '*~' gcc-4.8.3-orig/gcc/gcc.c gcc-4.8.3/gcc/gcc.c
---- gcc-4.8.3-orig/gcc/gcc.c 2014-03-23 12:30:57.000000000 +0100
-+++ gcc-4.8.3/gcc/gcc.c 2014-08-18 13:19:32.689201690 +0200
-@@ -1162,10 +1162,10 @@
- /* Default prefixes to attach to command names. */
-
- #ifndef STANDARD_STARTFILE_PREFIX_1
--#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
-+#define STANDARD_STARTFILE_PREFIX_1 ""
- #endif
- #ifndef STANDARD_STARTFILE_PREFIX_2
--#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
-+#define STANDARD_STARTFILE_PREFIX_2 ""
- #endif
-
- #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
diff --git a/nix/nixcrpkgs/mingw-w64/gcc/ubsan.patch b/nix/nixcrpkgs/mingw-w64/gcc/ubsan.patch
deleted file mode 100644
index 0ad3b7991..000000000
--- a/nix/nixcrpkgs/mingw-w64/gcc/ubsan.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- gcc-6.3.0-orig/gcc/ubsan.c
-+++ gcc-6.3.0/gcc/ubsan.c
-@@ -1471,7 +1471,7 @@
-
- expanded_location xloc = expand_location (loc);
- if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
-- || xloc.file == '\0' || xloc.file[0] == '\xff'
-+ || xloc.file == NULL || xloc.file[0] == '\xff'
- || xloc.file[1] == '\xff')
- return false;
diff --git a/nix/nixcrpkgs/mingw-w64/gcc/use-source-date-epoch.patch b/nix/nixcrpkgs/mingw-w64/gcc/use-source-date-epoch.patch
deleted file mode 100644
index 65a5ab028..000000000
--- a/nix/nixcrpkgs/mingw-w64/gcc/use-source-date-epoch.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02210.html
-
-diff --git a/libcpp/macro.c b/libcpp/macro.c
-index 1e0a0b5..a52e3cb 100644
---- a/libcpp/macro.c
-+++ b/libcpp/macro.c
-@@ -349,14 +349,38 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
- slow on some systems. */
- time_t tt;
- struct tm *tb = NULL;
-+ char *source_date_epoch;
-
-- /* (time_t) -1 is a legitimate value for "number of seconds
-- since the Epoch", so we have to do a little dance to
-- distinguish that from a genuine error. */
-- errno = 0;
-- tt = time(NULL);
-- if (tt != (time_t)-1 || errno == 0)
-- tb = localtime (&tt);
-+ /* Allow the date and time to be set externally by an exported
-+ environment variable to enable reproducible builds. */
-+ source_date_epoch = getenv ("SOURCE_DATE_EPOCH");
-+ if (source_date_epoch)
-+ {
-+ errno = 0;
-+ tt = (time_t) strtol (source_date_epoch, NULL, 10);
-+ if (errno == 0)
-+ {
-+ tb = gmtime (&tt);
-+ if (tb == NULL)
-+ cpp_error (pfile, CPP_DL_ERROR,
-+ "SOURCE_DATE_EPOCH=\"%s\" is not a valid date",
-+ source_date_epoch);
-+ }
-+ else
-+ cpp_error (pfile, CPP_DL_ERROR,
-+ "SOURCE_DATE_EPOCH=\"%s\" is not a valid number",
-+ source_date_epoch);
-+ }
-+ else
-+ {
-+ /* (time_t) -1 is a legitimate value for "number of seconds
-+ since the Epoch", so we have to do a little dance to
-+ distinguish that from a genuine error. */
-+ errno = 0;
-+ tt = time(NULL);
-+ if (tt != (time_t)-1 || errno == 0)
-+ tb = localtime (&tt);
-+ }
-
- if (tb)
- {
diff --git a/nix/nixcrpkgs/mingw-w64/guid-selectany.patch b/nix/nixcrpkgs/mingw-w64/guid-selectany.patch
deleted file mode 100644
index b495a67b5..000000000
--- a/nix/nixcrpkgs/mingw-w64/guid-selectany.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 339371eafd2fb2bcbf8b0a08e5328fc7c16b892f Mon Sep 17 00:00:00 2001
-From: David Grayson
-Date: Thu, 4 May 2017 06:41:28 -0700
-Subject: [PATCH] guiddef.h: Use __declspec(selectany) on GUID declarations.
-
-If __declspec(selectany) is not used on the prototype but later used
-on a definition, GCC 6+ seems to ignore it, and you can get
-multiple-definition errors at link time.
-
-That situation can arise in code like Microsoft's usbview utility that
-has multiple translation units including the following headers in this
-order: windows.h, initguid.h, winioctl.h.
-
-However, this patch cannot be upstreamed to mingw-w64 because it
-breaks older versions of GCC, and MSDN says that putting selectany on
-a declaration is "incorrect". Once GCC is fixed, we can remove this
-patch.
----
- mingw-w64-headers/include/guiddef.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/mingw-w64-headers/include/guiddef.h b/mingw-w64-headers/include/guiddef.h
-index 9ecea3e2..6c9444cf 100644
---- a/mingw-w64-headers/include/guiddef.h
-+++ b/mingw-w64-headers/include/guiddef.h
-@@ -58,8 +58,7 @@ __extension__ template const GUID &__mingw_uuidof();
- #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
- #endif
- #else
--/* __declspec(selectany) must be applied to initialized objects on GCC 5 hence must not be used here. */
--#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name
-+#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name
- #endif
-
- #define DEFINE_OLEGUID(name, l, w1, w2) DEFINE_GUID (name, l, w1, w2, 0xc0, 0, 0, 0, 0, 0, 0, 0x46)
---
-2.12.1
-
diff --git a/nix/nixcrpkgs/mingw-w64/license_builder.sh b/nix/nixcrpkgs/mingw-w64/license_builder.sh
deleted file mode 100644
index beb53ee27..000000000
--- a/nix/nixcrpkgs/mingw-w64/license_builder.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-source $setup
-
-tar -xf $gcc_src
-mv gcc-* gcc
-
-license_gcc=$(cat gcc/COPYING3.LIB)
-cd $src
-license_runtime=$(cat COPYING.MinGW-w64-runtime/COPYING.MinGW-w64-runtime.txt)
-license_winpthread=$(cat mingw-w64-libraries/winpthreads/COPYING)
-
-cat > $out <
- The third-party software included with this software may
- have been patched or otherwise modified.
-
-
-GCC run-time libraries
-
-
- The GCC run-time libraries libgcc and libstdc++ are licensed under the GNU
- General Public License Version 3 (GPLv3) as shown below.
-
-
-
-$license_gcc
-
-
-MinGW-w64 runtime components
-
-
-$license_runtime
-
-
-
- libwinpthread also comes from the mingw-w64 project and its license is below.
-
-
-
-$license_winpthread
-
-
-EOF
diff --git a/nix/nixcrpkgs/mingw-w64/usb.patch b/nix/nixcrpkgs/mingw-w64/usb.patch
deleted file mode 100644
index 768c4a979..000000000
--- a/nix/nixcrpkgs/mingw-w64/usb.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-diff --git a/mingw-w64-headers/include/usbspec.h b/mingw-w64-headers/include/usbspec.h
-index 86557d8d..97ab5f3b 100644
---- a/mingw-w64-headers/include/usbspec.h
-+++ b/mingw-w64-headers/include/usbspec.h
-@@ -213,6 +213,13 @@ typedef struct _USB_BOS_DESCRIPTOR {
- #define USB_DEVICE_CAPABILITY_USB20_EXTENSION 0x02
- #define USB_DEVICE_CAPABILITY_SUPERSPEED_USB 0x03
- #define USB_DEVICE_CAPABILITY_CONTAINER_ID 0x04
-+#define USB_DEVICE_CAPABILITY_PLATFORM 0x05
-+#define USB_DEVICE_CAPABILITY_POWER_DELIVERY 0x06
-+#define USB_DEVICE_CAPABILITY_BATTERY_INFO 0x07
-+#define USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT 0x08
-+#define USB_DEVICE_CAPABILITY_PD_PROVIDER_PORT 0x09
-+#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB 0x0A
-+#define USB_DEVICE_CAPABILITY_PRECISION_TIME_MEASUREMENT 0x0B
- #define USB_DEVICE_CAPABILITY_BILLBOARD 0x0D
-
- typedef struct _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR {
-@@ -666,6 +673,54 @@ typedef struct _USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR {
- ULONG dwBytesPerInterval;
- } USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR,*PUSB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR;
-
-+typedef union _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED {
-+ ULONG AsUlong32;
-+ struct {
-+ ULONG SublinkSpeedAttrID:4;
-+ ULONG LaneSpeedExponent:2;
-+ ULONG SublinkTypeMode:1;
-+ ULONG SublinkTypeDir:1;
-+ ULONG Reserved:6;
-+ ULONG LinkProtocol:2;
-+ ULONG LaneSpeedMantissa:16;
-+ };
-+} USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED, *PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED;
-+
-+typedef struct _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR {
-+ UCHAR bLength;
-+ UCHAR bDescriptorType;
-+ UCHAR bDevCapabilityType;
-+ UCHAR bReserved;
-+ union {
-+ ULONG AsUlong;
-+ struct {
-+ ULONG SublinkSpeedAttrCount:5;
-+ ULONG SublinkSpeedIDCount:4;
-+ ULONG Reserved:23;
-+ };
-+ } bmAttributes;
-+ union {
-+ USHORT AsUshort;
-+ struct {
-+ USHORT SublinkSpeedAttrID:4;
-+ USHORT Reserved:4;
-+ USHORT MinRxLaneCount:4;
-+ USHORT MinTxLaneCount:4;
-+ };
-+ } wFunctionalitySupport;
-+ USHORT wReserved;
-+ USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED bmSublinkSpeedAttr[1];
-+} USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR,*PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR;
-+
-+typedef struct _USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR {
-+ UCHAR bLength;
-+ UCHAR bDescriptorType;
-+ UCHAR bDevCapabilityType;
-+ UCHAR bReserved;
-+ GUID PlatformCapabilityUuid;
-+ UCHAR CapabililityData[1];
-+} USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR,*PUSB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR;
-+
- #include
-
- #endif
diff --git a/nix/nixcrpkgs/native/default.nix b/nix/nixcrpkgs/native/default.nix
deleted file mode 100644
index e56c5ce5c..000000000
--- a/nix/nixcrpkgs/native/default.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{ nixpkgs }:
-
-let
- native_base = {
- inherit nixpkgs;
-
- is_cross = false;
-
- default_native_inputs = [
- nixpkgs.bashInteractive
- nixpkgs.binutils
- (nixpkgs.binutils-unwrapped or nixpkgs.binutils)
- nixpkgs.bzip2
- nixpkgs.cmake
- nixpkgs.coreutils
- nixpkgs.diffutils
- nixpkgs.findutils
- nixpkgs.gcc
- nixpkgs.gawk
- nixpkgs.gnumake
- nixpkgs.gnugrep
- nixpkgs.gnused
- nixpkgs.gnutar
- nixpkgs.gzip
- nixpkgs.ninja
- nixpkgs.patch
- nixpkgs.which
- nixpkgs.xz
- ];
-
- make_derivation = import ../make_derivation.nix native_base;
- };
-
- pkgconf = import ./pkgconf { env = native_base; };
-
- wrappers = import ./wrappers { env = native_base; };
-
- gnu_config = nixpkgs.fetchgit {
- url = "https://git.savannah.gnu.org/git/config.git";
- rev = "81497f5aaf50a12a9fe0cba30ef18bda46b62959";
- sha256 = "1fq0nki2118zwbc8rdkqx5i04lbfw7gqbsyf5bscg5im6sfphq1d";
- };
-
- native = native_base // {
- default_native_inputs = native_base.default_native_inputs ++ [
- pkgconf
- ];
-
- inherit pkgconf wrappers gnu_config;
-
- make_derivation = import ../make_derivation.nix native;
- };
-
-in native
diff --git a/nix/nixcrpkgs/native/pkgconf/builder.sh b/nix/nixcrpkgs/native/pkgconf/builder.sh
deleted file mode 100644
index e58ccf98a..000000000
--- a/nix/nixcrpkgs/native/pkgconf/builder.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-source $setup
-
-tar -xf $src
-
-mkdir build
-
-cd build
-
-../pkgconf-$version/configure \
- --prefix=$out \
- --with-system-libdir=/no-system-libdir/ \
- --with-system-includedir=/no-system-includedir/
-
-make
-
-make install
-
-ln -s $out/bin/pkgconf $out/bin/pkg-config
-
-mkdir $out/license
-cp ../pkgconf-$version/COPYING $out/license/LICENSE
diff --git a/nix/nixcrpkgs/native/pkgconf/default.nix b/nix/nixcrpkgs/native/pkgconf/default.nix
deleted file mode 100644
index cd7eea7bd..000000000
--- a/nix/nixcrpkgs/native/pkgconf/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ env }:
-
-env.make_derivation rec {
- name = "pkgconf-${version}";
-
- version = "1.0.1";
-
- src = env.nixpkgs.fetchurl {
- url = "https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${version}/pkgconf-${version}.tar.gz";
- sha256 = "1w9wb2z7zz6s4mifbllvhx0401bwsynhp02v312i6i9jn1m2zkj5";
- };
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/native/wrappers/builder.sh b/nix/nixcrpkgs/native/wrappers/builder.sh
deleted file mode 100644
index 64d149cef..000000000
--- a/nix/nixcrpkgs/native/wrappers/builder.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-source $setup
-
-mkdir -p $out/bin
-
-cat > $out/bin/pkg-config-cross < $out/bin/cmake-cross < $out/gdbcmd.txt
-set substitute-path ../samples src/angle/samples
-set substitute-path ../util src/angle/util
-EOF
diff --git a/nix/nixcrpkgs/pkgs/angle/default.nix b/nix/nixcrpkgs/pkgs/angle/default.nix
deleted file mode 100644
index da5a76c37..000000000
--- a/nix/nixcrpkgs/pkgs/angle/default.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ crossenv, gdb, debug ? false }:
-
-if crossenv.os != "windows" then "" else
-
-let
- angle = import ./lib.nix {
- inherit crossenv debug;
- };
-
- util = import ./util.nix {
- inherit crossenv angle;
- };
-
- examples = import ./examples.nix {
- inherit crossenv angle;
- angle_util = util;
- };
-
- debug_bundle = import ./debug_bundle.nix {
- inherit crossenv gdb angle examples;
- };
-
-in angle // { inherit util examples debug_bundle; }
diff --git a/nix/nixcrpkgs/pkgs/angle/examples.nix b/nix/nixcrpkgs/pkgs/angle/examples.nix
deleted file mode 100644
index 6ccb47f05..000000000
--- a/nix/nixcrpkgs/pkgs/angle/examples.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ crossenv, angle, angle_util }:
-
-crossenv.make_derivation rec {
- name = "angle-samples-${angle.version}";
-
- src = angle.src;
-
- inherit angle angle_util;
-
- builder = ./samples_builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/angle/lib.nix b/nix/nixcrpkgs/pkgs/angle/lib.nix
deleted file mode 100644
index 7357d905f..000000000
--- a/nix/nixcrpkgs/pkgs/angle/lib.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ crossenv, debug ? false }:
-
-if crossenv.os != "windows" then "windows only" else
-
-crossenv.make_derivation rec {
- name = "angle-${version}";
-
- version = "2017-03-09";
-
- src = crossenv.nixpkgs.fetchgit {
- url = "https://chromium.googlesource.com/angle/angle";
- rev = "fe9306a8e5bb6a8d52368e8e7b8e92f3bc7e77d4";
- sha256 = "0m2pbkl9x9kybcxzhai0s3bk9k0r8nb531gzlxcvb3gb2za388bn";
- };
-
- patches = [ ./megapatch.patch ];
-
- builder = ./builder.sh;
-
- native_inputs = [
- crossenv.nixpkgs.pythonPackages.gyp
- ];
-
- GYP_GENERATORS = "ninja";
-
- gyp_flags =
- "-D OS=win " +
- "-D TARGET=win32 " +
- "-D use_ozone=0 " +
- "-D angle_enable_vulkan=0 " + # Vulkan support is in progress
- "-D angle_gl_library_type=static_library " +
- "-I ../src/gyp/common.gypi " +
- "--depth .";
-
- CC_target = "${crossenv.host}-gcc";
- CXX_target = "${crossenv.host}-g++";
- AR = "${crossenv.host}-ar";
- RANLIB = "${crossenv.host}-ranlib";
-
- CXXFLAGS = "-msse2 -Wno-conversion-null";
-
- inherit debug;
-}
diff --git a/nix/nixcrpkgs/pkgs/angle/megapatch.patch b/nix/nixcrpkgs/pkgs/angle/megapatch.patch
deleted file mode 100644
index 319b192a7..000000000
--- a/nix/nixcrpkgs/pkgs/angle/megapatch.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -ur angle-src-orig/src/angle.gyp angle-src/src/angle.gyp
---- angle-src-orig/src/angle.gyp 2017-02-07 07:42:35.090343332 -0800
-+++ angle-src/src/angle.gyp 2017-02-09 08:44:52.752006998 -0800
-@@ -286,7 +286,7 @@
- }
- ]
- }],
-- ['OS=="win"',
-+ ['OS=="win" and 0',
- {
- 'targets':
- [
-diff -ur angle-src-orig/src/libGLESv2.gypi angle-src/src/libGLESv2.gypi
---- angle-src-orig/src/libGLESv2.gypi 2017-02-07 07:42:35.113676666 -0800
-+++ angle-src/src/libGLESv2.gypi 2017-02-09 09:19:37.985340331 -0800
-@@ -1078,7 +1078,7 @@
- '<@(libangle_null_sources)',
- ],
- }],
-- ['angle_build_winrt==0 and OS=="win"',
-+ ['angle_build_winrt==0 and OS=="win" and 0',
- {
- 'dependencies':
- [
diff --git a/nix/nixcrpkgs/pkgs/angle/samples_builder.sh b/nix/nixcrpkgs/pkgs/angle/samples_builder.sh
deleted file mode 100644
index 3b89c9c0b..000000000
--- a/nix/nixcrpkgs/pkgs/angle/samples_builder.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-source $setup
-
-cp -r $src/samples .
-cp -r $src/util .
-
-mkdir include
-cp -r $src/samples/sample_util/* include/
-
-mkdir build
-cd build
-mkdir bin
-
-CFLAGS="-mwindows -g -O2 -I../include -I$angle_util/include -I$angle/include"
-CFLAGS="$CFLAGS -DGL_APICALL= -DANGLE_EXPORT= -DGL_GLEXT_PROTOTYPES"
-LDFLAGS="-L$angle_util/lib -L$angle/lib"
-LIBS="-langle_util -lEGL_static -lGLESv2_static -lANGLE -ltranslator
--lpreprocessor -langle_image_util -langle_common -ld3d9 -lgdi32"
-
-echo "compiling texture_wrap"
-$host-g++ $CFLAGS $LDFLAGS \
- ../samples/texture_wrap/TextureWrap.cpp \
- ../samples/sample_util/texture_utils.cpp \
- ../samples/sample_util/SampleApplication.cpp \
- $LIBS -o bin/texture_wrap${exe_suffix}
-
-echo "compiling simple_texture_2d"
-$host-g++ $CFLAGS $LDFLAGS \
- ../samples/simple_texture_2d/SimpleTexture2D.cpp \
- ../samples/sample_util/texture_utils.cpp \
- ../samples/sample_util/SampleApplication.cpp \
- $LIBS -o bin/simple_texture_2d${exe_suffix}
-
-echo "compiling particle_system"
-$host-g++ $CFLAGS $LDFLAGS \
- ../samples/particle_system/ParticleSystem.cpp \
- ../samples/sample_util/tga_utils.cpp \
- ../samples/sample_util/SampleApplication.cpp \
- $LIBS -o bin/particle_system${exe_suffix}
-cp ../samples/particle_system/smoke.tga bin/
-
-echo "compiling hello_triangle"
-$host-g++ $CFLAGS $LDFLAGS \
- ../samples/hello_triangle/HelloTriangle.cpp \
- ../samples/sample_util/SampleApplication.cpp \
- $LIBS -o bin/hello_triangle${exe_suffix}
-
-echo "compiling window_test"
-$host-g++ $CFLAGS $LDFLAGS \
- ../samples/WindowTest/WindowTest.cpp \
- -langle_util -lgdi32 -o bin/window_test${exe_suffix}
-
-mkdir -p $out/license
-cp $src/LICENSE $out/license/
-cp -r bin $out/
diff --git a/nix/nixcrpkgs/pkgs/angle/util.nix b/nix/nixcrpkgs/pkgs/angle/util.nix
deleted file mode 100644
index 83d703882..000000000
--- a/nix/nixcrpkgs/pkgs/angle/util.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-# libangle_util is a helper library for programs like tests
-# and samples that surround ANGLE but that are not the ANGLE libraries
-# themselves
-
-{ crossenv, angle }:
-
-crossenv.make_derivation rec {
- name = "angle_util-${angle.version}";
-
- src = angle.src;
-
- inherit angle;
-
- builder = ./util_builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/angle/util_builder.sh b/nix/nixcrpkgs/pkgs/angle/util_builder.sh
deleted file mode 100644
index 7929083b6..000000000
--- a/nix/nixcrpkgs/pkgs/angle/util_builder.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-source $setup
-
-cp -r $src/util .
-
-mkdir include
-cp -r $src/util/*.h include/
-cp -r $src/include/export.h include/
-mkdir include/common
-cp -r $src/src/common/*.h include/common/
-mkdir -p include/windows/win32
-cp -r $src/util/windows/*.h include/windows/
-cp -r $src/util/windows/win32/*.h include/windows/win32/
-
-mkdir -p build/{obj,lib}
-cd build
-
-source_files=../util/*.cpp
-
-if [ "$os" == "windows" ]; then
- source_files="$source_files ../util/windows/*.cpp ../util/windows/win32/*.cpp"
-fi
-
-for c in $source_files; do
- echo "compiling $(basename $c)"
- $host-g++ -c -g -O2 -fpermissive \
- -I../include -I"$angle/include" -L"$angle/lib" \
- -DGL_APICALL= -DANGLE_EXPORT= -DEGLAPI= \
- -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES -DLIBANGLE_UTIL_IMPLEMENTATION \
- $c -lGLESv2 -lEGL \
- -o obj/$(basename $c).o
-done
-
-$host-ar r lib/libangle_util.a obj/*.o
-
-mkdir -p $out/{license,lib}
-cp $src/LICENSE $out/license/
-cp lib/libangle_util.a $out/lib/
-cp -r ../include $out/
diff --git a/nix/nixcrpkgs/pkgs/at-spi2-headers/builder.sh b/nix/nixcrpkgs/pkgs/at-spi2-headers/builder.sh
deleted file mode 100644
index 04ac14fda..000000000
--- a/nix/nixcrpkgs/pkgs/at-spi2-headers/builder.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-source $setup
-
-mkdir -p $out/include/atspi $out/lib/pkgconfig
-
-cp $src/atspi/*.h $out/include/atspi/
-
-cat > $out/lib/pkgconfig/atspi-2.pc < $out <at-spi2-headers
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/avrdude/builder.sh b/nix/nixcrpkgs/pkgs/avrdude/builder.sh
deleted file mode 100644
index 8c7f2c078..000000000
--- a/nix/nixcrpkgs/pkgs/avrdude/builder.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-source $setup
-
-tar -xf $src
-mv avrdude-* avrdude
-
-ls -lad avrdude
-cd avrdude
-chmod -R u+w .
-cp $config_dot_sub config.sub
-cat $extra_conf >> avrdude.conf.in
-cd ..
-
-mkdir build
-cd build
-
-../avrdude/configure --host=$host --prefix=$out \
- --enable-static \
- --disable-shared \
- --disable-dependency-tracking
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/avrdude/config.sub b/nix/nixcrpkgs/pkgs/avrdude/config.sub
deleted file mode 100644
index 1d8e98bce..000000000
--- a/nix/nixcrpkgs/pkgs/avrdude/config.sub
+++ /dev/null
@@ -1,1801 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright 1992-2018 Free Software Foundation, Inc.
-
-timestamp='2018-02-22'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see .
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches to .
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
-
-Canonicalize a configuration name.
-
-Options:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to ."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright 1992-2018 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo "$1"
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
- kopensolaris*-gnu* | cloudabi*-eabi* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
- if [ "$basic_machine" != "$1" ]
- then os=`echo "$1" | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | ba \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | e2k | epiphany \
- | fido | fr30 | frv | ft32 \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia16 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pru \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | wasm32 \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | ba-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | e2k-* | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pru-* \
- | pyramid-* \
- | riscv32-* | riscv64-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | visium-* \
- | wasm32-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-pc
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- asmjs)
- basic_machine=asmjs-unknown
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2*)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- e500v[12])
- basic_machine=powerpc-unknown
- os=$os"spe"
- ;;
- e500v[12]-*)
- basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- os=$os"spe"
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
- i*86v32)
- basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next)
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- nsv-tandem)
- basic_machine=nsv-tandem
- ;;
- nsx-tandem)
- basic_machine=nsx-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- x64)
- basic_machine=x86_64-pc
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases that might get confused
- # with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
- ;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # es1800 is here to avoid being matched by es* (a different OS)
- -es1800*)
- os=-ose
- ;;
- # Now accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST end in a * to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* | -cloudabi* | -sortix* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
- | -midnightbsd*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -xray | -os68k* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo "$os" | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2)
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -pikeos*)
- # Until real need of OS specific support for
- # particular features comes up, bare metal
- # configurations are quite functional.
- case $basic_machine in
- arm*)
- os=-eabi
- ;;
- *)
- os=-elf
- ;;
- esac
- ;;
- -nacl*)
- ;;
- -ios)
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- c8051-*)
- os=-elf
- ;;
- hexagon-*)
- os=-elf
- ;;
- tic54x-*)
- os=-coff
- ;;
- tic55x-*)
- os=-coff
- ;;
- tic6x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- pru-*)
- os=-elf
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next)
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -cnk*|-aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo "$basic_machine$os"
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-functions 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/nix/nixcrpkgs/pkgs/avrdude/default.nix b/nix/nixcrpkgs/pkgs/avrdude/default.nix
deleted file mode 100644
index d5442cc90..000000000
--- a/nix/nixcrpkgs/pkgs/avrdude/default.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-# TODO: remove giveio.sys and any other sketchy drivers or binaries from the source
-
-# Note: There are no patches to help AVRDUDE find its configuration
-# file, so it will expect that file to be at
-# /nix/store/...-avrdude/etc/avrdude.conf
-
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "avrdude-${version}";
-
- version = "6.3"; # February 2016
-
- src = crossenv.nixpkgs.fetchurl {
- url = "http://download.savannah.gnu.org/releases/avrdude/avrdude-${version}.tar.gz";
- sha256 = "15m1w1qad3dj7r8n5ng1qqcaiyx1gyd6hnc3p2apgjllccdp77qg";
- };
-
- native_inputs = [
- crossenv.nixpkgs.yacc
- crossenv.nixpkgs.flex
- ];
-
- cross_inputs = [
- # TODO: libusb
- # TODO: libftdi
- # TODO: libelf
- # TODO: libhid
- ];
-
- config_dot_sub = ./config.sub;
- extra_conf = ./extra.conf;
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/avrdude/extra.conf b/nix/nixcrpkgs/pkgs/avrdude/extra.conf
deleted file mode 100644
index 539cd65f4..000000000
--- a/nix/nixcrpkgs/pkgs/avrdude/extra.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-part parent "m328p"
- id = "m328pb";
- desc = "ATmega328PB";
- signature = 0x1e 0x95 0x16;
- ocdrev = 1;
-;
\ No newline at end of file
diff --git a/nix/nixcrpkgs/pkgs/curl/builder.sh b/nix/nixcrpkgs/pkgs/curl/builder.sh
deleted file mode 100644
index 303f6278e..000000000
--- a/nix/nixcrpkgs/pkgs/curl/builder.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-source $setup
-
-tar -xf $src
-cd *
-
-export CFLAGS=-fPIC
-
-case $host in
- *darwin*) CFLAGS="$CFLAGS -mmacosx-version-min=10.11";;
-esac
-
-./configure --prefix=$out --host=$host $configureFlags
-
-make
-make install
diff --git a/nix/nixcrpkgs/pkgs/curl/default.nix b/nix/nixcrpkgs/pkgs/curl/default.nix
deleted file mode 100644
index 8268e288e..000000000
--- a/nix/nixcrpkgs/pkgs/curl/default.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ crossenv, openssl, zlib }:
-
-crossenv.make_derivation rec {
- name = "curl-${version}";
- version = "7.62.0";
-
- cross_inputs = [ crossenv.nixpkgs.perl ];
- native_inputs = [ zlib openssl ];
- builder = ./builder.sh;
-
- configureFlags = [
- "--disable-shared"
- "--disable-manual"
- "--disable-ldap"
- "--with-ssl=${openssl}"
- ];
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://curl.haxx.se/download/${name}.tar.bz2";
- sha256 = "084niy7cin13ba65p8x38w2xcyc54n3fgzbin40fa2shfr0ca0kq";
- };
-}
diff --git a/nix/nixcrpkgs/pkgs/dejavu-fonts/builder.sh b/nix/nixcrpkgs/pkgs/dejavu-fonts/builder.sh
deleted file mode 100644
index 1161ce85a..000000000
--- a/nix/nixcrpkgs/pkgs/dejavu-fonts/builder.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-source $setup
-
-tar -xf $src
-cd dejavu-*
-mkdir $out
-cp -r * $out/
diff --git a/nix/nixcrpkgs/pkgs/dejavu-fonts/default.nix b/nix/nixcrpkgs/pkgs/dejavu-fonts/default.nix
deleted file mode 100644
index bd8a9d743..000000000
--- a/nix/nixcrpkgs/pkgs/dejavu-fonts/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ crossenv }:
-
-let
- version = "2.37";
-
- name = "dejavu-fonts-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- # Sourceforge went down. The original URL was:
- # http://sourceforge.net/projects/dejavu/files/dejavu/${version}/dejavu-fonts-ttf-${version}.tar.bz2";
- url = "https://files.tmphax.com/repo1/dejavu-fonts-ttf-${version}.tar.bz2";
- sha256 = "1mqpds24wfs5cmfhj57fsfs07mji2z8812i5c4pi5pbi738s977s";
- };
-
- fonts = crossenv.native.make_derivation {
- inherit version name src;
- builder = ./builder.sh;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set = { "${name}" = license; };
-
-in
- fonts // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/dejavu-fonts/license_builder.sh b/nix/nixcrpkgs/pkgs/dejavu-fonts/license_builder.sh
deleted file mode 100644
index 4ba33030b..000000000
--- a/nix/nixcrpkgs/pkgs/dejavu-fonts/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv dejavu-* dejavu
-
-license=$(cat dejavu/LICENSE)
-
-cat > $out <DejaVu Fonts
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/devcon/builder.sh b/nix/nixcrpkgs/pkgs/devcon/builder.sh
deleted file mode 100644
index 166abe2ad..000000000
--- a/nix/nixcrpkgs/pkgs/devcon/builder.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-source $setup
-
-cp --no-preserve=mode -r $src/setup/devcon .
-
-cd devcon
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-$host-windmc msg.mc
-cd ..
-
-mkdir build
-cd build
-
-$host-windres ../devcon/devcon.rc rc.o
-
-$host-g++ -municode -O2 \
- -DUNICODE -D_UNICODE \
- ../devcon/*.cpp rc.o \
- -lsetupapi -lole32 \
- -o devcon.exe
-
-mkdir -p $out/bin $out/license
-cp devcon.exe $out/bin
-cp $src/LICENSE $out/license
diff --git a/nix/nixcrpkgs/pkgs/devcon/default.nix b/nix/nixcrpkgs/pkgs/devcon/default.nix
deleted file mode 100644
index e9410aee8..000000000
--- a/nix/nixcrpkgs/pkgs/devcon/default.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ crossenv }:
-
-if crossenv.os != "windows" then "windows only" else
-
-crossenv.make_derivation rec {
- name = "devcon-${version}";
-
- version = "2017-05-01";
-
- src = crossenv.nixpkgs.fetchFromGitHub {
- owner = "Microsoft";
- repo = "Windows-driver-samples";
- rev = "4c5c5e0297c7a61e151f92af702cdac650a14489";
- sha256 = "1drq26bnad98xqn805qx0b6g4y65lmrdj7v40b3jhhzdsp8993pf";
- };
-
- patches = [];
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/devcon/my_xmlhelper.c b/nix/nixcrpkgs/pkgs/devcon/my_xmlhelper.c
deleted file mode 100644
index 0cdf29140..000000000
--- a/nix/nixcrpkgs/pkgs/devcon/my_xmlhelper.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "xmlhelper.h"
-
-EXTERN_C HRESULT InitXmlHelper()
-{
- return 0;
-}
-
-EXTERN_C HRESULT ReleaseXmlWriter()
-{
- return 0;
-}
-
-EXTERN_C HRESULT SaveXml(LPTSTR szfileName, DWORD dwCreationDisposition)
-{
- MessageBox(NULL,
- "Sorry, XML saving is not supported in this build.",
- "XML not supported",
- MB_OK | MB_ICONEXCLAMATION);
- return 0;
-}
-
-EXTERN_C HRESULT XmlAddHostController(
- PSTR hcName,
- PUSBHOSTCONTROLLERINFO hcInfo
- )
-{
- return 0;
-}
-
-EXTERN_C HRESULT XmlAddRootHub(PSTR rhName, PUSBROOTHUBINFO rhInfo)
-{
- return 0;
-}
-
-EXTERN_C HRESULT XmlAddExternalHub(PSTR ehName, PUSBEXTERNALHUBINFO ehInfo)
-{
- return 0;
-}
-
-EXTERN_C HRESULT XmlAddUsbDevice(PSTR devName, PUSBDEVICEINFO deviceInfo)
-{
- return 0;
-}
-
-EXTERN_C VOID XmlNotifyEndOfNodeList(PVOID pContext)
-{
-}
diff --git a/nix/nixcrpkgs/pkgs/expat/builder.sh b/nix/nixcrpkgs/pkgs/expat/builder.sh
deleted file mode 100644
index 3a8bfb731..000000000
--- a/nix/nixcrpkgs/pkgs/expat/builder.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-source $setup
-
-tar -xf $src
-
-cd expat-$version
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-cd ..
-
-mkdir build
-cd build
-
-../expat-$version/configure \
- --prefix=$out --host=$host \
- --enable-static --disable-shared
-
-make
-
-make install
-
-mv $out/bin/xmlwf $out/bin/xmlwf.exe
-
-mkdir $out/license
-cp ../expat-$version/COPYING $out/license/LICENSE
diff --git a/nix/nixcrpkgs/pkgs/expat/cve-2016-0718.patch b/nix/nixcrpkgs/pkgs/expat/cve-2016-0718.patch
deleted file mode 100644
index 6d66fec0c..000000000
--- a/nix/nixcrpkgs/pkgs/expat/cve-2016-0718.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 3e6190e433479e56f8c1e5adc1198b3c86b15577 Mon Sep 17 00:00:00 2001
-From: Sebastian Pipping
-Date: Sun, 17 Jul 2016 20:22:29 +0200
-Subject: [PATCH] Fix regression introduced by patch to CVE-2016-0718 (bug
- #539)
-
-Tag names were cut off in some cases; reported by Andy Wang
----
- expat/lib/xmlparse.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
-index 13e080d..2630310 100644
---- expat/lib/xmlparse.c
-+++ expat-fixed/lib/xmlparse.c
-@@ -2430,7 +2430,7 @@ doContent(XML_Parser parser,
- &fromPtr, rawNameEnd,
- (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1);
- convLen = (int)(toPtr - (XML_Char *)tag->buf);
-- if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) {
-+ if ((fromPtr >= rawNameEnd) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) {
- tag->name.strLen = convLen;
- break;
- }
---
-2.9.2
diff --git a/nix/nixcrpkgs/pkgs/expat/default.nix b/nix/nixcrpkgs/pkgs/expat/default.nix
deleted file mode 100644
index 860f54004..000000000
--- a/nix/nixcrpkgs/pkgs/expat/default.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "expat-${version}";
-
- version = "2.2.0";
-
- src = crossenv.nixpkgs.fetchurl {
- # Sourceforge went down. The original URL we used was:
- # mirror://sourceforge/expat/expat-${version}.tar.bz2
- url = "https://files.tmphax.com/repo1/expat-${version}.tar.bz2";
- sha256 = "1zq4lnwjlw8s9mmachwfvfjf2x3lk24jm41746ykhdcvs7r0zrfr";
- };
-
- patches = [
- ./cve-2016-0718.patch
- ];
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/fixesproto/builder.sh b/nix/nixcrpkgs/pkgs/fixesproto/builder.sh
deleted file mode 100644
index 4d91d6e9f..000000000
--- a/nix/nixcrpkgs/pkgs/fixesproto/builder.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-source $setup
-
-cp -r $src src
-chmod -R u+w src
-cd src
-autoreconf -v --install
-cd ..
-
-mkdir build
-cd build
-
-../src/configure --prefix=$out
-make
-make install
-
-ln -sf $xextproto/lib/pkgconfig/*.pc $out/lib/pkgconfig
diff --git a/nix/nixcrpkgs/pkgs/fixesproto/default.nix b/nix/nixcrpkgs/pkgs/fixesproto/default.nix
deleted file mode 100644
index 49936287e..000000000
--- a/nix/nixcrpkgs/pkgs/fixesproto/default.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ crossenv, xorg-macros, xextproto }:
-
-let
- version = "2017-01-26";
-
- name = "fixesproto-${version}";
-
- src = crossenv.nixpkgs.fetchgit {
- url = "https://anongit.freedesktop.org/git/xorg/proto/fixesproto";
- rev = "4292ec1c63180c5f4e7c0e606fa68c51913f172b";
- sha256 = "0mmx4cmkbrsmbq1j58g8gcx4h3qz9y4xbjpz7jcl7crki7zrz3kx";
- };
-
- lib = crossenv.native.make_derivation rec {
- inherit version name src;
-
- builder = ./builder.sh;
-
- native_inputs = [
- crossenv.nixpkgs.autoconf
- crossenv.nixpkgs.automake
- ];
-
- ACLOCAL_PATH = "${xorg-macros}/lib/aclocal";
-
- inherit xextproto;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- xorg-macros.license_set //
- xextproto.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/fixesproto/license_builder.sh b/nix/nixcrpkgs/pkgs/fixesproto/license_builder.sh
deleted file mode 100644
index 8e347c361..000000000
--- a/nix/nixcrpkgs/pkgs/fixesproto/license_builder.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-source $setup
-
-license=$(cat $src/COPYING)
-
-cat > $out <fixesproto
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/gdb/builder.sh b/nix/nixcrpkgs/pkgs/gdb/builder.sh
deleted file mode 100644
index 8133f5199..000000000
--- a/nix/nixcrpkgs/pkgs/gdb/builder.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-source $setup
-
-tar -xf $src
-
-cd gdb-$version
-for patch in $patches
-do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-cd ..
-
-mkdir build
-cd build
-
-export LDFLAGS="-L$curses/lib"
-export CFLAGS="-I$curses/include"
-export CXXFLAGS="-I$curses/include"
-
-../gdb-$version/configure \
- --prefix=$out \
- --host=$host \
- --target=$host \
- --with-expat=yes --with-libexpat-prefix=$expat \
- --enable-tui \
- --disable-win32-registry \
- --disable-rpath
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/gdb/default.nix b/nix/nixcrpkgs/pkgs/gdb/default.nix
deleted file mode 100644
index 43378cb68..000000000
--- a/nix/nixcrpkgs/pkgs/gdb/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-# Note: This package has only been tested on Windows, and the pdcurses library
-# it uses does not support Linux in console mode or mac OS X.
-
-# Note: GDB has a bundled copy of readline that it uses.
-# There is a --with-system-readline option we could try to use.
-
-# Note: consider providing a mingw-w64 isl to gdb because its configure script looks for it
-
-{ crossenv, expat, curses }:
-
-crossenv.make_derivation rec {
- name = "gdb-${version}";
-
- version = "7.12.1";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://ftp.gnu.org/gnu/gdb/gdb-${version}.tar.xz";
- sha256 = "11ii260h1sd7v0bs3cz6d5l8gqxxgldry0md60ncjgixjw5nh1s6";
- };
-
- patches = [
- # Make GCC better at finding source files.
- # https://sourceware.org/ml/gdb-patches/2017-02/msg00693.html
- ./substitute-path-all-filenames.patch
- ];
-
- native_inputs = [
- crossenv.nixpkgs.texinfo
- crossenv.nixpkgs.bison
- crossenv.nixpkgs.yacc
- crossenv.nixpkgs.m4
- crossenv.nixpkgs.flex
- ];
-
- inherit expat curses;
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/gdb/substitute-path-all-filenames.patch b/nix/nixcrpkgs/pkgs/gdb/substitute-path-all-filenames.patch
deleted file mode 100644
index f1821a772..000000000
--- a/nix/nixcrpkgs/pkgs/gdb/substitute-path-all-filenames.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -ur gdb-7.12.1-orig/gdb/source.c gdb-7.12.1/gdb/source.c
---- gdb-7.12.1-orig/gdb/source.c 2017-02-24 19:33:13.340349333 -0800
-+++ gdb-7.12.1/gdb/source.c 2017-02-24 19:34:40.660349333 -0800
-@@ -1103,10 +1103,7 @@
- }
- }
-
-- if (IS_ABSOLUTE_PATH (filename))
- {
-- /* If filename is absolute path, try the source path
-- substitution on it. */
- char *rewritten_filename = rewrite_source_path (filename);
-
- if (rewritten_filename != NULL)
diff --git a/nix/nixcrpkgs/pkgs/hello/builder.sh b/nix/nixcrpkgs/pkgs/hello/builder.sh
deleted file mode 100644
index 36c57adc7..000000000
--- a/nix/nixcrpkgs/pkgs/hello/builder.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-source $setup
-
-$host-gcc $src_file -o hello$exe_suffix
-
-mkdir -p $out/bin
-
-cp hello$exe_suffix $out/bin/
diff --git a/nix/nixcrpkgs/pkgs/hello/default.nix b/nix/nixcrpkgs/pkgs/hello/default.nix
deleted file mode 100644
index c8e4d5208..000000000
--- a/nix/nixcrpkgs/pkgs/hello/default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "hello";
- src_file = ./hello.c;
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/hello/hello.c b/nix/nixcrpkgs/pkgs/hello/hello.c
deleted file mode 100644
index 98e2277bc..000000000
--- a/nix/nixcrpkgs/pkgs/hello/hello.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include
-
-#ifdef _WIN32
-#include
-#endif
-
-int main(int argc, char ** argv)
-{
- printf("Hello, World!\n");
-
-#ifdef _WIN32
- MessageBoxA(NULL, "Hello, World!", "Hello", MB_OK);
-#endif
- return 0;
-}
diff --git a/nix/nixcrpkgs/pkgs/hello_cpp/builder.sh b/nix/nixcrpkgs/pkgs/hello_cpp/builder.sh
deleted file mode 100644
index dae159775..000000000
--- a/nix/nixcrpkgs/pkgs/hello_cpp/builder.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-. $setup
-
-$host-g++ $src_file -o hello$exe_suffix
-
-mkdir -p $out/bin/
-
-cp hello$exe_suffix $out/bin/
-
diff --git a/nix/nixcrpkgs/pkgs/hello_cpp/default.nix b/nix/nixcrpkgs/pkgs/hello_cpp/default.nix
deleted file mode 100644
index 8f35d0b6f..000000000
--- a/nix/nixcrpkgs/pkgs/hello_cpp/default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "hello_cpp";
- src_file = ./hello.cpp;
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/hello_cpp/hello.cpp b/nix/nixcrpkgs/pkgs/hello_cpp/hello.cpp
deleted file mode 100644
index d081ace70..000000000
--- a/nix/nixcrpkgs/pkgs/hello_cpp/hello.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include
-
-#ifdef _WIN32
-#include
-#endif
-
-int main(int argc, char ** argv)
-{
- std::cout << "hello world" << std::endl;
-
-#ifdef _WIN32
- MessageBoxA(NULL, "Hello world", "Hello Box", MB_OK);
-#endif
- return 0;
-}
diff --git a/nix/nixcrpkgs/pkgs/inputproto/builder.sh b/nix/nixcrpkgs/pkgs/inputproto/builder.sh
deleted file mode 100644
index ff349bbcd..000000000
--- a/nix/nixcrpkgs/pkgs/inputproto/builder.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-source $setup
-
-tar -xf $src
-mv inputproto-* proto
-
-mkdir build
-cd build
-
-../proto/configure --prefix=$out
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/inputproto/default.nix b/nix/nixcrpkgs/pkgs/inputproto/default.nix
deleted file mode 100644
index 7c384049d..000000000
--- a/nix/nixcrpkgs/pkgs/inputproto/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ crossenv }:
-
-let
- version = "2.3.2";
-
- name = "inputproto-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xorg.freedesktop.org/releases/individual/proto/inputproto-${version}.tar.bz2";
- sha256 = "07gk7v006zqn3dcfh16l06gnccy7xnqywf3vl9c209ikazsnlfl9";
- };
-
- lib = crossenv.native.make_derivation rec {
- inherit version name src;
- builder = ./builder.sh;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set = { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/inputproto/license_builder.sh b/nix/nixcrpkgs/pkgs/inputproto/license_builder.sh
deleted file mode 100644
index aad143efb..000000000
--- a/nix/nixcrpkgs/pkgs/inputproto/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv inputproto-* inputproto
-
-license=$(cat inputproto/COPYING)
-
-cat > $out <inputproto
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/ion/builder.sh b/nix/nixcrpkgs/pkgs/ion/builder.sh
deleted file mode 100644
index 6ac7950a2..000000000
--- a/nix/nixcrpkgs/pkgs/ion/builder.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-source $setup
-
-tar -xf $src
-mv bitwise-* bitwise
-
-mkdir build
-cd build
-
-$host-gcc -O2 ../bitwise/ion/main.c -o ion$exe_suffix \
- -DIONHOME=\"$out/ionhome\"
-
-# TODO: make -DIONHOME actually work
-
-mkdir $out
-
-mkdir $out/bin
-mv ion$exe_suffix $out/bin/
-
-mkdir $out/ionhome
-mv ../bitwise/ion/system_packages $out/ionhome/
diff --git a/nix/nixcrpkgs/pkgs/ion/default.nix b/nix/nixcrpkgs/pkgs/ion/default.nix
deleted file mode 100644
index 222f6c885..000000000
--- a/nix/nixcrpkgs/pkgs/ion/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ crossenv }:
-
-# TODO: SDL integration would be nice, so we can use noir.ion
-
-let
- version = "7524dc7"; # 2018-04-30
-
- name = "ion-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://github.com/DavidEGrayson/bitwise/archive/${version}.tar.gz";
- sha256 = "169j7yhphvcyfbqgi5p1i4lhd9n5a31n99fv2kxyrh7djmr8g2s9";
- };
-
- ion = crossenv.make_derivation {
- inherit version name src;
- builder = ./builder.sh;
- };
-
-in
- ion
diff --git a/nix/nixcrpkgs/pkgs/kbproto/builder.sh b/nix/nixcrpkgs/pkgs/kbproto/builder.sh
deleted file mode 100644
index 3f21643e8..000000000
--- a/nix/nixcrpkgs/pkgs/kbproto/builder.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-source $setup
-
-tar -xf $src
-mv kbproto-* proto
-
-mkdir build
-cd build
-
-../proto/configure --prefix=$out
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/kbproto/default.nix b/nix/nixcrpkgs/pkgs/kbproto/default.nix
deleted file mode 100644
index 6af2fcf90..000000000
--- a/nix/nixcrpkgs/pkgs/kbproto/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ crossenv }:
-
-let
- version = "1.0.7";
-
- name = "kbproto-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xorg.freedesktop.org/releases/individual/proto/kbproto-${version}.tar.bz2";
- sha256 = "0mxqj1pzhjpz9495vrjnpi10kv2n1s4vs7di0sh3yvipfq5j30pq";
- };
-
- lib = crossenv.native.make_derivation rec {
- inherit version name src;
- builder = ./builder.sh;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set = { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/kbproto/license_builder.sh b/nix/nixcrpkgs/pkgs/kbproto/license_builder.sh
deleted file mode 100644
index 65776595a..000000000
--- a/nix/nixcrpkgs/pkgs/kbproto/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv kbproto-* kbproto
-
-license=$(cat kbproto/COPYING)
-
-cat > $out <kbproto
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/libgmp/builder.sh b/nix/nixcrpkgs/pkgs/libgmp/builder.sh
deleted file mode 100644
index c284c9a5f..000000000
--- a/nix/nixcrpkgs/pkgs/libgmp/builder.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-source $setup
-
-tar -xf $src
-
-mkdir build
-cd build
-../gmp-$version/configure --host=$host --prefix=$out --disable-shared
-make
-make install
diff --git a/nix/nixcrpkgs/pkgs/libgmp/default.nix b/nix/nixcrpkgs/pkgs/libgmp/default.nix
deleted file mode 100644
index 52af7aefb..000000000
--- a/nix/nixcrpkgs/pkgs/libgmp/default.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "gmp-${version}";
- version = "6.1.2";
- builder = ./builder.sh;
- native_inputs = [ crossenv.nixpkgs.m4 ];
-
- src = crossenv.nixpkgs.fetchurl {
- urls = [ "mirror://gnu/gmp/${name}.tar.bz2"
- "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2"
- ];
- sha256 = "1clg7pbpk6qwxj5b2mw0pghzawp2qlm3jf9gdd8i6fl6yh2bnxaj";
- };
-
-}
diff --git a/nix/nixcrpkgs/pkgs/libsigsegv/builder.sh b/nix/nixcrpkgs/pkgs/libsigsegv/builder.sh
deleted file mode 100644
index 39d7ddc01..000000000
--- a/nix/nixcrpkgs/pkgs/libsigsegv/builder.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-source $setup
-
-tar -xf $src
-
-cd libsigsegv-$version
-patch -p1 << 'HEREDOC'
---- a/src/fault-linux-i386.h 2020-06-25 23:46:02.099235491 +0000
-+++ b/src/fault-linux-i386.h 2020-06-25 23:45:48.679156892 +0000
-@@ -18,6 +18,7 @@
-
- #include "fault-posix-ucontext.h"
-
-+#define HAVE_STACKVMA 0
- #if defined __x86_64__
- /* 64 bit registers */
-
-HEREDOC
-cd ..
-
-mkdir build
-cd build
-
-../libsigsegv-$version/configure \
- --host=$host \
- --prefix=$out \
- --enable-static=yes \
- --enable-shared=no
-
-make
-make install
diff --git a/nix/nixcrpkgs/pkgs/libsigsegv/default.nix b/nix/nixcrpkgs/pkgs/libsigsegv/default.nix
deleted file mode 100644
index 60e8c7b6a..000000000
--- a/nix/nixcrpkgs/pkgs/libsigsegv/default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "libsigsegv-${version}";
- version = "2.12";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "mirror://gnu/libsigsegv/${name}.tar.gz";
- sha256 = "1dlhqf4igzpqayms25lkhycjq1ccavisx8cnb3y4zapbkqsszq9s";
- };
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/libudev/builder.sh b/nix/nixcrpkgs/pkgs/libudev/builder.sh
deleted file mode 100644
index aad209a22..000000000
--- a/nix/nixcrpkgs/pkgs/libudev/builder.sh
+++ /dev/null
@@ -1,71 +0,0 @@
-source $setup
-
-tar -xf $src
-mv systemd-* systemd
-
-cd systemd
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-cd ..
-
-$host-g++ -x c++ -c $size_flags - -o test.o <
-#include
-#include
-static_assert(sizeof(pid_t) == SIZEOF_PID_T);
-static_assert(sizeof(uid_t) == SIZEOF_UID_T);
-static_assert(sizeof(gid_t) == SIZEOF_GID_T);
-static_assert(sizeof(time_t) == SIZEOF_TIME_T);
-static_assert(sizeof(rlim_t) == SIZEOF_RLIM_T);
-static_assert(sizeof(dev_t) == SIZEOF_DEV_T);
-static_assert(sizeof(ino_t) == SIZEOF_INO_T);
-EOF
-
-rm test.o
-
-mkdir build
-cd build
-
-# -DHAVE_SECURE_GETENV: We don't have secure_getenv but we want to avoid a header error,
-# and hopefully secure_getenv isn't actually needed by libudev.
-
-$host-gcc -c -Werror -I$fill $fill/*.c
-$host-gcc -c $CFLAGS \
- -I../systemd/src/libudev \
- -I../systemd/src/basic \
- -I../systemd/src/libsystemd/sd-device \
- -I../systemd/src/libsystemd/sd-hwdb \
- -I../systemd/src/systemd \
- ../systemd/src/libudev/*.c
-$host-gcc -c $CFLAGS \
- -I../systemd/src/libsystemd/sd-device \
- -I../systemd/src/basic \
- -I../systemd/src/systemd \
- ../systemd/src/libsystemd/sd-device/{device-enumerator,device-private,sd-device}.c
-$host-gcc -c $CFLAGS \
- -DPACKAGE_STRING="\"libudev $version\"" \
- -DFALLBACK_HOSTNAME="\"localhost\"" \
- -DDEFAULT_HIERARCHY_NAME="\"hybrid\"" \
- -DDEFAULT_HIERARCHY=CGROUP_UNIFIED_SYSTEMD \
- -I../systemd/src/basic \
- -I../systemd/src/systemd \
- -I$fill \
- ../systemd/src/basic/{alloc-util,architecture,bus-label,cgroup-util,device-nodes,dirent-util,env-util,escape,extract-word,fd-util,fileio,fs-util,gunicode,glob-util,hashmap,hash-funcs,hexdecoct,hostname-util,io-util,log,login-util,mempool,mkdir,path-util,proc-cmdline,parse-util,prioq,process-util,random-util,signal-util,siphash24,socket-util,stat-util,string-table,string-util,strv,strxcpyx,syslog-util,terminal-util,time-util,unit-name,user-util,utf8,util,virt,MurmurHash2}.c
-$host-ar cr libudev.a *.o
-
-mkdir -p $out/lib/pkgconfig $out/include
-cp libudev.a $out/lib/
-cp ../systemd/src/libudev/libudev.h $out/include/
-
-cat > $out/lib/pkgconfig/libudev.pc <
-
- With parts from the musl C library
- Copyright 2005-2014 Rich Felker, et al.
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see .
-***/
-
-#include
-#include
-#include
-
-static const char *consume_nonarg(const char *fmt)
-{
- do {
- if (*fmt == '\0')
- return fmt;
- } while (*fmt++ != '%');
- return fmt;
-}
-
-static const char *consume_num(const char *fmt)
-{
- for (;*fmt >= '0' && *fmt <= '9'; fmt++)
- /* do nothing */;
- return fmt;
-}
-
-static const char *consume_argn(const char *fmt, size_t *arg)
-{
- const char *p = fmt;
- size_t val = 0;
-
- if (*p < '1' || *p > '9')
- return fmt;
- do {
- val = 10*val + (*p++ - '0');
- } while (*p >= '0' && *p <= '9');
-
- if (*p != '$')
- return fmt;
- *arg = val;
- return p+1;
-}
-
-static const char *consume_flags(const char *fmt)
-{
- while (1) {
- switch (*fmt) {
- case '#':
- case '0':
- case '-':
- case ' ':
- case '+':
- case '\'':
- case 'I':
- fmt++;
- continue;
- }
- return fmt;
- }
-}
-
-enum state {
- BARE,
- LPRE,
- LLPRE,
- HPRE,
- HHPRE,
- BIGLPRE,
- ZTPRE,
- JPRE,
- STOP
-};
-
-enum type {
- NONE,
- PTR,
- INT,
- UINT,
- ULLONG,
- LONG,
- ULONG,
- SHORT,
- USHORT,
- CHAR,
- UCHAR,
- LLONG,
- SIZET,
- IMAX,
- UMAX,
- PDIFF,
- UIPTR,
- DBL,
- LDBL,
- MAXTYPE
-};
-
-static const short pa_types[MAXTYPE] = {
- [NONE] = PA_INT,
- [PTR] = PA_POINTER,
- [INT] = PA_INT,
- [UINT] = PA_INT,
- [ULLONG] = PA_INT | PA_FLAG_LONG_LONG,
- [LONG] = PA_INT | PA_FLAG_LONG,
- [ULONG] = PA_INT | PA_FLAG_LONG,
- [SHORT] = PA_INT | PA_FLAG_SHORT,
- [USHORT] = PA_INT | PA_FLAG_SHORT,
- [CHAR] = PA_CHAR,
- [UCHAR] = PA_CHAR,
- [LLONG] = PA_INT | PA_FLAG_LONG_LONG,
- [SIZET] = PA_INT | PA_FLAG_LONG,
- [IMAX] = PA_INT | PA_FLAG_LONG_LONG,
- [UMAX] = PA_INT | PA_FLAG_LONG_LONG,
- [PDIFF] = PA_INT | PA_FLAG_LONG_LONG,
- [UIPTR] = PA_INT | PA_FLAG_LONG,
- [DBL] = PA_DOUBLE,
- [LDBL] = PA_DOUBLE | PA_FLAG_LONG_DOUBLE
-};
-
-#define S(x) [(x)-'A']
-#define E(x) (STOP + (x))
-
-static const unsigned char states[]['z'-'A'+1] = {
- { /* 0: bare types */
- S('d') = E(INT), S('i') = E(INT),
- S('o') = E(UINT),S('u') = E(UINT),S('x') = E(UINT), S('X') = E(UINT),
- S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
- S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
- S('c') = E(CHAR),S('C') = E(INT),
- S('s') = E(PTR), S('S') = E(PTR), S('p') = E(UIPTR),S('n') = E(PTR),
- S('m') = E(NONE),
- S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE,
- S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE
- }, { /* 1: l-prefixed */
- S('d') = E(LONG), S('i') = E(LONG),
- S('o') = E(ULONG),S('u') = E(ULONG),S('x') = E(ULONG),S('X') = E(ULONG),
- S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
- S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
- S('c') = E(INT), S('s') = E(PTR), S('n') = E(PTR),
- S('l') = LLPRE
- }, { /* 2: ll-prefixed */
- S('d') = E(LLONG), S('i') = E(LLONG),
- S('o') = E(ULLONG),S('u') = E(ULLONG),
- S('x') = E(ULLONG),S('X') = E(ULLONG),
- S('n') = E(PTR)
- }, { /* 3: h-prefixed */
- S('d') = E(SHORT), S('i') = E(SHORT),
- S('o') = E(USHORT),S('u') = E(USHORT),
- S('x') = E(USHORT),S('X') = E(USHORT),
- S('n') = E(PTR),
- S('h') = HHPRE
- }, { /* 4: hh-prefixed */
- S('d') = E(CHAR), S('i') = E(CHAR),
- S('o') = E(UCHAR),S('u') = E(UCHAR),
- S('x') = E(UCHAR),S('X') = E(UCHAR),
- S('n') = E(PTR)
- }, { /* 5: L-prefixed */
- S('e') = E(LDBL),S('f') = E(LDBL),S('g') = E(LDBL), S('a') = E(LDBL),
- S('E') = E(LDBL),S('F') = E(LDBL),S('G') = E(LDBL), S('A') = E(LDBL),
- S('n') = E(PTR)
- }, { /* 6: z- or t-prefixed (assumed to be same size) */
- S('d') = E(PDIFF),S('i') = E(PDIFF),
- S('o') = E(SIZET),S('u') = E(SIZET),
- S('x') = E(SIZET),S('X') = E(SIZET),
- S('n') = E(PTR)
- }, { /* 7: j-prefixed */
- S('d') = E(IMAX), S('i') = E(IMAX),
- S('o') = E(UMAX), S('u') = E(UMAX),
- S('x') = E(UMAX), S('X') = E(UMAX),
- S('n') = E(PTR)
- }
-};
-
-size_t parse_printf_format(const char *fmt, size_t n, int *types)
-{
- size_t i = 0;
- size_t last = 0;
-
- memset(types, 0, n);
-
- while (1) {
- size_t arg;
- unsigned int state;
-
- fmt = consume_nonarg(fmt);
- if (*fmt == '\0')
- break;
- if (*fmt == '%') {
- fmt++;
- continue;
- }
- arg = 0;
- fmt = consume_argn(fmt, &arg);
- /* flags */
- fmt = consume_flags(fmt);
- /* width */
- if (*fmt == '*') {
- size_t warg = 0;
- fmt = consume_argn(fmt+1, &warg);
- if (warg == 0)
- warg = ++i;
- if (warg > last)
- last = warg;
- if (warg <= n && types[warg-1] == NONE)
- types[warg-1] = INT;
- } else
- fmt = consume_num(fmt);
- /* precision */
- if (*fmt == '.') {
- fmt++;
- if (*fmt == '*') {
- size_t parg = 0;
- fmt = consume_argn(fmt+1, &parg);
- if (parg == 0)
- parg = ++i;
- if (parg > last)
- last = parg;
- if (parg <= n && types[parg-1] == NONE)
- types[parg-1] = INT;
- } else {
- if (*fmt == '-')
- fmt++;
- fmt = consume_num(fmt);
- }
- }
- /* length modifier and conversion specifier */
- state = BARE;
- do {
- unsigned char c = *fmt++;
-
- if (c < 'A' || c > 'z')
- continue;
- state = states[state]S(c);
- if (state == 0)
- continue;
- } while (state < STOP);
-
- if (state == E(NONE))
- continue;
-
- if (arg == 0)
- arg = ++i;
- if (arg > last)
- last = arg;
- if (arg <= n)
- types[arg-1] = state - STOP;
- }
-
- if (last > n)
- last = n;
- for (i = 0; i < last; i++)
- types[i] = pa_types[types[i]];
-
- return last;
-}
diff --git a/nix/nixcrpkgs/pkgs/libudev/fill/printf.h b/nix/nixcrpkgs/pkgs/libudev/fill/printf.h
deleted file mode 100644
index ee64bdca4..000000000
--- a/nix/nixcrpkgs/pkgs/libudev/fill/printf.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
- This file is part of systemd.
-
- Copyright 2014 Emil Renner Berthing
-
- With parts from the GNU C Library
- Copyright 1991-2014 Free Software Foundation, Inc.
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see .
-***/
-
-#pragma once
-
-#include
-
-enum { /* C type: */
- PA_INT, /* int */
- PA_CHAR, /* int, cast to char */
- PA_WCHAR, /* wide char */
- PA_STRING, /* const char *, a '\0'-terminated string */
- PA_WSTRING, /* const wchar_t *, wide character string */
- PA_POINTER, /* void * */
- PA_FLOAT, /* float */
- PA_DOUBLE, /* double */
- PA_LAST
-};
-
-/* Flag bits that can be set in a type returned by `parse_printf_format'. */
-#define PA_FLAG_MASK 0xff00
-#define PA_FLAG_LONG_LONG (1 << 8)
-#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
-#define PA_FLAG_LONG (1 << 9)
-#define PA_FLAG_SHORT (1 << 10)
-#define PA_FLAG_PTR (1 << 11)
-
-size_t parse_printf_format(const char *fmt, size_t n, int *types);
-
diff --git a/nix/nixcrpkgs/pkgs/libudev/license_builder.sh b/nix/nixcrpkgs/pkgs/libudev/license_builder.sh
deleted file mode 100644
index 9b612b976..000000000
--- a/nix/nixcrpkgs/pkgs/libudev/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv systemd-* systemd
-
-license=$(cat systemd/LICENSE.LGPL2.1)
-
-cat > $out <libudev (part of systemd)
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/libudev/megapatch.patch b/nix/nixcrpkgs/pkgs/libudev/megapatch.patch
deleted file mode 100644
index a22af551f..000000000
--- a/nix/nixcrpkgs/pkgs/libudev/megapatch.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-diff -ur systemd-234-orig/src/basic/glob-util.c systemd-234/src/basic/glob-util.c
---- systemd-234-orig/src/basic/glob-util.c 2017-07-17 19:46:03.031674662 -0700
-+++ systemd-234/src/basic/glob-util.c 2017-07-22 20:11:56.931514364 -0700
-@@ -31,22 +31,8 @@
- int safe_glob(const char *path, int flags, glob_t *pglob) {
- int k;
-
-- /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
-- assert(!(flags & GLOB_ALTDIRFUNC));
--
-- if (!pglob->gl_closedir)
-- pglob->gl_closedir = (void (*)(void *)) closedir;
-- if (!pglob->gl_readdir)
-- pglob->gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot;
-- if (!pglob->gl_opendir)
-- pglob->gl_opendir = (void *(*)(const char *)) opendir;
-- if (!pglob->gl_lstat)
-- pglob->gl_lstat = lstat;
-- if (!pglob->gl_stat)
-- pglob->gl_stat = stat;
--
- errno = 0;
-- k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
-+ k = glob(path, flags, NULL, pglob);
-
- if (k == GLOB_NOMATCH)
- return -ENOENT;
-@@ -66,7 +52,7 @@
-
- assert(path);
-
-- k = safe_glob(path, GLOB_NOSORT|GLOB_BRACE, &g);
-+ k = safe_glob(path, GLOB_NOSORT, &g);
- if (k == -ENOENT)
- return false;
- if (k < 0)
-@@ -78,7 +64,7 @@
- _cleanup_globfree_ glob_t g = {};
- int k;
-
-- k = safe_glob(path, GLOB_NOSORT|GLOB_BRACE, &g);
-+ k = safe_glob(path, GLOB_NOSORT, &g);
- if (k < 0)
- return k;
-
-diff -ur systemd-234-orig/src/basic/missing.h systemd-234/src/basic/missing.h
---- systemd-234-orig/src/basic/missing.h 2017-07-17 19:46:03.031674662 -0700
-+++ systemd-234/src/basic/missing.h 2017-07-21 08:02:12.349505168 -0700
-@@ -40,6 +40,22 @@
- #include
- #include
-
-+static __inline__ char * canonicalize_file_name(const char * path)
-+{
-+ return realpath(path, NULL);
-+}
-+
-+static __inline__ char * strndupa(const char * s, size_t n)
-+{
-+ size_t length = strnlen(s, n);
-+ char * new_string = (char *)__builtin_alloca(length + 1);
-+ new_string[length] = 0;
-+ memcpy(new_string, s, length);
-+ return new_string;
-+}
-+
-+typedef int comparison_fn_t(const void *, const void *);
-+
- #ifdef HAVE_AUDIT
- #include
- #endif
-@@ -550,7 +566,7 @@
- # ifdef HAVE___SECURE_GETENV
- # define secure_getenv __secure_getenv
- # else
--# error "neither secure_getenv nor __secure_getenv are available"
-+# define secure_getenv getenv
- # endif
- #endif
-
-diff -ur systemd-234-orig/src/basic/mkdir.c systemd-234/src/basic/mkdir.c
---- systemd-234-orig/src/basic/mkdir.c 2017-07-17 19:46:03.031674662 -0700
-+++ systemd-234/src/basic/mkdir.c 2017-07-22 21:09:51.065274838 -0700
-@@ -28,6 +28,7 @@
- #include "path-util.h"
- #include "stat-util.h"
- #include "user-util.h"
-+#include "missing.h"
-
- int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir) {
- struct stat st;
-diff -ur systemd-234-orig/src/basic/parse-util.c systemd-234/src/basic/parse-util.c
---- systemd-234-orig/src/basic/parse-util.c 2017-07-17 19:46:03.031674662 -0700
-+++ systemd-234/src/basic/parse-util.c 2017-07-21 07:59:05.337491775 -0700
-@@ -30,6 +30,7 @@
- #include "parse-util.h"
- #include "process-util.h"
- #include "string-util.h"
-+#include "missing.h"
-
- int parse_boolean(const char *v) {
- assert(v);
diff --git a/nix/nixcrpkgs/pkgs/libusb/builder.sh b/nix/nixcrpkgs/pkgs/libusb/builder.sh
deleted file mode 100644
index 211ee465a..000000000
--- a/nix/nixcrpkgs/pkgs/libusb/builder.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libusb-* libusb
-
-mkdir build
-cd build
-
-if [ -n "$libudev" ]; then
- export CFLAGS="${CFLAGS:=} -isystem $libudev/include"
- export LDFLAGS="${LDFLAGS:=} -L$libudev/lib"
-fi
-
-../libusb/configure \
- --prefix=$out \
- --host=$host \
- --enable-static \
- --disable-shared
-
-make
-
-make install
-
-if [ -n "$libudev" ]; then
- ln -s $libudev/lib/pkgconfig/*.pc $out/lib/pkgconfig/
- echo "Requires: libudev" >> $out/lib/pkgconfig/libusb-1.0.pc
-fi
diff --git a/nix/nixcrpkgs/pkgs/libusb/default.nix b/nix/nixcrpkgs/pkgs/libusb/default.nix
deleted file mode 100644
index 3edc45f0b..000000000
--- a/nix/nixcrpkgs/pkgs/libusb/default.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ crossenv, libudev }:
-
-let
- version = "1.0.22";
-
- name = "libusbp-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.tar.bz2";
- sha256 = "0mw1a5ss4alg37m6bd4k44v35xwrcwp5qm4s686q1nsgkbavkbkm";
- };
-
- lib = crossenv.make_derivation {
- inherit version name src;
- builder = ./builder.sh;
- libudev = if crossenv.os == "linux" then libudev else null;
- };
-
-in
- lib
diff --git a/nix/nixcrpkgs/pkgs/libusbp/builder.sh b/nix/nixcrpkgs/pkgs/libusbp/builder.sh
deleted file mode 100644
index f117fa578..000000000
--- a/nix/nixcrpkgs/pkgs/libusbp/builder.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libusbp-* libusbp
-
-mkdir build
-cd build
-
-cmake-cross ../libusbp \
- -DCMAKE_INSTALL_PREFIX=$out \
- -DBUILD_SHARED_LIBS=false
-
-make
-
-make install
-
-if [ -d $out/bin ]; then
- find $out/bin -type f -exec $host-strip {} +
-fi
-
-if [ -n "$libudev" ]; then
- ln -s $libudev/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-fi
diff --git a/nix/nixcrpkgs/pkgs/libusbp/default.nix b/nix/nixcrpkgs/pkgs/libusbp/default.nix
deleted file mode 100644
index 75c58a241..000000000
--- a/nix/nixcrpkgs/pkgs/libusbp/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ crossenv, libudev }:
-
-let
- version = "1.1.0";
-
- name = "libusbp-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://github.com/pololu/libusbp/archive/${version}.tar.gz";
- sha256 = "18l34580ci1pq8p3133dnp8nzlz17qw2796xsz1gn0aca6978izc";
- };
-
- lib = crossenv.make_derivation {
- inherit version name src;
- builder = ./builder.sh;
-
- cross_inputs =
- if crossenv.os == "linux" then
- [ libudev ]
- else
- [];
-
- libudev = if crossenv.os == "linux" then libudev else null;
- };
-
- examples = crossenv.make_derivation {
- name = "${name}-examples";
- inherit src version;
- builder = ./examples_builder.sh;
- cross_inputs = [ lib ];
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- (if crossenv.os == "linux" then libudev.license_set else {}) //
- { "${name}" = license; };
-in
- lib // { inherit examples license_set; }
diff --git a/nix/nixcrpkgs/pkgs/libusbp/examples_builder.sh b/nix/nixcrpkgs/pkgs/libusbp/examples_builder.sh
deleted file mode 100644
index 563608be0..000000000
--- a/nix/nixcrpkgs/pkgs/libusbp/examples_builder.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libusbp-* libusbp
-
-mkdir build
-cd build
-
-FLAGS="-std=gnu++11 $(pkg-config-cross --cflags --libs libusbp-1)"
-
-$host-g++ ../libusbp/examples/lsusb/*.cpp -o lsusb$exe_suffix $FLAGS
-$host-g++ ../libusbp/examples/lsport/*.cpp -o lsport$exe_suffix $FLAGS
-
-mkdir -p $out/bin
-cp * $out/bin/
diff --git a/nix/nixcrpkgs/pkgs/libusbp/license_builder.sh b/nix/nixcrpkgs/pkgs/libusbp/license_builder.sh
deleted file mode 100644
index 93111231a..000000000
--- a/nix/nixcrpkgs/pkgs/libusbp/license_builder.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libusbp-* libusbp
-
-license=$(cat libusbp/LICENSE.txt)
-
-{
- cat > $out <Pololu USB library (libusbp)
-
-
- The Pololu USB Library (libusbp) is licensed under the following license:
-
-
-
-$license
-
-EOF
-} > $out
diff --git a/nix/nixcrpkgs/pkgs/libx11/builder.sh b/nix/nixcrpkgs/pkgs/libx11/builder.sh
deleted file mode 100644
index 9f46ef8ac..000000000
--- a/nix/nixcrpkgs/pkgs/libx11/builder.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libX11-* libx11
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../libx11/configure --prefix $out $configure_flags
-
-make
-
-make install
-
-# Make static linking work.
-sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc
-
-ln -s x11-xcb.pc $out/lib/pkgconfig/X11-xcb.pc
-ln -s x11.pc $out/lib/pkgconfig/X11.pc
-
-ln -sf $xproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $kbproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $libxcb/lib/pkgconfig/*.pc $out/lib/pkgconfig/
diff --git a/nix/nixcrpkgs/pkgs/libx11/default.nix b/nix/nixcrpkgs/pkgs/libx11/default.nix
deleted file mode 100644
index a20b63f75..000000000
--- a/nix/nixcrpkgs/pkgs/libx11/default.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-{ crossenv, xorg-macros, xproto, libxcb, xtrans,
- xextproto, inputproto, kbproto }:
-
-let
- version = "1.6.5";
-
- name = "libx11-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xorg.freedesktop.org/releases/individual/libX11-${version}.tar.bz2";
- sha256 = "0pa3cfp6h9rl2vxmkph65250gfqyki0ccqyaan6bl9d25gdr0f2d";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- builder = ./builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--disable-malloc0returnsnull " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [
- xorg-macros
- xproto
- libxcb
- xtrans
- xextproto
- inputproto
- kbproto
- ];
-
- inherit kbproto xproto libxcb;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- xorg-macros.license_set //
- xproto.license_set //
- libxcb.license_set //
- xtrans.license_set //
- xextproto.license_set //
- inputproto.license_set //
- kbproto.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/libx11/license_builder.sh b/nix/nixcrpkgs/pkgs/libx11/license_builder.sh
deleted file mode 100644
index 030bafd88..000000000
--- a/nix/nixcrpkgs/pkgs/libx11/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libX11-* libx11
-
-license=$(cat libx11/COPYING)
-
-cat > $out <libx11
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/libxall/builder.rb b/nix/nixcrpkgs/pkgs/libxall/builder.rb
deleted file mode 100644
index f7937666a..000000000
--- a/nix/nixcrpkgs/pkgs/libxall/builder.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'pathname'
-require 'fileutils'
-include FileUtils
-
-OutDir = Pathname(ENV.fetch('out'))
-LibDirs = ENV.fetch('libs').split(' ').map { |s| Pathname(s) }
-
-def symlink_file(target, dest)
- real_target = target.realpath
-
- if dest.exist?
- if !dest.symlink?
- raise "Want to link #{dest} (to #{target}) " \
- "but it already exists and is not a symlink."
- end
-
- current_target = dest.readlink
- if current_target != real_target
- raise "Conflict: #{dest} links to #{current_target} " \
- "but we want to link it to #{real_target}."
- end
- else
- dest.make_symlink(real_target)
- end
-end
-
-def recursive_symlink(target, dest)
- if target.directory?
- dest.mkdir if !dest.directory?
- target.children(false).each do |c|
- recursive_symlink(target + c, dest + c)
- end
- else
- symlink_file(target, dest)
- end
-end
-
-LibDirs.each do |libdir|
- recursive_symlink(libdir, OutDir)
-end
diff --git a/nix/nixcrpkgs/pkgs/libxall/default.nix b/nix/nixcrpkgs/pkgs/libxall/default.nix
deleted file mode 100644
index f570802ea..000000000
--- a/nix/nixcrpkgs/pkgs/libxall/default.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-# Amalgamates all of our X libraries into one derivation to make it easier to
-# build projects like Qt that expect them all to be installed in one place.
-
-{ crossenv, libs }:
-
-let
- lib = crossenv.make_derivation {
- name = "libxall";
- builder.ruby = ./builder.rb;
- inherit libs;
- };
-
- license_set = builtins.foldl' (x: y: x // y) {} (map (x: x.license_set) libs);
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/libxau/builder.sh b/nix/nixcrpkgs/pkgs/libxau/builder.sh
deleted file mode 100644
index b1dd74899..000000000
--- a/nix/nixcrpkgs/pkgs/libxau/builder.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libXau-* libxau
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../libxau/configure --prefix=$out $configure_flags
-
-make
-
-make install
-
-ln -s $xproto/lib/pkgconfig/xproto.pc $out/lib/pkgconfig/
diff --git a/nix/nixcrpkgs/pkgs/libxau/default.nix b/nix/nixcrpkgs/pkgs/libxau/default.nix
deleted file mode 100644
index fcfabbb0c..000000000
--- a/nix/nixcrpkgs/pkgs/libxau/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ crossenv, xorg-macros, xproto }:
-
-let
- version = "1.0.8";
-
- name = "libxau-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://www.x.org/archive/individual/lib/libXau-${version}.tar.bz2";
- sha256 = "1wm4pv12f36cwzhldpp7vy3lhm3xdcnp4f184xkxsp7b18r7gm7x";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- builder = ./builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ xorg-macros xproto ];
-
- inherit xproto;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- xorg-macros.license_set //
- xproto.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/libxau/license_builder.sh b/nix/nixcrpkgs/pkgs/libxau/license_builder.sh
deleted file mode 100644
index fb3825f7a..000000000
--- a/nix/nixcrpkgs/pkgs/libxau/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libXau-* libxau
-
-license=$(cat libxau/COPYING)
-
-cat > $out <libxau
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/libxcb/builder.sh b/nix/nixcrpkgs/pkgs/libxcb/builder.sh
deleted file mode 100644
index 19162ca98..000000000
--- a/nix/nixcrpkgs/pkgs/libxcb/builder.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libxcb-* libxcb
-
-cd libxcb
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-cd ..
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../libxcb/configure --prefix=$out $configure_flags
-
-make
-
-make install
-
-# Make static linking work.
-sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc
-sed -i 's/Libs.private/Libs/' $out/lib/pkgconfig/*.pc
-
-ln -sf $libxau/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-
diff --git a/nix/nixcrpkgs/pkgs/libxcb/default.nix b/nix/nixcrpkgs/pkgs/libxcb/default.nix
deleted file mode 100644
index d927f1555..000000000
--- a/nix/nixcrpkgs/pkgs/libxcb/default.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-{ crossenv, xcb-proto, libxau }:
-
-let
- version = "1.12";
-
- name = "libxcb-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xcb.freedesktop.org/dist/libxcb-${version}.tar.bz2";
- sha256 = "0nvv0la91cf8p5qqlb3r5xnmg1jn2wphn4fb5jfbr6byqsvv3psa";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- patches = [ ./no-pthread-stubs.patch ];
-
- builder = ./builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared " +
- "--enable-xinput " +
- "--enable-xkb";
-
- cross_inputs = [ xcb-proto libxau ];
-
- inherit libxau;
-
- native_inputs = [ crossenv.nixpkgs.python2 ];
- };
-
- examples = crossenv.make_derivation rec {
- name = "libxcb-examples";
-
- builder = ./examples_builder.sh;
-
- cross_inputs = [ lib ];
-
- example1 = ./example1.c;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- xcb-proto.license_set //
- libxau.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit examples license_set; }
diff --git a/nix/nixcrpkgs/pkgs/libxcb/example1.c b/nix/nixcrpkgs/pkgs/libxcb/example1.c
deleted file mode 100644
index 48c284636..000000000
--- a/nix/nixcrpkgs/pkgs/libxcb/example1.c
+++ /dev/null
@@ -1,68 +0,0 @@
-// Source: https://en.wikipedia.org/wiki/XCB#Example
-
-#include
-#include
-#include
-
-int main(void)
-{
- xcb_connection_t *c;
- xcb_screen_t *s;
- xcb_window_t w;
- xcb_gcontext_t g;
- xcb_generic_event_t *e;
- uint32_t mask;
- uint32_t values[2];
- int done = 0;
- xcb_rectangle_t r = { 20, 20, 60, 60 };
-
- /* open connection with the server */
- c = xcb_connect(NULL,NULL);
- if (xcb_connection_has_error(c)) {
- printf("Cannot open display\n");
- exit(1);
- }
- /* get the first screen */
- s = xcb_setup_roots_iterator( xcb_get_setup(c) ).data;
-
- /* create black graphics context */
- g = xcb_generate_id(c);
- w = s->root;
- mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
- values[0] = s->black_pixel;
- values[1] = 0;
- xcb_create_gc(c, g, w, mask, values);
-
- /* create window */
- w = xcb_generate_id(c);
- mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
- values[0] = s->white_pixel;
- values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS;
- xcb_create_window(c, s->root_depth, w, s->root,
- 10, 10, 100, 100, 1,
- XCB_WINDOW_CLASS_INPUT_OUTPUT, s->root_visual,
- mask, values);
-
- /* map (show) the window */
- xcb_map_window(c, w);
-
- xcb_flush(c);
-
- /* event loop */
- while (!done && (e = xcb_wait_for_event(c))) {
- switch (e->response_type & ~0x80) {
- case XCB_EXPOSE: /* draw or redraw the window */
- xcb_poly_fill_rectangle(c, w, g, 1, &r);
- xcb_flush(c);
- break;
- case XCB_KEY_PRESS: /* exit on key press */
- done = 1;
- break;
- }
- free(e);
- }
- /* close connection to server */
- xcb_disconnect(c);
-
- return 0;
-}
diff --git a/nix/nixcrpkgs/pkgs/libxcb/examples_builder.sh b/nix/nixcrpkgs/pkgs/libxcb/examples_builder.sh
deleted file mode 100644
index 1a936f734..000000000
--- a/nix/nixcrpkgs/pkgs/libxcb/examples_builder.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-source $setup
-
-pkg-config-cross xcb --cflags --libs
-
-$host-gcc -Wall $example1 \
- $(pkg-config-cross xcb --cflags --libs) \
- -o example1$exe_suffix
-
-mkdir -p $out/bin
-cp example1$exe_suffix $out/bin/
diff --git a/nix/nixcrpkgs/pkgs/libxcb/license_builder.sh b/nix/nixcrpkgs/pkgs/libxcb/license_builder.sh
deleted file mode 100644
index 31dd9f821..000000000
--- a/nix/nixcrpkgs/pkgs/libxcb/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libxcb-* libxcb
-
-license=$(cat libxcb/COPYING)
-
-cat > $out <libxcb
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/libxcb/no-pthread-stubs.patch b/nix/nixcrpkgs/pkgs/libxcb/no-pthread-stubs.patch
deleted file mode 100644
index 53c66b74e..000000000
--- a/nix/nixcrpkgs/pkgs/libxcb/no-pthread-stubs.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur libxcb-1.12-orig/configure libxcb-1.12/configure
---- libxcb-1.12-orig/configure 2017-07-29 22:28:37.986987240 -0700
-+++ libxcb-1.12/configure 2017-07-29 22:51:26.410210675 -0700
-@@ -19666,7 +19666,7 @@
- $as_echo "yes" >&6; }
-
- fi
--NEEDED="pthread-stubs xau >= 0.99.2"
-+NEEDED="xau >= 0.99.2"
-
- pkg_failed=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NEEDED" >&5
diff --git a/nix/nixcrpkgs/pkgs/libxext/builder.sh b/nix/nixcrpkgs/pkgs/libxext/builder.sh
deleted file mode 100644
index 53bec1552..000000000
--- a/nix/nixcrpkgs/pkgs/libxext/builder.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libXext-* xext
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../xext/configure --prefix=$out $configure_flags
-
-make
-
-make install
-
-sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc
-
-ln -sf $xextproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $libx11/lib/pkgconfig/*.pc $out/lib/pkgconfig/
diff --git a/nix/nixcrpkgs/pkgs/libxext/default.nix b/nix/nixcrpkgs/pkgs/libxext/default.nix
deleted file mode 100644
index 7cb0295ba..000000000
--- a/nix/nixcrpkgs/pkgs/libxext/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ crossenv, xproto, libx11, xextproto }:
-
-let
- version = "1.3.3";
-
- name = "libxext-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://www.x.org/releases/individual/lib/libXext-${version}.tar.bz2";
- sha256 = "0dbfn5bznnrhqzvkrcmw4c44yvvpwdcsrvzxf4rk27r36b9x865m";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- builder = ./builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--disable-malloc0returnsnull " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ xproto libx11 xextproto ];
-
- inherit xextproto libx11;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- xproto.license_set //
- libx11.license_set //
- xextproto.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
-
diff --git a/nix/nixcrpkgs/pkgs/libxext/license_builder.sh b/nix/nixcrpkgs/pkgs/libxext/license_builder.sh
deleted file mode 100644
index 991196310..000000000
--- a/nix/nixcrpkgs/pkgs/libxext/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libXext-* libxext
-
-license=$(cat libxext/COPYING)
-
-cat > $out <libxext
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/libxfixes/builder.sh b/nix/nixcrpkgs/pkgs/libxfixes/builder.sh
deleted file mode 100644
index 0217ce743..000000000
--- a/nix/nixcrpkgs/pkgs/libxfixes/builder.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libXfixes-* xfixes
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../xfixes/configure --prefix=$out $configure_flags
-
-make
-
-make install
-
-sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc
-
-ln -sf $xproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $fixesproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $libx11/lib/pkgconfig/*.pc $out/lib/pkgconfig/
diff --git a/nix/nixcrpkgs/pkgs/libxfixes/default.nix b/nix/nixcrpkgs/pkgs/libxfixes/default.nix
deleted file mode 100644
index fb98228ec..000000000
--- a/nix/nixcrpkgs/pkgs/libxfixes/default.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{ crossenv, xproto, xextproto, libx11, fixesproto }:
-
-let
- version = "5.0.3";
-
- name = "libxfixes-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://www.x.org/releases/individual/lib/libXfixes-${version}.tar.bz2";
- sha256 = "1miana3y4hwdqdparsccmygqr3ic3hs5jrqfzp70hvi2zwxd676y";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- builder = ./builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ xproto xextproto libx11 fixesproto ];
-
- inherit xproto libx11 fixesproto;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- xproto.license_set //
- xextproto.license_set //
- libx11.license_set //
- fixesproto.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/libxfixes/license_builder.sh b/nix/nixcrpkgs/pkgs/libxfixes/license_builder.sh
deleted file mode 100644
index 72bd5a222..000000000
--- a/nix/nixcrpkgs/pkgs/libxfixes/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libXfixes-* libxfixes
-
-license=$(cat libxfixes/COPYING)
-
-cat > $out <libxfixes
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/libxi/builder.sh b/nix/nixcrpkgs/pkgs/libxi/builder.sh
deleted file mode 100644
index 8c07f9da2..000000000
--- a/nix/nixcrpkgs/pkgs/libxi/builder.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libXi-* libxi
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../libxi/configure --prefix=$out $configure_flags
-
-make
-
-make install
-
-sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc
-
-ln -sf $inputproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $libx11/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $libxext/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $libxfixes/lib/pkgconfig/*.pc $out/lib/pkgconfig/
diff --git a/nix/nixcrpkgs/pkgs/libxi/default.nix b/nix/nixcrpkgs/pkgs/libxi/default.nix
deleted file mode 100644
index ab41d41d8..000000000
--- a/nix/nixcrpkgs/pkgs/libxi/default.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ crossenv, xproto, xextproto, inputproto, libx11, libxext, libxfixes }:
-
-let
- version = "1.7.9";
-
- name = "libxi-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://www.x.org/releases/individual/lib/libXi-${version}.tar.bz2";
- sha256 = "0idg1wc01hndvaa820fvfs7phvd1ymf0lldmq6386i7rhkzvirn2";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- builder = ./builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--disable-malloc0returnsnull " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ xproto xextproto inputproto libx11 libxext libxfixes ];
-
- inherit inputproto libx11 libxext libxfixes;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- xproto.license_set //
- xextproto.license_set //
- inputproto.license_set //
- libx11.license_set //
- libxext.license_set //
- libxfixes.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/libxi/license_builder.sh b/nix/nixcrpkgs/pkgs/libxi/license_builder.sh
deleted file mode 100644
index 966f93096..000000000
--- a/nix/nixcrpkgs/pkgs/libxi/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv libXi-* libxi
-
-license=$(cat libxi/COPYING)
-
-cat > $out <libxi
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/lmdb/builder.sh b/nix/nixcrpkgs/pkgs/lmdb/builder.sh
deleted file mode 100644
index a8d2909d8..000000000
--- a/nix/nixcrpkgs/pkgs/lmdb/builder.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-source $setup
-
-cp -r $src ./src
-chmod -R u+w ./src
-cd src/libraries/liblmdb
-
-sed -i 's/liblmdb.a liblmdb..SOEXT.$/liblmdb.a/' Makefile
-sed -i "s/gcc/$host-gcc/" Makefile
-sed -i "s/ar/$host-ar/" Makefile
-sed -i 's/^CC.*/CC = '"$host-gcc/" Makefile
-
-cat Makefile
-
-make CFLAGS+="-fPIC"
-
-make DESTDIR="$out" prefix=/ install
diff --git a/nix/nixcrpkgs/pkgs/lmdb/default.nix b/nix/nixcrpkgs/pkgs/lmdb/default.nix
deleted file mode 100644
index 140fc1609..000000000
--- a/nix/nixcrpkgs/pkgs/lmdb/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "lmdb-${version}";
- version = "0.9.23";
- builder = ./builder.sh;
-
- src = crossenv.nixpkgs.fetchFromGitHub {
- owner = "LMDB";
- repo = "lmdb";
- rev = "LMDB_${version}";
- sha256 = "0ag7l5180ajvm73y59m7sn3p52xm8m972d08cshxhpwgwa4v35k6";
- };
-}
diff --git a/nix/nixcrpkgs/pkgs/ncurses/builder.sh b/nix/nixcrpkgs/pkgs/ncurses/builder.sh
deleted file mode 100644
index d7740f353..000000000
--- a/nix/nixcrpkgs/pkgs/ncurses/builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-cd *
-
-./configure --host=$host --prefix=$out $configureFlags
-
-make
-
-make install.{libs,includes,data}
-
-# TODO Why do I need to do this?
-mkdir -p $out/lib/pkgconfig
-cp misc/*.pc $out/lib/pkgconfig
diff --git a/nix/nixcrpkgs/pkgs/ncurses/default.nix b/nix/nixcrpkgs/pkgs/ncurses/default.nix
deleted file mode 100644
index e602b2ec6..000000000
--- a/nix/nixcrpkgs/pkgs/ncurses/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "ncurses-${version}";
- version = "6.1-20181027";
- builder = ./builder.sh;
-
- # Needs to be the same version.
- native_inputs = [ crossenv.nixpkgs.ncurses ];
-
- configureFlags = [
- "--without-debug"
- "--enable-pc-files"
- "--enable-symlinks"
- # "--with-manpage-format=normal"
- "--without-cxx"
- # "--enable-widec"
- ];
-
- src = crossenv.nixpkgs.fetchurl {
- urls = [
- "https://invisible-mirror.net/archives/ncurses/current/ncurses-${version}.tgz"
- "ftp://ftp.invisible-island.net/ncurses/current/ncurses-${version}.tgz"
- ];
- sha256 = "1xn6wpi22jc61158w4ifq6s1fvilhmsy1in2srn3plk8pm0d4902";
- };
-}
diff --git a/nix/nixcrpkgs/pkgs/openocd/builder.sh b/nix/nixcrpkgs/pkgs/openocd/builder.sh
deleted file mode 100644
index c1c388d88..000000000
--- a/nix/nixcrpkgs/pkgs/openocd/builder.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-source $setup
-
-cp -r $src openocd
-chmod -R u+w openocd
-
-cd openocd
-SKIP_SUBMODULE=1 ./bootstrap
-cd ..
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross ../openocd/configure \
- --prefix=$out \
- --host=$host \
- --disable-dependency-tracking \
- --enable-static \
- --disable-shared
-
-make
-
-make install
-
-$host-strip $out/bin/openocd
diff --git a/nix/nixcrpkgs/pkgs/openocd/default.nix b/nix/nixcrpkgs/pkgs/openocd/default.nix
deleted file mode 100644
index 756ce9989..000000000
--- a/nix/nixcrpkgs/pkgs/openocd/default.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ crossenv, libusb }:
-
-let
- version = "2018-08-16";
-
- name = "openocd-${version}";
-
- nixpkgs = crossenv.nixpkgs;
-
- src = nixpkgs.fetchgit {
- url = "git://repo.or.cz/openocd"; # official mirror
- rev = "b2d259f67cc3ee4b689e704228d97943bae94064";
- sha256 = "0c5zpjplwp0ivl4mpiix628j0iad9gkmg9f7lidgqjr5a80cr6hg";
- deepClone = true;
- };
-
- drv = crossenv.make_derivation {
- inherit version name src;
- builder = ./builder.sh;
-
- native_inputs = [
- nixpkgs.autoconf
- nixpkgs.automake
- nixpkgs.libtool
- nixpkgs.m4
- ];
-
- ACLOCAL_PATH =
- "${nixpkgs.libtool}/share/aclocal:" +
- "${crossenv.native.pkgconf}/share/aclocal";
-
- # Avoid a name conflict: get_home_dir is also defined in libudev.
- CFLAGS = "-Dget_home_dir=openocd_get_home_dir";
-
- cross_inputs = [ libusb ];
- };
-
-in
- drv
diff --git a/nix/nixcrpkgs/pkgs/openssl/builder.sh b/nix/nixcrpkgs/pkgs/openssl/builder.sh
deleted file mode 100644
index e47e43ab1..000000000
--- a/nix/nixcrpkgs/pkgs/openssl/builder.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-source $setup
-
-tar -xf $src
-
-mkdir build
-cd build
-
-err () { echo ERR "$@" >&2; }
-
-case $host in
- i686-linux-musleabi)
- confighost=linux-x86;;
- x86_64-linux-musleabi)
- confighost=linux-x86_64;;
- x86_64-apple-darwin*)
- confighost=darwin64-x86_64-cc;;
- *)
- err openssl builder.sh needs to excplicitly translate
- err "'host=$host'" to something openssl understands.
- confighost=$host;;
-esac
-
-# TODO The `no-async` option seems weird, but
-# https://github.com/openssl/openssl/issues/1607
-
-# TODO I stole the no-dso option from the here[1], but is it
-# needed? I seems to be related to shared libraries, which we aren't using
-# anyways, but I don't like not understanding.
-#
-# [1]: https://github.com/rust-embedded/cross/blob/master/docker/openssl.sh
-
-# TODO Why `-fPIC`? I stole it from [2]
-#
-# [2]: https://github.com/rust-embedded/cross/pull/218/files
-
-../openssl-$version/Configure \
- --prefix=$out \
- --cross-compile-prefix=$host- \
- no-shared \
- no-dso \
- no-async \
- $confighost \
- -fPIC
-
-make
-make install
diff --git a/nix/nixcrpkgs/pkgs/openssl/default.nix b/nix/nixcrpkgs/pkgs/openssl/default.nix
deleted file mode 100644
index de9b876f9..000000000
--- a/nix/nixcrpkgs/pkgs/openssl/default.nix
+++ /dev/null
@@ -1,83 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "openssl-${version}";
- version = "1.1.1";
-
- native_inputs = [ crossenv.nixpkgs.perl ];
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://www.openssl.org/source/${name}.tar.gz";
- sha256 = "0gbab2fjgms1kx5xjvqx8bxhr98k4r8l2fa8vw7kvh491xd8fdi8";
- };
-
- builder = ./builder.sh;
-}
-
-# let
-#
-# coreutils = crossenv.nixpkgs.coreutils;
-#
-# # with stdenv.lib;
-#
-# in
-#
-# {
-#
-# patches = [ ./nix-ssl-cert-file.patch ];
-#
-# native_inputs = [ crossenv.nixpkgs.perl ];
-#
-# postPatch = ''
-# patchShebangs Configure
-# '' + optionalString (versionAtLeast version "1.1.1") ''
-# substituteInPlace config --replace '/usr/bin/env' '${coreutils}/bin/env'
-# '' + optionalString (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isMusl) ''
-# substituteInPlace crypto/async/arch/async_posix.h \
-# --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \
-# '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0'
-# '';
-#
-# configureScript = {
-# "x86_64-darwin" = "./Configure darwin64-x86_64-cc";
-# "x86_64-solaris" = "./Configure solaris64-x86_64-gcc";
-# "armv6l-linux" = "./Configure linux-armv4 -march=armv6";
-# "armv7l-linux" = "./Configure linux-armv4 -march=armv7-a";
-# }.${stdenv.hostPlatform.system} or (
-# if stdenv.hostPlatform == stdenv.buildPlatform
-# then "./config"
-# else if stdenv.hostPlatform.isMinGW
-# then "./Configure mingw${optionalString
-# (stdenv.hostPlatform.parsed.cpu.bits != 32)
-# (toString stdenv.hostPlatform.parsed.cpu.bits)}"
-# else if stdenv.hostPlatform.isLinux
-# then "./Configure linux-generic${toString stdenv.hostPlatform.parsed.cpu.bits}"
-# else if stdenv.hostPlatform.isiOS
-# then "./Configure ios${toString stdenv.hostPlatform.parsed.cpu.bits}-cross"
-# else
-# throw "Not sure what configuration to use for ${stdenv.hostPlatform.config}"
-# );
-#
-# configureFlags = [
-# "shared" # "shared" builds both shared and static libraries
-# "--libdir=lib"
-# "--openssldir=etc/ssl"
-# ] ++ stdenv.lib.optionals withCryptodev [
-# "-DHAVE_CRYPTODEV"
-# "-DUSE_CRYPTODEV_DIGESTS"
-# ]
-# ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isAarch64) "no-afalgeng";
-#
-# postInstall = ''
-# mkdir -p $bin
-# mv $out/bin $bin/
-#
-# mkdir $dev
-# mv $out/include $dev/
-#
-# # remove dependency on Perl at runtime
-# rm -r $out/etc/ssl/misc
-#
-# rmdir $out/etc/ssl/{certs,private}
-# '';
-# };
diff --git a/nix/nixcrpkgs/pkgs/p-load/builder.sh b/nix/nixcrpkgs/pkgs/p-load/builder.sh
deleted file mode 100644
index 7ebc2e6ac..000000000
--- a/nix/nixcrpkgs/pkgs/p-load/builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv p-load-* p-load
-
-mkdir build
-cd build
-
-cmake-cross ../p-load \
- -DCMAKE_INSTALL_PREFIX=$out
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/p-load/default.nix b/nix/nixcrpkgs/pkgs/p-load/default.nix
deleted file mode 100644
index 6ce88528b..000000000
--- a/nix/nixcrpkgs/pkgs/p-load/default.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ crossenv, libusbp }:
-
-crossenv.make_derivation rec {
- name = "p-load-${version}";
-
- version = "2041b02"; # 2.1.0ish
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://github.com/pololu/p-load/archive/${version}.tar.gz";
- sha256 = "07xn0k96pkvirsh45zn9976lwliiqkfx76vy1yrbx6kp55ssp2zp";
- };
-
- builder = ./builder.sh;
-
- cross_inputs = [ libusbp ];
-}
diff --git a/nix/nixcrpkgs/pkgs/pavr2/builder.sh b/nix/nixcrpkgs/pkgs/pavr2/builder.sh
deleted file mode 100644
index b516b6926..000000000
--- a/nix/nixcrpkgs/pkgs/pavr2/builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv pololu-usb-avr-programmer-v2-* pavr2
-
-mkdir build
-cd build
-
-cmake-cross ../pavr2 \
- -DCMAKE_INSTALL_PREFIX=$out
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/pavr2/default.nix b/nix/nixcrpkgs/pkgs/pavr2/default.nix
deleted file mode 100644
index 379e61b51..000000000
--- a/nix/nixcrpkgs/pkgs/pavr2/default.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ crossenv, qt, libusbp }:
-
-crossenv.make_derivation rec {
- name = "pavr2-${version}";
-
- version = "a113a3b"; # 1.0.2ish
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://github.com/pololu/pololu-usb-avr-programmer-v2/archive/${version}.tar.gz";
- sha256 = "1mg467jx7mpcn01vh8rq80w7p8mbj7l69dmpyni0nik44ggsj7ij";
- };
-
- builder = ./builder.sh;
-
- cross_inputs = [ libusbp qt ];
-}
diff --git a/nix/nixcrpkgs/pkgs/pdcurses/builder.sh b/nix/nixcrpkgs/pkgs/pdcurses/builder.sh
deleted file mode 100644
index e9dc46205..000000000
--- a/nix/nixcrpkgs/pkgs/pdcurses/builder.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-source $setup
-
-tar -xf $src
-mv PDCurses-* pdcurses
-
-mkdir build
-cd build
-
-source_files=../pdcurses/pdcurses/*.c
-
-if [ "$os" == "windows" ]; then
- os_files=../pdcurses/win32/*.c
-fi
-
-if [ "$os" == "linux" ]; then
- os_files=
-fi
-
-source_files="$source_files $os_files"
-
-for s in $source_files; do
- echo "compiling $s"
- $host-gcc -g -O2 -I../pdcurses \
- -DPDC_WIDE -DPDC_FORCE_UTF8 -c "$s" -o "$(basename $s).o"
-done
-
-$host-ar r libpdcurses.a *.o
-$host-ranlib libpdcurses.a
-
-mkdir -p $out/{lib,include}
-cp libpdcurses.a $out/lib/libpdcurses.a
-
-# Make libcurses.a so programs like GDB can find pdcurses.
-ln -s $out/lib/libpdcurses.a $out/lib/libcurses.a
-
-cd ../pdcurses
-cp curses.h panel.h term.h $out/include/
diff --git a/nix/nixcrpkgs/pkgs/pdcurses/default.nix b/nix/nixcrpkgs/pkgs/pdcurses/default.nix
deleted file mode 100644
index 0a47f6564..000000000
--- a/nix/nixcrpkgs/pkgs/pdcurses/default.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-# Note: This only seems to work on Windows.
-
-{ crossenv }:
-
-let
-
- pdcurses = import ./lib.nix {
- inherit crossenv;
- };
-
- examples = import ./examples.nix {
- inherit crossenv pdcurses;
- };
-
-in
- pdcurses // { inherit examples; }
diff --git a/nix/nixcrpkgs/pkgs/pdcurses/demos_builder.sh b/nix/nixcrpkgs/pkgs/pdcurses/demos_builder.sh
deleted file mode 100644
index eea6a6737..000000000
--- a/nix/nixcrpkgs/pkgs/pdcurses/demos_builder.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-source $setup
-
-tar -xf $src
-mv PDCurses-$version/demos .
-rm -r PDCurses-$version
-
-mkdir build
-cd build
-
-CFLAGS="-g -O2 -I$pdcurses/include -DPDC_WIDE"
-
-$host-gcc $CFLAGS -c ../demos/tui.c -o tui.o
-$host-ar r tui.a tui.o
-
-demos="firework newdemo ptest rain testcurs worm xmas tuidemo"
-
-for name in $demos; do
- src=../demos/$name.c
- echo "compiling $name"
- $host-gcc $CFLAGS -L"$pdcurses/lib" \
- "$src" tui.a -lpdcurses -o "$name.exe"
-done
-
-mkdir -p $out/bin
-mv *.exe $out/bin/
diff --git a/nix/nixcrpkgs/pkgs/pdcurses/examples.nix b/nix/nixcrpkgs/pkgs/pdcurses/examples.nix
deleted file mode 100644
index 8b3dbee38..000000000
--- a/nix/nixcrpkgs/pkgs/pdcurses/examples.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ crossenv, pdcurses }:
-
-crossenv.make_derivation rec {
- name = "pdcurses_demos-${version}";
-
- inherit pdcurses;
- inherit (pdcurses) src version;
-
- builder = ./demos_builder.sh;
-}
-
diff --git a/nix/nixcrpkgs/pkgs/pdcurses/lib.nix b/nix/nixcrpkgs/pkgs/pdcurses/lib.nix
deleted file mode 100644
index ef4293502..000000000
--- a/nix/nixcrpkgs/pkgs/pdcurses/lib.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "pdcurses-${version}";
-
- version = "3.4";
-
- src = crossenv.nixpkgs.fetchurl {
- # Sourceforge went down. The original URL was:
- # url = "mirror://sourceforge/pdcurses/PDCurses-${version}.tar.gz";
- url = "https://files.tmphax.com/repo1/pdcurses-${version}.tar.gz";
- sha256 = "0jz6l8552fnf1j542yhzifgknrdzrisxg158ks0l87g777a8zba6";
- };
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/qt/absolute-paths.patch b/nix/nixcrpkgs/pkgs/qt/absolute-paths.patch
deleted file mode 100644
index 93ab1e1fc..000000000
--- a/nix/nixcrpkgs/pkgs/qt/absolute-paths.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -ur qtbase-opensource-src-5.9.2-orig/configure qtbase-opensource-src-5.9.2/configure
---- qtbase-opensource-src-5.9.2-orig/configure 2017-10-26 08:10:12.932646805 -0700
-+++ qtbase-opensource-src-5.9.2/configure 2017-11-01 08:48:44.973917507 -0700
-@@ -36,9 +36,9 @@
- relconf=`basename $0`
- # the directory of this script is the "source tree"
- relpath=`dirname $0`
--relpath=`(cd "$relpath"; /bin/pwd)`
-+relpath=`(cd "$relpath"; pwd)`
- # the current directory is the "build tree" or "object tree"
--outpath=`/bin/pwd`
-+outpath=`pwd`
-
- WHICH="which"
-
-@@ -232,7 +232,7 @@
-
- sdk=$(getSingleQMakeVariable "QMAKE_MAC_SDK" "$1")
- if [ -z "$sdk" ]; then echo "QMAKE_MAC_SDK must be set when building on Mac" >&2; exit 1; fi
-- sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)
-+ sysroot=$(xcrun --sdk $sdk --show-sdk-path 2>/dev/null)
- if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi
-
- case "$sdk" in
-@@ -267,7 +267,7 @@
- # Prefix tool with toolchain path
- var=$(echo "$line" | cut -d '=' -f 1)
- val=$(echo "$line" | cut -d '=' -f 2-)
-- sdk_val=$(/usr/bin/xcrun -sdk $sdk -find $(echo $val | cut -d ' ' -f 1))
-+ sdk_val=$(xcrun -sdk $sdk -find $(echo $val | cut -d ' ' -f 1))
- val=$(echo $sdk_val $(echo $val | cut -s -d ' ' -f 2-))
- echo "$var=$val"
- ;;
-@@ -305,9 +305,6 @@
- UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-
- BUILD_ON_MAC=no
--if [ -d /System/Library/Frameworks/Carbon.framework ]; then
-- BUILD_ON_MAC=yes
--fi
- if [ "$OSTYPE" = "msys" ]; then
- relpath=`(cd "$relpath"; pwd -W)`
- outpath=`pwd -W`
-@@ -318,7 +315,7 @@
- #-------------------------------------------------------------------------------
-
- if [ "$BUILD_ON_MAC" = "yes" ]; then
-- if ! /usr/bin/xcode-select --print-path >/dev/null 2>&1; then
-+ if ! xcode-select --print-path >/dev/null 2>&1; then
- echo >&2
- echo " No Xcode selected. Please install Xcode via the App Store, " >&2
- echo " or the command line developer tools via xcode-select --install, " >&2
-@@ -329,8 +326,8 @@
- fi
-
- # In the else case we are probably using a Command Line Tools installation
-- if /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1; then
-- if ! /usr/bin/xcrun xcodebuild -license check 2>/dev/null; then
-+ if xcrun -find xcodebuild >/dev/null 2>&1; then
-+ if ! xcrun xcodebuild -license check 2>/dev/null; then
- echo >&2
- echo " Xcode setup not complete. You need to confirm the license" >&2
- echo " agreement by running 'sudo xcrun xcodebuild -license accept'." >&2
diff --git a/nix/nixcrpkgs/pkgs/qt/builder.sh b/nix/nixcrpkgs/pkgs/qt/builder.sh
deleted file mode 100644
index 1668ce280..000000000
--- a/nix/nixcrpkgs/pkgs/qt/builder.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-source $setup
-
-mkdir -p $out
-pushd $out
-tar -xf $src
-mv qtbase-opensource-src-* src
-cd src
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-popd
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-$out/src/configure -prefix $out $configure_flags
-
-make
-
-make install
-
diff --git a/nix/nixcrpkgs/pkgs/qt/core_macros.cmake b/nix/nixcrpkgs/pkgs/qt/core_macros.cmake
deleted file mode 100644
index f3ef672fd..000000000
--- a/nix/nixcrpkgs/pkgs/qt/core_macros.cmake
+++ /dev/null
@@ -1,106 +0,0 @@
-# These macros come from src/corelib/Qt5CoreMacros.cmake originally.
-
-#=============================================================================
-# Copyright 2005-2011 Kitware, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# * Neither the name of Kitware, Inc. nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#=============================================================================
-
-macro(QT5_MAKE_OUTPUT_FILE infile prefix ext outfile )
- string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
- string(LENGTH ${infile} _infileLength)
- set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
- if(_infileLength GREATER _binlength)
- string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
- if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
- file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
- else()
- file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
- endif()
- else()
- file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
- endif()
- if(WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path
- set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
- endif()
- set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
- string(REPLACE ".." "__" _outfile ${_outfile})
- get_filename_component(outpath ${_outfile} PATH)
- get_filename_component(_outfile ${_outfile} NAME_WE)
- file(MAKE_DIRECTORY ${outpath})
- set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
-endmacro()
-
-function(_QT5_PARSE_QRC_FILE infile _out_depends _rc_depends)
- get_filename_component(rc_path ${infile} PATH)
- if(EXISTS "${infile}")
- file(READ "${infile}" RC_FILE_CONTENTS)
- string(REGEX MATCHALL "]*>" "" RC_FILE "${RC_FILE}")
- if(NOT IS_ABSOLUTE "${RC_FILE}")
- set(RC_FILE "${rc_path}/${RC_FILE}")
- endif()
- set(RC_DEPENDS ${RC_DEPENDS} "${RC_FILE}")
- endforeach()
- qt5_make_output_file("${infile}" "" "qrc.depends" out_depends)
- configure_file("${infile}" "${out_depends}" COPYONLY)
- else()
- set(out_depends)
- endif()
- set(${_out_depends} ${out_depends} PARENT_SCOPE)
- set(${_rc_depends} ${RC_DEPENDS} PARENT_SCOPE)
-endfunction()
-
-function(QT5_ADD_RESOURCES outfiles )
- set(options)
- set(oneValueArgs)
- set(multiValueArgs OPTIONS)
- cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
- set(rcc_options ${_RCC_OPTIONS})
-
- if("${rcc_options}" MATCHES "-binary")
- message(WARNING "Use qt5_add_binary_resources for binary option")
- endif()
-
- foreach(it ${rcc_files})
- get_filename_component(outfilename ${it} NAME_WE)
- get_filename_component(infile ${it} ABSOLUTE)
- set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
- _QT5_PARSE_QRC_FILE(${infile} _out_depends _rc_depends)
- add_custom_command(OUTPUT ${outfile}
- COMMAND ${Qt5Core_RCC_EXECUTABLE}
- ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile}
- MAIN_DEPENDENCY ${infile}
- DEPENDS ${_rc_depends} "${out_depends}" VERBATIM)
- list(APPEND ${outfiles} ${outfile})
- endforeach()
- set(${outfiles} ${${outfiles}} PARENT_SCOPE)
-endfunction()
diff --git a/nix/nixcrpkgs/pkgs/qt/dbus-null-pointer.patch b/nix/nixcrpkgs/pkgs/qt/dbus-null-pointer.patch
deleted file mode 100644
index 8e8543c62..000000000
--- a/nix/nixcrpkgs/pkgs/qt/dbus-null-pointer.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur qtbase-opensource-src-5.9.6-orig/src/platformsupport/linuxaccessibility/dbusconnection.cpp qtbase-opensource-src-5.9.6/src/platformsupport/linuxaccessibility/dbusconnection.cpp
---- qtbase-opensource-src-5.9.6-orig/src/platformsupport/linuxaccessibility/dbusconnection.cpp 2018-06-19 12:42:00.533895696 -0700
-+++ qtbase-opensource-src-5.9.6/src/platformsupport/linuxaccessibility/dbusconnection.cpp 2018-06-19 12:45:03.308744607 -0700
-@@ -75,7 +75,7 @@
- connect(dbusWatcher, SIGNAL(serviceRegistered(QString)), this, SLOT(serviceRegistered()));
-
- // If it is registered already, setup a11y right away
-- if (c.interface()->isServiceRegistered(A11Y_SERVICE))
-+ if (c.interface() && c.interface()->isServiceRegistered(A11Y_SERVICE))
- serviceRegistered();
-
- // In addition try if there is an xatom exposing the bus address, this allows applications run as root to work
diff --git a/nix/nixcrpkgs/pkgs/qt/default.nix b/nix/nixcrpkgs/pkgs/qt/default.nix
deleted file mode 100644
index 5a9f4d675..000000000
--- a/nix/nixcrpkgs/pkgs/qt/default.nix
+++ /dev/null
@@ -1,165 +0,0 @@
-# TODO: look into why were compiling with this impure option on Linux:
-# -DDFLT_XKB_CONFIG_ROOT=\"/usr/share/X11/xkb\"
-
-# TODO: patch qt to not use /bin/pwd, test building it in a sandbox
-
-{ crossenv, libudev, libxall, at-spi2-headers, dejavu-fonts }:
-
-let
- version = "5.9.6";
-
- name = "qtbase-${version}";
-
- platform =
- let
- os_code =
- if crossenv.os == "windows" then "win32"
- else if crossenv.os == "macos" then "macx"
- else if crossenv.os == "linux" then "devices/linux-generic"
- else crossenv.os;
- compiler_code =
- if crossenv.compiler == "gcc" then "g++"
- else crossenv.compiler;
- in "${os_code}-${compiler_code}";
-
- base_src = crossenv.nixpkgs.fetchurl {
- url = "https://download.qt.io/official_releases/qt/5.9/${version}/submodules/qtbase-opensource-src-${version}.tar.xz";
- sha256 = "0vz3rgx7bk50jzy78lxv5pff2l8xqmqs9iiz7gc9n6cb4v5j1mpf";
- };
-
- base_raw = crossenv.make_derivation {
- name = "qtbase-raw-${version}";
- inherit version;
- src = base_src;
- builder = ./builder.sh;
-
- patches = [
- # Purity issue: Don't look at the build system using absolute paths.
- ./absolute-paths.patch
-
- # macOS configuration: Don't run tools from /usr/bin, use the right
- # compiler, and don't pass redundant options to it (-arch, -isysroot,
- # -mmacosx-version-min).
- ./macos-config.patch
-
- # libX11.a depends on libxcb.a. This makes tests.xlib in
- # src/gui/configure.json pass, enabling lots of X functionality in Qt.
- ./find-x-libs.patch
-
- # Fix the build error caused by https://bugreports.qt.io/browse/QTBUG-63637
- ./win32-link-object-max.patch
-
- # The .pc files have incorrect library names without this (e.g. Qt5Cored)
- ./pc-debug-name.patch
-
- # uxtheme.h test is broken, always returns false, and results in QtWidgets
- # apps looking bad on Windows. https://stackoverflow.com/q/44784414/28128
- ./dont-test-uxtheme.patch
-
- # When cross-compiling, Qt uses some heuristics about whether to trust the
- # pkg-config executable supplied by the PKG_CONFIG environment variable.
- # These heuristics are wrong for us, so disable them, making qt use
- # pkg-config-cross.
- ./pkg-config-cross.patch
-
- # When the DBus session bus is not available, Qt tries to dereference a
- # null pointer, so Linux applications can't start up.
- ./dbus-null-pointer.patch
-
- # Look for fonts in the same directory as the application by default if
- # the QT_QPA_FONTDIR environment variable is not present. Without this
- # patch, Qt tries to look for a font directory in the nix store that does
- # not exists, and prints warnings.
- # You must ship a .ttf, .ttc, .pfa, .pfb, or .otf font file
- # with your application (e.g. https://dejavu-fonts.github.io/ ).
- # That list of extensions comes from qbasicfontdatabase.cpp.
- ./font-dir.patch
- ];
-
- configure_flags =
- "-opensource -confirm-license " +
- "-xplatform ${platform} " +
- "-device-option CROSS_COMPILE=${crossenv.host}- " +
- "-release " + # change to -debug if you want debugging symbols
- "-static " +
- "-pkg-config " +
- "-nomake examples " +
- "-no-icu " +
- "-no-fontconfig " +
- "-no-reduce-relocations " +
- ( if crossenv.os == "windows" then
- "-opengl desktop"
- else if crossenv.os == "linux" then
- "-qpa xcb " +
- "-system-xcb " +
- "-no-opengl " +
- "-device-option QMAKE_INCDIR_X11=${libxall}/include " +
- "-device-option QMAKE_LIBDIR_X11=${libxall}/lib"
- else if crossenv.os == "macos" then
- "-device-option QMAKE_MAC_SDK.macosx.--show-sdk-path=" +
- "${crossenv.sdk} " +
- "-device-option QMAKE_MAC_SDK.macosx.--show-sdk-platform-path=" +
- "${crossenv.sdk}/does-not-exist " +
- "-device-option QMAKE_MAC_SDK.macosx.--show-sdk-version=" +
- "${crossenv.macos_version_min} " +
- "-device-option QMAKE_XCODE_VERSION=7.0"
- else "" );
-
- cross_inputs =
- if crossenv.os == "linux" then [
- libudev # not sure if this helps, but Qt does look for it
- libxall
- at-spi2-headers # for accessibility
- ]
- else [];
- };
-
- # This wrapper aims to make Qt easier to use by generating CMake package files
- # for it. The existing support for CMake in Qt does not handle static
- # linking; other projects maintian large, messy patches to fix it, but we
- # prefer to generate the CMake files in a clean way from scratch.
- base = crossenv.make_derivation {
- inherit version name;
- os = crossenv.os;
- qtbase = base_raw;
- cross_inputs = base_raw.cross_inputs;
- builder.ruby = ./wrapper_builder.rb;
- core_macros = ./core_macros.cmake;
- };
-
- examples = crossenv.make_derivation {
- name = "qtbase-examples-${version}";
- inherit version;
- os = crossenv.os;
- qtbase = base;
- cross_inputs = [ base ];
- dejavu = dejavu-fonts;
- builder = ./examples_builder.sh;
- };
-
- license_fragment = crossenv.native.make_derivation {
- name = "qtbase-${version}-license-fragment";
- inherit version;
- src = base_src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- (
- if crossenv.os == "linux" then
- libudev.license_set //
- libxall.license_set //
- at-spi2-headers.license_set
- else
- {}
- ) //
- { "${name}" = license_fragment; };
-in
- base // {
- recurseForDerivations = true;
- inherit base_src;
- inherit base_raw;
- inherit base;
- inherit examples;
- inherit license_set;
- }
diff --git a/nix/nixcrpkgs/pkgs/qt/dont-test-uxtheme.patch b/nix/nixcrpkgs/pkgs/qt/dont-test-uxtheme.patch
deleted file mode 100644
index c41620138..000000000
--- a/nix/nixcrpkgs/pkgs/qt/dont-test-uxtheme.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -ur qtbase-opensource-src-5.9.2-orig/src/widgets/configure.json qtbase-opensource-src-5.9.2/src/widgets/configure.json
---- qtbase-opensource-src-5.9.2-orig/src/widgets/configure.json 2017-10-25 13:52:49.173421900 -0700
-+++ qtbase-opensource-src-5.9.2/src/widgets/configure.json 2017-10-25 13:53:42.891341214 -0700
-@@ -28,11 +28,6 @@
- },
-
- "tests": {
-- "uxtheme": {
-- "label": "uxtheme.h",
-- "type": "files",
-- "files": [ "uxtheme.h" ]
-- }
- },
-
- "features": {
-@@ -57,7 +52,7 @@
- },
- "style-windowsxp": {
- "label": "WindowsXP",
-- "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme",
-+ "condition": "features.style-windows && config.win32 && !config.winrt",
- "output": [ "privateFeature", "styles" ]
- },
- "style-windowsvista": {
diff --git a/nix/nixcrpkgs/pkgs/qt/examples_builder.sh b/nix/nixcrpkgs/pkgs/qt/examples_builder.sh
deleted file mode 100644
index d5d56e11c..000000000
--- a/nix/nixcrpkgs/pkgs/qt/examples_builder.sh
+++ /dev/null
@@ -1,88 +0,0 @@
-source $setup
-
-examples=$qtbase/src/examples
-
-mkdir build
-cd build
-mkdir bin moc obj
-
-cat > obj/plugins.cpp <
-#ifdef _WIN32
-Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin);
-#endif
-#ifdef __linux__
-Q_IMPORT_PLUGIN (QLinuxFbIntegrationPlugin);
-Q_IMPORT_PLUGIN (QXcbIntegrationPlugin);
-#endif
-EOF
-
-CFLAGS="-std=gnu++11"
-
-echo "compiling reference to plugins"
-$host-g++ $CFLAGS \
- $(pkg-config-cross --cflags Qt5Core) \
- -c obj/plugins.cpp \
- -o obj/plugins.o
-
-CFLAGS="$CFLAGS -g -I. $(pkg-config-cross --cflags Qt5Widgets)"
-LIBS="$(pkg-config-cross --libs Qt5Widgets)"
-LDFLAGS=""
-
-if [ $os = "windows" ]; then
- CFLAGS="-mwindows $CFLAGS"
-fi
-
-echo "compiling dynamiclayouts"
-$qtbase/bin/moc $examples/widgets/layouts/dynamiclayouts/dialog.h > moc/dynamiclayouts.cpp
-$host-g++ $CFLAGS $LDFLAGS \
- $examples/widgets/layouts/dynamiclayouts/dialog.cpp \
- $examples/widgets/layouts/dynamiclayouts/main.cpp \
- moc/dynamiclayouts.cpp \
- obj/plugins.o \
- $LIBS -o bin/dynamiclayouts$exe_suffix
-
-echo "compiling rasterwindow"
-$qtbase/bin/moc $examples/gui/rasterwindow/rasterwindow.h > moc/rasterwindow.cpp
-$host-g++ $CFLAGS $LDFLAGS \
- $examples/gui/rasterwindow/rasterwindow.cpp \
- $examples/gui/rasterwindow/main.cpp \
- moc/rasterwindow.cpp \
- obj/plugins.o \
- $LIBS -o bin/rasterwindow$exe_suffix
-
-echo "compiling analogclock"
-$host-g++ $CFLAGS $LDFLAGS \
- -I$examples/gui/rasterwindow/ \
- $examples/gui/analogclock/main.cpp \
- $examples/gui/rasterwindow/rasterwindow.cpp \
- moc/rasterwindow.cpp \
- obj/plugins.o \
- $LIBS -o bin/analogclock$exe_suffix
-
-# We haven't gotten OpenGL support to work on Linux yet (TODO)
-if [ $os != "linux" ]; then
- echo "compiling openglwindow"
- $qtbase/bin/moc $examples/gui/openglwindow/openglwindow.h > moc/openglwindow.cpp
- $host-g++ $CFLAGS $LDFLAGS \
- $examples/gui/openglwindow/main.cpp \
- $examples/gui/openglwindow/openglwindow.cpp \
- moc/openglwindow.cpp \
- obj/plugins.o \
- $LIBS -o bin/openglwindow$exe_suffix
-fi
-
-# TODO: try to compile some stuff with $qtbase/bin/qmake too, make sure that works
-
-mkdir -p $out/bin
-
-for prog in analogclock dynamiclayouts openglwindow rasterwindow; do
- if [ -f bin/$prog ]; then
- $host-strip bin/$prog
- cp bin/$prog $out/bin/
- fi
-done
-
-if [ $os = "linux" ]; then
- cp $dejavu/ttf/DejaVuSans.ttf $out/bin/
-fi
diff --git a/nix/nixcrpkgs/pkgs/qt/find-x-libs.patch b/nix/nixcrpkgs/pkgs/qt/find-x-libs.patch
deleted file mode 100644
index 73bd77005..000000000
--- a/nix/nixcrpkgs/pkgs/qt/find-x-libs.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/common/linux.conf qtbase-opensource-src-5.9.2/mkspecs/common/linux.conf
---- qtbase-opensource-src-5.9.2-orig/mkspecs/common/linux.conf 2017-10-26 08:10:12.922646692 -0700
-+++ qtbase-opensource-src-5.9.2/mkspecs/common/linux.conf 2017-10-26 21:44:37.695088447 -0700
-@@ -28,7 +28,7 @@
-
- QMAKE_LIBS =
- QMAKE_LIBS_DYNLOAD = -ldl
--QMAKE_LIBS_X11 = -lXext -lX11 -lm
-+QMAKE_LIBS_X11 = -lXext -lX11 -lxcb -lXau
- QMAKE_LIBS_EGL = -lEGL
- QMAKE_LIBS_OPENGL = -lGL
- QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
diff --git a/nix/nixcrpkgs/pkgs/qt/font-dir.patch b/nix/nixcrpkgs/pkgs/qt/font-dir.patch
deleted file mode 100644
index ab8384764..000000000
--- a/nix/nixcrpkgs/pkgs/qt/font-dir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- qt-5.8.0-orig/src/gui/text/qplatformfontdatabase.cpp
-+++ qt-5.8.0/src/gui/text/qplatformfontdatabase.cpp
-@@ -396,7 +396,7 @@
- {
- QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR"));
- if (fontpath.isEmpty())
-- fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts");
-+ fontpath = QCoreApplication::applicationDirPath();
-
- return fontpath;
- }
diff --git a/nix/nixcrpkgs/pkgs/qt/license_builder.sh b/nix/nixcrpkgs/pkgs/qt/license_builder.sh
deleted file mode 100644
index f0fec2354..000000000
--- a/nix/nixcrpkgs/pkgs/qt/license_builder.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-# Last updated for qtbase-opensource-src-5.8.0.tar.xz
-
-source $setup
-
-if [ "$version" != "5.9.6" ]; then
- echo "You need to update the license fragment builder for Qt $version."
- exit 1
-fi
-
-tar -xf $src
-mv qtbase-* qtbase
-
-# Read the license files here instead of in the big string so it is a fatal
-# error if any of them are missing.
-license_qt=$(cat qtbase/LICENSE.LGPLv3)
-cd qtbase/src/3rdparty
-license_android=$(cat android/LICENSE)
-license_angle1=$(cat angle/LICENSE)
-license_angle2=$(cat angle/TRACEEVENT_LICENSE)
-license_angle3=$(cat angle/SYSTEMINFO_LICENSE)
-license_dc=$(cat double-conversion/LICENSE)
-license_easing=$(cat easing/LICENSE)
-license_forkfd=$(cat forkfd/LICENSE)
-license_freebsd=$(cat freebsd/LICENSE)
-license_freetype=$(cat freetype/docs/GPLv2.TXT)
-license_gradle=$(cat gradle/LICENSE-GRADLEW.txt)
-license_harfbuzz=$(cat harfbuzz/COPYING)
-license_harfbuzz_ng=$(cat harfbuzz-ng/COPYING)
-license_ia2=$(cat iaccessible2/LICENSE)
-license_libjpeg=$(cat libjpeg/LICENSE)
-license_libpng=$(cat libpng/LICENSE)
-license_pcre2=$(cat pcre2/LICENCE)
-license_pixman=$(cat pixman/LICENSE)
-license_rfc6234=$(cat rfc6234/LICENSE)
-license_sha3_1=$(cat sha3/BRG_ENDIAN_LICENSE)
-license_sha3_2=$(cat sha3/CC0_LICENSE)
-license_xcb=$(cat xcb/LICENSE)
-license_xkbcommon=$(cat xkbcommon/COPYING)
-license_zlib=$(cat zlib/LICENSE)
-
-cat > $out <Qt
-
-
- The Qt Toolkit is licensed under the
- GNU Lesser General Public License Version 3 (LGPLv3) as shown below.
-
-
-
-$license_qt
-
-
-Third-party components bundled with Qt
-
-
- This software might include code from third-party comoponents bundled with Qt.
- The copyright notices of those components are reproduced below.
-
-
-
-$license_android
-
-
-
-$license_angle1
-
-
-
-$license_angle2
-
-
-
-$license_angle3
-
-
-
-$license_dc
-
-
-
-$license_easing
-
-
-
-$license_forkfd
-
-
-
-$license_freebsd
-
-
-
-$license_freetype
-
-
-
-$license_gradle
-
-
-
-$license_harfbuzz
-
-
-
-$license_harfbuzz_ng
-
-
-
-$license_ia2
-
-
-
-$license_libjpeg
-
-
-
-$license_libpng
-
-
-
-$license_pcre2
-
-
-
-$license_pixman
-
-
-
-$license_rfc6234
-
-
-
-$license_sha3_1
-
-
-
-$license_sha3_2
-
-
-
-$license_xcb
-
-
-
-$license_xkbcommon
-
-
-
-$license_zlib
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/qt/macos-config.patch b/nix/nixcrpkgs/pkgs/qt/macos-config.patch
deleted file mode 100644
index de8c3a282..000000000
--- a/nix/nixcrpkgs/pkgs/qt/macos-config.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/common/clang.conf qtbase-opensource-src-5.9.2-mac/mkspecs/common/clang.conf
---- qtbase-opensource-src-5.9.2-orig/mkspecs/common/clang.conf 2017-11-03 20:37:01.001539490 -0700
-+++ qtbase-opensource-src-5.9.2-mac/mkspecs/common/clang.conf 2017-11-03 20:46:20.159382848 -0700
-@@ -4,8 +4,8 @@
-
- QMAKE_COMPILER = gcc clang llvm # clang pretends to be gcc
-
--QMAKE_CC = clang
--QMAKE_CXX = clang++
-+QMAKE_CC = $${CROSS_COMPILE}clang
-+QMAKE_CXX = $${CROSS_COMPILE}clang++
-
- QMAKE_LINK_C = $$QMAKE_CC
- QMAKE_LINK_C_SHLIB = $$QMAKE_CC
-diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/common/clang-mac.conf qtbase-opensource-src-5.9.2-mac/mkspecs/common/clang-mac.conf
---- qtbase-opensource-src-5.9.2-orig/mkspecs/common/clang-mac.conf 2017-11-03 20:37:01.001539490 -0700
-+++ qtbase-opensource-src-5.9.2-mac/mkspecs/common/clang-mac.conf 2017-11-03 20:55:13.878575754 -0700
-@@ -6,8 +6,6 @@
-
- QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0
-
--QMAKE_CXXFLAGS += -stdlib=libc++
--QMAKE_LFLAGS += -stdlib=libc++
- QMAKE_AR_LTCG = libtool -static -o
-
- QMAKE_CFLAGS_APPLICATION_EXTENSION = -fapplication-extension
-diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/common/mac.conf qtbase-opensource-src-5.9.2-mac/mkspecs/common/mac.conf
---- qtbase-opensource-src-5.9.2-orig/mkspecs/common/mac.conf 2017-11-03 20:37:01.001539490 -0700
-+++ qtbase-opensource-src-5.9.2-mac/mkspecs/common/mac.conf 2017-11-03 22:03:30.960602142 -0700
-@@ -35,10 +35,10 @@
-
- QMAKE_ACTOOL = actool
-
--QMAKE_DSYMUTIL = dsymutil
--QMAKE_STRIP = strip
-+QMAKE_DSYMUTIL = $${CROSS_COMPILE}dsymutil
-+QMAKE_STRIP = $${CROSS_COMPILE}strip
- QMAKE_STRIPFLAGS_LIB += -S -x
-
--QMAKE_AR = ar cq
--QMAKE_RANLIB = ranlib -s
--QMAKE_NM = nm -P
-+QMAKE_AR = $${CROSS_COMPILE}ar cq
-+QMAKE_RANLIB = $${CROSS_COMPILE}ranlib -s
-+QMAKE_NM = $${CROSS_COMPILE}nm -P
-diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/default_post.prf qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/default_post.prf
---- qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/default_post.prf 2017-11-03 20:37:01.008206202 -0700
-+++ qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/default_post.prf 2017-11-03 21:06:25.247871399 -0700
-@@ -2,29 +2,6 @@
-
- !no_objective_c:CONFIG += objective_c
-
--qt {
-- qtConfig(static) {
-- # C++11 support means using libc++ instead of libstd++. As the
-- # two libraries are incompatible we need to ensure the end user
-- # project is built using the same C++11 support/no support as Qt.
-- qtConfig(c++11) {
-- CONFIG += c++11
-- } else: c++11 {
-- warning("Qt was not built with C++11 enabled, disabling feature")
-- CONFIG -= c++11
-- }
--
-- !c++11 {
-- # Explicitly use libstdc++ if C++11 support is not enabled,
-- # as otherwise the compiler will choose the standard library
-- # based on the deployment target, which for iOS 7 and OS X 10.9
-- # is libc++, and we can't mix and match the two.
-- QMAKE_CXXFLAGS += -stdlib=libstdc++
-- QMAKE_LFLAGS += -stdlib=libstdc++
-- }
-- }
--}
--
- # Add the same default rpaths as Xcode does for new projects.
- # This is especially important for iOS/tvOS/watchOS where no other option is possible.
- !no_default_rpath {
-@@ -89,10 +66,6 @@
-
- arch_flags = $(EXPORT_ARCH_ARGS)
-
-- QMAKE_CFLAGS += $$arch_flags
-- QMAKE_CXXFLAGS += $$arch_flags
-- QMAKE_LFLAGS += $$arch_flags
--
- QMAKE_PCH_ARCHS = $$VALID_ARCHS
-
- macos: deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
-@@ -149,9 +122,6 @@
- else: \
- version_identifier = $$device.deployment_identifier
- version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
-- QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
-- QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
-- QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag
- }
-
- # Enable precompiled headers for multiple architectures
-diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/default_pre.prf qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/default_pre.prf
---- qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/default_pre.prf 2017-11-03 20:37:01.008206202 -0700
-+++ qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/default_pre.prf 2017-11-03 20:46:20.159382848 -0700
-@@ -1,43 +1,6 @@
- CONFIG = asset_catalogs rez $$CONFIG
- load(default_pre)
-
--isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
-- # Get path of Xcode's Developer directory
-- QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
-- isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
-- error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
--
-- # Make sure Xcode path is valid
-- !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
-- error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
--}
--
--isEmpty(QMAKE_XCODEBUILD_PATH): \
-- QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
--
--!isEmpty(QMAKE_XCODEBUILD_PATH) {
-- # Make sure Xcode is set up properly
-- !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
-- error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
--
-- isEmpty(QMAKE_XCODE_VERSION) {
-- # Extract Xcode version using xcodebuild
-- xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
-- QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
-- isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
-- unset(xcode_version)
-- }
--}
--
--isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
-- QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist
-- exists($$QMAKE_XCODE_PREFERENCES_FILE): \
-- QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null")
--
-- !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
-- cache(QMAKE_TARGET_BUNDLE_PREFIX)
--}
--
- QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
-
- # Make the default debug info format for static debug builds
-diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/sdk.prf qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/sdk.prf
---- qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/sdk.prf 2017-11-03 20:37:01.008206202 -0700
-+++ qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/sdk.prf 2017-11-03 20:46:20.159382848 -0700
-@@ -18,7 +18,7 @@
- sdk = $$QMAKE_MAC_SDK
-
- isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
-- QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$info 2>/dev/null")
-+ QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("xcrun --sdk $$sdk $$info 2>/dev/null")
- # --show-sdk-platform-path won't work for Command Line Tools; this is fine
- # only used by the XCTest backend to testlib
- isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(info, "--show-sdk-platform-path")): \
-@@ -50,7 +50,7 @@
- value = $$eval($$tool)
- isEmpty(value): next()
-
-- sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
-+ sysrooted = $$system("xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
- isEmpty(sysrooted): next()
-
- $$tool = $$sysrooted $$member(value, 1, -1)
diff --git a/nix/nixcrpkgs/pkgs/qt/pc-debug-name.patch b/nix/nixcrpkgs/pkgs/qt/pc-debug-name.patch
deleted file mode 100644
index 690e8bea7..000000000
--- a/nix/nixcrpkgs/pkgs/qt/pc-debug-name.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 995313e0795df5500fd84350e80a3f88202b473d Mon Sep 17 00:00:00 2001
-From: Martchus
-Date: Sun, 18 Sep 2016 14:01:14 +0200
-Subject: [PATCH 07/30] Prevent debug library names in pkg-config files
-
-qmake generates the pkgconfig .pc files two times, once for the
-release build and once for the debug build (which we're not actually
-building in this package). For both generations the exact same
-pkgconfig file name is used. This causes references to the debug
-build ending up in the .pc files which are unwanted
-Prevent this from happening by giving the pkgconfig .pc
-files for the debug build an unique file name.
----
- qmake/generators/makefile.cpp | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
-index 182fe79238..a762443fe2 100644
---- a/qmake/generators/makefile.cpp
-+++ b/qmake/generators/makefile.cpp
-@@ -3164,6 +3164,9 @@ MakefileGenerator::pkgConfigFileName(bool fixify, bool onlyPrependDestdir)
- if (dot != -1)
- ret = ret.left(dot);
- }
-+ if (project->isActiveConfig("debug")) {
-+ ret += "d";
-+ }
- ret += Option::pkgcfg_ext;
- QString subdir = project->first("QMAKE_PKGCONFIG_DESTDIR").toQString();
- if(!subdir.isEmpty()) {
---
-2.11.1
-
diff --git a/nix/nixcrpkgs/pkgs/qt/pkg-config-cross.patch b/nix/nixcrpkgs/pkgs/qt/pkg-config-cross.patch
deleted file mode 100644
index 506df0ff8..000000000
--- a/nix/nixcrpkgs/pkgs/qt/pkg-config-cross.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -ur qt-orig/configure.pri qt/configure.pri
---- qt-orig/configure.pri 2017-07-27 18:16:48.205591390 -0700
-+++ qt/configure.pri 2017-07-29 13:11:08.957085166 -0700
-@@ -139,7 +139,8 @@
- }
- }
-
-- $$qtConfEvaluate("features.cross_compile") {
-+ qtLog("Blindly trusting this pkg-config to be valid.");
-+ false {
- # cross compiling, check that pkg-config is set up sanely
- sysroot = $$config.input.sysroot
-
diff --git a/nix/nixcrpkgs/pkgs/qt/win32-link-object-max.patch b/nix/nixcrpkgs/pkgs/qt/win32-link-object-max.patch
deleted file mode 100644
index c47279b2e..000000000
--- a/nix/nixcrpkgs/pkgs/qt/win32-link-object-max.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -ur qtbase-opensource-src-5.9.6-orig/mkspecs/win32-g++/qmake.conf qtbase-opensource-src-5.9.6/mkspecs/win32-g++/qmake.conf
---- qtbase-opensource-src-5.9.6-orig/mkspecs/win32-g++/qmake.conf 2018-06-19 12:41:49.061465695 -0700
-+++ qtbase-opensource-src-5.9.6/mkspecs/win32-g++/qmake.conf 2018-06-19 12:42:15.406453120 -0700
-@@ -54,10 +54,8 @@
- QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
- QMAKE_LFLAGS_DLL = -shared
- QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
--equals(QMAKE_HOST.os, Windows) {
-- QMAKE_LINK_OBJECT_MAX = 10
-- QMAKE_LINK_OBJECT_SCRIPT = object_script
--}
-+QMAKE_LINK_OBJECT_MAX = 10
-+QMAKE_LINK_OBJECT_SCRIPT = object_script
- QMAKE_EXT_OBJ = .o
- QMAKE_EXT_RES = _res.o
- QMAKE_PREFIX_SHLIB =
diff --git a/nix/nixcrpkgs/pkgs/qt/wrapper_builder.rb b/nix/nixcrpkgs/pkgs/qt/wrapper_builder.rb
deleted file mode 100644
index 49b3efd8a..000000000
--- a/nix/nixcrpkgs/pkgs/qt/wrapper_builder.rb
+++ /dev/null
@@ -1,499 +0,0 @@
-require 'pathname'
-require 'fileutils'
-include FileUtils
-
-STDOUT.sync = true
-
-ENV['PATH'] = ENV.fetch('_PATH')
-
-Os = ENV.fetch('os')
-QtVersionString = ENV.fetch('version')
-QtVersionMajor = QtVersionString.split('.').first.to_i
-
-QtBaseDir = Pathname(ENV.fetch('qtbase'))
-
-OutDir = Pathname(ENV.fetch('out'))
-OutPcDir = OutDir + 'lib' + 'pkgconfig'
-CMakeDir = OutDir + 'lib' + 'cmake'
-OutIncDir = OutDir + 'include'
-MocExe = OutDir + 'bin' + 'moc'
-RccExe = OutDir + 'bin' + 'rcc'
-
-DepGraph = {}
-DepGraphBack = {}
-
-DepInfo = {}
-DepInfo.default_proc = proc do |hash, name|
- hash[name] = find_dep_info(name)
-end
-
-case Os
-when "windows"
- PrlPrefix = ''
-else
- PrlPrefix = 'lib'
-end
-
-# Note: These dependencies just came from me fixing errors for specific
-# programs. There are likely misisng dependencies in this graph, and there
-# might be a few dependencies that could be safely removed because they are
-# purely transitive.
-def make_dep_graph
- # High-level dependencies.
- add_dep 'Qt5Widgets.x', 'libQt5Widgets.a'
- add_dep 'Qt5Widgets.x', 'Qt5Gui.x'
- add_dep 'Qt5Gui.x', 'Qt5GuiNoPlugins.x'
- add_dep 'Qt5GuiNoPlugins.x', 'libQt5Gui.a'
- add_dep 'Qt5GuiNoPlugins.x', 'Qt5Core.x'
- add_dep 'Qt5Core.x', 'libQt5Core.a'
-
- # Include directories.
- add_dep 'Qt5Core.x', '-I' + OutIncDir.to_s
- add_dep 'Qt5Core.x', '-I' + (OutIncDir + 'QtCore').to_s
- add_dep 'Qt5Gui.x', '-I' + (OutIncDir + 'QtGui').to_s
- add_dep 'Qt5Widgets.x', '-I' + (OutIncDir + 'QtWidgets').to_s
-
- # Libraries that Qt depends on.
- add_dep 'libQt5Widgets.a', 'libQt5Gui.a'
- add_dep 'libQt5FontDatabaseSupport.a', 'libqtfreetype.a'
- add_dep 'libQt5Gui.a', 'libQt5Core.a'
- add_dep 'libQt5Gui.a', 'libqtlibpng.a'
- add_dep 'libQt5Gui.a', 'libqtharfbuzz.a'
- add_dep 'libQt5Core.a', 'libqtpcre2.a'
-
- if Os == 'windows'
- add_dep 'Qt5Gui.x', 'qwindows.x'
- add_dep 'qwindows.x', 'libqwindows.a'
-
- add_dep 'libqwindows.a', '-ldwmapi'
- add_dep 'libqwindows.a', '-limm32'
- add_dep 'libqwindows.a', '-loleaut32'
- add_dep 'libqwindows.a', 'libQt5Gui.a'
- add_dep 'libqwindows.a', 'libQt5EventDispatcherSupport.a'
- add_dep 'libqwindows.a', 'libQt5FontDatabaseSupport.a'
- add_dep 'libqwindows.a', 'libQt5ThemeSupport.a'
-
- add_dep 'libQt5Core.a', '-lole32'
- add_dep 'libQt5Core.a', '-luuid'
- add_dep 'libQt5Core.a', '-lversion'
- add_dep 'libQt5Core.a', '-lwinmm'
- add_dep 'libQt5Core.a', '-lws2_32'
-
- add_dep 'libQt5Gui.a', '-lopengl32'
-
- add_dep 'libQt5Widgets.a', '-luxtheme'
- end
-
- if Os == 'linux'
- add_dep 'Qt5Gui.x', 'qlinuxfb.x'
- add_dep 'Qt5Gui.x', 'qxcb.x'
- add_dep 'qlinuxfb.x', 'libqlinuxfb.a'
- add_dep 'qxcb.x', 'libqxcb.a'
-
- add_dep 'libqlinuxfb.a', 'libQt5FbSupport.a'
- add_dep 'libqlinuxfb.a', 'libQt5InputSupport.a'
-
- add_dep 'libqxcb.a', 'libQt5XcbQpa.a'
-
- add_dep 'libQt5DBus.a', 'libQt5Core.a'
- add_dep 'libQt5DBus.a', 'libQt5Gui.a'
- add_dep 'libQt5DeviceDiscoverySupport.a', 'libudev.pc'
- add_dep 'libQt5InputSupport.a', 'libQt5DeviceDiscoverySupport.a'
- add_dep 'libQt5LinuxAccessibilitySupport.a', 'libQt5AccessibilitySupport.a'
- add_dep 'libQt5LinuxAccessibilitySupport.a', 'libQt5DBus.a'
- add_dep 'libQt5LinuxAccessibilitySupport.a', 'xcb-aux.pc'
- add_dep 'libQt5ThemeSupport.a', 'libQt5DBus.a'
-
- add_dep 'libQt5XcbQpa.a', 'libQt5EventDispatcherSupport.a'
- add_dep 'libQt5XcbQpa.a', 'libQt5FontDatabaseSupport.a'
- add_dep 'libQt5XcbQpa.a', 'libQt5Gui.a'
- add_dep 'libQt5XcbQpa.a', 'libQt5LinuxAccessibilitySupport.a'
- add_dep 'libQt5XcbQpa.a', 'libQt5ServiceSupport.a'
- add_dep 'libQt5XcbQpa.a', 'libQt5ThemeSupport.a'
- add_dep 'libQt5XcbQpa.a', 'x11.pc'
- add_dep 'libQt5XcbQpa.a', 'x11-xcb.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-icccm.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-image.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-keysyms.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-randr.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-renderutil.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-shape.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-shm.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-sync.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-xfixes.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-xinerama.pc'
- add_dep 'libQt5XcbQpa.a', 'xcb-xkb.pc'
- add_dep 'libQt5XcbQpa.a', 'xi.pc'
- end
-
- if Os == 'macos'
- add_dep 'Qt5Gui.x', 'qcocoa.x'
- add_dep 'qcocoa.x', 'libqcocoa.a'
-
- add_dep 'libqcocoa.a', 'libcocoaprintersupport.a'
- add_dep 'libqcocoa.a', '-lcups' # Also available: -lcups.2
- add_dep 'libqcocoa.a', 'libQt5AccessibilitySupport.a'
- add_dep 'libqcocoa.a', 'libQt5ClipboardSupport.a'
- add_dep 'libqcocoa.a', 'libQt5CglSupport.a'
- add_dep 'libqcocoa.a', 'libQt5GraphicsSupport.a'
- add_dep 'libqcocoa.a', 'libQt5FontDatabaseSupport.a'
- add_dep 'libqcocoa.a', 'libQt5ThemeSupport.a'
- add_dep 'libqcocoa.a', 'libQt5PrintSupport.a'
-
- add_dep 'libqtlibpng.a', '-lz'
-
- add_dep 'libQt5Core.a', '-lobjc'
- add_dep 'libQt5Core.a', '-framework CoreServices'
- add_dep 'libQt5Core.a', '-framework CoreText'
- add_dep 'libQt5Gui.a', '-framework CoreGraphics'
- add_dep 'libQt5Gui.a', '-framework OpenGL'
- add_dep 'libQt5Widgets.a', '-framework Carbon'
- add_dep 'libQt5Widgets.a', '-framework AppKit'
- end
-
- add_deps_of_pc_files
-end
-
-# Qt depends on some system libraries with .pc files. It tends to only depend
-# on these things at link time, not compile time. So use pkg-config with --libs
-# to get those dependencies, for use in .cmake files.
-def add_deps_of_pc_files
- DepGraph.keys.each do |dep|
- next if determine_dep_type(dep) != :pc
- name = dep.chomp('.pc')
- new_deps = `pkg-config-cross --libs #{name}`.split(' ')
- raise "Failed to #{dep} libs" if $?.exitstatus != 0
- new_deps.each do |new_dep|
- add_dep dep, new_dep
- end
- end
-end
-
-def add_dep(library, *deps)
- a = DepGraph[library] ||= []
- DepGraphBack[library] ||= []
- deps.each do |dep|
- DepGraph[dep] ||= []
- a << dep unless a.include? dep
- (DepGraphBack[dep] ||= []) << library
- end
-end
-
-# Given a name of a dep in the graph, figure out what kind of dep
-# it use.
-def determine_dep_type(name)
- extension = Pathname(name).extname
- case
- when extension == '.a' then :a
- when extension == '.pc' then :pc
- when extension == '.x' then :x
- when name.start_with?('-I') then :incdirflag
- when name.start_with?('-L') then :libdirflag
- when name.start_with?('-l') then :ldflag
- when name.start_with?('-framework') then :ldflag
- end
-end
-
-def find_pkg_config_file(name)
- ENV.fetch('PKG_CONFIG_CROSS_PATH').split(':').each do |dir|
- path = Pathname(dir) + name
- return path if path.exist?
- end
- nil
-end
-
-def find_qt_library(name)
- debug_name = Pathname(name).sub_ext("d.a").to_s
-
- search_dirs = [ OutDir + 'lib' ] +
- (OutDir + 'plugins').children
-
- search_dirs.each do |dir|
- lib = dir + name
- return lib if lib.exist?
- end
-
- search_dirs.each do |dir|
- lib = dir + debug_name
- return lib if lib.exist?
- end
-
- nil
-end
-
-def find_dep_info(name)
- case determine_dep_type(name)
- when :a then find_qt_library(name)
- when :pc then find_pkg_config_file(name)
- end
-end
-
-# Given an array of dependencies and a block for retrieving dependencies of an
-# dependency, returns an array of dependencies with three guarantees:
-#
-# 1) Contains all the listed dependencies.
-# 2) Has no duplicates.
-# 3) For any dependency in the list, all of its dependencies are before it.
-#
-# Guarantee 3 only holds if the underlying graph has no circul dependencies. If
-# there is a circular dependency, it will not be detected, but it will not cause
-# an infinite loop either.
-def flatten_deps(deps)
- work = [].concat(deps)
- expanded = {}
- output = {}
- while !work.empty?
- dep = work.last
- if expanded[dep]
- output[dep] = true
- work.pop
- else
- expanded[dep] = true
- deps = yield dep
- work.concat(deps)
- end
- end
- output.keys # relies on Ruby's ordered hashes
-end
-
-def canonical_x_file(dep)
- return nil if determine_dep_type(dep) != :a
- x_files = DepGraphBack.fetch(dep).select do |name|
- determine_dep_type(name) == :x
- end
- if x_files.size > 2
- raise "There is more than one .x file #{dep}."
- end
- x_files.first
-end
-
-# Note: It would be nice to find some solution so that Qt5Widgets.pc does not
-# require Qt5GuiNoPlugins, since it already requires Qt5Gui.
-def flatten_deps_for_pc_file(pc_file)
- flatten_deps(DepGraph[pc_file]) do |dep|
- deps = case determine_dep_type(dep)
- when :x, :pc then
- # Don't expand dependencies for a .pc file because we can just
- # refer to them with the Requires line in our .pc file.
- []
- else DepGraph.fetch(dep)
- end
-
- # Replace .a files with a canonical .x file if there is one.
- deps.map do |name|
- substitute = canonical_x_file(name)
- substitute = nil if substitute == pc_file
- substitute || name
- end
- end
-end
-
-def flatten_deps_for_cmake_file(cmake_file)
- flatten_deps(DepGraph[cmake_file]) do |dep|
- DepGraph.fetch(dep)
- end
-end
-
-def create_pc_file(name)
- requires = []
- libdirs = []
- ldflags = []
- cflags = []
-
- deps = flatten_deps_for_pc_file(name)
-
- deps.each do |dep|
- dep = dep.dup
- case determine_dep_type(dep)
- when :a then
- full_path = DepInfo[dep]
- raise "Could not find library: #{dep}" if !full_path
- libdir = full_path.dirname.to_s
- libdir.sub!((OutDir + 'lib').to_s, '${libdir}')
- libdir.sub!(OutDir.to_s, '${prefix}')
- libname = full_path.basename.to_s
- libname.sub!(/\Alib/, '')
- libname.sub!(/.a\Z/, '')
- libdirs << "-L#{libdir}"
- ldflags << "-l#{libname}"
- when :x then
- dep.chomp!('.x')
- requires << dep
- when :pc then
- dep.chomp!('.pc')
- requires << dep
- when :ldflag then
- ldflags << dep
- when :libdirflag then
- libdirs << dep
- when :incdirflag then
- dep.sub!(OutIncDir.to_s, '${includedir}')
- cflags << dep
- end
- end
-
- r = ""
- r << "prefix=#{OutDir}\n"
- r << "libdir=${prefix}/lib\n"
- r << "includedir=${prefix}/include\n"
- r << "Version: #{QtVersionString}\n"
- if !libdirs.empty? || !ldflags.empty?
- r << "Libs: #{libdirs.reverse.uniq.join(' ')} #{ldflags.reverse.join(' ')}\n"
- end
- if !cflags.empty?
- r << "Cflags: #{cflags.join(' ')}\n"
- end
- if !requires.empty?
- r << "Requires: #{requires.sort.join(' ')}\n"
- end
-
- path = OutPcDir + Pathname(name).sub_ext(".pc")
- File.open(path.to_s, 'w') do |f|
- f.write r
- end
-end
-
-# For .pc files we depend on, add symlinks to the .pc file and any other .pc
-# files in the same directory which might be transitive dependencies.
-def symlink_pc_file_closure(name)
- dep_pc_dir = DepInfo[name].dirname
- dep_pc_dir.each_child do |target|
- link = OutPcDir + target.basename
-
- # Skip it if we already made this link.
- next if link.symlink?
-
- # Link directly to the real PC file.
- target = target.realpath
-
- ln_s target, link
- end
-end
-
-def create_pc_files
- mkdir OutPcDir
- DepGraph.each_key do |name|
- case determine_dep_type(name)
- when :x then create_pc_file(name)
- when :pc then symlink_pc_file_closure(name)
- end
- end
-end
-
-def set_property(f, target_name, property_name, value)
- if value.is_a?(Array)
- value = value.map do |entry|
- if entry.to_s.include?(' ')
- "\"#{entry}\""
- else
- entry
- end
- end.join(' ')
- end
-
- f.puts "set_property(TARGET #{target_name} " \
- "PROPERTY #{property_name} #{value})"
-end
-
-def set_properties(f, target_name, properties)
- properties.each do |property_name, value|
- set_property(f, target_name, property_name, value)
- end
-end
-
-def import_static_lib(f, target_name, properties)
- f.puts "add_library(#{target_name} STATIC IMPORTED)"
- set_properties(f, target_name, properties)
-end
-
-def create_cmake_core_files
- File.open(CMakeDir + 'core.cmake', 'w') do |f|
- f.puts "set(QT_VERSION_MAJOR #{QtVersionMajor})"
- f.puts
-
- f.puts "set(QT_MOC_EXECUTABLE #{MocExe})"
- f.puts "add_executable(Qt5::moc IMPORTED)"
- f.puts "set_target_properties(Qt5::moc PROPERTIES " \
- "IMPORTED_LOCATION ${QT_MOC_EXECUTABLE})"
- f.puts
-
- f.puts "add_executable(Qt5::rcc IMPORTED)"
- f.puts "set_target_properties(Qt5::rcc PROPERTIES " \
- "IMPORTED_LOCATION #{RccExe})"
- f.puts "set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)"
- f.puts
-
- f.write File.read(ENV.fetch('core_macros'))
- end
-end
-
-def create_cmake_qt5widgets
- mkdir CMakeDir + 'Qt5Widgets'
-
- widgets_a = find_qt_library('libQt5Widgets.a') || raise
-
- deps = flatten_deps_for_cmake_file('Qt5Widgets.x')
-
- incdirs = []
- libdirflags = []
- ldflags = []
- deps.each do |dep|
- dep = dep.dup
- case determine_dep_type(dep)
- when :a then
- full_path = DepInfo[dep]
- raise "Could not find library: #{dep}" if !full_path
- libdir = full_path.dirname.to_s
- libname = full_path.basename.to_s
- libname.sub!(/\Alib/, '')
- libname.sub!(/.a\Z/, '')
- libdirflags << "-L#{libdir}"
- ldflags << "-l#{libname}"
- when :ldflag then
- ldflags << dep
- when :libdirflag then
- libdirflags << dep
- when :incdirflag then
- incdir = dep.sub(/\A-I/, '')
- incdirs << incdir
- end
- end
-
- File.open(CMakeDir + 'Qt5Widgets' + 'Qt5WidgetsConfig.cmake', 'w') do |f|
- import_static_lib f, 'Qt5::Widgets',
- IMPORTED_LOCATION: widgets_a,
- IMPORTED_LINK_INTERFACE_LANGUAGES: 'CXX',
- INTERFACE_LINK_LIBRARIES: libdirflags.reverse.uniq + ldflags.reverse,
- INTERFACE_INCLUDE_DIRECTORIES: incdirs,
- INTERFACE_COMPILE_DEFINITIONS: 'QT_STATIC'
-
- f.puts "include(#{CMakeDir + 'core.cmake'})"
- end
-end
-
-def main
- # Symlink the include, bin, and plugins directories into $out.
- mkdir OutDir
- ln_s QtBaseDir + 'include', OutDir + 'include'
- ln_s QtBaseDir + 'bin', OutDir + 'bin'
- ln_s QtBaseDir + 'plugins', OutDir + 'plugins'
- ln_s QtBaseDir + 'src', OutDir + 'src'
-
- # Symlink the .a files and copy the .prl files into $out/lib.
- mkdir OutDir + 'lib'
- (QtBaseDir + 'lib').each_child do |c|
- ln_s c, OutDir + 'lib' if c.extname == '.a'
- cp c, OutDir + 'lib' if c.extname == '.prl'
- end
-
- make_dep_graph
-
- create_pc_files
-
- mkdir CMakeDir
- create_cmake_core_files
- create_cmake_qt5widgets
-end
-
-main
diff --git a/nix/nixcrpkgs/pkgs/readline/builder.sh b/nix/nixcrpkgs/pkgs/readline/builder.sh
deleted file mode 100644
index defaa8b7d..000000000
--- a/nix/nixcrpkgs/pkgs/readline/builder.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-source $setup
-
-# This is from the mingw-w64-readline AUR arch package.
-export bash_cv_wcwidth_broken=no
-
-tar -xf $src
-
-cd readline-$version
-for patch in $patches_p2; do
- echo applying patch $patch
- patch -p2 -i $patch
-done
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-cd ..
-
-mkdir build
-cd build
-
-../readline-$version/configure \
- --prefix=$out --host=$host \
- --enable-static --disable-shared \
- --with-curses=$curses
-
-make
-
-make install
-
-mkdir $out/license
-cp ../readline-$version/COPYING $out/license/LICENSE
diff --git a/nix/nixcrpkgs/pkgs/readline/default.nix b/nix/nixcrpkgs/pkgs/readline/default.nix
deleted file mode 100644
index b1369e70f..000000000
--- a/nix/nixcrpkgs/pkgs/readline/default.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-# Note: This has only been tested on Windows, and is using pdcurses
-# which only seems to work on Windows.
-
-{ crossenv, curses }:
-
-let
- fetchurl = crossenv.nixpkgs.fetchurl;
-in
-crossenv.make_derivation rec {
- name = "readline-${version}";
-
- version = "7.0";
-
- src = fetchurl {
- url = "mirror://gnu/readline/readline-${version}.tar.gz";
- sha256 = "0d13sg9ksf982rrrmv5mb6a2p4ys9rvg9r71d6il0vr8hmql63bm";
- };
-
- patches_p2 = [
- (fetchurl {
- url = "mirror://gnu/readline/readline-7.0-patches/readline70-001";
- sha256 = "0xm3sxvwmss7ddyfb11n6pgcqd1aglnpy15g143vzcf75snb7hcs";
- })
- (fetchurl {
- url = "mirror://gnu/readline/readline-7.0-patches/readline70-002";
- sha256 = "0n1dxmqsbjgrfxb1hgk5c6lsraw4ncbnzxlsx7m35nym6lncjiw7";
- })
- (fetchurl {
- url = "mirror://gnu/readline/readline-7.0-patches/readline70-003";
- sha256 = "1027kmymniizcy0zbdlrczxfx3clxcdln5yq05q9yzlc6y9slhwy";
- })
- ];
-
- patches = [
- ./readline-1.patch
- ];
-
- builder = ./builder.sh;
-
- inherit curses;
-}
diff --git a/nix/nixcrpkgs/pkgs/readline/readline-1.patch b/nix/nixcrpkgs/pkgs/readline/readline-1.patch
deleted file mode 100644
index 52938b804..000000000
--- a/nix/nixcrpkgs/pkgs/readline/readline-1.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-We got this patch from the mingw-w64-readline AUR Arch package.
-
-This patch originall comes from MXE, and is licensed under the MIT license.
-
-https://github.com/mxe/mxe/blob/master/src/readline-1.patch
-
-Copyright (c) 2007-2016
-
-Volker Diels-Grabsch
-Mark Brand
-Tony Theodore
-Martin Gerhardy
-Tiancheng "Timothy" Gu
-Boris Nagaev
-... and many other contributors
-(contact via the project mailing list or issue tracker)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of
-the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
-From 6896ffa4fc85bf0dfae58e69a860d2076c1d9fd2 Mon Sep 17 00:00:00 2001
-From: Timothy Gu
-Date: Tue, 30 Sep 2014 17:16:32 -0700
-Subject: [PATCH 2/2] Handle missing S_IS* macros more gracefully
-
-diff --git a/colors.c b/colors.c
-index 89d9035..ec19844 100644
---- a/colors.c
-+++ b/colors.c
-@@ -152,14 +152,22 @@ _rl_print_color_indicator (char *f)
- {
- colored_filetype = C_FILE;
-
-+#if defined (S_ISUID)
- if ((mode & S_ISUID) != 0 && is_colored (C_SETUID))
- colored_filetype = C_SETUID;
-- else if ((mode & S_ISGID) != 0 && is_colored (C_SETGID))
-+ else
-+#endif
-+#if defined (S_ISGID)
-+ if ((mode & S_ISGID) != 0 && is_colored (C_SETGID))
- colored_filetype = C_SETGID;
-- else if (is_colored (C_CAP) && 0) //f->has_capability)
-+ else
-+#endif
-+ if (is_colored (C_CAP) && 0) //f->has_capability)
- colored_filetype = C_CAP;
-+#if defined(S_IXUGO)
- else if ((mode & S_IXUGO) != 0 && is_colored (C_EXEC))
- colored_filetype = C_EXEC;
-+#endif
- else if ((1 < astat.st_nlink) && is_colored (C_MULTIHARDLINK))
- colored_filetype = C_MULTIHARDLINK;
- }
-@@ -173,8 +181,10 @@ _rl_print_color_indicator (char *f)
- colored_filetype = C_STICKY_OTHER_WRITABLE;
- else
- #endif
-+#if defined (S_IWOTH)
- if ((mode & S_IWOTH) != 0 && is_colored (C_OTHER_WRITABLE))
- colored_filetype = C_OTHER_WRITABLE;
-+#endif
- #if defined (S_ISVTX)
- else if ((mode & S_ISVTX) != 0 && is_colored (C_STICKY))
- colored_filetype = C_STICKY;
-diff --git a/colors.h b/colors.h
-index fc926e5..e62edd0 100644
---- a/colors.h
-+++ b/colors.h
-@@ -96,7 +96,7 @@ enum indicator_no
- };
-
-
--#if !S_IXUGO
-+#if !S_IXUGO && defined(S_IXUSR) && defined(S_IXGRP) && defined(S_IXOTH)
- # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
- #endif
-
-diff --git a/posixstat.h b/posixstat.h
-index 3eb7f29..854a2c9 100644
---- a/posixstat.h
-+++ b/posixstat.h
-@@ -78,30 +78,44 @@
-
- #if defined (S_IFBLK) && !defined (S_ISBLK)
- #define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */
-+#elif !defined (S_IFBLK)
-+#define S_ISBLK(m) 0
- #endif
-
- #if defined (S_IFCHR) && !defined (S_ISCHR)
- #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */
-+#elif !defined (S_IFCHR)
-+#define S_ISCHR(m) 0
- #endif
-
- #if defined (S_IFDIR) && !defined (S_ISDIR)
- #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */
-+#elif !defined (S_IFDIR)
-+#define S_ISDIR(m) 0
- #endif
-
- #if defined (S_IFREG) && !defined (S_ISREG)
- #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */
-+#elif !defined (S_IFREG)
-+#define S_ISREG(m) 0
- #endif
-
- #if defined (S_IFIFO) && !defined (S_ISFIFO)
- #define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */
-+#elif !defined (S_IFIFO)
-+#define S_ISFIFO(m) 0
- #endif
-
- #if defined (S_IFLNK) && !defined (S_ISLNK)
- #define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */
-+#elif !defined (S_IFLNK)
-+#define S_ISLNK(m) 0
- #endif
-
- #if defined (S_IFSOCK) && !defined (S_ISSOCK)
- #define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */
-+#elif !defined (S_IFSOCK)
-+#define S_ISSOCK(m) 0
- #endif
-
- /*
-@@ -137,6 +151,8 @@
- /* These are non-standard, but are used in builtins.c$symbolic_umask() */
- #define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH)
- #define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH)
-+#if defined(S_IXUSR) && defined(S_IXGRP) && defined(S_IXOTH)
- #define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
-+#endif
-
- #endif /* _POSIXSTAT_H_ */
---
-1.8.3.2
-
-diff --git a/histfile.c b/histfile.c
---- a/histfile.c
-+++ b/histfile.c
-@@ -610,8 +610,6 @@
- user is running this, it's a no-op. If the shell is running after sudo
- with a shared history file, we don't want to leave the history file
- owned by root. */
-- if (rv == 0 && exists)
-- r = chown (filename, finfo.st_uid, finfo.st_gid);
-
- xfree (filename);
- FREE (tempname);
-@@ -757,8 +755,6 @@
- user is running this, it's a no-op. If the shell is running after sudo
- with a shared history file, we don't want to leave the history file
- owned by root. */
-- if (rv == 0 && exists)
-- mode = chown (histname, finfo.st_uid, finfo.st_gid);
-
- FREE (histname);
- FREE (tempname);
diff --git a/nix/nixcrpkgs/pkgs/tic/builder.sh b/nix/nixcrpkgs/pkgs/tic/builder.sh
deleted file mode 100644
index 5052b2583..000000000
--- a/nix/nixcrpkgs/pkgs/tic/builder.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-source $setup
-
-tar -xf $src
-mv pololu-tic-software-* tic
-
-mkdir build
-cd build
-
-cmake-cross ../tic \
- -DCMAKE_INSTALL_PREFIX=$out \
- -DBUILD_SHARED_LIBS=false
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/tic/default.nix b/nix/nixcrpkgs/pkgs/tic/default.nix
deleted file mode 100644
index 6f870d911..000000000
--- a/nix/nixcrpkgs/pkgs/tic/default.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ crossenv, qt, libusbp }:
-
-crossenv.make_derivation rec {
- name = "tic-${version}";
-
- version = "e1693cd"; # 1.5.0ish
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://github.com/pololu/pololu-tic-software/archive/${version}.tar.gz";
- sha256 = "07m75w0walr61yqki7h1ipzbfz7x417g7qnx0p1l6qdz89fyc7i8";
- };
-
- builder = ./builder.sh;
-
- cross_inputs = [ libusbp qt ];
-}
diff --git a/nix/nixcrpkgs/pkgs/usbview/builder.sh b/nix/nixcrpkgs/pkgs/usbview/builder.sh
deleted file mode 100644
index 3aa4cb901..000000000
--- a/nix/nixcrpkgs/pkgs/usbview/builder.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-source $setup
-
-cp --no-preserve=mode -r $src/usb/usbview .
-
-cd usbview
-rm usbschema.hpp xmlhelper.cpp
-for patch in $patches; do
- echo applying patch $patch
- patch -p1 -i $patch
-done
-cp $my_xmlhelper_c .
-cd ..
-
-mkdir build
-cd build
-
-$host-windres ../usbview/uvcview.rc rc.o
-
-# TODO: after fixing bug with selectany in GCC, remove -DINITGUID
-
-$host-gcc -mwindows -std=gnu99 -O2 \
- -Iinclude \
- -DNTDDI_VERSION=0x06020000 -D_WIN32_WINNT=0x0602 \
- -DSTRSAFE_NO_DEPRECATE -Doffsetof=__builtin_offsetof \
- ../usbview/*.c rc.o \
- -lcomctl32 -lcomdlg32 -lsetupapi -lshell32 -lshlwapi -lole32 -lgdi32 \
- -o usbview.exe
-
-mkdir -p $out/bin $out/license
-cp usbview.exe $out/bin
-cp $src/LICENSE $out/license
diff --git a/nix/nixcrpkgs/pkgs/usbview/default.nix b/nix/nixcrpkgs/pkgs/usbview/default.nix
deleted file mode 100644
index 7d5260859..000000000
--- a/nix/nixcrpkgs/pkgs/usbview/default.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ crossenv }:
-
-if crossenv.os != "windows" then "windows only" else
-
-crossenv.make_derivation rec {
- name = "usbview-${version}";
-
- version = "2017-05-01";
-
- src = crossenv.nixpkgs.fetchFromGitHub {
- owner = "Microsoft";
- repo = "Windows-driver-samples";
- rev = "4c5c5e0297c7a61e151f92af702cdac650a14489";
- sha256 = "1drq26bnad98xqn805qx0b6g4y65lmrdj7v40b3jhhzdsp8993pf";
- };
-
- patches = [ ./megapatch.patch ];
-
- my_xmlhelper_c = ./my_xmlhelper.c;
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pkgs/usbview/megapatch.patch b/nix/nixcrpkgs/pkgs/usbview/megapatch.patch
deleted file mode 100644
index fe3227aee..000000000
--- a/nix/nixcrpkgs/pkgs/usbview/megapatch.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-diff -ur usbview-orig/usbdesc.h usbview/usbdesc.h
---- usbview-orig/usbdesc.h 2017-04-01 16:00:09.314007997 -0700
-+++ usbview/usbdesc.h 2017-04-01 16:10:23.667341332 -0700
-@@ -81,7 +81,7 @@
- #define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
- #define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08
- #define USB_OTG_DESCRIPTOR_TYPE 0x09
--#define USB_DEBUG_DESCRIPTOR_TYPE 0x0A
-+//#define USB_DEBUG_DESCRIPTOR_TYPE 0x0A
- #define USB_IAD_DESCRIPTOR_TYPE 0x0B
-
- //
-diff -ur usbview-orig/uvcdesc.h usbview/uvcdesc.h
---- usbview-orig/uvcdesc.h 2017-04-01 16:00:09.314007997 -0700
-+++ usbview/uvcdesc.h 2017-04-01 17:43:09.134007999 -0700
-@@ -15,7 +15,7 @@
-
-
- // USB Video Device Class Code
--#define USB_DEVICE_CLASS_VIDEO 0x0E
-+//#define USB_DEVICE_CLASS_VIDEO 0x0E
-
- // Video sub-classes
- #define SUBCLASS_UNDEFINED 0x00
-diff -ur usbview-orig/uvcview.h usbview/uvcview.h
---- usbview-orig/uvcview.h 2017-04-01 16:00:09.314007997 -0700
-+++ usbview/uvcview.h 2017-04-03 20:25:08.145676664 -0700
-@@ -34,10 +33,10 @@
- #include
- #include
- #include
--#include
- #include
- #include
- #include
-+#include
- #include
- #include
- #include
-@@ -50,6 +49,8 @@
- #include
- #include
- #include
-+#include
-+#include
-
- // This is mostly a private USB Audio descriptor header
- #include "usbdesc.h"
-@@ -381,7 +382,7 @@
- // ENUM.C
- //
-
--PCHAR ConnectionStatuses[];
-+extern PCHAR ConnectionStatuses[];
-
- //
- // DISPVID.C
-Only in usbview: uvcview.h.orig
-diff -ur usbview-orig/uvcview.rc usbview/uvcview.rc
---- usbview-orig/uvcview.rc 2017-04-01 16:00:09.314007997 -0700
-+++ usbview/uvcview.rc 2017-04-01 16:04:07.210674665 -0700
-@@ -22,19 +22,19 @@
- //
- // ICON
- //
--IDI_ICON ICON DISCARDABLE "USB.ICO"
--IDI_BADICON ICON DISCARDABLE "BANG.ICO"
--IDI_COMPUTER ICON DISCARDABLE "MONITOR.ICO"
--IDI_HUB ICON DISCARDABLE "HUB.ICO"
--IDI_NODEVICE ICON DISCARDABLE "PORT.ICO"
--IDI_NOSSDEVICE ICON DISCARDABLE "SSPORT.ICO"
--IDI_SSICON ICON DISCARDABLE "SSUSB.ICO"
-+IDI_ICON ICON DISCARDABLE "usb.ico"
-+IDI_BADICON ICON DISCARDABLE "bang.ico"
-+IDI_COMPUTER ICON DISCARDABLE "monitor.ico"
-+IDI_HUB ICON DISCARDABLE "hub.ico"
-+IDI_NODEVICE ICON DISCARDABLE "port.ico"
-+IDI_NOSSDEVICE ICON DISCARDABLE "ssport.ico"
-+IDI_SSICON ICON DISCARDABLE "ssusb.ico"
-
- //////////////////////////////////////////////////////////////////////////////
- //
- // Cursor
- //
--IDC_SPLIT CURSOR DISCARDABLE "SPLIT.CUR"
-+IDC_SPLIT CURSOR DISCARDABLE "split.cur"
-
- /////////////////////////////////////////////////////////////////////////////
- //
-@@ -84,7 +84,7 @@
- BEGIN
- MENUITEM "&Refresh\tF5", ID_REFRESH
- MENUITEM SEPARATOR
-- MENUITEM "Save Current &View ..." ID_SAVE
-+ MENUITEM "Save Current &View ...", ID_SAVE
- MENUITEM "Save As (&txt) ...", ID_SAVEALL
- MENUITEM "Save As (&xml) ...\tF2", ID_SAVEXML
- MENUITEM SEPARATOR
-@@ -130,7 +130,7 @@
- BEGIN
- IDS_STANDARD_FONT "Courier"
- IDS_STANDARD_FONT_HEIGHT "\13"
-- IDS_STANDARD_FONT_WIDTH "\8"
-+ IDS_STANDARD_FONT_WIDTH "\08"
- END
-
- STRINGTABLE DISCARDABLE
diff --git a/nix/nixcrpkgs/pkgs/usbview/my_xmlhelper.c b/nix/nixcrpkgs/pkgs/usbview/my_xmlhelper.c
deleted file mode 100644
index 0cdf29140..000000000
--- a/nix/nixcrpkgs/pkgs/usbview/my_xmlhelper.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "xmlhelper.h"
-
-EXTERN_C HRESULT InitXmlHelper()
-{
- return 0;
-}
-
-EXTERN_C HRESULT ReleaseXmlWriter()
-{
- return 0;
-}
-
-EXTERN_C HRESULT SaveXml(LPTSTR szfileName, DWORD dwCreationDisposition)
-{
- MessageBox(NULL,
- "Sorry, XML saving is not supported in this build.",
- "XML not supported",
- MB_OK | MB_ICONEXCLAMATION);
- return 0;
-}
-
-EXTERN_C HRESULT XmlAddHostController(
- PSTR hcName,
- PUSBHOSTCONTROLLERINFO hcInfo
- )
-{
- return 0;
-}
-
-EXTERN_C HRESULT XmlAddRootHub(PSTR rhName, PUSBROOTHUBINFO rhInfo)
-{
- return 0;
-}
-
-EXTERN_C HRESULT XmlAddExternalHub(PSTR ehName, PUSBEXTERNALHUBINFO ehInfo)
-{
- return 0;
-}
-
-EXTERN_C HRESULT XmlAddUsbDevice(PSTR devName, PUSBDEVICEINFO deviceInfo)
-{
- return 0;
-}
-
-EXTERN_C VOID XmlNotifyEndOfNodeList(PVOID pContext)
-{
-}
diff --git a/nix/nixcrpkgs/pkgs/xcb-proto/builder.sh b/nix/nixcrpkgs/pkgs/xcb-proto/builder.sh
deleted file mode 100644
index e83c5bbb3..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-proto/builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-ls
-mv xcb-proto-* xcb-proto
-
-mkdir build
-cd build
-
-../xcb-proto/configure --prefix=$out
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/xcb-proto/default.nix b/nix/nixcrpkgs/pkgs/xcb-proto/default.nix
deleted file mode 100644
index b9cdc0b1f..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-proto/default.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ crossenv }:
-
-let
- version = "1.12";
-
- name = "xcb-proto-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xcb.freedesktop.org/dist/xcb-proto-${version}.tar.bz2";
- sha256 = "01j91946q8f34l1mbvmmgvyc393sm28ym4lxlacpiav4qsjan8jr";
- };
-
- lib = crossenv.native.make_derivation rec {
- inherit version name src;
- builder = ./builder.sh;
- native_inputs = [ crossenv.nixpkgs.python2 ];
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set = { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xcb-proto/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-proto/license_builder.sh
deleted file mode 100644
index 2ea711435..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-proto/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-proto-* xcb-proto
-
-license=$(cat xcb-proto/COPYING)
-
-cat > $out <xcb-proto
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-image/default.nix b/nix/nixcrpkgs/pkgs/xcb-util-image/default.nix
deleted file mode 100644
index 14a5b5458..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-image/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ crossenv, libxcb, xcb-util }:
-
-let
- version = "0.4.0";
-
- name = "xcb-util-image-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xcb.freedesktop.org/dist/xcb-util-image-${version}.tar.bz2";
- sha256 = "1z1gxacg7q4cw6jrd26gvi5y04npsyavblcdad1xccc8swvnmf9d";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
- builder = ./util_image_builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ libxcb xcb-util ];
-
- inherit libxcb;
- libxcb_util = xcb-util;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- libxcb.license_set //
- xcb-util.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-image/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-image/license_builder.sh
deleted file mode 100644
index 9cc75651e..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-image/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-util-image-* xcb-util-image
-
-license=$(cat xcb-util-image/COPYING)
-
-cat > $out <xcb-util-image
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-image/util_image_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-image/util_image_builder.sh
deleted file mode 100644
index 3b5d1e6cf..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-image/util_image_builder.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-* util
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../util/configure --prefix=$out $configure_flags
-
-make
-
-make install
-
-# xcb-util-image-0.4.0/image/xcb_image.c includes
-echo "Requires: xcb-aux" >> $out/lib/pkgconfig/xcb-image.pc
-ln -sf $libxcb/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-ln -sf $libxcb_util/lib/pkgconfig/*.pc $out/lib/pkgconfig/
-
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/default.nix b/nix/nixcrpkgs/pkgs/xcb-util-keysyms/default.nix
deleted file mode 100644
index 6d5b8298f..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ crossenv, libxcb }:
-
-let
- version = "0.4.0";
-
- name = "xcb-util-keysyms";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xcb.freedesktop.org/dist/xcb-util-keysyms-${version}.tar.bz2";
- sha256 = "1nbd45pzc1wm6v5drr5338j4nicbgxa5hcakvsvm5pnyy47lky0f";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- builder = ./util_keysyms_builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ libxcb ];
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- libxcb.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-keysyms/license_builder.sh
deleted file mode 100644
index 66175097f..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-util-keysyms-* xcb-util-keysyms
-
-license=$(head -n31 xcb-util-keysyms/keysyms/keysyms.c)
-
-cat > $out <xcb-util-keysyms
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/util_keysyms_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-keysyms/util_keysyms_builder.sh
deleted file mode 100644
index eaa898225..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/util_keysyms_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-* util
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../util/configure --prefix=$out $configure_flags
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/default.nix b/nix/nixcrpkgs/pkgs/xcb-util-renderutil/default.nix
deleted file mode 100644
index f20b271e3..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ crossenv, libxcb }:
-
-let
- version = "0.3.9";
-
- name = "xcb-util-renderutil"; # TODO: add -${version} (mass rebuild)
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xcb.freedesktop.org/dist/xcb-util-renderutil-${version}.tar.bz2";
- sha256 = "0nza1csdvvxbmk8vgv8vpmq7q8h05xrw3cfx9lwxd1hjzd47xsf6";
- };
-
- lib = crossenv.make_derivation {
- inherit version name src;
-
- # TODO: rename all xcb-util builders to builder.sh (mass rebuild)
- builder = ./util_renderutil_builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ libxcb ];
-
- xcb = libxcb;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- libxcb.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-renderutil/license_builder.sh
deleted file mode 100644
index 96f60bcf9..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-util-renderutil-* xcb-util-renderutil
-
-license=$(cat xcb-util-renderutil/COPYING)
-
-cat > $out <xcb-util-renderutil
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/util_renderutil_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-renderutil/util_renderutil_builder.sh
deleted file mode 100644
index 4540eae4c..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/util_renderutil_builder.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-* util
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../util/configure --prefix=$out $configure_flags
-
-make
-
-make install
-
-ln -s $xcb/lib/pkgconfig/{xcb,xcb-render}.pc $out/lib/pkgconfig/
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-wm/default.nix b/nix/nixcrpkgs/pkgs/xcb-util-wm/default.nix
deleted file mode 100644
index 1390a4abd..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-wm/default.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ crossenv, libxcb }:
-
-let
- version = "0.4.1";
-
- name = "xcb-util-wm-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xcb.freedesktop.org/dist/xcb-util-wm-${version}.tar.bz2";
- sha256 = "0gra7hfyxajic4mjd63cpqvd20si53j1q3rbdlkqkahfciwq3gr8";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- builder = ./util_wm_builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ libxcb ];
-
- native_inputs = [ crossenv.nixpkgs.m4 ];
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- libxcb.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-wm/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-wm/license_builder.sh
deleted file mode 100644
index adbaa5ed5..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-wm/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-util-wm-* xcb-util-wm
-
-license=$(cat xcb-util-wm/COPYING)
-
-cat > $out <xcb-util-wm
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xcb-util-wm/util_wm_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-wm/util_wm_builder.sh
deleted file mode 100644
index eaa898225..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util-wm/util_wm_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-* util
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../util/configure --prefix=$out $configure_flags
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/xcb-util/default.nix b/nix/nixcrpkgs/pkgs/xcb-util/default.nix
deleted file mode 100644
index 48cadb58d..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ crossenv, libxcb }:
-
-let
- version = "0.4.0";
-
- name = "xcb-util-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xcb.freedesktop.org/dist/xcb-util-${version}.tar.bz2";
- sha256 = "1sahmrgbpyki4bb72hxym0zvxwnycmswsxiisgqlln9vrdlr9r26";
- };
-
- lib = crossenv.make_derivation rec {
- inherit version name src;
-
- builder = ./util_builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ libxcb ];
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set =
- libxcb.license_set //
- { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xcb-util/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util/license_builder.sh
deleted file mode 100644
index 7d65ade3b..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-util-* xcb-util
-
-license=$(cat xcb-util/COPYING)
-
-cat > $out <xcb-util
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xcb-util/util_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util/util_builder.sh
deleted file mode 100644
index 6264407a6..000000000
--- a/nix/nixcrpkgs/pkgs/xcb-util/util_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xcb-util-* util
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../util/configure --prefix=$out $configure_flags
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/xextproto/builder.sh b/nix/nixcrpkgs/pkgs/xextproto/builder.sh
deleted file mode 100644
index 6bf1c02c5..000000000
--- a/nix/nixcrpkgs/pkgs/xextproto/builder.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xextproto-* xextproto
-
-mkdir build
-cd build
-
-../xextproto/configure --prefix=$out
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/xextproto/default.nix b/nix/nixcrpkgs/pkgs/xextproto/default.nix
deleted file mode 100644
index 82b0a626e..000000000
--- a/nix/nixcrpkgs/pkgs/xextproto/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ crossenv }:
-
-let
- version = "7.3.0";
-
- name = "xextproto-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xorg.freedesktop.org/releases/individual/proto/xextproto-${version}.tar.bz2";
- sha256 = "1c2vma9gqgc2v06rfxdiqgwhxmzk2cbmknwf1ng3m76vr0xb5x7k";
- };
-
- lib = crossenv.native.make_derivation rec {
- inherit version name src;
- builder = ./builder.sh;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set = { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xextproto/license_builder.sh b/nix/nixcrpkgs/pkgs/xextproto/license_builder.sh
deleted file mode 100644
index 9fbf3543d..000000000
--- a/nix/nixcrpkgs/pkgs/xextproto/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xextproto-* xextproto
-
-license=$(cat xextproto/COPYING)
-
-cat > $out <xextproto
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xorg-macros/builder.sh b/nix/nixcrpkgs/pkgs/xorg-macros/builder.sh
deleted file mode 100644
index f940d965f..000000000
--- a/nix/nixcrpkgs/pkgs/xorg-macros/builder.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-source $setup
-
-tar -xf $src
-ls
-mv util-macros-* macros
-
-mkdir build
-cd build
-
-../macros/configure --prefix=$out
-
-make
-
-make install
-
-# The .pc files gets installed to /share/pkgconfig, but we want to see it in
-# /lib/pkgconfig.
-ln -s share $out/lib
diff --git a/nix/nixcrpkgs/pkgs/xorg-macros/default.nix b/nix/nixcrpkgs/pkgs/xorg-macros/default.nix
deleted file mode 100644
index 2f5c8508f..000000000
--- a/nix/nixcrpkgs/pkgs/xorg-macros/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ crossenv }:
-
-let
- version = "1.19.1";
-
- name = "xorg-macros-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://www.x.org/releases/individual/util/util-macros-1.19.1.tar.gz";
- sha256 = "1f27cmbxq0kdyvqsplxpsi9pxm5qy45lcagxr9gby2hy3pjd0aj7";
- };
-
- lib = crossenv.native.make_derivation {
- inherit version name src;
- builder = ./builder.sh;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set = { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xorg-macros/license_builder.sh b/nix/nixcrpkgs/pkgs/xorg-macros/license_builder.sh
deleted file mode 100644
index fb723a09d..000000000
--- a/nix/nixcrpkgs/pkgs/xorg-macros/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv util-macros-* xorg-macros
-
-license=$(cat xorg-macros/COPYING)
-
-cat > $out <xorg-macros
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xproto/builder.sh b/nix/nixcrpkgs/pkgs/xproto/builder.sh
deleted file mode 100644
index 7f6b13edb..000000000
--- a/nix/nixcrpkgs/pkgs/xproto/builder.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xproto-* xproto
-
-cp $gnu_config/{config.guess,config.sub} xproto
-
-mkdir build
-cd build
-
-PKG_CONFIG=pkg-config-cross \
-../xproto/configure --prefix=$out $configure_flags
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/xproto/default.nix b/nix/nixcrpkgs/pkgs/xproto/default.nix
deleted file mode 100644
index 6b16b0b4e..000000000
--- a/nix/nixcrpkgs/pkgs/xproto/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ crossenv, xorg-macros }:
-
-let
- version = "7.0.31";
-
- name = "xproto-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://www.x.org/releases/individual/proto/xproto-${version}.tar.gz";
- sha256 = "1is3xl0zjk4l0d8d0zinkfbfapgdby2i56jjfp6caibvwam5wxbd";
- };
-
- lib = crossenv.make_derivation {
- inherit version name src;
-
- builder = ./builder.sh;
-
- configure_flags =
- "--host=${crossenv.host} " +
- "--enable-static " +
- "--disable-shared";
-
- cross_inputs = [ xorg-macros ];
-
- # Need the latest version of config.sub so we can support musl.
- gnu_config = crossenv.native.gnu_config;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set = xorg-macros.license_set // { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xproto/license_builder.sh b/nix/nixcrpkgs/pkgs/xproto/license_builder.sh
deleted file mode 100644
index 4ed0509f1..000000000
--- a/nix/nixcrpkgs/pkgs/xproto/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xproto-* xproto
-
-license=$(cat xproto/COPYING)
-
-cat > $out <xproto
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/xtrans/builder.sh b/nix/nixcrpkgs/pkgs/xtrans/builder.sh
deleted file mode 100644
index 354670cb0..000000000
--- a/nix/nixcrpkgs/pkgs/xtrans/builder.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xtrans-* xtrans
-
-mkdir build
-cd build
-
-../xtrans/configure --prefix $out
-
-make
-
-make install
-
-# So we can find the pkgconfig files in lib/pkgconfig
-ln -s share $out/lib
diff --git a/nix/nixcrpkgs/pkgs/xtrans/default.nix b/nix/nixcrpkgs/pkgs/xtrans/default.nix
deleted file mode 100644
index 44daf818a..000000000
--- a/nix/nixcrpkgs/pkgs/xtrans/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ crossenv }:
-
-let
- version = "1.3.5";
-
- name = "xtrans-${version}";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://xorg.freedesktop.org/releases/individual/lib/xtrans-${version}.tar.bz2";
- sha256 = "00c3ph17acnsch3gbdmx33b9ifjnl5w7vx8hrmic1r1cjcv3pgdd";
- };
-
- lib = crossenv.native.make_derivation rec {
- inherit version name src;
- builder = ./builder.sh;
- };
-
- license = crossenv.native.make_derivation {
- name = "${name}-license";
- inherit src;
- builder = ./license_builder.sh;
- };
-
- license_set = { "${name}" = license; };
-
-in
- lib // { inherit license_set; }
diff --git a/nix/nixcrpkgs/pkgs/xtrans/license_builder.sh b/nix/nixcrpkgs/pkgs/xtrans/license_builder.sh
deleted file mode 100644
index 0b43e8b78..000000000
--- a/nix/nixcrpkgs/pkgs/xtrans/license_builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $setup
-
-tar -xf $src
-mv xtrans-* xtrans
-
-license=$(cat xtrans/COPYING)
-
-cat > $out <xtrans
-
-
-$license
-
-EOF
diff --git a/nix/nixcrpkgs/pkgs/zlib/builder.sh b/nix/nixcrpkgs/pkgs/zlib/builder.sh
deleted file mode 100644
index b7906b5a2..000000000
--- a/nix/nixcrpkgs/pkgs/zlib/builder.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-source $setup
-
-tar -xf $src
-
-mkdir build
-cd build
-
-sed -i 's$Darwin. | darwin.$Ignore* | ignore*$' ../zlib-$version/configure
-
-CHOST=$host \
-../zlib-$version/configure --prefix=$out --static
-
-make
-
-make install
diff --git a/nix/nixcrpkgs/pkgs/zlib/default.nix b/nix/nixcrpkgs/pkgs/zlib/default.nix
deleted file mode 100644
index 11242407a..000000000
--- a/nix/nixcrpkgs/pkgs/zlib/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ crossenv }:
-
-crossenv.make_derivation rec {
- name = "zlib-${version}";
-
- version = "1.2.11";
-
- src = crossenv.nixpkgs.fetchurl {
- url = "https://zlib.net/zlib-${version}.tar.gz";
- sha256 = "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3";
- };
-
- builder = ./builder.sh;
-}
diff --git a/nix/nixcrpkgs/pretend_stdenv/setup b/nix/nixcrpkgs/pretend_stdenv/setup
deleted file mode 100644
index a0f3af700..000000000
--- a/nix/nixcrpkgs/pretend_stdenv/setup
+++ /dev/null
@@ -1 +0,0 @@
-export PATH=$_PATH
diff --git a/nix/nixcrpkgs/support/derivations.txt b/nix/nixcrpkgs/support/derivations.txt
deleted file mode 100644
index d5d9f09af..000000000
--- a/nix/nixcrpkgs/support/derivations.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-define all = win32,win64,linux32,linux64,linux-rpi,mac
-define windows = win32,win64
-define linux = linux32,linux64,linux-rpi
-
-# Cross-compiler toolchains
-{$windows,$linux}.gcc slow=1
-mac.toolchain slow=1
-
-# Packages
-{$windows}.angle{,.examples} slow=1
-{$windows}.angle.examples
-omni.at-spi2-headers
-{$all}.avrdude
-omni.dejavu-fonts
-{$windows}.devcon
-{$all}.expat
-omni.fixesproto
-{$windows}.gdb
-{$all}.hello
-{$all}.hello_cpp
-omni.inputproto
-{$all}.ion
-omni.kbproto
-{$linux}.libudev
-{$all}.libusb
-{$all}.libusbp{,.examples}
-{$linux}.libx11
-{$linux}.libxall
-{$all}.libxau
-{$all}.libxcb{,.examples}
-{$linux}.libxext
-{$linux}.libxfixes
-{$linux}.libxi
-{$all}.openocd
-{$all}.pavr2
-{$windows}.pdcurses{,.examples}
-{$all}.p-load
-{$all}.qt slow=1
-{$all}.qt.examples
-{$windows}.readline
-{$all}.tic
-{$windows}.usbview
-omni.xcb-proto
-{$all}.xcb-util
-{$all}.xcb-util-image
-{$all}.xcb-util-keysyms
-{$all}.xcb-util-renderutil
-{$all}.xcb-util-wm
-omni.xextproto
-omni.xorg-macros
-{$all}.xproto
-omni.xtrans
-{$all}.zlib
-
-# Derivations we care about at Pololu
-{win32,linux32,linux-rpi,mac}.{p-load,pavr2,tic} priority=1
-
-# TODO: Test building the license_sets somehow too.
diff --git a/nix/nixcrpkgs/support/expand_brackets.rb b/nix/nixcrpkgs/support/expand_brackets.rb
deleted file mode 100644
index fccee4510..000000000
--- a/nix/nixcrpkgs/support/expand_brackets.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-def expand_brackets_core(str, depth)
- finished_parts = []
- active_parts = [+'']
- while true
- if str.empty?
- raise AnticipatedError, "Unmatched opening brace" if depth > 0
- break
- elsif str.start_with?('}')
- str.slice!(0)
- raise AnticipatedError, "Unmatched closing brace" if depth == 0
- break
- elsif str.start_with?('{')
- # Recurse, which removes everything up to and
- # including the matching closing brace.
- str.slice!(0)
- options = expand_brackets_core(str, depth + 1)
- raise if options.empty?
- active_parts = active_parts.flat_map { |p1|
- options.map { |p2| p1 + p2 }
- }
- elsif str.start_with?(',')
- raise AnticipatedError, "Comma at top level" if depth == 0
- # Remove the comma, mark the parts we are working
- # on as finished, and start a new part.
- str.slice!(0)
- finished_parts += active_parts
- active_parts = ['']
- else
- part_length = str.index(/[{},]|$/)
- raise if part_length < 1
- part = str.slice!(0, part_length)
- active_parts.each do |s|
- s.insert(-1, part)
- end
- end
- end
- finished_parts + active_parts
-end
-
-# Expands something like "{a,b}{,.x}" to ["a", "a.x", "b", "b.x"]
-def expand_brackets(str)
- expand_brackets_core(str.dup, 0)
-end
diff --git a/nix/nixcrpkgs/support/graph.rb b/nix/nixcrpkgs/support/graph.rb
deleted file mode 100644
index b1db81137..000000000
--- a/nix/nixcrpkgs/support/graph.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-def print_graph(graph)
- graph.each do |parent, children|
- puts "#{parent} ->"
- children.each do |child|
- puts " #{child}"
- end
- end
-end
-
-def check_graph!(graph)
- graph.each do |parent, children|
- children.each do |child|
- if !graph.key?(child)
- raise "Graph is missing an entry for #{child}"
- end
- end
- end
-end
-
-def depth_first_search_exclude_start(graph, start)
- stack = [graph.fetch(start).to_a.reverse]
- visited = Set.new
- until stack.empty?
- node = stack.last.pop
- if node.nil?
- stack.pop
- next
- end
- next if visited.include?(node)
- visited << node
- stack << graph.fetch(node).to_a.reverse
- yield node
- end
-end
-
-def transitive_closure(graph)
- tc = {}
- graph.each_key do |node|
- tc[node] = enum_for(:depth_first_search_exclude_start, graph, node).to_a
- end
- tc
-end
-
-def restricted_transitive_closure(graph, allowed)
- rtc = {}
- graph.each_key do |node|
- next if !allowed.include?(node)
- reached_nodes = []
- depth_first_search_exclude_start(graph, node) do |reached_node|
- next if !allowed.include?(reached_node)
- reached_nodes << reached_node
- end
- rtc[node] = reached_nodes
- end
- rtc
-end
-
-def transitive_reduction(graph)
- tr = {}
- graph.each do |start_node, nodes|
- nodes_with_max_distance_1 = Set.new(nodes)
- distance = 1
- until nodes.empty?
- nodes = Set.new nodes.flat_map &graph.method(:fetch)
- nodes_with_max_distance_1 -= nodes
- distance += 1
- if distance > graph.size
- raise "Cycle detected: this algorithm only works with DAGs."
- end
- end
- tr[start_node] = nodes_with_max_distance_1.to_a
- end
- tr
-end
diff --git a/nix/nixcrpkgs/support/manage b/nix/nixcrpkgs/support/manage
deleted file mode 100755
index a21f3ec9f..000000000
--- a/nix/nixcrpkgs/support/manage
+++ /dev/null
@@ -1,541 +0,0 @@
-#!/usr/bin/env ruby
-
-# This part of hte code is under construction. It will eventually be a script that
-# helps us check that the derivations we care about are all building,
-# and prints the status of those builds.
-
-
-# This requires Ruby 2.5.0 or later because it uses a new syntax for rescuing
-# exceptions in a block with needing to make an extra begin/end pair.
-
-require 'open3'
-require 'pathname'
-require 'set'
-require 'sqlite3' # gem install sqlite3
-require_relative 'graph'
-require_relative 'expand_brackets'
-
-ResultsDir = Pathname('support/results')
-
-class AnticipatedError < RuntimeError
-end
-
-# Don't automatically change directory because maybe people want to test one
-# nixcrpkgs repository using the test script from another one. But do give an
-# early, friendly warning if they are running in the wrong directory.
-def check_directory!
- return if File.directory?('pretend_stdenv')
- $stderr.puts "You should run this script from the nixcrpkgs directory."
- dir = Pathname(__FILE__).parent.parent
- $stderr.puts "Try running these commands:\n cd #{dir}\n test/test.rb"
- exit 1
-end
-
-def substitute_definitions(defs, str)
- str.gsub(/\$([\w-]+)/) do |x|
- defs.fetch($1)
- end
-end
-
-def parse_derivation_list(filename)
- defs = {}
- all_paths = Set.new
- all_attrs = {}
- File.foreach(filename).with_index do |line, line_index|
- line.strip!
-
- # Handle empty lines and comments.
- next if line.empty? || line.start_with?('#')
-
- # Handle variable definitions (e.g. "define windows = win32,win64").
- if line.start_with?('define')
- md = line.match(/^define\s+([\w-]+)\s*=\s*(.*)$/)
- if !md
- raise AnticipatedError, "Invalid definition syntax."
- end
- name, value = md[1], md[2]
- defs[name] = value
- next
- end
-
- # Expand variable definitions (e.g. $windows expands to "win32,win64").
- line = substitute_definitions(defs, line)
-
- # Figure out which parts of the line are attribute paths with brackets and
- # which are attributes.
- items = line.split(' ')
- attr_defs, path_items = items.partition { |p| p.include?('=') }
-
- # Expand any brackets in the attribute paths to get the complete list of
- # paths specified on this line.
- paths = path_items.flat_map { |p| expand_brackets(p) }.map(&:to_sym)
-
- # Process attribute definitions on the line, like "priority=1".
- attrs = {}
- attr_defs.each do |attr_def|
- md = attr_def.match(/^(\w+)=(\d+)$/)
- if !md
- raise AnticipatedError, "Invalid attribute definition: #{attr_def.inspect}."
- end
- name, value = md[1], md[2]
- case name
- when 'priority', 'slow'
- attrs[name.to_sym] = value.to_i
- else
- raise AnticipatedError, "Unrecognized attribute: #{name.inspect}."
- end
- end
-
- # Record the paths for this line and the attributes for those paths,
- # overriding previous attributes values if necessary.
- all_paths += paths
- if !attrs.empty?
- paths.each do |path|
- (all_attrs[path] ||= {}).merge!(attrs)
- end
- end
- rescue AnticipatedError => e
- raise AnticipatedError, "#{filename}:#{line_index + 1}: error: #{e}"
- end
-
- if all_paths.empty?
- raise AnticipatedError, "#{filename} specifies no paths"
- end
-
- all_paths.each do |path|
- if !path.match?(/^[\w.-]+$/)
- raise "Invalid characters in path name: #{path}"
- end
- end
-
- { defs: defs, paths: all_paths.to_a, attrs: all_attrs }
-end
-
-# Make a hash holding the priority of each Nix attribute path we want to build.
-# This routine determines the default priority.
-def make_path_priority_map(settings)
- attrs = settings.fetch(:attrs)
- m = {}
- settings.fetch(:paths).each do |path|
- m[path] = attrs.fetch(path, {}).fetch(:priority, 0)
- end
- m
-end
-
-# Make a hash holding the relative build time of each Nix attribute path we want
-# to build. This routine detrmines the default time, and what "slow" means.
-def make_path_time_map(settings)
- attrs = settings.fetch(:attrs)
- m = {}
- settings.fetch(:paths).each do |path|
- m[path] = attrs.fetch(path, {})[:slow] ? 100 : 1
- end
- m
-end
-
-def instantiate_drvs(paths)
- cmd = 'nix-instantiate ' + paths.map { |p| "-A #{p}" }.join(' ')
- stdout_str, stderr_str, status = Open3.capture3(cmd)
- if !status.success?
- $stderr.puts stderr_str
- raise AnticipatedError, "Failed to instantiate derivations."
- end
- paths.zip(stdout_str.split.map(&:to_sym)).to_h
-end
-
-# We want there to be a one-to-one mapping between paths in the derivations.txt
-# list and derivations, so we can make a graph of dependencies of the
-# derivations and each derivation in the graph will have a unique path in the
-# derivations.txt list.
-def check_paths_are_unique!(path_drv_map)
- set = Set.new
- path_drv_map.each do |key, drv|
- if set.include?(drv)
- raise AnticipatedError, "The derivation #{key} is the same as " \
- "other derivations in the list. Maybe use the 'omni' namespace."
- end
- set << drv
- end
-end
-
-# Makes a new map that has the same keys as map1, and the values
-# have all been mapped by map2.
-#
-# Requires map2 to have a key for every value in map1.
-def map_compose(map1, map2)
- map1.transform_values &map2.method(:fetch)
-end
-
-# Like map_compose, but excludes keys from map1 where the corresponding map1
-# value is not a key of map2.
-def map_join(map1, map2)
- r = {}
- map1.each do |key, value|
- if map2.key?(value)
- r[key] = map2.fetch(value)
- end
- end
- r
-end
-
-def nix_db
- return $db if $db
- $db = SQLite3::Database.new '/nix/var/nix/db/db.sqlite', readonly: true
-end
-
-# Given an array of derivations (paths to .drv files in /nix), this function
-# queries the Nix database and returns hash table mapping derivations to
-# a boolean that is true if they have already been built.
-def get_build_status(drvs)
- drv_list_str = drvs.map { |d| "\"#{d}\"" }.join(", ")
- query = < 0
- more_attrs << " penwidth=3"
- end
-
- # Draw slow nodes as a double octagon.
- if path_time_map.fetch(path) > 10
- more_attrs << " shape=doubleoctagon"
- end
- f.puts "\"#{path}\" [label=\"#{component}\"#{more_attrs}]"
- end
- f.puts "}"
- end
-
- # Output dependencies between nodes.
- visible_paths.each do |path|
- path_graph.fetch(path).each do |dep|
- next if decompose.(dep).first == 'omni'
- f.puts "\"#{path}\" -> \"#{dep}\""
- end
- end
- f.puts "}"
- end
-end
-
-def make_build_plan(path_state)
- path_graph = path_state.fetch(:graph)
- path_priority_map = path_state.fetch(:priority_map)
- path_time_map = path_state.fetch(:time_map)
- path_built_map = path_state.fetch(:built_map)
-
- # It's handy to be able to get all the dependencies of a node in one step, and
- # we will use that frequently to calculate how expensive it is to build a
- # node and to make the toplogical sort.
- path_graph = transitive_closure(path_graph).freeze
-
- # The paths we need to build. In the future we could filter this by priority.
- required_paths = Set.new(path_graph.keys).freeze
-
- # built_paths: The set of paths that are already built. We will mutate this
- # as we simulate our build plan.
- built_paths = Set.new
- path_built_map.each do |path, built|
- built_paths << path if built
- end
-
- # List of paths to build. Each path should only be built once all the paths it
- # depends on are built. I know nix-build can take care of that for us, but it's
- # nice to see the precise order of what is going to be built so we can tell when
- # slow things will get built.
- build_plan = []
-
- # Computes the time to build a path, taking into account what has already been
- # built.
- calculate_time = lambda do |path|
- deps = path_graph.fetch(path) + [path]
- deps.reject! &built_paths.method(:include?)
- deps.map(&path_time_map.method(:fetch)).sum
- end
-
- # Adds plans to build this path and all of its unbuilt depedencies.
- add_to_build_plan = lambda do |path|
- deps = path_graph.fetch(path) + [path]
-
- # Remove dependencies that are already built.
- deps.reject! &built_paths.method(:include?)
-
- # Topological sort
- deps.sort! do |p1, p2|
- case
- when path_graph.fetch(p1).include?(p2) then 1
- when path_graph.fetch(p2).include?(p1) then -1
- else 0
- end
- end
-
- deps.each do |path|
- build_plan << path
- built_paths << path
- end
- end
-
- while true
- unbuilt_required_paths = required_paths - built_paths
- break if unbuilt_required_paths.empty?
-
- # Find the maximum priority of the unbuilt required paths.
- max_priority = nil
- unbuilt_required_paths.each do |path|
- priority = path_priority_map.fetch(path)
- if !max_priority || priority > max_priority
- max_priority = priority
- end
- end
-
- top_priority_paths = unbuilt_required_paths.select do |path|
- path_priority_map.fetch(path) == max_priority
- end
-
- target = top_priority_paths.min_by(&calculate_time)
-
- add_to_build_plan.(target)
- end
-
- build_plan
-end
-
-# Updates the 'support/results' directory, which holds
-# symbolic links to all the derivations defined by nixcrpkgs and
-# listed in support/derivations.txt which have already been built.
-#
-# Intended use:
-# ln -s $PWD/support/results /nix/var/nix/gcroots/nixcrpkgs-results
-# support/manage results
-# nix-collect-garbage
-def update_results_dir(path_valid_results_map)
- ResultsDir.mkdir if !ResultsDir.directory?
- ResultsDir.children.each do |p|
- p.unlink
- end
- modern_links = Set.new
- path_valid_results_map.each do |path, results_map|
- results_map.each do |id, result|
- suffix = id == :out ? '' : ".#{id}"
- link_name = "#{path}#{suffix}"
- (ResultsDir + link_name).make_symlink(result)
- modern_links << link_name
- end
- end
-end
-
-def build_paths(path_graph, path_built_map, build_plan, keep_going: true)
- path_built_map = path_built_map.dup
- path_graph = transitive_closure(path_graph)
- build_plan.each do |path|
- if !path_graph.fetch(path).all?(&path_built_map.method(:fetch))
- # One of the dependencies of this path has not been built, presumably
- # because there was an error.
- puts "# skipping #{path}"
- next
- end
-
- print "nix-build -A #{path}"
- system("nix-build -A #{path} > /dev/null 2> /dev/null")
-
- if $?.success?
- path_built_map[path] = true
- puts
- else
- puts " # failed"
- return false if !keep_going
- end
- end
- true
-end
-
-def parse_args(argv)
- action = case argv.first
- when 'graph' then :graph
- when 'results' then :results
- when 'build' then :build
- when 'plan' then :plan
- when 'stats', nil then :stats
- else raise AnticipatedError, "Invalid action: #{argv.first.inspect}"
- end
-
- { action: action }
-end
-
-begin
- check_directory!
- args = parse_args(ARGV)
- action = args.fetch(:action)
-
- settings = parse_derivation_list('support/derivations.txt')
-
- path_drv_map = instantiate_drvs(settings.fetch(:paths))
- check_paths_are_unique!(path_drv_map)
-
- drvs = path_drv_map.values.uniq
- drv_built_map = get_build_status(drvs)
-
- if [:graph, :build, :plan].include?(action)
- global_drv_graph = get_drv_graph
- drv_graph = graph_restrict_nodes(global_drv_graph, drvs)
- path_state = {
- graph: graph_unmap(drv_graph, path_drv_map).freeze,
- priority_map: make_path_priority_map(settings).freeze,
- time_map: make_path_time_map(settings).freeze,
- built_map: map_compose(path_drv_map, drv_built_map).freeze,
- }.freeze
- end
-
- if action == :graph
- output_graphviz(path_state)
- end
-
- if [:build, :plan].include?(action)
- build_plan = make_build_plan(path_state)
- end
-
- if action == :plan
- puts "Build plan:"
- build_plan.each do |path|
- puts "nix-build -A #{path}"
- end
- end
-
- if action == :build
- success = build_paths(path_state[:graph], path_state[:built_map], build_plan)
- exit(1) if !success
- end
-
- if action == :results || action == :build
- drv_valid_results_map = get_valid_results(drvs)
- path_valid_results_map = map_join(path_drv_map, drv_valid_results_map).freeze
- update_results_dir(path_valid_results_map)
- end
-
- if action == :stats
- print_stats(drv_built_map)
- end
-rescue AnticipatedError => e
- $stderr.puts e
-end
diff --git a/nix/nixcrpkgs/top.nix b/nix/nixcrpkgs/top.nix
deleted file mode 100644
index 5e1aa63a6..000000000
--- a/nix/nixcrpkgs/top.nix
+++ /dev/null
@@ -1,72 +0,0 @@
-{ osx_sdk, nixpkgs }:
-
-rec {
- inherit nixpkgs;
-
- # Some native build tools.
- native = import ./native { inherit nixpkgs; };
-
- # Cross-compiling environments for each target system.
- crossenvs = {
- i686-w64-mingw32 = import ./mingw-w64 { inherit native; arch = "i686"; };
- x86_64-w64-mingw32 = import ./mingw-w64 { inherit native; arch = "x86_64"; };
- i686-linux-musl = import ./linux { inherit native; arch = "i686"; };
- x86_64-linux-musl = import ./linux { inherit native; arch = "x86_64"; };
- armv6-linux-musl = import ./linux {
- inherit native;
- arch = "armv6";
- gcc_options = "--with-fpu=vfp --with-float=hard ";
- };
- macos = import ./macos { inherit osx_sdk native; };
- };
-
- pkgFun = crossenv: import ./pkgs.nix { inherit crossenv; } // crossenv;
-
- # Sets of packages for each target system.
- i686-w64-mingw32 = pkgFun crossenvs.i686-w64-mingw32;
- x86_64-w64-mingw32 = pkgFun crossenvs.x86_64-w64-mingw32;
- i686-linux-musl = pkgFun crossenvs.i686-linux-musl;
- x86_64-linux-musl = pkgFun crossenvs.x86_64-linux-musl;
- armv6-linux-musl = pkgFun crossenvs.armv6-linux-musl;
- macos = pkgFun crossenvs.macos;
-
- # omni is convenient name for packages that are used for cross-compiling but
- # are actually the same on all platforms. You can just refer to it by
- # 'omni.package_name' instead of 'some_platform.package_name'.
- omni = pkgFun { inherit native nixpkgs; };
-
- # Handy aliases.
- win32 = i686-w64-mingw32;
- win64 = x86_64-w64-mingw32;
- linux32 = i686-linux-musl;
- linux-x86 = i686-linux-musl;
- linux-i686 = i686-linux-musl;
- linux64 = x86_64-linux-musl;
- linux-x86_64 = x86_64-linux-musl;
- linux-rpi = armv6-linux-musl;
- rpi = armv6-linux-musl;
- mac = macos;
-
- # filter is a function that can be applied to a local directory to filter out
- # files that are likely to change frequently without affecting the build,
- # causing unneeded rebuilds.
- filter_func = name: type: let bn = baseNameOf (toString name); in !(
- (type == "directory" && bn == ".git") ||
- (type == "symlink" && nixpkgs.lib.hasPrefix "result" bn) ||
- (type == "directory" && bn == "nix") ||
- (type == "directory" && bn == "build") ||
- nixpkgs.lib.hasSuffix ".nix" bn ||
- nixpkgs.lib.hasSuffix "~" bn
- );
- filter = builtins.filterSource filter_func;
-
- # bundle is a function that takes a set of derivations and makes a
- # derivation for a bundle that has symbolic links in it to each of
- # the input derivations.
- bundle = drvs: native.make_derivation rec {
- name = "bundle";
- builder = ./bundle_builder.sh;
- names = builtins.attrNames drvs;
- dirs = builtins.attrValues drvs;
- };
-}
diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix
deleted file mode 100644
index fd2d2cd4a..000000000
--- a/nix/nixpkgs.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-let
-
- rev = "61c3169a0e17d789c566d5b241bfe309ce4a6275";
- hash = "0qbycg7wkb71v20rchlkafrjfpbk2fnlvvbh3ai9pyfisci5wxvq";
- pkgs = builtins.fetchTarball {
- name = "nixpkgs-2019-01-15";
- url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
- sha256 = hash;
- };
-
-in
-
-import pkgs {}
diff --git a/nix/ops/boot-ship.nix b/nix/ops/boot-ship.nix
deleted file mode 100644
index b54a7a90a..000000000
--- a/nix/ops/boot-ship.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ pkgs ? import ../nixpkgs.nix
-, debug ? false
-, ship ? "zod"
-, pill ? ../../bin/solid.pill
-}:
-
-let
-
- deps = import ../deps { inherit pkgs; };
- tlon = import ../pkgs { inherit pkgs; };
- arvo = tlon.arvo;
- urbit = tlon.urbit;
- herb = tlon.herb;
-
-in
-
-import ./fakeship {
- inherit pkgs arvo pill ship urbit herb;
-}
diff --git a/nix/ops/brass/builder.sh b/nix/ops/brass/builder.sh
deleted file mode 100755
index 75f76e872..000000000
--- a/nix/ops/brass/builder.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-source $stdenv/setup
-
-set -ex
-
-cp -r $PIER ./pier
-chmod -R u+rw ./pier
-
-$URBIT -d ./pier
-
-cleanup () {
- if [ -e ./pier/.vere.lock ]
- then kill $(< ./pier/.vere.lock) || true;
- fi
-}
-
-trap cleanup EXIT
-
-herb ./pier -P brass.pill -d '+brass'
-
-mv brass.pill $out
-
-set +x
diff --git a/nix/ops/brass/default.nix b/nix/ops/brass/default.nix
deleted file mode 100644
index ea83c4ff7..000000000
--- a/nix/ops/brass/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, herb, urbit, pier, arvo }:
-
-pkgs.stdenv.mkDerivation rec {
- name = "brass";
- builder = ./builder.sh;
- buildInputs = [ herb pkgs.coreutils ];
-
- URBIT = urbit.meta.exe;
- PIER = pier;
- ARVO = arvo;
-}
diff --git a/nix/ops/default.nix b/nix/ops/default.nix
deleted file mode 100644
index d048d783e..000000000
--- a/nix/ops/default.nix
+++ /dev/null
@@ -1,86 +0,0 @@
-{ pkgs ? import ../nixpkgs.nix, debug ? false }:
-
-let
-
- tlon = import ../pkgs { inherit pkgs; };
- arvo = tlon.arvo;
- arvo-ropsten = tlon.arvo-ropsten;
- herb = tlon.herb;
- urbit = if debug then tlon.urbit-debug else tlon.urbit;
-
- bootbrass = ../../bin/brass.pill;
- bootsolid = ../../bin/solid.pill;
-
- rawzod = import ./fakeship {
- inherit pkgs herb urbit;
- pill = bootsolid;
- ship = "zod";
- arvo = null;
- };
-
- ropzod = import ./fakeship {
- inherit pkgs herb urbit;
- pill = bootsolid;
- ship = "zod";
- arvo = arvo-ropsten;
- };
-
- zod = import ./fakeship {
- inherit pkgs herb urbit arvo;
- pill = bootsolid;
- ship = "zod";
- };
-
-in
-
-rec {
-
- bus = import ./fakeship {
- inherit pkgs herb urbit arvo;
- pill = bootsolid;
- ship = "bus";
- };
-
- test = import ./test {
- inherit pkgs herb urbit;
- ship = bus;
- };
-
- solid = import ./solid {
- inherit pkgs herb urbit arvo;
- pier = rawzod;
- };
-
- brass = import ./brass {
- inherit pkgs herb urbit arvo;
- pier = zod;
- };
-
- brass-ropsten = import ./brass {
- inherit pkgs herb urbit;
- arvo = arvo-ropsten;
- pier = ropzod;
- };
-
- ivory = import ./ivory {
- inherit pkgs herb urbit arvo;
- pier = zod;
- };
-
- ivory-ropsten = import ./ivory {
- inherit pkgs herb urbit;
- arvo = arvo-ropsten;
- pier = ropzod;
- };
-
- image = import ./image {
- inherit pkgs herb urbit solid;
- };
-
- image-ropsten = import ./image {
- inherit pkgs herb urbit;
- brass = brass-ropsten;
- ivory = ivory-ropsten;
- };
-
-}
diff --git a/nix/ops/fakeship/builder.sh b/nix/ops/fakeship/builder.sh
deleted file mode 100755
index 19ef10b87..000000000
--- a/nix/ops/fakeship/builder.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-source $stdenv/setup
-
-set -ex
-
-if [ -z "$ARVO" ]
-then
- $URBIT -d -F $SHIP -B "$PILL" $out
-else
- $URBIT -d -F $SHIP -A "$ARVO" -B "$PILL" $out
-fi
-
-check () {
- [ 3 -eq "$(herb $out -d 3)" ]
-}
-
-if check && sleep 10 && check
-then
- echo "Boot success." >&2
- herb $out -p hood -d '+hood/exit' || true
-else
- echo "Boot failure." >&2
- kill $(< $out/.vere.lock) || true
- exit 1
-fi
-
-set +x
diff --git a/nix/ops/fakeship/default.nix b/nix/ops/fakeship/default.nix
deleted file mode 100644
index 8ebfa4a5e..000000000
--- a/nix/ops/fakeship/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, herb, urbit, pill, ship, arvo }:
-
-pkgs.stdenv.mkDerivation {
- name = "fake" + ship;
- builder = ./builder.sh;
- buildInputs = [ herb ];
- URBIT = urbit.meta.exe;
- ARVO = arvo;
- PILL = pill;
- SHIP = ship;
-}
diff --git a/nix/ops/image/default.nix b/nix/ops/image/default.nix
deleted file mode 100644
index ecfc97d26..000000000
--- a/nix/ops/image/default.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ pkgs
-, herb
-, urbit
-, solid ? null
-, brass ? null
-, ivory ? null
-}:
-
-let
- link = pill: path:
- if pill == null then ""
- else "${pkgs.coreutils}/bin/ln -sf ${pill} ${path}";
-
-in pkgs.dockerTools.buildImage {
- name = urbit.meta.name;
-
- runAsRoot = ''
- #!${pkgs.stdenv.shell}
-
- set -euo pipefail
-
- ${pkgs.dockerTools.shadowSetup}
-
- mkdir -p /share /data /tmp
-
- ${link solid "/share/solid.pill"}
- ${link brass "/share/brass.pill"}
- ${link ivory "/share/ivory.pill"}
- '';
-
- contents = [ urbit herb ];
-
- config = {
- Entrypoint = [ urbit.meta.name ];
-
- WorkingDir = "/data";
-
- Volumes = {
- "/data" = {};
- };
-
- ExposedPorts = {
- "80/tcp" = {};
- "443/tcp" = {};
- };
- };
-}
diff --git a/nix/ops/ivory/builder.sh b/nix/ops/ivory/builder.sh
deleted file mode 100755
index 1e929a84f..000000000
--- a/nix/ops/ivory/builder.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-source $stdenv/setup
-
-set -ex
-
-cp -r $PIER ./pier
-chmod -R u+rw ./pier
-
-$URBIT -d ./pier
-
-cleanup () {
- if [ -e ./pier/.vere.lock ]
- then kill $(< ./pier/.vere.lock) || true;
- fi
-}
-
-trap cleanup EXIT
-
-herb ./pier -P ivory.pill -d '+ivory'
-
-mv ivory.pill $out
-
-set +x
diff --git a/nix/ops/ivory/default.nix b/nix/ops/ivory/default.nix
deleted file mode 100644
index 36532b7b5..000000000
--- a/nix/ops/ivory/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, herb, urbit, pier, arvo }:
-
-pkgs.stdenv.mkDerivation rec {
- name = "ivory";
- builder = ./builder.sh;
- buildInputs = [ herb pkgs.coreutils ];
-
- URBIT = urbit.meta.exe;
- PIER = pier;
- ARVO = arvo;
-}
diff --git a/nix/ops/solid/builder.sh b/nix/ops/solid/builder.sh
deleted file mode 100755
index f5b39a057..000000000
--- a/nix/ops/solid/builder.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-source $stdenv/setup
-
-set -ex
-
-cp -r $PIER ./pier
-chmod -R u+rw ./pier
-
-$URBIT -d ./pier
-
-shutdown () {
- if [ -e ./pier/.vere.lock ]
- then kill $(< ./pier/.vere.lock) || true;
- fi
-}
-
-trap shutdown EXIT
-
-# update pill strategy to ensure correct staging
-#
-
-herb ./pier -p hood -d "+hood/mount /=home="
-
-until [ -d ./pier/home ]
-do
- sleep 1
-done
-
-# update :lens, :dojo and dependencies
-#
-# XX reduce this list
-#
-cp $ARVO/app/lens.hoon ./pier/home/app/ 2>/dev/null || true
-cp $ARVO/app/dojo.hoon ./pier/home/app/ 2>/dev/null || true
-cp $ARVO/lib/base64.hoon ./pier/home/lib/ 2>/dev/null || true
-cp $ARVO/lib/server.hoon ./pier/home/lib/ 2>/dev/null || true
-cp $ARVO/lib/sole.hoon ./pier/home/lib/ 2>/dev/null || true
-cp $ARVO/lib/xray.hoon ./pier/home/lib/ 2>/dev/null || true
-cp $ARVO/lib/pprint.hoon ./pier/home/lib/ 2>/dev/null || true
-mkdir -p ./pier/home/mar/lens/
-cp $ARVO/mar/lens/* ./pier/home/mar/lens/ 2>/dev/null || true
-
-cp $ARVO/sur/lens.hoon ./pier/home/sur/ 2>/dev/null || true
-cp $ARVO/sur/sole.hoon ./pier/home/sur/ 2>/dev/null || true
-
-# update +solid and its dependencies
-#
-cp $ARVO/lib/pill.hoon ./pier/home/lib/ 2>/dev/null || true
-cp $ARVO/gen/solid.hoon ./pier/home/gen/ 2>/dev/null || true
-
-chmod -R u+rw ./pier/home/
-
-herb ./pier -p hood -d "+hood/commit %home"
-herb ./pier -p hood -d "+hood/unmount %home"
-
-# XX horrible hack to ensure the update is applied first
-#
-sleep 10
-
-# stage new desk for pill contents
-#
-herb ./pier -p hood -d '+hood/merge %stage our %home'
-herb ./pier -p hood -d "+hood/mount /=stage="
-
-until [ -d ./pier/stage ]
-do
- sleep 1
-done
-
-rm -rf ./pier/stage
-cp -r $ARVO ./pier/stage
-chmod -R u+rw ./pier/stage
-
-herb ./pier -p hood -d "+hood/commit %stage"
-herb ./pier -p hood -d "+hood/unmount %stage"
-
-herb ./pier -P solid.pill -d '+solid /=stage=/sys, =dub &'
-
-herb ./pier -p hood -d '+hood/exit' || true
-
-mv solid.pill $out
-
-set +x
diff --git a/nix/ops/solid/default.nix b/nix/ops/solid/default.nix
deleted file mode 100644
index 050763c3b..000000000
--- a/nix/ops/solid/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, herb, urbit, pier, arvo }:
-
-pkgs.stdenv.mkDerivation rec {
- name = "solid";
- builder = ./builder.sh;
- buildInputs = [ herb pkgs.coreutils ];
-
- URBIT = urbit.meta.exe;
- PIER = pier;
- ARVO = arvo;
-}
diff --git a/nix/ops/test/builder.sh b/nix/ops/test/builder.sh
deleted file mode 100644
index 2746797ab..000000000
--- a/nix/ops/test/builder.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-source $stdenv/setup
-
-set -ex
-
-cp -r $SHIP ./ship
-chmod -R u+rw ./ship
-
-$URBIT -d ./ship 2> urbit-output
-
-tail -f urbit-output >&2 &
-tailproc=$!
-
-shutdown () {
- if [ -e ./ship/.vere.lock ]
- then kill $(< ./ship/.vere.lock) || true;
- fi
-
- kill "$tailproc" || true;
-}
-
-trap shutdown EXIT
-
-herb ./ship -p hood -d '+hood/mass'
-
-# Run the unit tests and then print scrollback
-herb ./ship -d '~& ~ ~& %test-unit-start ~'
-herb ./ship -d '####-test %/tests'
-herb ./ship -d '~& ~ ~& %test-unit-end ~'
-
-# Start and run the test app
-herb ./ship -p hood -d '+hood/start %test'
-
-herb ./ship -d '~& ~ ~& %test-agents-start ~'
-herb ./ship -p test -d '%agents'
-herb ./ship -d '~& ~ ~& %test-agents-end ~'
-
-herb ./ship -d '~& ~ ~& %test-generators-start ~'
-herb ./ship -p test -d '%generators'
-herb ./ship -d '~& ~ ~& %test-generators-end ~'
-
-herb ./ship -d '~& ~ ~& %test-marks-start ~'
-herb ./ship -p test -d '%marks'
-herb ./ship -d '~& ~ ~& %test-marks-end ~'
-
-# compact the loom, comparing memory use before and after
-herb ./ship -p hood -d '+hood/mass'
-
-herb ./ship -d '~& ~ ~& %pack-start ~'
-herb ./ship -p hood -d '+hood/pack'
-herb ./ship -d '~& ~ ~& %pack-end ~'
-
-herb ./ship -p hood -d '+hood/mass'
-
-shutdown
-
-# Collect output
-
-cp urbit-output test-output-unit
-cp urbit-output test-output-agents
-cp urbit-output test-output-generators
-cp urbit-output test-output-marks
-rm urbit-output
-
-sed -i '0,/test-unit-start/d' test-output-unit
-sed -i '/test-unit-end/,$d' test-output-unit
-
-sed -i '0,/test-agents-start/d' test-output-agents
-sed -i '/test-agents-end/,$d' test-output-agents
-
-sed -i '0,/test-generators-start/d' test-output-generators
-sed -i '/test-generators-end/,$d' test-output-generators
-
-sed -i '0,/test-marks-start/d' test-output-marks
-sed -i '/test-marks-end/,$d' test-output-marks
-
-mkdir $out
-
-cp -r test-output-* $out/
-
-set +x
diff --git a/nix/ops/test/default.nix b/nix/ops/test/default.nix
deleted file mode 100644
index e901d2dc5..000000000
--- a/nix/ops/test/default.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{ pkgs, herb, urbit, ship }:
-
-pkgs.stdenv.mkDerivation rec {
- name = "test";
- builder = ./builder.sh;
- buildInputs = [ herb ];
-
- URBIT = urbit.meta.exe;
- SHIP = ship;
-}
diff --git a/nix/overlays/arm.nix b/nix/overlays/arm.nix
new file mode 100644
index 000000000..62bb1eb0d
--- /dev/null
+++ b/nix/overlays/arm.nix
@@ -0,0 +1,13 @@
+final: prev:
+
+let
+
+ isAarch64 = prev.stdenv.hostPlatform.isAarch64;
+
+in prev.lib.optionalAttrs isAarch64 {
+ libsigsegv = prev.libsigsegv.overrideAttrs (attrs: {
+ preConfigure = (old.preConfigure or "") + ''
+ sed -i 's/^CFG_FAULT=$/CFG_FAULT=fault-linux-arm.h/' configure
+ '';
+ });
+}
diff --git a/nix/overlays/musl.nix b/nix/overlays/musl.nix
new file mode 100644
index 000000000..857cb7504
--- /dev/null
+++ b/nix/overlays/musl.nix
@@ -0,0 +1,28 @@
+final: prev:
+
+let
+
+ isMusl = prev.stdenv.hostPlatform.isMusl;
+
+ optionalList = xs: if xs == null then [ ] else xs;
+
+ overrideStdenv = pkg: pkg.override { stdenv = prev.gcc9Stdenv; };
+
+in prev.lib.optionalAttrs isMusl {
+ libsigsegv = prev.libsigsegv.overrideAttrs (attrs: {
+ preConfigure = (attrs.preConfigure or "") + ''
+ sed -i 's/^CFG_FAULT=$/CFG_FAULT=fault-linux-i386.h/' configure
+ '';
+ });
+
+ secp256k1 = prev.secp256k1.overrideAttrs (attrs: {
+ nativeBuildInputs = (attrs.nativeBuildInputs or [ ])
+ ++ [ prev.buildPackages.stdenv.cc ];
+ });
+
+ rhash = overrideStdenv prev.rhash;
+
+ numactl = overrideStdenv prev.numactl;
+
+ lmdb = overrideStdenv prev.lmdb;
+}
diff --git a/nix/overlays/native.nix b/nix/overlays/native.nix
new file mode 100644
index 000000000..2ab55e375
--- /dev/null
+++ b/nix/overlays/native.nix
@@ -0,0 +1,28 @@
+final: prev:
+
+let
+
+ optionalList = xs: if xs == null then [ ] else xs;
+
+in {
+ h2o = prev.h2o.overrideAttrs (_attrs: {
+ version = final.sources.h2o.rev;
+ src = final.sources.h2o;
+ outputs = [ "out" "dev" "lib" ];
+ });
+
+ libsigsegv = prev.libsigsegv.overrideAttrs (attrs: {
+ patches = optionalList attrs.patches ++ [
+ ../pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch
+ ../pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch
+ ];
+ });
+
+ curlMinimal = prev.curl.override {
+ http2Support = false;
+ scpSupport = false;
+ gssSupport = false;
+ ldapSupport = false;
+ brotliSupport = false;
+ };
+}
diff --git a/nix/overlays/static.nix b/nix/overlays/static.nix
new file mode 100644
index 000000000..fa0cfdd89
--- /dev/null
+++ b/nix/overlays/static.nix
@@ -0,0 +1,37 @@
+final: prev:
+
+let
+
+ # https://github.com/NixOS/nixpkgs/pull/97047/files
+ # Will make pkgs.stdenv.isStatic available indepedent of the platform.
+ # isStatic = prev.stdenv.hostPlatform.isStatic;
+
+ configureFlags = attrs: {
+ configureFlags = (attrs.configureFlags or [ ])
+ ++ [ "--disable-shared" "--enable-static" ];
+ };
+
+ enableStatic = pkg: pkg.overrideAttrs configureFlags;
+
+in {
+ gmp = enableStatic prev.gmp;
+
+ curlMinimal = enableStatic prev.curlMinimal;
+
+ libuv = enableStatic prev.libuv;
+
+ libffi = enableStatic prev.libffi;
+
+ secp256k1 = enableStatic prev.secp256k1;
+
+ lmdb = prev.lmdb.overrideAttrs (old:
+ configureFlags old // {
+ # Why remove the so version? It's easier than preventing it from being
+ # built with lmdb's custom Makefiles, and it can't exist in the output
+ # because otherwise the linker will preferentially choose the .so over
+ # the .a.
+ postInstall = ''
+ rm $out/lib/liblmdb.so
+ '';
+ });
+}
diff --git a/nix/pkgs/argon2u/default.nix b/nix/pkgs/argon2u/default.nix
new file mode 100644
index 000000000..60c7a1089
--- /dev/null
+++ b/nix/pkgs/argon2u/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, sources, enableParallelBuilding ? true }:
+
+stdenv.mkDerivation {
+ pname = "argon2u";
+ version = sources.argon2u.rev;
+ src = sources.argon2u;
+
+ postPatch = ''
+ substituteInPlace Makefile --replace 'ar rcs' '$(AR) rcs'
+ '';
+
+ buildPhase = ''
+ make libargon2.a
+ '';
+
+ installPhase = ''
+ mkdir -p $out/{lib,include}
+ cp libargon2.a $out/lib/
+ cp include/argon2.h $out/include/
+ cp ./src/blake2/*.h $out/include/
+ '';
+
+ makeFlags = [
+ "AR=${stdenv.cc.targetPrefix}ar" # Fix cross-compilation
+ ];
+
+ NO_THREADS = true;
+
+ inherit enableParallelBuilding;
+}
diff --git a/nix/pkgs/arvo-ropsten/builder.sh b/nix/pkgs/arvo-ropsten/builder.sh
deleted file mode 100644
index af133a2f2..000000000
--- a/nix/pkgs/arvo-ropsten/builder.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-source $stdenv/setup
-
-cp -r $src tmp
-chmod -R u+w tmp
-
-ZUSE=tmp/sys/zuse.hoon
-AMES=tmp/sys/vane/ames.hoon
-ACME=tmp/app/acme.hoon
-
-# replace the mainnet azimuth contract with the ropsten contract
-sed --in-place \
- 's/\(\+\+ contracts \)mainnet\-contracts/\1ropsten-contracts/' \
- $ZUSE
-
-# increment the %ames protocol version
-sed -r --in-place \
- 's_^(=/ protocol\-version=\?\(.*\) %)([0-7])_echo "\1$(echo "(\2+1) % 8" | bc)"_e' \
- $AMES
-
-# use the staging API in :acme
-sed --in-place \
- 's_https://acme-v02.api.letsencrypt.org/directory_https://acme-staging-v02.api.letsencrypt.org/directory_' \
- $ACME
-
-cp -r tmp $out
-chmod -R u+w $out
diff --git a/nix/pkgs/arvo-ropsten/default.nix b/nix/pkgs/arvo-ropsten/default.nix
deleted file mode 100644
index 9f4bb7e7d..000000000
--- a/nix/pkgs/arvo-ropsten/default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ pkgs }:
-
-pkgs.stdenv.mkDerivation {
- name = "arvo-ropsten";
- buildInputs = [ pkgs.bc ];
- builder = ./builder.sh;
- src = pkgs.buildRustCrateHelpers.exclude [ ".git" ] ../../../pkg/arvo;
-}
diff --git a/nix/pkgs/arvo/builder.sh b/nix/pkgs/arvo/builder.sh
deleted file mode 100644
index 3a0c49ad2..000000000
--- a/nix/pkgs/arvo/builder.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-source $stdenv/setup
-
-cp -r $src/ $out
-chmod -R u+w $out
diff --git a/nix/pkgs/arvo/default.nix b/nix/pkgs/arvo/default.nix
index 8b31237cf..c9204a01f 100644
--- a/nix/pkgs/arvo/default.nix
+++ b/nix/pkgs/arvo/default.nix
@@ -1,10 +1,46 @@
-{ pkgs }:
+{ lib, stdenvNoCC, bc }:
-pkgs.stdenv.mkDerivation {
+stdenvNoCC.mkDerivation {
name = "arvo";
- builder = ./builder.sh;
- src = pkgs.buildRustCrateHelpers.exclude [ ".git" ] ../../../pkg/arvo;
- meta = {
- priority = 0;
- };
+ src = lib.cleanSource ../../../pkg/arvo;
+
+ buildInputs = [ bc ];
+
+ outputs = [ "out" "ropsten" ];
+
+ phases = [ "mainnetPhase" "ropstenPhase" ];
+
+ mainnetPhase = ''
+ cp -r $src/ $out
+ chmod -R u+w $out
+ '';
+
+ ropstenPhase = ''
+ cp -r $src tmp
+ chmod -R u+w tmp
+
+ ZUSE=tmp/sys/zuse.hoon
+ AMES=tmp/sys/vane/ames.hoon
+ ACME=tmp/app/acme.hoon
+
+ # Replace the mainnet azimuth contract with the ropsten contract
+ sed --in-place \
+ 's/\(\+\+ contracts \)mainnet\-contracts/\1ropsten-contracts/' \
+ $ZUSE
+
+ # Increment the %ames protocol version
+ sed -r --in-place \
+ 's_^(=/ protocol\-version=\?\(.*\) %)([0-7])_echo "\1$(echo "(\2+1) % 8" | bc)"_e' \
+ $AMES
+
+ # Use the staging API in :acme
+ sed --in-place \
+ 's_https://acme-v02.api.letsencrypt.org/directory_https://acme-staging-v02.api.letsencrypt.org/directory_' \
+ $ACME
+
+ cp -r tmp $ropsten
+ chmod -R u+w $ropsten
+ '';
+
+ preferLocalBuild = true;
}
diff --git a/nix/pkgs/ca-bundle/default.nix b/nix/pkgs/ca-bundle/default.nix
new file mode 100644
index 000000000..ddef1fb3e
--- /dev/null
+++ b/nix/pkgs/ca-bundle/default.nix
@@ -0,0 +1,29 @@
+{ stdenvNoCC, xxd, cacert }:
+
+stdenvNoCC.mkDerivation {
+ name = "ca-bundle";
+
+ nativeBuildInputs = [ cacert xxd ];
+
+ phases = [ "installPhase" ];
+
+ installPhase = ''
+ set -euo pipefail
+
+ if ! [ -f "$SSL_CERT_FILE" ]; then
+ header "$SSL_CERT_FILE doesn't exist"
+ exit 1
+ fi
+
+ mkdir include
+
+ cat $SSL_CERT_FILE > include/ca-bundle.crt
+ xxd -i include/ca-bundle.crt > ca-bundle.h
+
+ mkdir -p $out/include
+
+ mv ca-bundle.h $out/include
+ '';
+
+ preferLocalBuild = true;
+}
diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix
deleted file mode 100644
index ba1129dd3..000000000
--- a/nix/pkgs/default.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ pkgs ? import ../nixpkgs.nix }:
-
-let
-
- deps = import ../deps { inherit pkgs; };
-
- ent = import ./ent { inherit pkgs; };
- arvo = import ./arvo { inherit pkgs; };
- 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;
- };
-
- mkUrbit = { debug }:
- import ./urbit {
- inherit pkgs ent debug ge-additions libaes_siv;
- inherit (deps) argon2 murmur3 uv ed25519 scrypt softfloat3;
- inherit (deps) secp256k1 h2o ivory-header ca-header;
- };
-
- urbit = mkUrbit { debug = false; };
- urbit-debug = mkUrbit { debug = true; };
-
-in
-
-{ inherit ent ge-additions libaes_siv arvo arvo-ropsten herb urbit urbit-debug; }
diff --git a/nix/pkgs/ed25519/default.nix b/nix/pkgs/ed25519/default.nix
new file mode 100644
index 000000000..7edd85223
--- /dev/null
+++ b/nix/pkgs/ed25519/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, sources }:
+
+stdenv.mkDerivation {
+ pname = "ed25519";
+ version = sources.ed25519.rev;
+ src = sources.ed25519;
+
+ buildPhase = ''
+ CFLAGS="-O3 -Wall -I$src/src"
+
+ for f in $(find src -type f -name '*.c'); do
+ $CC $CFLAGS -c $f -o "''${f//\//_}.o"
+ done
+ '';
+
+ installPhase = ''
+ mkdir -p $out/{lib,include}
+ $AR rcs $out/lib/libed25519.a *.o
+ cp $src/src/*.h $out/include/
+ '';
+}
diff --git a/nix/pkgs/ent/builder.sh b/nix/pkgs/ent/builder.sh
deleted file mode 100644
index 464f62e0b..000000000
--- a/nix/pkgs/ent/builder.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-source $stdenv/setup
-
-cp -r $src ./src
-chmod -R u+w ./src
-cd ./src
-
-bash ./configure
-PREFIX=$out make install
diff --git a/nix/pkgs/ent/cross.nix b/nix/pkgs/ent/cross.nix
deleted file mode 100644
index e84d7a01e..000000000
--- a/nix/pkgs/ent/cross.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{ env_name, env, deps }:
-
-env.make_derivation rec {
- name = "ent-7506f";
- builder = ./builder.sh;
- src = ../../../pkg/ent;
-
- CC = "${env.host}-gcc";
- AR = "${env.host}-ar";
-}
diff --git a/nix/pkgs/ent/default.nix b/nix/pkgs/ent/default.nix
index ce7c2088c..ee13758f5 100644
--- a/nix/pkgs/ent/default.nix
+++ b/nix/pkgs/ent/default.nix
@@ -1,7 +1,14 @@
-{ pkgs }:
+{ lib, stdenv, enableParallelBuilding ? true }:
-pkgs.stdenv.mkDerivation rec {
- name = "ent-7506f";
- builder = ./builder.sh;
- src = ../../../pkg/ent;
+stdenv.mkDerivation {
+ name = "ent";
+ src = lib.cleanSource ../../../pkg/ent;
+
+ postPatch = ''
+ patchShebangs ./configure
+ '';
+
+ installFlags = [ "PREFIX=$(out)" ];
+
+ inherit enableParallelBuilding;
}
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
index e77098cff..e317972d6 100644
--- a/nix/pkgs/ge-additions/default.nix
+++ b/nix/pkgs/ge-additions/default.nix
@@ -1,9 +1,13 @@
-{ pkgs, ed25519 }:
+{ lib, stdenv, ed25519, enableParallelBuilding ? true }:
-pkgs.stdenv.mkDerivation rec {
- name = "ge-additions";
- builder = ./builder.sh;
- src = ../../../pkg/ge-additions;
+stdenv.mkDerivation {
+ name = "ge-additions";
+ src = lib.cleanSource ../../../pkg/ge-additions;
- nativeBuildInputs = [ ed25519 ];
+ buildInputs = [ ed25519 ];
+
+ installFlags = [ "PREFIX=$(out)" ];
+
+ inherit enableParallelBuilding;
}
+
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/herb/default.nix b/nix/pkgs/herb/default.nix
new file mode 100644
index 000000000..ac9ae8dca
--- /dev/null
+++ b/nix/pkgs/herb/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenvNoCC, python }:
+
+# Avoid using `python.withPackages` as it creates a wrapper script to set
+# PYTHONPATH, and the script is used verbatim as a python shebang.
+#
+# Unfortunately Darwin does not allow scripts as a shebang - so to get a
+# cross platform python interpreter with appropriate site-packages setup
+# we use `wrapPython/Packages` which handles these cases correctly.
+
+stdenvNoCC.mkDerivation {
+ name = "herb";
+ src = ../../../pkg/herb/herb;
+
+ nativeBuildInputs = [ python.pkgs.wrapPython ];
+ buildInputs = [ python python.pkgs.requests ];
+ pythonPath = [ python.pkgs.requests ];
+
+ phases = [ "installPhase" "fixupPhase" ];
+
+ installPhase = ''
+ mkdir -p $out/bin
+ cp $src $out/bin/herb
+ chmod +x $out/bin/herb
+ '';
+
+ postFixup = ''
+ wrapPythonPrograms
+ '';
+}
diff --git a/nix/pkgs/hs/default.nix b/nix/pkgs/hs/default.nix
new file mode 100644
index 000000000..91a2102e5
--- /dev/null
+++ b/nix/pkgs/hs/default.nix
@@ -0,0 +1,87 @@
+{ lib, stdenv, darwin, haskell-nix, gmp, zlib, libffi, brass
+, enableStatic ? stdenv.hostPlatform.isStatic }:
+
+haskell-nix.stackProject {
+ compiler-nix-name = "ghc884";
+ index-state = "2020-09-24T00:00:00Z";
+
+ # This is incredibly difficult to get right, almost everything goes wrong.
+ # See: https://github.com/input-output-hk/haskell.nix/issues/496
+ src = haskell-nix.haskellLib.cleanSourceWith {
+ # Otherwise this depends on the name in the parent directory, which
+ # reduces caching, and is particularly bad on Hercules.
+ # See: https://github.com/hercules-ci/support/issues/40
+ name = "urbit-hs";
+ src = ../../../pkg/hs;
+ };
+
+ modules = [{
+ # This corresponds to the set of packages (boot libs) that ship with GHC.
+ # We declare them yere to ensure any dependency gets them from GHC itself
+ # rather than trying to re-install them into the package database.
+ nonReinstallablePkgs = [
+ "Cabal"
+ "Win32"
+ "array"
+ "base"
+ "binary"
+ "bytestring"
+ "containers"
+ "deepseq"
+ "directory"
+ "filepath"
+ "ghc"
+ "ghc-boot"
+ "ghc-boot-th"
+ "ghc-compact"
+ "ghc-heap"
+ "ghc-prim"
+ "ghci"
+ "ghcjs-prim"
+ "ghcjs-th"
+ "haskeline"
+ "hpc"
+ "integer-gmp"
+ "integer-simple"
+ "mtl"
+ "parsec"
+ "pretty"
+ "process"
+ "rts"
+ "stm"
+ "template-haskell"
+ "terminfo"
+ "text"
+ "time"
+ "transformers"
+ "unix"
+ "xhtml"
+ ];
+
+ # Override various project-local flags and build configuration.
+ packages = {
+ urbit-king.components.exes.urbit-king = {
+ enableStatic = enableStatic;
+ enableShared = !enableStatic;
+
+ configureFlags = lib.optionals enableStatic [
+ "--ghc-option=-optl=-L${gmp}/lib"
+ "--ghc-option=-optl=-L${libffi}/lib"
+ "--ghc-option=-optl=-L${zlib}/lib"
+ ] ++ lib.optionals (enableStatic && stdenv.isDarwin)
+ [ "--ghc-option=-optl=-L${darwin.libiconv}/lib" ];
+
+ postInstall = lib.optionalString (enableStatic && stdenv.isDarwin) ''
+ find "$out/bin" -type f -exec \
+ install_name_tool -change \
+ ${stdenv.cc.libc}/lib/libSystem.B.dylib \
+ /usr/lib/libSystem.B.dylib {} \;
+ '';
+ };
+
+ urbit-king.components.tests.urbit-king-tests.testFlags =
+ [ "--brass-pill=${brass.lfs}" ];
+ };
+ }];
+}
+
diff --git a/nix/pkgs/libaes_siv/builder.sh b/nix/pkgs/libaes_siv/builder.sh
deleted file mode 100644
index 5a0404377..000000000
--- a/nix/pkgs/libaes_siv/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/libaes_siv/cross.nix b/nix/pkgs/libaes_siv/cross.nix
deleted file mode 100644
index f78240058..000000000
--- a/nix/pkgs/libaes_siv/cross.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ env_name, env, deps }:
-
-env.make_derivation rec {
- name = "libaes_siv";
- builder = ./release.sh;
- src = ../../../pkg/libaes_siv;
-
- cross_inputs = [ env.openssl ];
-
- CC = "${env.host}-gcc";
- AR = "${env.host}-ar";
-}
diff --git a/nix/pkgs/libaes_siv/default.nix b/nix/pkgs/libaes_siv/default.nix
index fbdda7ebe..8b298f72f 100644
--- a/nix/pkgs/libaes_siv/default.nix
+++ b/nix/pkgs/libaes_siv/default.nix
@@ -1,9 +1,12 @@
-{ pkgs }:
+{ lib, stdenv, openssl, enableParallelBuilding ? true }:
-pkgs.stdenv.mkDerivation rec {
- name = "libaes_siv";
- builder = ./builder.sh;
- src = ../../../pkg/libaes_siv;
+stdenv.mkDerivation {
+ name = "libaes_siv";
+ src = lib.cleanSource ../../../pkg/libaes_siv;
- nativeBuildInputs = [ pkgs.openssl ];
+ buildInputs = [ openssl ];
+
+ installFlags = [ "PREFIX=$(out)" ];
+
+ inherit enableParallelBuilding;
}
diff --git a/nix/pkgs/libaes_siv/release.sh b/nix/pkgs/libaes_siv/release.sh
deleted file mode 100644
index aaa54b5e1..000000000
--- a/nix/pkgs/libaes_siv/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/libscrypt/default.nix b/nix/pkgs/libscrypt/default.nix
new file mode 100644
index 000000000..55ed88f2c
--- /dev/null
+++ b/nix/pkgs/libscrypt/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, sources }:
+
+stdenv.mkDerivation {
+ pname = "libscrypt";
+ version = sources.libscrypt.rev;
+ src = sources.libscrypt;
+
+ buildPhase = ''
+ sources=" \
+ crypto_scrypt-check \
+ crypto_scrypt-hash \
+ crypto_scrypt-hexconvert \
+ crypto_scrypt-nosse \
+ crypto-mcf \
+ crypto-scrypt-saltgen \
+ slowequals \
+ sha256 \
+ b64 \
+ "
+
+ CFLAGS="-I$src -Wall -ffast-math -O3 -D_FORTIFY_SOURCE=2 -fstack-protector"
+
+ for s in $sources; do
+ $CC $CFLAGS -c $src/$s.c -o $s.o
+ done
+
+ $AR rcs libscrypt.a *.o
+ '';
+
+ installPhase = ''
+ mkdir -p $out/{lib,include}
+ cp libscrypt.a $out/lib
+ cp $src/*.h $out/include/
+ '';
+}
diff --git a/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch b/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch
new file mode 100644
index 000000000..56d2b4b75
--- /dev/null
+++ b/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch
@@ -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.
diff --git a/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch b/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch
new file mode 100644
index 000000000..9d7d03bd1
--- /dev/null
+++ b/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch
@@ -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 */
+
diff --git a/nix/pkgs/murmur3/default.nix b/nix/pkgs/murmur3/default.nix
new file mode 100644
index 000000000..abac84c95
--- /dev/null
+++ b/nix/pkgs/murmur3/default.nix
@@ -0,0 +1,17 @@
+{ stdenv, sources }:
+
+stdenv.mkDerivation {
+ pname = "murmur3";
+ version = sources.murmur3.rev;
+ src = sources.murmur3;
+
+ 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/
+ '';
+}
diff --git a/nix/pkgs/pill/brass.nix b/nix/pkgs/pill/brass.nix
new file mode 100644
index 000000000..54a816df0
--- /dev/null
+++ b/nix/pkgs/pill/brass.nix
@@ -0,0 +1,22 @@
+{ lib, stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, herb
+, withRopsten ? false }:
+
+let
+
+ lfs = fetchGitHubLFS { src = ../../../bin/brass.pill; };
+
+in {
+ build = import ./builder.nix {
+ inherit stdenvNoCC urbit herb;
+
+ name = "brass" + lib.optionalString withRopsten "-ropsten";
+ builder = ./brass.sh;
+ arvo = if withRopsten then arvo.ropsten else arvo;
+ pier = bootFakeShip {
+ inherit urbit herb;
+
+ pill = solid.lfs;
+ ship = "zod";
+ };
+ };
+} // lib.optionalAttrs (!withRopsten) { inherit lfs; }
diff --git a/nix/pkgs/pill/brass.sh b/nix/pkgs/pill/brass.sh
new file mode 100644
index 000000000..114578d6b
--- /dev/null
+++ b/nix/pkgs/pill/brass.sh
@@ -0,0 +1,23 @@
+source $stdenv/setup
+
+set -euo pipefail
+
+cp -r $src ./pier
+chmod -R u+rw ./pier
+
+urbit -d ./pier
+
+cleanup () {
+ if [ -f ./pier/.vere.lock ]; then
+ kill $(< ./pier/.vere.lock) || true
+ fi
+}
+
+trap cleanup EXIT
+
+header "running herb +brass"
+
+herb ./pier -P brass.pill -d '+brass'
+herb ./pier -p hood -d '+hood/exit'
+
+stopNest
diff --git a/nix/pkgs/pill/builder.nix b/nix/pkgs/pill/builder.nix
new file mode 100644
index 000000000..f97d0f81e
--- /dev/null
+++ b/nix/pkgs/pill/builder.nix
@@ -0,0 +1,16 @@
+{ stdenvNoCC, urbit, arvo, herb, name, builder, pier }:
+
+stdenvNoCC.mkDerivation {
+ name = "${name}.pill";
+ src = pier;
+ buildInputs = [ urbit herb ];
+ dontUnpack = true;
+
+ buildPhase = builtins.readFile builder;
+
+ installPhase = ''
+ mv ${name}.pill $out
+ '';
+
+ ARVO = arvo;
+}
diff --git a/nix/pkgs/pill/ivory.nix b/nix/pkgs/pill/ivory.nix
new file mode 100644
index 000000000..354cfbd39
--- /dev/null
+++ b/nix/pkgs/pill/ivory.nix
@@ -0,0 +1,42 @@
+{ lib, stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, herb, xxd
+, withRopsten ? false }:
+
+let
+
+ lfs = fetchGitHubLFS { src = ../../../bin/ivory.pill; };
+
+in {
+ build = import ./builder.nix {
+ inherit stdenvNoCC urbit herb;
+
+ name = "ivory" + lib.optionalString withRopsten "-ropsten";
+ builder = ./ivory.sh;
+ arvo = if withRopsten then arvo.ropsten else arvo;
+ pier = bootFakeShip {
+ inherit urbit herb;
+
+ pill = solid.lfs;
+ ship = "zod";
+ };
+ };
+
+ # The hexdump of the `.lfs` pill contents as a C header.
+ header = stdenvNoCC.mkDerivation {
+ name = "ivory-header";
+ src = lfs;
+ nativeBuildInputs = [ xxd ];
+ phases = [ "installPhase" ];
+
+ installPhase = ''
+ file=u3_Ivory.pill
+
+ header "writing $file"
+
+ mkdir -p $out/include
+ cat $src > $file
+ xxd -i $file > $out/include/ivory.h
+ '';
+
+ preferLocalBuild = true;
+ };
+} // lib.optionalAttrs (!withRopsten) { inherit lfs; }
diff --git a/nix/pkgs/pill/ivory.sh b/nix/pkgs/pill/ivory.sh
new file mode 100644
index 000000000..fc5ced9a6
--- /dev/null
+++ b/nix/pkgs/pill/ivory.sh
@@ -0,0 +1,23 @@
+source $stdenv/setup
+
+set -euo pipefail
+
+cp -r $src ./pier
+chmod -R u+rw ./pier
+
+urbit -d ./pier
+
+cleanup () {
+ if [ -f ./pier/.vere.lock ]; then
+ kill $(< ./pier/.vere.lock) || true
+ fi
+}
+
+trap cleanup EXIT
+
+header "running herb +ivory"
+
+herb ./pier -P ivory.pill -d '+ivory'
+herb ./pier -p hood -d '+hood/exit'
+
+stopNest
diff --git a/nix/pkgs/pill/solid.nix b/nix/pkgs/pill/solid.nix
new file mode 100644
index 000000000..17bcd4433
--- /dev/null
+++ b/nix/pkgs/pill/solid.nix
@@ -0,0 +1,23 @@
+{ stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, herb }:
+
+let
+
+ lfs = fetchGitHubLFS { src = ../../../bin/solid.pill; };
+
+in {
+ inherit lfs;
+
+ build = import ./builder.nix {
+ inherit stdenvNoCC urbit arvo herb;
+
+ name = "solid";
+ builder = ./solid.sh;
+ pier = bootFakeShip {
+ inherit urbit herb;
+
+ arvo = null;
+ pill = solid.lfs;
+ ship = "zod";
+ };
+ };
+}
diff --git a/nix/pkgs/pill/solid.sh b/nix/pkgs/pill/solid.sh
new file mode 100644
index 000000000..0c1937088
--- /dev/null
+++ b/nix/pkgs/pill/solid.sh
@@ -0,0 +1,75 @@
+source $stdenv/setup
+
+set -euo pipefail
+
+ARVO=${ARVO?:ARVO location is unset}
+
+cp -r $src ./pier
+chmod -R u+rw ./pier
+
+urbit -d ./pier
+
+cleanup () {
+ if [ -f ./pier/.vere.lock ]; then
+ kill $(< ./pier/.vere.lock) || true
+ fi
+}
+
+trap cleanup EXIT
+
+# Update pill strategy to ensure correct staging
+herb ./pier -p hood -d "+hood/mount /=home="
+
+until [ -d ./pier/home ]; do
+ sleep 1
+done
+
+# Update :lens, :dojo and dependencies
+# FIXME: reduce this list
+cp $ARVO/app/lens.hoon ./pier/home/app/
+cp $ARVO/app/dojo.hoon ./pier/home/app/
+cp $ARVO/lib/plume.hoon ./pier/home/lib/
+cp $ARVO/lib/server.hoon ./pier/home/lib/
+cp $ARVO/lib/sole.hoon ./pier/home/lib/
+cp $ARVO/lib/xray.hoon ./pier/home/lib/
+cp $ARVO/lib/pprint.hoon ./pier/home/lib/
+
+mkdir -p ./pier/home/mar/lens/
+
+cp $ARVO/mar/lens/* ./pier/home/mar/lens/
+
+cp $ARVO/sur/lens.hoon ./pier/home/sur/
+cp $ARVO/sur/plum.hoon ./pier/home/sur/
+cp $ARVO/sur/sole.hoon ./pier/home/sur/
+cp $ARVO/sur/xray.hoon ./pier/home/sur/
+
+# Update +solid and its dependencies
+cp $ARVO/lib/pill.hoon ./pier/home/lib/
+cp $ARVO/gen/solid.hoon ./pier/home/gen/
+
+chmod -R u+rw ./pier/home/
+
+herb ./pier -p hood -d "+hood/commit %home"
+herb ./pier -p hood -d "+hood/unmount %home"
+
+# FIXME: horrible hack to ensure the update is applied first
+sleep 10
+
+# Stage new desk for pill contents
+herb ./pier -p hood -d '+hood/merge %stage our %home'
+herb ./pier -p hood -d "+hood/mount /=stage="
+
+until [ -d ./pier/stage ]; do
+ sleep 1
+done
+
+rm -rf ./pier/stage
+cp -r $ARVO ./pier/stage
+chmod -R u+rw ./pier/stage
+
+herb ./pier -p hood -d "+hood/commit %stage"
+herb ./pier -p hood -d "+hood/unmount %stage"
+herb ./pier -P solid.pill -d '+solid /=stage=/sys, =dub &'
+herb ./pier -p hood -d '+hood/exit'
+
+stopNest
diff --git a/nix/pkgs/softfloat3/default.nix b/nix/pkgs/softfloat3/default.nix
new file mode 100644
index 000000000..cae76a366
--- /dev/null
+++ b/nix/pkgs/softfloat3/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, sources, enableParallelBuilding ? true }:
+
+stdenv.mkDerivation {
+ pname = "softfloat3";
+ version = sources.softfloat3.rev;
+ src = sources.softfloat3;
+
+ postPatch = ''
+ for f in $(find build -type f -name 'Makefile'); do
+ substituteInPlace $f \
+ --replace 'gcc' '$(CC)' \
+ --replace 'ar crs' '$(AR) crs'
+ done
+ '';
+
+ preBuild = ''
+ cd build/Linux-x86_64-GCC
+ '';
+
+ installPhase = ''
+ mkdir -p $out/{lib,include}
+ cp $src/source/include/*.h $out/include/
+ cp softfloat.a $out/lib/libsoftfloat3.a
+ '';
+
+ inherit enableParallelBuilding;
+}
+
diff --git a/nix/pkgs/urbit/default.nix b/nix/pkgs/urbit/default.nix
index 19befa1ef..c92543964 100644
--- a/nix/pkgs/urbit/default.nix
+++ b/nix/pkgs/urbit/default.nix
@@ -1,61 +1,76 @@
-{
- pkgs,
- debug,
- argon2, ed25519, ent, ge-additions, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header
-}:
+{ lib, stdenv, coreutils, pkgconfig, argon2u, cacert, ca-bundle, curlMinimal
+, ed25519, ent, ge-additions, gmp, h2o, herb, ivory, libaes_siv, libscrypt
+, libsigsegv, libuv, lmdb, murmur3, openssl, secp256k1, softfloat3, zlib
+, enableStatic ? stdenv.hostPlatform.isStatic, enableDebug ? false
+, doCheck ? true, enableParallelBuilding ? true, dontStrip ? true }:
let
- name =
- if debug then "urbit-debug" else "urbit";
+ src = lib.cleanSource ../../../pkg/urbit;
- meta = rec {
- inherit debug;
- bin = "${urbit}/bin/${name}";
- flags = if debug then [ "-g" ] else [];
- exe = ''${meta.bin} ${pkgs.lib.strings.concatStringsSep " " meta.flags}'';
+ version = builtins.readFile "${src}/version";
+
+in stdenv.mkDerivation {
+ inherit src version;
+
+ pname = "urbit" + lib.optionalString enableDebug "-debug"
+ + lib.optionalString enableStatic "-static";
+
+ nativeBuildInputs = [ pkgconfig ];
+
+ buildInputs = [
+ argon2u
+ cacert
+ ca-bundle
+ curlMinimal
+ ed25519
+ ent
+ ge-additions
+ gmp
+ h2o
+ ivory.header
+ libaes_siv
+ libscrypt
+ libsigsegv
+ libuv
+ lmdb
+ murmur3
+ openssl
+ secp256k1
+ softfloat3
+ zlib
+ ];
+
+ checkInputs = [ herb ];
+
+ # Ensure any `/usr/bin/env bash` shebang is patched.
+ postPatch = ''
+ patchShebangs ./configure
+ '';
+
+ checkTarget = "test";
+
+ installPhase = ''
+ mkdir -p $out/bin
+ cp ./build/urbit $out/bin/urbit
+ cp ./build/urbit-worker $out/bin/urbit-worker
+ '';
+
+ CFLAGS = [ (if enableDebug then "-O0" else "-O3") "-g" ]
+ ++ lib.optionals (!enableDebug) [ "-Werror" ]
+ ++ lib.optionals enableStatic [ "-static" ];
+
+ MEMORY_DEBUG = enableDebug;
+ CPU_DEBUG = enableDebug;
+ EVENT_TIME_DEBUG = false;
+
+ # See https://github.com/NixOS/nixpkgs/issues/18995
+ hardeningDisable = lib.optionals enableDebug [ "all" ];
+
+ inherit enableParallelBuilding doCheck dontStrip;
+
+ meta = {
+ debug = enableDebug;
+ arguments = lib.optionals enableDebug [ "-g" ];
};
-
- sigseg =
- pkgs.libsigsegv.overrideAttrs (oldAttrs: rec {
- patches = [ ./libsigsegv_fix.patch ];
- });
-
- deps =
- with pkgs;
- [ curl gmp sigseg openssl zlib lmdb ];
-
- vendor =
- [ argon2 softfloat3 ed25519 ent ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ];
-
- urbit = pkgs.stdenv.mkDerivation {
- inherit name meta;
- exename = name;
- src = ../../../pkg/urbit;
- nativeBuildInputs = deps ++ vendor;
-
- configurePhase = ''
- bash ./configure
- '';
-
- installPhase = ''
- make all -j8
- make test
-
- mkdir -p $out/bin
- cp ./build/urbit $out/bin/$exename
- cp ./build/urbit-worker $out/bin/$exename-worker
- '';
-
- # See https://github.com/NixOS/nixpkgs/issues/18995
- hardeningDisable = if debug then [ "all" ] else [];
-
- CFLAGS = "-O3 -g -Werror";
- MEMORY_DEBUG = debug;
- CPU_DEBUG = debug;
- EVENT_TIME_DEBUG = false;
- };
-
-in
-
-urbit
+}
diff --git a/nix/pkgs/urbit/libsigsegv_fix.patch b/nix/pkgs/urbit/libsigsegv_fix.patch
deleted file mode 100644
index a3b630860..000000000
--- a/nix/pkgs/urbit/libsigsegv_fix.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/fault-linux-i386.h 2020-06-25 23:46:02.099235491 +0000
-+++ b/src/fault-linux-i386.h 2020-06-25 23:45:48.679156892 +0000
-@@ -18,6 +18,7 @@
-
- #include "fault-posix-ucontext.h"
-
-+#define HAVE_STACKVMA 0
- #if defined __x86_64__
- /* 64 bit registers */
-
diff --git a/nix/pkgs/urbit/release.nix b/nix/pkgs/urbit/release.nix
deleted file mode 100644
index 9d486f3df..000000000
--- a/nix/pkgs/urbit/release.nix
+++ /dev/null
@@ -1,36 +0,0 @@
-{ env_name, env, deps }:
-
-{
- ent,
- name ? "urbit",
- debug ? false,
- ge-additions,
- libaes_siv
-}:
-
-let
-
- crossdeps =
- with env;
- [ curl libgmp libsigsegv openssl zlib lmdb ];
-
- vendor =
- with deps;
- [ argon2 softfloat3 ed25519 ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ];
-
-in
-
-env.make_derivation {
- CFLAGS = if debug then "-O0 -g" else "-O3 -g";
- # binary stripping disabled
- # LDFLAGS = if debug then "" else "-s";
- MEMORY_DEBUG = debug;
- CPU_DEBUG = debug;
- EVENT_TIME_DEBUG = false;
-
- name = "${name}-${env_name}";
- exename = name;
- src = ../../../pkg/urbit;
- cross_inputs = crossdeps ++ vendor ++ [ ent ];
- builder = ./release.sh;
-}
diff --git a/nix/pkgs/urbit/release.sh b/nix/pkgs/urbit/release.sh
deleted file mode 100644
index 4bff817e4..000000000
--- a/nix/pkgs/urbit/release.sh
+++ /dev/null
@@ -1,21 +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
-
-CC=$host-gcc \
-PKG_CONFIG=pkg-config-cross \
-HOST=$host \
-bash ./configure
-
-make build/urbit build/urbit-worker -j8
-
-mkdir -p $out/bin
-cp ./build/urbit $out/bin/$exename
-cp ./build/urbit-worker $out/bin/$exename-worker
diff --git a/nix/pkgs/urbit/shell.nix b/nix/pkgs/urbit/shell.nix
deleted file mode 100644
index dee99d962..000000000
--- a/nix/pkgs/urbit/shell.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-let
-
- pkgs = import ../../nixpkgs.nix;
- deps = import ../../deps { inherit pkgs; };
- tlon = import ../../pkgs { inherit pkgs; };
-
-in
-
-import ./default.nix {
- inherit pkgs;
- debug = false;
- inherit (tlon)
- ent ge-additions libaes_siv;
- inherit (deps)
- argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ivory-header ca-header;
-}
diff --git a/nix/release.nix b/nix/release.nix
deleted file mode 100644
index 2ccd1098b..000000000
--- a/nix/release.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-let
-
- nixpkgs = import ./nixpkgs.nix;
- nixcrpkgs = import ./nixcrpkgs.nix;
- crossdeps = import ./crossdeps.nix;
-
- release =
- env_name: env: {
- inherit env env_name;
- deps = crossdeps env;
- };
-
- linux64 = release "linux64" nixcrpkgs.linux64;
- darwin = release "darwin" nixcrpkgs.mac;
-
- 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;
-
- urbit = { env, debug }:
- import ./pkgs/urbit/release.nix env {
- inherit debug;
- name = if debug then "urbit-debug" else "urbit";
- ent = ent env;
- ge-additions = ge-additions env;
- libaes_siv = libaes_siv env;
- };
-
- builds-for-platform = plat:
- plat.deps // {
- 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; };
- };
-
- darwin_extra = {
- inherit (darwin.env) ranlib ld sdk ar toolchain tapi strip;
- };
-
-in
-
-{
- linux64 = builds-for-platform linux64;
- darwin = darwin_extra // builds-for-platform darwin;
-}
diff --git a/nix/sources.json b/nix/sources.json
new file mode 100644
index 000000000..abe295cd0
--- /dev/null
+++ b/nix/sources.json
@@ -0,0 +1,134 @@
+{
+ "argon2u": {
+ "branch": "master",
+ "description": "With argon2u. Based off https://github.com/P-H-C/phc-winner-argon2",
+ "homepage": "",
+ "owner": "urbit",
+ "repo": "argon2",
+ "rev": "4da94a611ee62bad87ab2b131ffda3bcc0723d9c",
+ "sha256": "0bqq1hg367l4jkb6cqhxlblpvdbwz3l586qsfakwzfd9wdvnm3yc",
+ "type": "tarball",
+ "url": "https://github.com/urbit/argon2/archive/4da94a611ee62bad87ab2b131ffda3bcc0723d9c.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "ed25519": {
+ "branch": "master",
+ "description": "Submodule included by Urbit",
+ "homepage": null,
+ "owner": "urbit",
+ "repo": "ed25519",
+ "rev": "76385f2ebbbc9580a9c236952d68d11d73a6135c",
+ "sha256": "0s1spif4s9lgcwcny3fl2fvpbw6acqn3s8r6qxnrmkd9icgyw4cp",
+ "type": "tarball",
+ "url": "https://github.com/urbit/ed25519/archive/76385f2ebbbc9580a9c236952d68d11d73a6135c.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "h2o": {
+ "branch": "master",
+ "description": "H2O - the optimized HTTP/1, HTTP/2, HTTP/3 server",
+ "homepage": "https://h2o.examp1e.net",
+ "owner": "h2o",
+ "repo": "h2o",
+ "rev": "v2.2.4",
+ "sha256": "0176x0bzjry19zs074a9i5vhncc842xikmx43wj61jky318nq4w4",
+ "type": "tarball",
+ "url": "https://github.com/h2o/h2o/archive/v2.2.4.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "hackage.nix": {
+ "branch": "master",
+ "description": "Automatically generated Nix expressions for Hackage",
+ "homepage": "",
+ "owner": "input-output-hk",
+ "repo": "hackage.nix",
+ "rev": "ed4d2759c9e6ca8133a4170f99fabdd76f30f51a",
+ "sha256": "1n5fk8zsxnbca96zk4ikh74iz3lzh35m302q65zk1rx3nmy4027d",
+ "type": "tarball",
+ "url": "https://github.com/input-output-hk/hackage.nix/archive/ed4d2759c9e6ca8133a4170f99fabdd76f30f51a.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "haskell.nix": {
+ "branch": "master",
+ "description": "Alternative Haskell Infrastructure for Nixpkgs",
+ "homepage": "https://input-output-hk.github.io/haskell.nix",
+ "owner": "input-output-hk",
+ "repo": "haskell.nix",
+ "rev": "bbb34dcdf7b90d478002f91713531f418ddf1b53",
+ "sha256": "1qq397j8vnlp5npk8r675fzjfimg74fcvrkxcdgx7vj48315bh2w",
+ "type": "tarball",
+ "url": "https://github.com/input-output-hk/haskell.nix/archive/bbb34dcdf7b90d478002f91713531f418ddf1b53.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "libscrypt": {
+ "branch": "master",
+ "description": null,
+ "homepage": null,
+ "owner": "urbit",
+ "repo": "libscrypt",
+ "rev": "029693ff1cbe4f69d3a2da87d0f4f034f92cc0c2",
+ "sha256": "17pcxypzjmmrvacw45cacvibm6mlr9ip30hy30l1appsnywx679n",
+ "type": "tarball",
+ "url": "https://github.com/urbit/libscrypt/archive/029693ff1cbe4f69d3a2da87d0f4f034f92cc0c2.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "murmur3": {
+ "branch": "master",
+ "description": null,
+ "homepage": null,
+ "owner": "urbit",
+ "repo": "murmur3",
+ "rev": "71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca",
+ "sha256": "0k7jq2nb4ad9ajkr6wc4w2yy2f2hkwm3nkbj2pklqgwsg6flxzwg",
+ "type": "tarball",
+ "url": "https://github.com/urbit/murmur3/archive/71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "niv": {
+ "branch": "master",
+ "description": "Easy dependency management for Nix projects",
+ "homepage": "https://github.com/nmattia/niv",
+ "owner": "nmattia",
+ "repo": "niv",
+ "rev": "9d35b9e4837ab88517210b1701127612c260eccf",
+ "sha256": "0q50xhnm8g2yfyakrh0nly4swyygxpi0a8cb9gp65wcakcgvzvdh",
+ "type": "tarball",
+ "url": "https://github.com/nmattia/niv/archive/9d35b9e4837ab88517210b1701127612c260eccf.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "nixpkgs": {
+ "branch": "master",
+ "description": "Nix Packages collection",
+ "homepage": null,
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "166ab9d237409c4b74b1f8ca31476ead35e8fe53",
+ "sha256": "13i43kvbkdl3dh8b986j6mxbn355mqjhcxrd8cni8zfx1z0wrscr",
+ "type": "tarball",
+ "url": "https://github.com/nixos/nixpkgs/archive/166ab9d237409c4b74b1f8ca31476ead35e8fe53.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "softfloat3": {
+ "branch": "master",
+ "description": null,
+ "homepage": null,
+ "owner": "urbit",
+ "repo": "berkeley-softfloat-3",
+ "rev": "ec4c7e31b32e07aad80e52f65ff46ac6d6aad986",
+ "sha256": "1lz4bazbf7lns1xh8aam19c814a4n4czq5xsq5rmi9sgqw910339",
+ "type": "tarball",
+ "url": "https://github.com/urbit/berkeley-softfloat-3/archive/ec4c7e31b32e07aad80e52f65ff46ac6d6aad986.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ },
+ "stackage.nix": {
+ "branch": "master",
+ "description": "Automatically generated Nix expressions of Stackage snapshots",
+ "homepage": "",
+ "owner": "input-output-hk",
+ "repo": "stackage.nix",
+ "rev": "08312f475f4f5f3b6578e7a78dc501de6fea8792",
+ "sha256": "15j1l6616kfv7351jxwgb9kj6y8227fcm87nxwabmbn1q6a8q2kf",
+ "type": "tarball",
+ "url": "https://github.com/input-output-hk/stackage.nix/archive/08312f475f4f5f3b6578e7a78dc501de6fea8792.tar.gz",
+ "url_template": "https://github.com///archive/.tar.gz"
+ }
+}
diff --git a/nix/sources.nix b/nix/sources.nix
new file mode 100644
index 000000000..0286dec14
--- /dev/null
+++ b/nix/sources.nix
@@ -0,0 +1,154 @@
+# This file has been generated by Niv.
+
+let
+
+ #
+ # The fetchers. fetch_ fetches specs of type .
+ #
+
+ fetch_file = pkgs: spec:
+ if spec.builtin or true then
+ builtins_fetchurl { inherit (spec) url sha256; }
+ else
+ pkgs.fetchurl { inherit (spec) url sha256; };
+
+ fetch_tarball = pkgs: name: spec:
+ let
+ ok = str: !builtins.isNull (builtins.match "[a-zA-Z0-9+-._?=]" str);
+ # sanitize the name, though nix will still fail if name starts with period
+ name' = stringAsChars (x: if !ok x then "-" else x) "${name}-src";
+ in if spec.builtin or true then
+ builtins_fetchTarball {
+ name = name';
+ inherit (spec) url sha256;
+ }
+ else
+ pkgs.fetchzip {
+ name = name';
+ inherit (spec) url sha256;
+ };
+
+ fetch_git = spec:
+ builtins.fetchGit {
+ url = spec.repo;
+ inherit (spec) rev ref;
+ };
+
+ fetch_local = spec: spec.path;
+
+ fetch_builtin-tarball = name:
+ throw ''
+ [${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
+ $ niv modify ${name} -a type=tarball -a builtin=true'';
+
+ fetch_builtin-url = name:
+ throw ''
+ [${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
+ $ niv modify ${name} -a type=file -a builtin=true'';
+
+ #
+ # Various helpers
+ #
+
+ # The set of packages used when specs are fetched using non-builtins.
+ mkPkgs = sources:
+ let
+ sourcesNixpkgs =
+ import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; })
+ { };
+ hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
+ hasThisAsNixpkgsPath = == ./.;
+ in if builtins.hasAttr "nixpkgs" sources then
+ sourcesNixpkgs
+ else if hasNixpkgsPath && !hasThisAsNixpkgsPath then
+ import { }
+ else
+ abort ''
+ Please specify either (through -I or NIX_PATH=nixpkgs=...) or
+ add a package called "nixpkgs" to your sources.json.
+ '';
+
+ # The actual fetching function.
+ fetch = pkgs: name: spec:
+
+ if !builtins.hasAttr "type" spec then
+ abort "ERROR: niv spec ${name} does not have a 'type' attribute"
+ else if spec.type == "file" then
+ fetch_file pkgs spec
+ else if spec.type == "tarball" then
+ fetch_tarball pkgs name spec
+ else if spec.type == "git" then
+ fetch_git spec
+ else if spec.type == "local" then
+ fetch_local spec
+ else if spec.type == "builtin-tarball" then
+ fetch_builtin-tarball name
+ else if spec.type == "builtin-url" then
+ fetch_builtin-url name
+ else
+ abort
+ "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
+
+ # Ports of functions for older nix versions
+
+ # a Nix version of mapAttrs if the built-in doesn't exist
+ mapAttrs = builtins.mapAttrs or (f: set:
+ with builtins;
+ listToAttrs (map (attr: {
+ name = attr;
+ value = f attr set.${attr};
+ }) (attrNames set)));
+
+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
+ range = first: last:
+ if first > last then
+ [ ]
+ else
+ builtins.genList (n: first + n) (last - first + 1);
+
+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
+ stringToCharacters = s:
+ map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
+
+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
+ stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
+ concatStrings = builtins.concatStringsSep "";
+
+ # fetchTarball version that is compatible between all the versions of Nix
+ builtins_fetchTarball = { url, name, sha256 }@attrs:
+ let inherit (builtins) lessThan nixVersion fetchTarball;
+ in if lessThan nixVersion "1.12" then
+ fetchTarball { inherit name url; }
+ else
+ fetchTarball attrs;
+
+ # fetchurl version that is compatible between all the versions of Nix
+ builtins_fetchurl = { url, sha256 }@attrs:
+ let inherit (builtins) lessThan nixVersion fetchurl;
+ in if lessThan nixVersion "1.12" then
+ fetchurl { inherit url; }
+ else
+ fetchurl attrs;
+
+ # Create the final "sources" from the config
+ mkSources = config:
+ mapAttrs (name: spec:
+ if builtins.hasAttr "outPath" spec then
+ abort
+ "The values in sources.json should not have an 'outPath' attribute"
+ else
+ spec // { outPath = fetch config.pkgs name spec; }) config.sources;
+
+ # The "config" used by the fetchers
+ mkConfig = { sourcesFile ? ./sources.json
+ , sources ? builtins.fromJSON (builtins.readFile sourcesFile)
+ , pkgs ? mkPkgs sources }: rec {
+ # The sources, i.e. the attribute set of spec name to spec
+ inherit sources;
+
+ # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
+ inherit pkgs;
+ };
+in mkSources (mkConfig { }) // {
+ __functor = _: settings: mkSources (mkConfig settings);
+}
diff --git a/package-lock.json b/package-lock.json
deleted file mode 100644
index 48e341a09..000000000
--- a/package-lock.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "lockfileVersion": 1
-}
diff --git a/pkg/arvo/app/acme.hoon b/pkg/arvo/app/acme.hoon
index 0c077e84c..bbb53b8eb 100644
--- a/pkg/arvo/app/acme.hoon
+++ b/pkg/arvo/app/acme.hoon
@@ -1,5 +1,5 @@
/- asn1
-/+ base64, der, primitive-rsa, *pkcs, *jose, default-agent, verb
+/+ der, primitive-rsa, *pkcs, *jose, default-agent, verb
=, eyre
=* rsa primitive-rsa
::
@@ -7,11 +7,11 @@
:: +en-base64url: url-safe base64 encoding, without padding
::
++ en-base64url
- ~(en base64 | &)
+ ~(en base64:mimes:html | &)
:: +de-base64url: url-safe base64 decoding, without padding
::
++ de-base64url
- ~(de base64 | &)
+ ~(de base64:mimes:html | &)
:: +join-turf
::
++ join-turf
diff --git a/pkg/arvo/app/aqua.hoon b/pkg/arvo/app/aqua.hoon
index 748a2ee2f..b530003ae 100644
--- a/pkg/arvo/app/aqua.hoon
+++ b/pkg/arvo/app/aqua.hoon
@@ -21,19 +21,30 @@
:: We get ++unix-event and ++pill from /-aquarium
::
/- aquarium
-/+ pill, default-agent
+/+ pill, azimuth, default-agent, aqua-azimuth, dbug, verb
=, pill-lib=pill
=, aquarium
=> $~ |%
- +$ state
+ +$ versioned-state
+ $% state-0
+ ==
+ +$ state-0
$: %0
pil=pill
assembled=*
tym=@da
- fleet-snaps=(map term (map ship pier))
- piers=(map ship pier)
+ fleet-snaps=(map term fleet)
+ piers=fleet
+ ==
+ :: XX temporarily shadowed, fix and remove
+ ::
+ +$ pill
+ $: boot-ova=*
+ kernel-ova=(list unix-event)
+ userspace-ova=(list unix-event)
==
::
+ +$ fleet [ships=(map ship pier) azi=az-state]
+$ pier
$: snap=*
event-log=(list unix-timed-event)
@@ -42,9 +53,11 @@
==
--
::
-=| state
-=* all-state -
+=| state-0
+=* state -
=<
+ %- agent:dbug
+ %+ verb |
^- agent:gall
|_ =bowl:gall
+* this .
@@ -52,24 +65,30 @@
ac ~(. aqua-core bowl)
def ~(. (default-agent this %|) bowl)
++ on-init `this
- ++ on-save !>(all-state)
+ ++ on-save !>(state)
++ on-load
- |= old-state=vase
+ |= old-vase=vase
^- step:agent:gall
~& prep=%aqua
- =+ new=((soft state) !<(* old-state))
- ?~ new
- `this
- `this(all-state u.new)
+ =+ !<(old=versioned-state old-vase)
+ =| cards=(list card:agent:gall)
+ |-
+ ?- -.old
+ :: wipe fleets and piers rather than give them falsely nulled azimuth state
+ ::
+ %0
+ [cards this(state old)]
+ ==
::
++ on-poke
|= [=mark =vase]
^- step:agent:gall
- =^ cards all-state
+ =^ cards state
?+ mark ~|([%aqua-bad-mark mark] !!)
- %aqua-events (poke-aqua-events:ac !<((list aqua-event) vase))
- %pill (poke-pill:ac !<(pill vase))
- %noun (poke-noun:ac !<(* vase))
+ %aqua-events (poke-aqua-events:ac !<((list aqua-event) vase))
+ %pill (poke-pill:ac !<(pill vase))
+ %noun (poke-noun:ac !<(* vase))
+ %azimuth-action (poke-azimuth-action:ac !<(azimuth-action vase))
==
[cards this]
::
@@ -92,7 +111,18 @@
++ on-peek peek:ac
::
++ on-agent on-agent:def
- ++ on-arvo on-arvo:def
+ ::
+ ++ on-arvo
+ |= [=wire sign=sign-arvo]
+ ^- step:agent:gall
+ ?+ wire (on-arvo:def wire sign)
+ [%wait @ ~]
+ ?> ?=(%wake +<.sign)
+ =/ wen=@da (slav %da i.t.wire)
+ =^ cards state
+ (handle-wake:ac wen)
+ [cards this]
+ ==
++ on-fail on-fail:def
--
::
@@ -110,7 +140,7 @@
::
++ pe
|= who=ship
- =+ (~(gut by piers) who *pier)
+ =+ (~(gut by ships.piers) who *pier)
=* pier-data -
|%
::
@@ -118,7 +148,7 @@
::
++ abet-pe
^+ this
- =. piers (~(put by piers) who pier-data)
+ =. ships.piers (~(put by ships.piers) who pier-data)
this
::
:: Initialize new ship
@@ -248,7 +278,19 @@
this
::
++ abet-aqua
- ^- (quip card:agent:gall state)
+ ^- (quip card:agent:gall _state)
+ ::
+ :: interecept %request effects to handle azimuth subscription
+ ::
+ =. this
+ %- emit-cards
+ %- zing
+ %+ turn ~(tap by unix-effects)
+ |= [=ship ufs=(list unix-effect)]
+ %+ murn ufs
+ |= uf=unix-effect
+ (router:aqua-azimuth our.hid ship uf azi.piers)
+ ::
=. this
=/ =path /effect
%- emit-cards
@@ -300,20 +342,19 @@
=/ =path /boths/(scot %p ship)
[%give %fact ~[path] %aqua-boths !>(`aqua-boths`[ship (flop bo)])]
::
- [(flop cards) all-state]
+ [(flop cards) state]
::
++ emit-cards
|= ms=(list card:agent:gall)
=. cards (weld ms cards)
this
::
-::
:: Run all events on all ships until all queues are empty
::
++ plow-all
|- ^+ this
=/ who
- =/ pers ~(tap by piers)
+ =/ pers ~(tap by ships.piers)
|- ^- (unit ship)
?~ pers
~
@@ -331,7 +372,7 @@
::
++ poke-pill
|= p=pill
- ^- (quip card:agent:gall state)
+ ^- (quip card:agent:gall _state)
=. this apex-aqua =< abet-aqua
=. pil p
~& lent=(met 3 (jam boot-ova.pil))
@@ -362,7 +403,7 @@
::
++ poke-noun
|= val=*
- ^- (quip card:agent:gall state)
+ ^- (quip card:agent:gall _state)
=. this apex-aqua =< abet-aqua
^+ this
:: Could potentially factor out the three lines of turn-ships
@@ -391,7 +432,7 @@
=/ txt .^(@ %cx (weld pax /hoon))
[/vane/[vane] [%veer v pax txt]]
=> .(this ^+(this this))
- =^ ms all-state (poke-pill pil)
+ =^ ms state (poke-pill pil)
(emit-cards ms)
::
[%swap-files ~]
@@ -402,7 +443,7 @@
%- unix-event
%- %*(. file-ovum:pill-lib directories slim-dirs)
/(scot %p our.hid)/work/(scot %da now.hid)
- =^ ms all-state (poke-pill pil)
+ =^ ms state (poke-pill pil)
(emit-cards ms)
::
[%wish hers=* p=@t]
@@ -412,12 +453,14 @@
(wish:(pe who) p.val)
::
[%unpause-events hers=*]
+ =. this start-azimuth-timer
%+ turn-ships ((list ship) hers.val)
|= [who=ship thus=_this]
=. this thus
start-processing-events:(pe who)
::
[%pause-events hers=*]
+ =. this stop-azimuth-timer
%+ turn-ships ((list ship) hers.val)
|= [who=ship thus=_this]
=. this thus
@@ -428,17 +471,47 @@
this
==
::
+:: Make changes to azimuth state for the current fleet
+::
+++ poke-azimuth-action
+ |= act=azimuth-action
+ ^- (quip card:agent:gall _state)
+ =. this apex-aqua =< abet-aqua
+ ^+ this
+ ?- -.act
+ ::
+ %init-azimuth
+ =. azi.piers *az-state
+ start-azimuth-timer
+ ::
+ %spawn
+ =. state (spawn who.act)
+ this
+ ::
+ %breach
+ :: should we remove the pier from state here?
+ =. state (breach who.act)
+ this
+ ::
+ ==
+::
:: Apply a list of events tagged by ship
::
++ poke-aqua-events
|= events=(list aqua-event)
- ^- (quip card:agent:gall state)
+ ^- (quip card:agent:gall _state)
=. this apex-aqua =< abet-aqua
%+ turn-events events
|= [ae=aqua-event thus=_this]
=. this thus
?- -.ae
+ ::
%init-ship
+ :: XX Note that the keys that get passed in are unused. The keys field
+ :: should be deleted now that aqua is capable of managing azimuth state
+ :: internally. Its been left this way for now until all the ph tests
+ :: can be rewritten
+ =/ keys=dawn-event:jael (dawn who.ae)
=. this abet-pe:(publish-effect:(pe who.ae) [/ %sleep ~])
=/ initted
=< plow
@@ -451,7 +524,7 @@
:^ //term/1 %boot &
?~ keys.ae
[%fake who.ae]
- [%dawn u.keys.ae]
+ [%dawn keys]
-.userspace-ova.pil
[//http-client/0v1n.2m9vh %born ~]
[//http-server/0v1n.2m9vh %born ~]
@@ -464,27 +537,36 @@
stop-processing-events:(pe who.ae)
::
%snap-ships
+ =. this
+ %+ turn-ships (turn ~(tap by ships.piers) head)
+ |= [who=ship thus=_this]
+ =. this thus
+ (publish-effect:(pe who) [/ %kill ~])
=. fleet-snaps
%+ ~(put by fleet-snaps) lab.ae
+ :_ azi.piers
%- malt
%+ murn hers.ae
|= her=ship
^- (unit (pair ship pier))
- =+ per=(~(get by piers) her)
+ =+ per=(~(get by ships.piers) her)
?~ per
~
`[her u.per]
+ =. this stop-azimuth-timer
+ =. piers *fleet
(pe -.hers.ae)
::
%restore-snap
=. this
- %+ turn-ships (turn ~(tap by piers) head)
+ %+ turn-ships (turn ~(tap by ships.piers) head)
|= [who=ship thus=_this]
=. this thus
- (publish-effect:(pe who) [/ %sleep ~])
- =. piers (~(uni by piers) (~(got by fleet-snaps) lab.ae))
+ (publish-effect:(pe who) [/ %kill ~])
+ =. piers (~(got by fleet-snaps) lab.ae)
+ =. this start-azimuth-timer
=. this
- %+ turn-ships (turn ~(tap by piers) head)
+ %+ turn-ships (turn ~(tap by ships.piers) head)
|= [who=ship thus=_this]
=. this thus
(publish-effect:(pe who) [/ %restore ~])
@@ -537,18 +619,163 @@
^- (unit (unit cage))
?+ path ~
[%x %fleet-snap @ ~] ``noun+!>((~(has by fleet-snaps) i.t.t.path))
- [%x %ships ~] ``noun+!>((turn ~(tap by piers) head))
+ [%x %fleets ~] ``noun+!>((turn ~(tap by fleet-snaps) head))
+ [%x %ships ~] ``noun+!>((turn ~(tap by ships.piers) head))
[%x %pill ~] ``pill+!>(pil)
[%x %i @ @ @ @ @ *]
=/ who (slav %p i.t.t.path)
- =/ pier (~(get by piers) who)
+ =/ pier (~(get by ships.piers) who)
?~ pier
~
:^ ~ ~ %noun !>
(peek:(pe who) t.t.t.path)
+ [%x %log-info ~]
+ ``noun+!>([lives.azi.piers (lent logs.azi.piers) tym.azi.piers])
==
::
:: Trivial scry for mock
::
++ scry |=([* *] ~)
+::
+++ handle-wake
+ |= wen=@da
+ ^- (quip card:agent:gall _state)
+ =. this apex-aqua =< abet-aqua
+ ?. =(wen tym.azi.piers)
+ this
+ =. state (spam-logs 10)
+ start-azimuth-timer
+::
+++ start-azimuth-timer
+ ^+ this
+ =? this !=(tym.azi.piers *@da)
+ stop-azimuth-timer
+ =/ until=@da (add now.hid ~s40)
+ =. tym.azi.piers until
+ %- emit-cards
+ [%pass /wait/(scot %da until) %arvo %b %wait until]~
+::
+++ stop-azimuth-timer
+ ^+ this
+ =* tym tym.azi.piers
+ ?: =(tym *@da)
+ this
+ %- emit-cards
+ [%pass /wait/(scot %da tym) %arvo %b %rest tym]~
+::
+++ spam-logs
+ |= n=@
+ ^- _state
+ =* loop $
+ ?: =(n 0)
+ state
+ =/ new-state=_state
+ ?. (~(has by lives.azi.piers) ~fes)
+ (spawn ~fes)
+ (cycle-keys ~fes)
+ =. state new-state
+ loop(n (dec n))
+::
+++ spawn
+ |= who=@p
+ ^- _state
+ ?< (~(has by lives.azi.piers) who)
+ =. lives.azi.piers (~(put by lives.azi.piers) who [1 0])
+ =. logs.azi.piers
+ %+ weld logs.azi.piers
+ :_ ~
+ %- changed-keys:lo:aqua-azimuth
+ :* who
+ (get-public:aqua-azimuth who 1 %crypt)
+ (get-public:aqua-azimuth who 1 %auth)
+ 1
+ 1
+ ==
+ (spam-logs 10)
+::
+++ cycle-keys
+ |= who=@p
+ ^- _state
+ =/ prev
+ ~| no-such-ship+who
+ (~(got by lives.azi.piers) who)
+ =/ lyfe +(lyfe.prev)
+ =. lives.azi.piers (~(put by lives.azi.piers) who [lyfe rut.prev])
+ =. logs.azi.piers
+ %+ weld logs.azi.piers
+ :_ ~
+ %- changed-keys:lo:aqua-azimuth
+ :* who
+ (get-public:aqua-azimuth who lyfe %crypt)
+ (get-public:aqua-azimuth who lyfe %auth)
+ 1
+ lyfe
+ ==
+ state
+::
+++ breach
+ |= who=@p
+ ^- _state
+ =. state (cycle-keys who)
+ =/ prev (~(got by lives.azi.piers) who)
+ =/ rut +(rut.prev)
+ =. lives.azi.piers (~(put by lives.azi.piers) who [lyfe.prev rut])
+ =. logs.azi.piers
+ %+ weld logs.azi.piers
+ [(broke-continuity:lo:aqua-azimuth who rut) ~]
+ (spam-logs 10)
+::
+++ dawn
+ |= who=ship
+ ^- dawn-event:jael
+ ?> ?=(?(%czar %king %duke) (clan:title who))
+ =/ spon=(list [ship point:azimuth])
+ %- flop
+ |- ^- (list [ship point:azimuth])
+ =/ =ship (^sein:title who)
+ =/ a-point=[^ship point:azimuth]
+ =/ spon-spon [& (^sein:title ship)]
+ =/ life-rift ~|([ship lives.azi.piers] (~(got by lives.azi.piers) ship))
+ =/ =life lyfe.life-rift
+ =/ =rift rut.life-rift
+ =/ =pass
+ %^ pass-from-eth:azimuth
+ (as-octs:mimes:html (get-public:aqua-azimuth ship life %crypt))
+ (as-octs:mimes:html (get-public:aqua-azimuth ship life %auth))
+ 1
+ :^ ship
+ *[address address address address]:azimuth
+ `[life=life pass rift spon-spon ~]
+ ~
+ ?: ?=(%czar (clan:title ship))
+ [a-point]~
+ [a-point $(who ship)]
+ =/ =seed:jael
+ =/ life-rift (~(got by lives.azi.piers) who)
+ =/ =life lyfe.life-rift
+ [who life sec:ex:(get-keys:aqua-azimuth who life) ~]
+ :* seed
+ spon
+ get-czars
+ ~[~['arvo' 'netw' 'ork']]
+ 0
+ `(need (de-purl:html 'http://localhost:8545'))
+ ==
+::
+:: Should only do galaxies
+::
+++ get-czars
+ ^- (map ship [rift life pass])
+ %- malt
+ %+ murn
+ ~(tap by lives.azi.piers)
+ |= [who=ship lyfe=life rut=rift]
+ ?. =(%czar (clan:title who))
+ ~
+ %- some
+ :^ who rut lyfe
+ %^ pass-from-eth:azimuth
+ (as-octs:mimes:html (get-public:aqua-azimuth who lyfe %crypt))
+ (as-octs:mimes:html (get-public:aqua-azimuth who lyfe %auth))
+ 1
--
diff --git a/pkg/arvo/app/azimuth-tracker.hoon b/pkg/arvo/app/azimuth-tracker.hoon
index f5a49cbcb..4b6766e4d 100644
--- a/pkg/arvo/app/azimuth-tracker.hoon
+++ b/pkg/arvo/app/azimuth-tracker.hoon
@@ -1,6 +1,6 @@
/- eth-watcher
-/+ default-agent, verb
-=, able:jael
+/+ ethereum, azimuth, default-agent, verb
+=, jael
|%
++ app-state
$: %0
@@ -75,13 +75,15 @@
++ jael-update
|= =udiffs:point
^- (list card:agent:gall)
+ :- [%give %fact ~[/] %azimuth-udiffs !>(udiffs)]
+ |- ^- (list card:agent:gall)
?~ udiffs
~
=/ =path /(scot %p ship.i.udiffs)
- :* [%give %fact ~[/] %azimuth-udiff !>(i.udiffs)]
- [%give %fact ~[path] %azimuth-udiff !>(i.udiffs)]
- $(udiffs t.udiffs)
- ==
+ :: Should really give all diffs involving each ship at the same time
+ ::
+ :- [%give %fact ~[path] %azimuth-udiffs !>(~[i.udiffs])]
+ $(udiffs t.udiffs)
::
++ start
|= [state=app-state our=ship dap=term]
@@ -158,7 +160,7 @@
%- jael-update
?- -.diff
%history (event-logs-to-udiffs loglist.diff)
- %log (event-logs-to-udiffs event-log.diff ~)
+ %logs (event-logs-to-udiffs loglist.diff)
%disavow [*ship id.diff %disavow ~]~
==
::
diff --git a/pkg/arvo/app/chat-cli.hoon b/pkg/arvo/app/chat-cli.hoon
index 1b98786d4..49e6b2ff7 100644
--- a/pkg/arvo/app/chat-cli.hoon
+++ b/pkg/arvo/app/chat-cli.hoon
@@ -9,29 +9,49 @@
:: we concat the ship onto the head of the path,
:: and trust it to take care of the rest.
::
-/- view=chat-view, hook=chat-hook, *group,
- *permission-store, *group-store, inv=invite-store,
- sole
-/+ shoe, default-agent, verb, dbug, store=chat-store,
- group-store, grpl=group, resource
+/- *resource, post, store=chat-store
+/+ shoe, default-agent, verb, dbug, graph=graph-store, libgraph=graph
::
|%
+$ card card:shoe
::
+$ versioned-state
- $% state-2
+ $% state-3
+ state-2
state-1
state-0
==
::
++$ state-3
+ $: %3
+ ::TODO support multiple sessions
+ sessions=(map sole-id session) :: sole sessions
+ bound=(map resource glyph) :: bound resource glyphs
+ binds=(jug glyph resource) :: resource glyph lookup
+ settings=(set term) :: frontend flags
+ width=@ud :: display width
+ timez=(pair ? @ud) :: timezone adjustment
+ ==
+::
++$ sole-id @ta
++$ session
+ $: viewing=(set resource) :: connected graphs
+ history=(list uid:post) :: scrollback pointers
+ count=@ud :: (lent history)
+ audience=target :: active target
+ ==
+::
+::TODO remove for breach
++$ target-2 [in-group=? =ship =path]
++$ mail [source=target-2 envelope:store]
+$ state-2
$: %2
grams=(list mail) :: all messages
- known=(set [target serial:store]) :: known message lookup
+ known=(set [target-2 serial:store]) :: known message lookup
count=@ud :: (lent grams)
- bound=(map target glyph) :: bound circle glyphs
- binds=(jug glyph target) :: circle glyph lookup
- audience=(set target) :: active targets
+ bound=(map target-2 glyph) :: bound circle glyphs
+ binds=(jug glyph target-2) :: circle glyph lookup
+ audience=(set target-2) :: active targets
settings=(set term) :: frontend flags
width=@ud :: display width
timez=(pair ? @ud) :: timezone adjustment
@@ -40,15 +60,15 @@
+$ state-1
$: %1
grams=(list mail) :: all messages
- known=(set [target serial:store]) :: known message lookup
+ known=(set [target-2 serial:store]) :: known message lookup
count=@ud :: (lent grams)
- bound=(map target glyph) :: bound circle glyphs
- binds=(jug glyph target) :: circle glyph lookup
- audience=(set target) :: active targets
+ bound=(map target-2 glyph) :: bound circle glyphs
+ binds=(jug glyph target-2) :: circle glyph lookup
+ audience=(set target-2) :: active targets
settings=(set term) :: frontend flags
width=@ud :: display width
timez=(pair ? @ud) :: timezone adjustment
- cli=state=sole-share:sole :: console state
+ cli=state=sole-share:shoe :: console state
eny=@uvJ :: entropy
==
::
@@ -62,50 +82,40 @@
settings=(set term) :: frontend flags
width=@ud :: display width
timez=(pair ? @ud) :: timezone adjustment
- cli=state=sole-share:sole :: console state
+ cli=state=sole-share:shoe :: console state
eny=@uvJ :: entropy
==
::
-+$ mail [source=target envelope:store]
-+$ target [in-group=? =ship =path]
++$ target resource
::
+$ glyph char
++ glyphs "!@#$%^&()-=_+[]\{}'\\:\",.<>?"
::
-+$ nu-security ?(%channel %village)
-::
+$ command
- $% [%target (set target)] :: set messaging target
- [%say letter:store] :: send message
+ $% [%target target] :: set messaging target
+ [%say content:post] :: send message
[%eval cord hoon] :: send #-message
- ::
- ::
- :: create chat
- [%create nu-security path (unit resource) (unit glyph) (unit ?)]
- [%delete path] :: delete chat
- [%invite [? path] (set ship)] :: allow
- [%banish [? path] (set ship)] :: disallow
- ::
- [%join target (unit glyph) (unit ?)] :: join target
- [%leave target] :: nuke target
- ::
+ :: ::
+ [%view $?(~ target)] :: notice chat
+ [%flee target] :: ignore chat
+ :: ::
[%bind glyph target] :: bind glyph
[%unbind glyph (unit target)] :: unbind glyph
[%what (unit $@(char target))] :: glyph lookup
- ::
+ :: ::
[%settings ~] :: show active settings
[%set term] :: set settings flag
[%unset term] :: unset settings flag
[%width @ud] :: adjust display width
[%timezone ? @ud] :: adjust time printing
- ::
+ :: ::
[%select $@(rel=@ud [zeros=@u abs=@ud])] :: rel/abs msg selection
[%chats ~] :: list available chats
[%help ~] :: print usage info
== ::
::
--
-=| state-2
+=| state-3
=* state -
::
%- agent:dbug
@@ -154,14 +164,14 @@
%kick
:_ state
?+ wire ~
- [%chat-store ~] ~[connect:tc]
- [%invites ~] ~[connect-invites:tc]
+ [%graph-store ~] ~[connect:tc]
==
::
%fact
- ?+ p.cage.sign ~|([%chat-cli-bad-sub-mark wire p.cage.sign] !!)
- %chat-update (diff-chat-update:tc wire !<(update:store q.cage.sign))
- %invite-update (handle-invite-update:tc !<(update:inv q.cage.sign))
+ ?+ p.cage.sign ~|([dap.bowl %bad-sub-mark wire p.cage.sign] !!)
+ %graph-update
+ %- on-graph-update:tc
+ !<(update:graph q.cage.sign)
==
==
[cards this]
@@ -173,50 +183,38 @@
++ on-fail on-fail:def
::
++ command-parser
- |= sole-id=@ta
- parser:sh:tc
+ |= =sole-id
+ parser:(make:sh:tc sole-id)
::
++ tab-list
- |= sole-id=@ta
+ |= =sole-id
tab-list:sh:tc
::
++ on-command
- |= [sole-id=@ta =command]
+ |= [=sole-id =command]
=^ cards state
- (work:sh:tc command)
+ (work:(make:sh:tc sole-id) command)
[cards this]
::
++ on-connect
- |= sole-id=@ta
+ |= =sole-id
^- (quip card _this)
- [[prompt:sh-out:tc ~] this]
+ [[prompt:(make:sh-out:tc sole-id)]~ this]
::
++ can-connect can-connect:des
++ on-disconnect on-disconnect:des
--
::
|_ =bowl:gall
-++ grp ~(. grpl bowl)
++* libgraph ~(. ^libgraph bowl)
:: +prep: setup & state adapter
::
++ prep
|= old=(unit versioned-state)
^- (quip card _state)
?~ old
- =^ cards state
- %_ catch-up
- audience [[| our-self /] ~ ~]
- settings (sy %showtime %notify ~)
- width 80
- ==
- [[connect connect-invites cards] state]
- :- %+ weld
- ?: (~(has by wex.bowl) [/invites our-self %invite-store]) ~
- ~[connect-invites]
- ?: (~(has by wex.bowl) [/chat-store our-self %chat-store]) ~
- ~[connect]
+ [~[connect] state(width 80)]
::
- ^- state-2
=? u.old ?=(?(~ ^) -.u.old)
^- state-1
:- %1
@@ -224,31 +222,31 @@
grams ~ ::NOTE this only impacts historic message lookup in chat-cli
::
known
- ^- (set [target serial:store])
+ ^- (set [target-2 serial:store])
%- ~(run in known.u.old)
|= [t=[ship path] s=serial:store]
- [`target`[| t] s]
+ [`target-2`[| t] s]
::
bound
- ^- (map target glyph)
- %- ~(gas by *(map target glyph))
+ ^- (map target-2 glyph)
+ %- ~(gas by *(map target-2 glyph))
%+ turn ~(tap by bound.u.old)
|= [t=[ship path] g=glyph]
- [`target`[| t] g]
+ [`target-2`[| t] g]
::
binds
- ^- (jug glyph target)
+ ^- (jug glyph target-2)
%- ~(run by binds.u.old)
|= s=(set [ship path])
%- ~(run in s)
|= t=[ship path]
- `target`[| t]
+ `target-2`[| t]
::
audience
- ^- (set target)
+ ^- (set target-2)
%- ~(run in audience.u.old)
|= t=[ship path]
- `target`[| t]
+ `target-2`[| t]
==
::
=? u.old ?=(%1 -.u.old)
@@ -260,57 +258,92 @@
settings width timez
==
::
- ?> ?=(%2 -.u.old)
- u.old
-:: +catch-up: process all chat-store state
-::
-++ catch-up
- ^- (quip card _state)
- =/ =inbox:store
- (scry-for inbox:store %chat-store /all)
- |- ^- (quip card _state)
- ?~ inbox [~ state]
- =* path p.n.inbox
- =* mailbox q.n.inbox
- =/ =target (path-to-target path)
- =^ cards-n state (read-envelopes target (flop envelopes.mailbox))
- =^ cards-l state $(inbox l.inbox)
- =^ cards-r state $(inbox r.inbox)
- [:(weld cards-n cards-l cards-r) state]
-:: +connect: connect to the chat-store
+ =^ cards u.old
+ ?. ?=(%2 -.u.old) [~ u.old]
+ :- :~ [%pass /chat-store %agent [our-self %chat-store] %leave ~]
+ [%pass /invites %agent [our.bowl %invite-store] %leave ~]
+ ==
+ ^- state-3
+ :- %3
+ :* %+ ~(put in *(map sole-id session))
+ (cat 3 'drum_' (scot %p our.bowl))
+ :* ~ ~ 0
+ ::
+ ?~ audience.u.old *target
+ [ship ?~(path %$ i.path)]:n.audience.u.old
+ ==
+ ::
+ %- ~(gas by *(map resource glyph))
+ %+ turn ~(tap in bound.u.old)
+ |= [t=target-2 g=glyph]
+ [[ship.t ?~(path.t %$ i.path.t)] g]
+ ::
+ ^- (jug glyph resource)
+ %- ~(run by binds.u.old)
+ |= s=(set target-2)
+ %- ~(run in s)
+ |= t=target-2
+ [ship.t ?~(path.t %$ i.path.t)]
+ ::
+ settings.u.old
+ width.u.old
+ timez.u.old
+ ==
+ ::
+ ?> ?=(%3 -.u.old)
+ :_ u.old
+ %+ welp
+ cards
+ ?: %- ~(has by wex.bowl)
+ [/graph-store our-self %graph-store]
+ ~
+ ~[connect]
+:: +connect: connect to the graph-store
::
++ connect
^- card
- [%pass /chat-store %agent [our-self %chat-store] %watch /updates]
-::
-++ connect-invites
- ^- card
- [%pass /invites %agent [our.bowl %invite-store] %watch /invitatory/chat]
+ [%pass /graph-store %agent [our-self %graph-store] %watch /updates]
::
::TODO better moon support. (name:title our.bowl)
++ our-self our.bowl
-:: +target-to-path: prepend ship to the path
::
-++ target-to-path
- |= target
- [(scot %p ship) path]
-:: +path-to-target: deduces a target from a mailbox path
+++ get-session
+ |= =sole-id
+ ^- session
+ (~(gut by sessions) sole-id %*(. *session audience [our-self %$]))
+:: +tor: term ordering for targets
::
-++ path-to-target
- |= =path
- ^- target
- =^ in-group path
- ?. ?=([%'~' *] path)
- [& path]
- [| t.path]
- :- in-group
- ?. ?=([@ @ *] path)
- ::TODO can we safely assert the above?
- ~& [%path-without-host path]
- [our-self path]
- =+ who=(slaw %p i.path)
- ?~ who [our-self path]
- [u.who t.path]
+++ tor
+ |= [[* a=term] [* b=term]]
+ (aor a b)
+:: +ior: index ordering for nodes
+::
+++ ior
+ |= [[a=index:post *] [b=index:post *]]
+ (aor a b)
+:: +safe-get-graph: virtualized +get-graph
+::
+++ safe-get-graph
+ |= =resource
+ ^- (unit update:graph)
+ =/ res=(each update:graph tang)
+ ::TODO doesn't actually contain the crash?
+ %- mule |.
+ (get-graph:libgraph resource)
+ ?- -.res
+ %& `p.res
+ %| ~
+ ==
+:: +is-chat-graph: check whether graph contains chat-style data
+::
+++ is-chat-graph
+ |= =resource
+ ^- ?
+ =/ update=(unit update:graph)
+ (safe-get-graph resource)
+ ?~ update |
+ ?> ?=(%add-graph -.q.u.update)
+ =(`%graph-validator-chat mark.q.u.update)
:: +poke-noun: debug helpers
::
++ poke-noun
@@ -318,45 +351,73 @@
^- (quip card _state)
?: ?=(%connect a)
[[connect ~] state]
- ?: ?=(%catch-up a)
- catch-up
[~ state]
-:: +handle-invite-update: get new invites
+:: +handle-graph-update: get new mailboxes & messages
::
-++ handle-invite-update
- |= upd=update:inv
+++ on-graph-update
+ |= upd=update:graph
^- (quip card _state)
- ?+ -.upd [~ state]
- %invite [[(show-invite:sh-out invite.upd) ~] state]
- ==
-:: +diff-chat-update: get new mailboxes & messages
+ ?. ?=(?(%remove-graph %add-nodes) -.q.upd)
+ [~ state]
+ =/ sez=(list [=sole-id =session])
+ ~(tap by sessions)
+ =| cards=(list card)
+ |-
+ ?~ sez [cards state]
+ =^ caz session.i.sez
+ ?- -.q.upd
+ %remove-graph (~(notice-remove se i.sez) +.q.upd)
+ ::
+ %add-nodes
+ ?. (~(has in viewing.session.i.sez) resource.q.upd)
+ [~ session.i.sez]
+ %+ ~(read-posts se i.sez)
+ resource.q.upd
+ (sort ~(tap by nodes.q.upd) ior)
+ ==
+ =. sessions (~(put by sessions) i.sez)
+ $(sez t.sez, cards (weld cards caz))
+:: +se: session event handling
::
-++ diff-chat-update
- |= [=wire upd=update:store]
- ^- (quip card _state)
- ?+ -.upd [~ state]
- %create (notice-create (path-to-target path.upd))
- %delete [[(show-delete:sh-out (path-to-target path.upd)) ~] state]
- %message (read-envelope (path-to-target path.upd) envelope.upd)
- %messages (read-envelopes (path-to-target path.upd) (flop envelopes.upd))
- ==
+++ se
+ |_ [=sole-id =session]
+ +* sh-out ~(. ^sh-out sole-id session)
+ ::
+ ++ read-posts
+ |= [=target nodes=(list [=index:post =node:graph])]
+ ^- (quip card _session)
+ =^ cards nodes
+ ^- (quip card _nodes)
+ =+ count=(lent nodes)
+ ?. (gth count 10) [~ nodes]
+ :_ (swag [(sub count 10) 10] nodes)
+ [(print:sh-out "skipping {(scow %ud (sub count 10))} messages...")]~
+ |-
+ ?~ nodes [cards session]
+ =^ caz session
+ (read-post target [index post.node]:i.nodes)
+ $(cards (weld cards caz), nodes t.nodes)
+ ::
+ :: +read-post: add envelope to state and show it to user
+ ::
+ ++ read-post
+ |= [=target =index:post =post:post]
+ ^- (quip card _session)
+ :- (show-post:sh-out target post)
+ %_ session
+ history [[target index] history.session]
+ count +(count.session)
+ ==
+ ::
+ ++ notice-remove
+ |= =target
+ ^- (quip card _session)
+ ?. (~(has in viewing.session) target)
+ [~ session]
+ :- [(show-delete:sh-out target) ~]
+ session(viewing (~(del in viewing.session) target))
+ --
::
-++ read-envelopes
- |= [=target envs=(list envelope:store)]
- ^- (quip card _state)
- ?~ envs [~ state]
- =^ cards-i state (read-envelope target i.envs)
- =^ cards-t state $(envs t.envs)
- [(weld cards-i cards-t) state]
-::
-++ notice-create
- |= =target
- ^- (quip card _state)
- =^ cards state
- ?: (~(has by bound) target)
- [~ state]
- (bind-default-glyph target)
- [[(show-create:sh-out target) cards] state]
:: +bind-default-glyph: bind to default, or random available
::
++ bind-default-glyph
@@ -410,40 +471,39 @@
:: +decode-glyph: find the target that matches a glyph, if any
::
++ decode-glyph
- |= =glyph
+ |= [=session =glyph]
^- (unit target)
=+ lax=(~(get ju binds) glyph)
- :: no circle
+ :: no target
?: =(~ lax) ~
%- some
- :: single circle
+ :: single target
+ ?: ?=([* ~ ~] lax) n.lax
+ :: in case of multiple matches, pick one we're viewing
+ =. lax (~(uni in lax) viewing.session)
?: ?=([* ~ ~] lax) n.lax
:: in case of multiple audiences, pick the most recently active one
|- ^- target
- ?~ grams -:~(tap in lax)
- =* source source.i.grams
- ?: (~(has in lax) source)
- source
- $(grams t.grams)
-:: +read-envelope: add envelope to state and show it to user
-::
-++ read-envelope
- |= [=target =envelope:store]
- ^- (quip card _state)
- ?: (~(has in known) [target uid.envelope])
- ::NOTE we no-op only because edits aren't possible
- [~ state]
- :- (show-envelope:sh-out target envelope)
- %_ state
- known (~(put in known) [target uid.envelope])
- grams [[target envelope] grams]
- count +(count)
- ==
+ ?~ history.session -:~(tap in lax)
+ =* resource resource.i.history.session
+ ?: (~(has in lax) resource)
+ resource
+ $(history.session t.history.session)
::
:: +sh: shoe handling
::
++ sh
- |%
+ |_ [=sole-id session]
+ +* session +<+
+ sh-out ~(. ^sh-out sole-id session)
+ put-ses state(sessions (~(put by sessions) sole-id session))
+ ::
+ ++ make
+ |= =^sole-id
+ %_ ..make
+ sole-id sole-id
+ +<+ (get-session sole-id)
+ ==
:: +read: command parser
::
:: parses the command line buffer.
@@ -455,31 +515,11 @@
%+ knee *command |. ~+
=- ;~(pose ;~(pfix mic -) message)
;~ pose
- (stag %target tars)
+ (stag %target targ)
::
- ;~ (glue ace)
- (tag %create)
- security
- ;~ plug
- path
- (punt ;~(pfix ace group))
- (punt ;~(pfix ace glyph))
- (punt ;~(pfix ace (fuss 'y' 'n')))
- ==
- ==
- ;~((glue ace) (tag %delete) path)
- ;~((glue ace) (tag %invite) tarx ships)
- ;~((glue ace) (tag %banish) tarx ships)
- ::
- ;~ (glue ace)
- (tag %join)
- ;~ plug
- targ
- (punt ;~(pfix ace glyph))
- (punt ;~(pfix ace (fuss 'y' 'n')))
- ==
- ==
- ;~((glue ace) (tag %leave) targ)
+ ;~((glue ace) (tag %view) targ)
+ ;~((glue ace) (tag %flee) targ)
+ ;~(plug (tag %view) (easy ~))
::
;~((glue ace) (tag %bind) glyph targ)
;~((glue ace) (tag %unbind) ;~(plug glyph (punt ;~(pfix ace targ))))
@@ -534,40 +574,20 @@
:: ;~(pfix ace ;~(plug i.opt $(opt t.opt)))
:: --
::
- ++ group ;~((glue net) ship sym)
+ ++ group ;~((glue fas) ship sym)
++ tag |*(a=@tas (cold a (jest a))) ::TODO into stdlib
++ ship ;~(pfix sig fed:ag)
- ++ path ;~(pfix net ;~(plug urs:ab (easy ~))) ::NOTE short only, tmp
- :: +mang: un/managed indicator prefix
- ::
- :: deprecated, as sig prefix is no longer used
- ::
- ++ mang (cold %& (easy ~))
+ ++ name ;~(pfix fas urs:ab)
:: +tarl: local target, as /path
::
- ++ tarl (stag our-self path)
- :: +tarx: local target, maybe managed
- ::
- ++ tarx ;~(plug mang path)
- :: +tarp: sponsor target, as ^/path
- ::
- ++ tarp
- =- ;~(pfix ket (stag - path))
- (sein:title our.bowl now.bowl our-self)
+ ++ tarl (stag our-self name)
:: +targ: any target, as tarl, tarp, ~ship/path or glyph
::
++ targ
;~ pose
- ;~ plug
- mang
- ::
- ;~ pose
- tarl
- tarp
- ;~(plug ship path)
- ==
- ==
- (sear decode-glyph glyph)
+ tarl
+ ;~(plug ship name)
+ (sear (cury decode-glyph session) glyph)
==
:: +tars: set of comma-separated targs
::
@@ -579,12 +599,6 @@
++ ships
%+ cook ~(gas in *(set ^ship))
(most ;~(plug com (star ace)) ship)
- ::
- :: +security: security mode
- ::
- ++ security
- (perk %channel %village ~)
- ::
:: +glyph: shorthand character
::
++ glyph (mask glyphs)
@@ -612,14 +626,14 @@
++ message
;~ pose
;~(plug (cold %eval hax) expr)
- (stag %say letter)
+ (stag %say content)
==
- :: +letter: simple messages
+ :: +content: simple messages
+ ::TODO mentions
::
- ++ letter
+ ++ content
;~ pose
(stag %url turl)
- (stag %me ;~(pfix vat text))
(stag %text ;~(less mic hax text))
==
:: +turl: url parser
@@ -647,13 +661,8 @@
++ tab-list
^- (list [@t tank])
:~
- [';join' leaf+";join ~ship/chat-name (glyph)"]
- [';leave' leaf+";leave ~ship/chat-name"]
- ::
- [';create' leaf+";create [type] /chat-name (glyph)"]
- [';delete' leaf+";delete /chat-name"]
- [';invite' leaf+";invite /chat-name ~ships"]
- [';banish' leaf+";banish /chat-name ~ships"]
+ [';view' leaf+";view ~ship/chat-name (glyph)"]
+ [';flee' leaf+";flee ~ship/chat-name"]
::
[';bind' leaf+";bind [glyph] ~ship/chat-name"]
[';unbind' leaf+";unbind [glyph]"]
@@ -676,13 +685,8 @@
%say (say +.job)
%eval (eval +.job)
::
- %create (create +.job)
- %delete (delete +.job)
- %invite (change-permission & +.job)
- %banish (change-permission | +.job)
- ::
- %join (join +.job)
- %leave (leave +.job)
+ %view (view +.job)
+ %flee (flee +.job)
::
%bind (bind-glyph +.job)
%unbind (unbind-glyph +.job)
@@ -710,177 +714,69 @@
%poke
cage
==
- :: +invite-card: build invite card
- ::
- ++ invite-card
- |= [where=path who=ship]
- ^- card
- :* %pass
- /cli-command/invite
- %agent
- [who %invite-hook] ::NOTE only place chat-cli pokes others
- %poke
- %invite-action
- ::
- !> ^- action:inv
- :^ %invite %chat
- (shax (jam [our-self where] who))
- ^- invite:inv
- [our-self %chat-hook (de-path:resource where) who '']
- ==
:: +set-target: set audience, update prompt
::
++ set-target
- |= tars=(set target)
- ^- (quip card _state)
- =. audience tars
- [[prompt:sh-out ~] state]
- :: +create: new local mailbox
- ::
- ++ create
- |= $: security=nu-security
- =path
- ugroup=(unit resource)
- gyf=(unit char)
- allow-history=(unit ?)
- ==
- ^- (quip card _state)
- =/ with-group=? ?=(^ ugroup)
- =/ =target [with-group our-self path]
- =/ real-path=^path (target-to-path target)
- =/ group-path=^path ?~(ugroup ship+real-path (en-path:resource u.ugroup))
- =/ =policy
- ?- security
- %channel *open:policy
- %village *invite:policy
- ==
- ?^ (scry-for (unit mailbox:store) %chat-store [%mailbox real-path])
- =- [[- ~] state]
- %- print:sh-out
- "{(spud path)} already exists!"
- =. audience [target ~ ~]
- =^ moz state
- ?. ?=(^ gyf) [~ state]
- (bind-glyph u.gyf target)
- =- [[- moz] state]
- %^ act %do-create %chat-view
- :- %chat-view-action
- !> ^- action:view
- :* %create
- (rsh 3 1 (spat path))
- ''
- real-path :: chat
- group-path :: group
- policy
- ~
- (fall allow-history %.y)
- with-group
- ==
- :: +delete: delete local chats
- ::
- ++ delete
- |= =path
- ^- (quip card _state)
- =- [[- ~] state]
- %^ act %do-delete %chat-view
- :- %chat-view-action
- !> ^- action:view
- [%delete (target-to-path | our-self path)]
- :: +change-permission: modify permissions on a local chat
- ::
- ++ change-permission
- |= [allow=? [group=? =path] ships=(set ship)]
- ^- (quip card _state)
- :_ state
- =/ real-path=^path
- (target-to-path group our-self path)
- =; permit=(unit card)
- %+ weld (drop permit)
- ?. allow ~
- ^- (list card)
- %+ murn ~(tap in ships)
- |= =ship
- ^- (unit card)
- :: if they weren't permitted before, some hook will send an invite.
- :: but if they already were, we want to send an invite ourselves.
- ::
- ?. (is-member:grp ship real-path)
- ~
- `(invite-card real-path ship)
- :: whitelist: empty if no matching permission, else true if whitelist
- ::
- =/ whitelist=(unit ?)
- =; grp=(unit ^group)
- ?~(grp ~ `?=(%open -.u.grp))
- ::TODO +permission-of-target?
- %^ scry-for (unit ^group)
- %group-store
- `^path`[%groups real-path]
- ?~ whitelist
- ~& [%weird-no-permission real-path]
- ~
- =/ rid=resource
- (de-path:resource real-path)
- %- some
- %^ act %do-permission %group-store
- :- %group-action
- !> ^- action:group-store
- ?: =(u.whitelist allow)
- [%add-members rid ships]
- [%remove-members rid ships]
- :: +join: sync with remote mailbox
- ::
- ++ join
- |= [=target gyf=(unit char) ask-history=(unit ?)]
- ^- (quip card _state)
- =^ moz state
- ?. ?=(^ gyf) [~ state]
- (bind-glyph u.gyf target)
- =. audience [target ~ ~]
- =; =card
- [[card prompt:sh-out moz] state]
- ::TODO ideally we'd check permission first. attempting this and failing
- :: gives ugly %chat-hook-reap
- %^ act %do-join %chat-view
- :- %chat-view-action
- !> ^- action:view
- [%join ship.target (target-to-path target) (fall ask-history %.y)]
- :: +leave: unsync & destroy mailbox
- ::
- ::TODO allow us to "mute" local chats using this
- ++ leave
|= =target
- =- [[- ~] state]
- ?: =(our-self ship.target)
- %- print:sh-out
- "can't ;leave local chats, maybe use ;delete instead"
- %^ act %do-leave %chat-hook
- :- %chat-hook-action
- !> ^- action:hook
- [%remove (target-to-path target)]
+ ^- (quip card _state)
+ =. audience target
+ [[prompt:sh-out ~] put-ses]
+ :: +view: start printing messages from a resource
+ ::
+ ++ view
+ |= target=$?(~ target)
+ ^- (quip card _state)
+ :: without argument, print all we're viewing
+ ::
+ ?~ target
+ [[(show-chats:sh-out ~(tap in viewing))]~ state]
+ :: only view existing chat-type graphs
+ ::
+ ?. (is-chat-graph target)
+ [[(note:sh-out "no such chat")]~ put-ses]
+ =. viewing (~(put in viewing) target)
+ =^ cards state
+ ?: (~(has by bound) target)
+ [~ state]
+ (bind-default-glyph target)
+ [[prompt:sh-out cards] put-ses]
+ :: +flee: stop printing messages from a resource
+ ::
+ ++ flee
+ |= =target
+ ^- (quip card _state)
+ =. viewing (~(del in viewing) target)
+ [~ put-ses]
:: +say: send messages
::
++ say
- |= =letter:store
+ |= msg=content:post
^- (quip card _state)
- ~! bowl
=/ =serial:store (shaf %msg-uid eny.bowl)
:_ state
- ^- (list card)
- %+ turn ~(tap in audience)
- |= =target
- %^ act %out-message %chat-hook
- :- %chat-action
- !> ^- action:store
- :+ %message (target-to-path target)
- [serial *@ our-self now.bowl letter]
+ :_ ~
+ ::TODO move creation into lib?
+ %^ act %out-message
+ %graph-push-hook
+ :- %graph-update
+ !> ^- update:graph
+ :+ %0 now.bowl
+ :+ %add-nodes audience
+ %- ~(put by *(map index:post node:graph))
+ :- ~[now.bowl]
+ :_ *internal-graph:graph
+ ^- post:post
+ [our-self ~[now.bowl] now.bowl [msg]~ ~ ~]
:: +eval: run hoon, send code and result as message
::
:: this double-virtualizes and clams to disable .^ for security reasons
::
++ eval
|= [txt=cord exe=hoon]
- (say %code txt (eval:store bowl exe))
+ ~& %eval-tmp-disabled
+ [~ state]
+ ::TODO why -find.eval??
+ :: (say %code txt (eval:store bowl exe))
:: +lookup-glyph: print glyph info for all, glyph or target
::
++ lookup-glyph
@@ -916,7 +812,7 @@
%- zing
^- (list tape)
:- "flags: "
- %+ ^join ", "
+ %+ join ", "
(turn `(list @t)`~(tap in settings) trip)
::
%- print:sh-out
@@ -990,49 +886,61 @@
++ activate
|= [number=tape index=@ud]
^- (quip card _state)
- =+ gam=(snag index grams)
- =. audience [source.gam ~ ~]
- :_ state
+ ::NOTE graph store allows node deletion, so can this crash?
+ =/ =uid:post (snag index history)
+ =/ =node:graph (got-node:libgraph uid)
+ =. audience resource.uid
+ :_ put-ses
^- (list card)
:~ (print:sh-out ['?' ' ' number])
- (effect:sh-out ~(render-activate mr gam))
+ (effect:sh-out ~(render-activate mr resource.uid post.node))
prompt:sh-out
==
--
- :: +chats: display list of local mailboxes
+ :: +chats: display list of joined chats
::
++ chats
^- (quip card _state)
:_ state
:_ ~
- %- print-more:sh-out
- =/ all
- %^ scry-for (set path)
- %chat-store
- /keys
- %+ turn ~(tap in all)
- %+ cork path-to-target
- |= target
- (weld (scow %p ship) (spud path))
+ %- show-chats:sh-out
+ (skim ~(tap in get-keys:libgraph) is-chat-graph)
:: +help: print (link to) usage instructions
::
++ help
^- (quip card _state)
- =- [[- ~] state]
- (print:sh-out "see https://urbit.org/using/operations/using-your-ship/#messaging")
+ :_ state
+ =- (turn - print:sh-out)
+ :~ ";view ~host/chat to print messages for a chat you've already jonied."
+ ";flee ~host/chat to stop printing messages for a chat."
+ "For more details:"
+ "https://urbit.org/using/operations/using-your-ship/#messaging"
+ ==
--
--
::
:: +sh-out: ouput to session
::
++ sh-out
- |%
- :: +effect: console effect card for all listeners
+ |_ [=sole-id session]
+ ++ make
+ |= =^sole-id
+ %_ ..make
+ sole-id sole-id
+ +<+ (get-session sole-id)
+ ==
+ :: +effex: emit shoe effect card
+ ::
+ ++ effex
+ |= effect=shoe-effect:shoe
+ ^- card
+ [%shoe ~[sole-id] effect]
+ :: +effect: emit console effect card
::
++ effect
- |= effect=sole-effect:sole
+ |= effect=sole-effect:shoe
^- card
- [%shoe ~ %sole effect]
+ (effex %sole effect)
:: +print: puts some text into the cli as-is
::
++ print
@@ -1063,29 +971,16 @@
^- card
%+ effect %pro
:+ & %talk-line
- ^- tape
- =- ?: =(1 (lent -)) "{-} "
- "[{-}] "
- =/ all
- %+ sort ~(tap in audience)
- |= [a=target b=target]
- (~(beat tr a) b)
- =+ fir=&
- |- ^- tape
- ?~ all ~
- ;: welp
- ?:(fir "" " ")
- ~(show tr i.all)
- $(all t.all, fir |)
- ==
- :: +show-envelope: print incoming message
+ =+ ~(show tr audience)
+ ?:(=(1 (lent -)) "{-} " "[{-}] ")
+ :: +show-post: print incoming message
::
:: every five messages, prints the message number also.
:: if the message mentions the user's (shortened) ship name,
:: and the %notify flag is set, emit a bell.
::
- ++ show-envelope
- |= [=target =envelope:store]
+ ++ show-post
+ |= [=target =post:post]
^- (list card)
%+ weld
^- (list card)
@@ -1094,18 +989,13 @@
=+ num=(scow %ud count)
%- print
(runt [(sub 13 (lent num)) '-'] "[{num}]")
- =+ lis=~(render-inline mr target envelope)
- ?~ lis ~
- :_ ~
- %+ effect %mor
- %+ turn `(list tape)`lis
- =+ nom=(scag 7 (cite:title our-self))
- |= t=tape
- ?. ?& (~(has in settings) %notify)
- ?=(^ (find nom (slag 15 t)))
- ==
- [%txt t]
- [%mor [%txt t] [%bel ~] ~]
+ ^- (list card)
+ :- (effex ~(render-inline mr target post))
+ =; mentioned=?
+ ?. mentioned ~
+ [(effect %bel ~)]~
+ %+ lien contents.post
+ (cury test %mention our.bowl)
:: +show-create: print mailbox creation notification
::
++ show-create
@@ -1128,165 +1018,188 @@
%+ weld "set: {[glyph ~]} "
?~ target "unbound"
~(phat tr u.target)
- :: +show-invite: print incoming invite notification
+ :: +show-chats: print list of targets
::
- ++ show-invite
- |= invite:inv
+ ++ show-chats
+ |= chats=(list target)
^- card
- (note "invited to: {(scow %p entity.resource)} {(trip name.resource)}")
+ %- print-more
+ %+ turn (sort chats tor)
+ |= resource
+ "{(nome:mr entity)}/{(trip name)}"
--
::
-:: +tr: render targets
+:: +tr: render targets (resource identifiers)
::
++ tr
- |_ :: one: the target.
- ::
- one=target
- :: +beat: true if one is more "relevant" than two
- ::
- ++ beat
- |= two=target
- ^- ?
- :: the target that's ours is better.
- ?: =(our-self ship.one)
- ?. =(our-self ship.two) &
- ?< =(path.one path.two)
- :: if both targets are ours, the main story is better.
- ?: =(%inbox path.one) &
- ?: =(%inbox path.two) |
- :: if neither are, pick the "larger" one.
- (lth (lent path.one) (lent path.two))
- :: if one isn't ours but two is, two is better.
- ?: =(our-self ship.two) |
- ?: =(ship.one ship.two)
- :: if they're from the same ship, pick the "larger" one.
- (lth (lent path.one) (lent path.two))
- :: if they're from different ships, neither ours, pick hierarchically.
- (lth (xeb ship.one) (xeb ship.two))
- :: +full: render target fully, always
+ |_ tr=target
+ :: +full: render target fully, always (as ~ship/path)
::
++ full
^- tape
- ;: weld
- ?:(in-group.one "" "~/")
- (scow %p ship.one)
- (spud path.one)
- ==
+ "{(scow %p entity.tr)}/{(trip name.tr)}"
:: +phat: render target with local shorthand
::
:: renders as ~ship/path.
:: for local mailboxes, renders just /path.
- :: for sponsor's mailboxes, renders ^/path.
::
++ phat
^- tape
%+ weld
- ?:(in-group.one "" "~/")
- %+ weld
- ?: =(our-self ship.one) ~
- ?: =((sein:title our.bowl now.bowl our-self) ship.one) "^"
- (scow %p ship.one)
- (spud path.one)
+ ?: =(our-self entity.tr) ~
+ (scow %p entity.tr)
+ "/{(trip name.tr)}"
:: +show: render as tape, as glyph if we can
::
++ show
^- tape
- =+ cha=(~(get by bound) one)
- ?~(cha phat "{u.cha ~}")
+ =+ cha=(~(get by bound) tr)
+ ?~(cha phat [u.cha ~])
:: +glyph: tape for glyph of target, defaulting to *
::
++ glyph
^- tape
- [(~(gut by bound) one '*') ~]
+ [(~(gut by bound) tr '*') ~]
--
::
:: +mr: render messages
::
++ mr
- =, sole
|_ $: source=target
- envelope:store
+ post:post
==
+ +* showtime (~(has in settings) %showtime)
+ notify (~(has in settings) %notify)
+ ::
+ ++ content-width
+ :: termwidth, minus author, timestamp, and padding
+ %+ sub width
+ %+ add 15
+ ?:(showtime 11 0)
+ ::
+ ++ render-inline
+ ^- shoe-effect:shoe
+ :+ %row
+ :- 15
+ ?. showtime
+ ~[(sub width 16)]
+ ~[(sub width 26) 9]
+ :+ t+(crip (weld (nome author) ~(glyph tr source)))
+ t+(crip line)
+ ?. showtime ~
+ :_ ~
+ :- %t
+ =. time-sent
+ %- ?:(p.timez add sub)
+ [time-sent (mul q.timez ~h1)]
+ =+ dat=(yore time-sent)
+ =* t (d-co:co 2)
+ =, t.dat
+ %- crip
+ :(weld "~" (t h) "." (t m) "." (t s))
+ ::
+ ++ line
+ ^- tape
+ %- zing
+ %+ join "\0a"
+ %- turn
+ :_ |=(ls=(list tape) `tape`(zing (join " " ls)))
+ %+ roll contents
+ |= [=content:post out=(list (list tape))]
+ ?- -.content
+ %text (append-inline out (trip text.content))
+ %mention (append-inline out (scow %p ship.content))
+ %reference (append-inline out "^")
+ ::
+ %code
+ %+ snoc out
+ ^- (list tape)
+ :- (trip expression.content)
+ ?: =(~ output.content) ~
+ :- "\0a"
+ ~(ram re (snag 0 output.content))^~
+ ::
+ %url
+ %+ append-inline out
+ =+ wyd=content-width
+ =+ ful=(trip url.content)
+ :: if the full url fits, just render it.
+ ?: (gte wyd (lent ful)) ful
+ :: if it doesn't, prefix with _ and truncate domain with ellipses
+ =. wyd (sub wyd 2)
+ :- '_'
+ =- (weld - "_")
+ =+ prl=(rust ful aurf:de-purl:html)
+ ?~ prl (scag wyd ful)
+ =+ hok=r.p.p.u.prl
+ =; domain=tape
+ %+ swag
+ [(sub (max wyd (lent domain)) wyd) wyd]
+ domain
+ ?. ?=(%& -.hok)
+ +:(scow %if p.hok)
+ %+ reel p.hok
+ |= [a=knot b=tape]
+ ?~ b (trip a)
+ (welp b '.' (trip a))
+ ==
+ ::
+ ++ append-newline
+ |= [content=(list (list tape)) newline=tape]
+ ^- (list (list tape))
+ (snoc content ~[newline])
+ ::
+ ++ append-inline
+ |= [content=(list (list tape)) inline=tape]
+ ^- (list (list tape))
+ ?: =(~ content)
+ ~[~[inline]]
+ =/ last
+ (dec (lent content))
+ =/ old=(list tape)
+ (snag last content)
+ =/ new=(list tape)
+ (snoc old inline)
+ (snap content last new)
+
:: +activate: produce sole-effect for printing message details
::
++ render-activate
- ^- sole-effect
+ ^- sole-effect:shoe
~[%mor [%tan meta] body]
:: +meta: render message metadata (serial, timestamp, author, target)
::
++ meta
^- tang
- =. when (sub when (mod when (div when ~s0..0001))) :: round
- =+ hed=leaf+"{(scow %uv uid)} at {(scow %da when)}"
+ =+ hed=leaf+"{(scow %uv (fall hash 0))} at {(scow %da time-sent)}"
=/ src=tape ~(phat tr source)
[%rose [" " ~ ~] [hed >author< [%rose [", " "to " ~] [leaf+src]~] ~]]~
:: +body: long-form render of message contents
::
++ body
- |- ^- sole-effect
- ?- -.letter
- ?(%text %me)
- =/ pre=tape ?:(?=(%me -.letter) "@ " "")
- tan+~[leaf+"{pre}{(trip +.letter)}"]
+ |- ^- sole-effect:shoe
+ :- %mor
+ %+ turn contents
+ |= =content:post
+ ^- sole-effect:shoe
+ ?- -.content
+ %text txt+(trip text.content)
+ %url url+url.content
+ %reference txt+"[reference to msg in {~(phat tr resource.uid.content)}]"
::
- %url
- url+url.letter
+ %mention
+ ?. =(ship.content our-self) txt+(scow %p ship.content)
+ :- %mor
+ :- klr+[[`%br ~ ~]^(scow %p ship.content)]~ ::TODO inline
+ ?.(notify ~ [%bel ~]~)
::
%code
- =/ texp=tape ['>' ' ' (trip expression.letter)]
- :- %mor
- |- ^- (list sole-effect)
- ?: =("" texp) [tan+output.letter ~]
- =/ newl (find "\0a" texp)
- ?~ newl [txt+texp $(texp "")]
- =+ (trim u.newl texp)
- :- txt+(scag u.newl texp)
- $(texp [' ' ' ' (slag +(u.newl) texp)])
+ :- %txt
+ %+ weld (trip expression.content)
+ ?: =(~ output.content) ~
+ :- '\0a'
+ ~(ram re (snag 0 output.content))
==
- :: +render-inline: produces lines to display message body in scrollback
- ::
- ++ render-inline
- ^- (list tape)
- =/ wyd
- :: termwidth,
- %+ sub width
- :: minus autor,
- %+ add 14
- :: minus timestamp.
- ?:((~(has in settings) %showtime) 10 0)
- =+ txs=(line wyd)
- ?~ txs ~
- :: nom: rendered author
- :: den: regular indent
- :: tam: timestamp, if desired
- ::
- =/ nom=tape (nome author)
- =/ den=tape (reap (lent nom) ' ')
- =/ tam=tape
- ?. (~(has in settings) %showtime) ""
- =. when
- %. [when (mul q.timez ~h1)]
- ?:(p.timez add sub)
- =+ dat=(yore when)
- =/ t
- |= a/@
- %+ weld
- ?:((lth a 10) "0" ~)
- (scow %ud a)
- =/ time
- ;: weld
- "~" (t h.t.dat)
- "." (t m.t.dat)
- "." (t s.t.dat)
- ==
- %+ weld
- (reap (sub +(wyd) (min wyd (lent (tuba i.txs)))) ' ')
- time
- %- flop
- %+ roll `(list tape)`txs
- |= [t=tape l=(list tape)]
- ?~ l [:(weld nom t tam) ~]
- [(weld den t) l]
:: +nome: prints a ship name in 14 characters, left-padding with spaces
::
++ nome
@@ -1294,91 +1207,6 @@
^- tape
=+ raw=(cite:title ship)
(runt [(sub 14 (lent raw)) ' '] raw)
- :: +line: renders most important contents, tries to fit one line
- ::
- ::TODO this should probably be rewritten someday
- ++ line
- :: pre: replace/append line prefix
- ::
- =| pre=(unit (pair ? tape))
- |= wyd=@ud
- ^- (list tape)
- ?- -.letter
- %code
- =+ texp=(trip expression.letter)
- =+ newline=(find "\0a" texp)
- =? texp ?=(^ newline)
- (weld (scag u.newline texp) " ...")
- :- (truncate wyd '#' ' ' texp)
- ?~ output.letter ~
- =- [' ' (truncate (dec wyd) ' ' -)]~
- ~(ram re (snag 0 `(list tank)`output.letter))
- ::
- %url
- :_ ~
- =+ ful=(trip url.letter)
- =+ pef=q:(fall pre [p=| q=""])
- :: clean up prefix if needed.
- =? pef =((scag 1 (flop pef)) " ")
- (scag (dec (lent pef)) pef)
- =. pef (weld "/" pef)
- =. wyd (sub wyd +((lent pef))) :: account for prefix.
- :: if the full url fits, just render it.
- ?: (gte wyd (lent ful)) :(weld pef " " ful)
- :: if it doesn't, prefix with _ and render just (the tail of) the domain.
- %+ weld (weld pef "_")
- =+ prl=(rust ful aurf:de-purl:html)
- ?~ prl (weld (scag (dec wyd) ful) "…")
- =+ hok=r.p.p.u.prl
- =- (swag [a=(sub (max wyd (lent -)) wyd) b=wyd] -)
- ^- tape
- =< ?: ?=(%& -.hok)
- (reel p.hok .)
- +:(scow %if p.hok)
- |= [a=knot b=tape]
- ?~ b (trip a)
- (welp b '.' (trip a))
- ::
- ?(%text %me)
- :: glyph prefix
- =/ pef=tape
- ?: &(?=(^ pre) p.u.pre) q.u.pre
- ?: ?=(%me -.letter) " "
- =- (weld - q:(fall pre [p=| q=" "]))
- ~(glyph tr source)
- =/ lis=(list tape)
- %+ simple-wrap
- =/ result=(each tape tang)
- %- mule |.
- `(list @)`(tuba (trip +.letter))
- ?- -.result
- %& p.result
- %| "[[msg rendering error]]"
- ==
- (sub wyd (min (div wyd 2) (lent pef)))
- =+ lef=(lent pef)
- =+ ?:((gth (lent lis) 0) (snag 0 lis) "")
- :- (weld pef -)
- %+ turn (slag 1 lis)
- |=(a=tape (runt [lef ' '] a))
- ==
- :: +truncate: truncate txt to fit len, indicating truncation with _ or …
- ::
- ++ truncate
- |= [len=@u txt=tape]
- ^- tape
- ?: (gth len (lent txt)) txt
- =. txt (scag len txt)
- |-
- ?~ txt txt
- ?: =(' ' i.txt)
- |-
- :- '_'
- ?. ?=([%' ' *] t.txt)
- t.txt
- $(txt t.txt)
- ?~ t.txt "…"
- [i.txt $(txt t.txt)]
--
::
++ simple-wrap
diff --git a/pkg/arvo/app/chat-hook.hoon b/pkg/arvo/app/chat-hook.hoon
index 340d1e6c1..622ce9227 100644
--- a/pkg/arvo/app/chat-hook.hoon
+++ b/pkg/arvo/app/chat-hook.hoon
@@ -1,73 +1,35 @@
:: chat-hook [landscape]:
-:: mirror chat data from foreign to local based on read permissions
+:: mirror chat data from foreign to local based on read
:: allow sending chat messages to foreign paths based on write perms
::
-/- *permission-store, inv=invite-store, *metadata-store,
- *permission-hook, *group-store, *permission-group-hook, ::TMP for upgrade
- hook=chat-hook,
- view=chat-view,
- *group
-/+ default-agent, verb, dbug, store=chat-store, group-store, grpl=group,
- resource
-~% %chat-hook-top ..is ~
+/- inv=invite-store, *metadata-store, *group-store,
+ hook=chat-hook, *group, push-hook, pull-hook, store=chat-store
+/+ default-agent, verb, dbug, group-store, grpl=group,
+ resource, graph-store, *migrate
|%
+$ card card:agent:gall
::
+$ versioned-state
- $% state-0
- state-1
- state-2
- state-3
- state-4
- state-5
- state-6
- state-7
- state-8
- state-9
- state-10
+ $% state-10
+ state-11
==
::
++$ migration-state (map resource @ud)
++$ state-11 [%11 state-base migrate=migration-state]
+$ state-10 [%10 state-base]
-+$ state-9 [%9 state-base]
-+$ state-8 [%8 state-base]
-+$ state-7 [%7 state-base]
-+$ state-6 [%6 state-base]
-+$ state-5 [%5 state-base]
-+$ state-4 [%4 state-base]
-+$ state-3 [%3 state-base]
-+$ state-2 [%2 state-base]
-::
-+$ state-1
- $: %1
- loaded-cards=*
- state-base
- ==
-+$ state-0 [%0 state-base]
+$ state-base
$: =synced:hook
invite-created=_|
allow-history=(map path ?)
==
-::
-+$ poke
- $% [%chat-action action:store]
- [%permission-action permission-action]
- [%invite-action action:inv]
- [%chat-view-action action:view]
- ==
-::
-+$ fact
- $% [%chat-update update:store]
- ==
--
-=| state-10
+=| state-11
=* state -
::
%- agent:dbug
%+ verb |
^- agent:gall
=<
- ~% %chat-hook-agent-core ..poke-json ~
|_ bol=bowl:gall
+* this .
chat-core +>
@@ -77,10 +39,7 @@
++ on-init
^- (quip card _this)
:_ this(invite-created %.y)
- :~ (invite-poke:cc [%create %chat])
- [%pass /invites %agent [our.bol %invite-store] %watch /invitatory/chat]
- watch-groups:cc
- ==
+ [(invite-poke:cc [%create %chat]) ~]
++ on-save !>(state)
++ on-load
|= old-vase=vase
@@ -89,950 +48,179 @@
=/ old !<(versioned-state old-vase)
=| cards=(list card)
|-
- ?: ?=(%10 -.old)
+ ?: ?=(%11 -.old)
[cards this(state old)]
- ?: ?=(%9 -.old)
- =. cards
- :_ cards
- [%pass /self-poke %agent [our.bol %chat-hook] %poke %noun !>(%run-upg9)]
- $(-.old %10)
- ?: ?=(%8 -.old)
- $(-.old %9)
- ?: ?=(%7 -.old)
- =. cards
- :_ cards
- [%pass /self-poke %agent [our.bol %chat-hook] %poke %noun !>(%run-upg7)]
- $(-.old %8)
- ?: ?=(%6 -.old)
- =. cards
- %+ weld cards
- ^- (list card)
- [%pass /s %agent [our.bol %chat-hook] %poke %noun !>(%fix-out-of-sync)]~
- $(-.old %7)
- ?: ?=(?(%3 %4 %5) -.old)
- =. cards
- %+ weld cards
- ^- (list card)
- [%pass /pokeme %agent [our.bol %chat-hook] %poke %noun !>(%fix-dm)]~
- $(-.old %6)
- ?: ?=(%2 -.old)
- =. cards
- %+ weld cards
- :~ watch-groups:cc
- [%pass /permissions %agent [our.bol %permission-store] %leave ~]
- ==
- =^ new-cards=(list card) old
- =| crds=(list card)
- =/ syncs
- ~(tap by synced.old)
- |-
- ?~ syncs
- [crds old]
- =/ [pax=path =ship]
- i.syncs
- ?> ?=(^ pax)
- ?. =('~' i.pax)
- $(syncs t.syncs)
- =/ new-path=path
- t.pax
- =. synced.old
- (~(del by synced.old) pax)
- ?. =(ship our.bol)
- =. synced.old
- (~(put by synced.old) new-path ship)
- $(syncs t.syncs)
- =/ history=?
- (~(gut by allow-history.old) pax %.y)
- =. allow-history.old
- (~(del by allow-history.old) pax)
- =. allow-history.old
- (~(put by allow-history.old) new-path history)
- =. crds
- %+ weld crds
- :- (add-owned new-path history)
- (kick-old-subs pax)
- $(syncs t.syncs)
- =. cards
- (weld cards new-cards)
- $(-.old %3)
- ::
- ?: ?=(%1 -.old)
- =. cards
- %+ welp cards
- ^- (list card)
- %+ murn ~(tap by wex.bol)
- |= [[=wire =ship =term] *]
- ^- (unit card)
- ?. &(?=([%mailbox *] wire) =(our.bol ship) =(%chat-store term))
- ~
- `[%pass wire %agent [our.bol %chat-store] %leave ~]
- $(old [%2 +>.old])
- :: path structure ugprade logic
- ::
- =/ keys=(set path) (scry:cc (set path) %chat-store /keys)
- %= $
- -.old %2
- ::
- cards
- %- zing
- ^- (list (list card))
- (turn ~(tap in keys) generate-cards)
- ==
- ::
- ++ scry-for
- |* [=mold app=term =path]
- .^ mold
- %gx
- (scot %p our.bol)
- app
- (scot %da now.bol)
- (snoc `^path`path %noun)
- ==
- ::
- ++ kick-old-subs
- |= old-path=path
- ^- (list card)
- ?> ?=(^ old-path)
- ?. =('~' i.old-path)
- ~
- [%give %kick ~[mailbox+old-path] ~]~
- ::
- ++ add-members-group
- |= [=path ships=(set ship)]
- ^- card
- ?> ?=([@ @ ~] path)
- =/ rid=resource
- [(slav %p i.path) i.t.path]
- =- [%pass / %agent [our.bol %group-store] %poke %group-action -]
- !>(`action:group-store`[%add-members rid ships])
- ::
- ++ add-synced
- |= [=ship =path]
- ^- card
- =- [%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action -]
- !>(`action:hook`[%add-synced ship path %.y])
- ::
- ++ add-owned
- |= [=path history=?]
- ^- card
- =- [%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action -]
- !>(`action:hook`[%add-owned path history])
- ::
- ++ generate-cards
- |= old-chat=path
- ^- (list card)
- =/ host=ship (slav %p (snag 0 old-chat))
- =/ new-chat [%'~' old-chat]
- =/ newp=permission (unify-permissions old-chat)
- =/ old-group=path [%chat old-chat]
- %- zing
- :~ :~ (delete-group host (snoc old-group %read))
- (delete-group host (snoc old-group %write))
- ==
- ::
- (create-group new-chat who.newp)
- (hookup-group new-chat kind.newp)
- [(record-group new-chat new-chat)]~
- (recreate-chat host old-chat new-chat)
- ==
- ::
- ++ recreate-chat
- |= [host=ship chat=path new-chat=path]
- ^- (list card)
- =/ old-mailbox=mailbox:store
- (need (scry:cc (unit mailbox:store) %chat-store [%mailbox chat]))
- =* enves envelopes.old-mailbox
- :~ (chat-poke:cc [%delete new-chat])
- (chat-poke:cc [%delete chat])
- (chat-poke:cc [%create new-chat])
- (chat-poke:cc [%messages new-chat enves])
- (chat-poke:cc [%read new-chat])
- %^ make-poke %chat-hook %chat-hook-action
- !> ^- action:hook
- ?: =(our.bol host) [%add-owned new-chat %.y]
- [%add-synced host new-chat %.y]
- ==
- ::
- ++ unify-permissions
- |= chat=path
- ^- permission
- =/ read=(unit permission) (get-permission chat %read)
- =/ write=(unit permission) (get-permission chat %write)
- ?. &(?=(^ read) ?=(^ write))
- ~& [%missing-permission chat read=?=(~ read) write=?=(~ write)]
- [%white [(slav %p (snag 0 chat)) ~ ~]]
- ?+ [kind.u.read kind.u.write] !!
- :: village: exclusive to writers
- ::
- [%white %white] [%white who.u.write]
- ::
- :: channel: merge blacklists
- ::
- [%black %black] [%black (~(uni in who.u.read) who.u.write)]
- ::
- :: journal: exclusive to writers
- ::
- [%black %white] [%white who.u.write]
- ::
- :: mailbox: exclusive to readers
- ::
- [%white %black] [%white who.u.read]
- ==
- ::
- ++ get-permission
- |= [chat=path what=?(%read %write)]
- %^ scry:cc (unit permission)
- %permission-store
- [%permission %chat (snoc chat what)]
- ::
- ++ make-poke
- |= [app=term =mark =vase]
- ^- card
- [%pass /on-load/[app]/[mark] %agent [our.bol app] %poke mark vase]
- ::
- ++ delete-group
- |= [host=ship group=path]
- ^- card
- :: if we host the group, delete it directly
- ::
- ?: =(our.bol host)
- %^ make-poke %group-store
- %group-action
- !> ^- action:group-store
- [%remove-group (de-path:resource group) ~]
- :: else, just delete the sync in the hook
- ::
- %^ make-poke %permission-hook
- %permission-hook-action
- !> ^- permission-hook-action
- [%remove group]
- ::
- ++ create-group
- |= [group=path who=(set ship)]
- ^- (list card)
- =/ rid=resource
- (de-path:resource group)
- :~ %^ make-poke %group-store
- %group-action
- !> ^- action:group-store
- [%add-group rid *invite:policy %.n]
- ::
- %^ make-poke %group-store
- %group-action
- !> ^- action:group-store
- [%add-members rid who]
- ==
- ::
- ++ hookup-group
- |= [group=path =kind]
- ^- (list card)
- :* %^ make-poke %permission-group-hook
- %permission-group-hook-action
- !> ^- permission-group-hook-action
- [%associate group [group^kind ~ ~]]
- ::
- =/ =ship (slav %p (snag 1 group))
- ?. =(our.bol ship) ~
- :_ ~
- %^ make-poke %permission-hook
- %permission-hook-action
- !> ^- permission-hook-action
- [%add-owned group group]
- ==
- ::
- ++ record-group
- |= [group=path chat=path]
- ^- card
- =/ =metadata
- ~| [%weird-chat-path chat]
- %* . *metadata
- title (snag 2 chat)
- date-created now.bol
- creator (slav %p (snag 1 chat))
- ==
- %^ make-poke %metadata-store
- %metadata-action
- !> ^- metadata-action
- [%add group [%chat chat] metadata]
+ =. cards
+ :_ cards
+ =- [%pass /self-poke %agent [our.bol %chat-hook] %poke -]
+ noun+!>(%migrate-graph)
+ $(old [%11 +.old ~])
--
::
++ on-poke
- ~/ %chat-hook-poke
|= [=mark =vase]
^- (quip card _this)
=^ cards state
?+ mark (on-poke:def mark vase)
- %json (poke-json:cc !<(json vase))
- %chat-action (poke-chat-action:cc !<(action:store vase))
%noun
- (poke-noun:cc !<(?(%fix-dm %fix-out-of-sync %run-upg7 %run-upg9) vase))
+ %- poke-noun:cc
+ !< ?(%migrate-graph)
+ vase
::
- %chat-hook-action
- (poke-chat-hook-action:cc !<(action:hook vase))
+ %import
+ ?> (team:title our.bol src.bol)
+ (poke-import:cc q.vase)
==
[cards this]
::
- ++ on-watch
- ~/ %chat-hook-watch
- |= =path
- ^- (quip card _this)
- ?+ path (on-watch:def path)
- [%backlog *] [(watch-backlog:cc t.path) this]
- [%mailbox *] [(watch-mailbox:cc t.path) this]
- [%synced *] [(watch-synced:cc t.path) this]
- ==
+ ++ on-watch on-watch:def
::
++ on-agent
- ~/ %chat-hook-agent
|= [=wire =sign:agent:gall]
^- (quip card _this)
- ?+ -.sign (on-agent:def wire sign)
- %watch-ack
- =^ cards state
- (watch-ack:cc wire p.sign)
- [cards this]
+ |^
+ ?. ?=([%migrate-graph *] wire)
+ `this
+ =/ rid=resource
+ (de-path:resource t.wire)
+ ?. ?=(%watch-ack -.sign)
+ ~| "Expected error, please ignore"
+ (on-agent:def wire sign)
+ ?~ p.sign
+ :_ this(migrate (~(del by migrate) rid))
+ ~[(poke-graph-pull-hook %add entity.rid rid)]
+ =/ nack-count=@ud
+ +((~(gut by migrate) rid 0))
+ ?: (gte nack-count 24)
+ ~& >>> "failed to migrate notebook {} to graph-store"
+ [~ this]
+ :_ this(migrate (~(put by migrate) rid nack-count))
+ =/ wakeup=@da
+ (add now.bol (mul ~s1 (bex (min 19 nack-count))))
+ [%pass wire %arvo %b %wait wakeup]~
::
- %kick
- =^ cards state
- (kick:cc wire)
- [cards this]
- ::
- %fact
- ?+ p.cage.sign (on-agent:def wire sign)
- %chat-update
- =^ cards state
- (fact-chat-update:cc wire !<(update:store q.cage.sign))
- [cards this]
- ::
- %invite-update
- =^ cards state
- (fact-invite-update:cc wire !<(update:inv q.cage.sign))
- [cards this]
- ::
- %group-update
- =^ cards state
- (fact-group-update:cc wire !<(update:group-store q.cage.sign))
- [cards this]
- ==
- ==
+ ++ poke-graph-pull-hook
+ |= =action:pull-hook
+ ^- card
+ =- [%pass / %agent [our.bol %graph-pull-hook] %poke -]
+ pull-hook-action+!>(action)
+ --
::
++ on-leave on-leave:def
++ on-peek on-peek:def
- ++ on-arvo on-arvo:def
+ ++ on-arvo
+ |= [=wire =sign-arvo]
+ ^- (quip card _this)
+ ?+ wire (on-arvo:def wire sign-arvo)
+ [%migrate-graph *]
+ =/ rid=resource
+ (de-path:resource t.wire)
+ ?> ?=([%behn %wake *] sign-arvo)
+ ~? ?=(^ error.sign-arvo)
+ "behn errored in backoff timers, continuing anyway"
+ :_ this
+ ~[(watch-graph:cc rid)]
+ ==
++ on-fail on-fail:def
--
::
-::
-~% %chat-hook-library ..card ~
|_ bol=bowl:gall
++ grp ~(. grpl bol)
+++ watch-graph
+ |= rid=resource
+ ^- card
+ =/ =path
+ (en-path:resource rid)
+ [%pass migrate-graph+path %agent [entity.rid %graph-push-hook] %watch resource+path]
::
++ poke-noun
- |= a=?(%fix-dm %fix-out-of-sync %run-upg7 %run-upg9)
+ |= a=?(%migrate-graph)
^- (quip card _state)
|^
?- a
- %fix-dm [(fix-dm %fix-dm) state]
- %fix-out-of-sync [(fix-out-of-sync %fix-out-of-sync) state]
- %run-upg7 run-7-to-8
- %run-upg9 run-9-to-10
+ %migrate-graph migrate-graph
==
::
- ++ scry-for
- |* [=mold app=term =path]
- .^ mold
- %gx
- (scot %p our.bol)
- app
- (scot %da now.bol)
- (snoc `^path`path %noun)
- ==
- ::
- ++ add-synced
- |= [=ship =path]
+ ++ poke-our
+ |= [app=term =cage]
^- card
- =- [%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action -]
- !>(`action:hook`[%add-synced ship path %.y])
+ [%pass / %agent [our.bol app] %poke cage]
::
- ++ add-owned
- |= [=path history=?]
+ ++ poke-graph-push-hook
+ |= =action:push-hook
^- card
- =- [%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action -]
- !>(`action:hook`[%add-owned path history])
+ (poke-our %graph-push-hook %push-hook-action !>(action))
::
- ++ run-7-to-8
- ^- (quip card _state)
- :_ state
- =/ subscribers=(jug path ship)
- %+ roll ~(val by sup.bol)
- |= [[=ship =path] out=(jug path ship)]
- :: /(mailbox|backlog)/~ship/resource.name
- ::
- ?. ?=([@ @ @ *] path) out
- =/ pax=^path [i.t.path i.t.t.path ~]
- (~(put ju out) pax ship)
- =/ group ~(. grpl bol)
- ^- (list card)
- %+ murn ~(tap in ~(key by synced.state))
+ ++ poke-graph-store
+ |= =update:graph-store
+ ^- card
+ (poke-our %graph-store %graph-update !>(update))
+ ::
+ ++ nobody
+ ^- @p
+ (bex 128)
+ ::
+ ++ path-to-resource
|= =path
- ^- (unit card)
- ?> ?=([@ @ ~] path)
- =/ group-paths (groups-of-chat path)
- ?~ group-paths ~
- =/ members (members-from-path:group i.group-paths)
- ?: (is-managed-path:group i.group-paths) ~
- =/ ships=(set ship) (~(get ju subscribers) path)
- %- some
- =+ [%invite path (~(dif in members) ships)]
- [%pass /inv %agent [our.bol %chat-view] %poke %chat-view-action !>(-)]
+ ^- resource
+ ?. ?=([@ @ ~] path)
+ nobody^(spat path)
+ =/ m-ship=(unit ship)
+ (slaw %p i.path)
+ ?~ m-ship
+ nobody^(spat path)
+ [u.m-ship i.t.path]
::
- ++ run-9-to-10
+ ++ migrate-graph
^- (quip card _state)
- :_
- =/ list-paths=(list path)
- %+ murn ~(tap in ~(key by synced.state))
- |= =app=path
- ^- (unit path)
- ?~ (groups-of-chat app-path)
- `app-path
- ~
- |-
- ?~ list-paths
- state
- =. synced.state (~(del by synced.state) i.list-paths)
- $(list-paths t.list-paths)
- %+ weld
- ^- (list card)
- %+ roll ~(tap in ~(key by wex.bol))
- |= [[=wire =ship =term] out=(list card)]
- ?> ?=([@ *] wire)
- ?. ?&(=(ship our.bol) =(term %chat-hook))
- out
- :_ out
- =- [%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action !>(-)]
- [%remove t.wire]
- =/ chat-keys=(set path) (scry-for (set path) %chat-store [%keys ~])
- ^- (list card)
- %+ turn ~(tap in chat-keys)
- |= =app=path
- ^- card
- ?> ?=([@ @ ~] app-path)
- =/ =ship (slav %p i.app-path)
- ?: =(ship our.bol)
- (add-owned app-path %.y)
- (add-synced ship app-path)
- ::
- ++ fix-out-of-sync
- |= b=%fix-out-of-sync
- ^- (list card)
- %- zing
- %+ turn ~(tap by synced)
- |= [=path host=ship]
- ^- (list card)
- ?: =(host our.bol) ~
- ?> ?=([@ @ ~] path)
- =/ =ship (slav %p i.path)
- :~ =- [%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action -]
- !> ^- action:hook
- [%remove path]
- ::
- =- [%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action -]
- !> ^- action:hook
- [%add-synced ship path %.y]
- ==
- ::
- ++ fix-dm
- |= b=%fix-dm
- ^- (list card)
- %- zing
- %+ turn
+ =/ syncs=(list [=path =ship])
~(tap by synced)
- |= [=path host=ship]
- ^- (list card)
- ?> ?=([@ @ *] path)
- =/ =ship (slav %p i.path)
- ?: =(ship our.bol)
- :: local dm, no need to do cleanup
- ~
- ?: ?=(^ (groups-of-chat path))
- :: correctly initialized, no need to do cleanup
- ::
- ~
- ?. =((end 3 4 i.t.path) 'dm--')
- ~
- :- =- [%pass /fixdm %agent [our.bol %chat-view] %poke %chat-view-action -]
- !> ^- action:view
- [%delete path]
- =/ new-dm /(scot %p our.bol)/(crip (weld "dm--" (trip (scot %p ship))))
- =/ mailbox=(unit mailbox:store) (chat-scry path)
- ?~ mailbox
- ~
- :~ =- [%pass /fixdm %agent [our.bol %chat-view] %poke %chat-view-action -]
- !> ^- action:view
- :* %create
- %- crip
- (zing [(trip (scot %p our.bol)) " <-> " (trip (scot %p ship)) ~])
- ''
- new-dm
- ship+new-dm
- [%invite (silt ~[ship])]
- (silt ~[ship])
- %.y
- %.n
- ==
- ::
- =- [%pass /fixdm %agent [our.bol %chat-store] %poke %chat-action -]
- !> ^- action:store
- [%messages new-dm envelopes.u.mailbox]
+ =| cards=(list card)
+ |-
+ ?~ syncs [cards state]
+ =, i.syncs
+ =/ rid=resource
+ (path-to-resource path)
+ ~& migrating+path
+ ~& to+rid
+ ?: =(nobody entity.rid)
+ %_ $
+ syncs t.syncs
+ ::
+ cards
+ :_ cards
+ %- poke-graph-store
+ :+ %0 now.bol
+ archive-graph+rid
+ ==
+ ?: =(our.bol ship)
+ %_ $
+ cards :_(cards (poke-graph-push-hook %add rid))
+ syncs t.syncs
+ ==
+ %_ $
+ cards :_(cards (watch-graph rid))
+ syncs t.syncs
+ migrate (~(put by migrate) rid 0)
==
--
::
-++ poke-json
- |= jon=json
+++ poke-import
+ |= arc=*
^- (quip card _state)
- (poke-chat-action (action:dejs:store jon))
-::
-++ poke-chat-action
- |= act=action:store
- ^- (quip card _state)
- ?> ?=(%message -.act)
- :: local
- :_ state
- ?: (team:title our.bol src.bol)
- ?. (~(has by synced) path.act)
- ~
- =* letter letter.envelope.act
- =? letter &(?=(%code -.letter) ?=(~ output.letter))
- =/ =hoon (ream expression.letter)
- letter(output (eval:store bol hoon))
- =/ ship (~(got by synced) path.act)
- =/ appl ?:(=(ship our.bol) %chat-store %chat-hook)
- [%pass / %agent [ship appl] %poke %chat-action !>(act)]~
- :: foreign
- =/ ship (~(get by synced) path.act)
- ?~ ship ~
- ?. =(u.ship our.bol) ~
- :: check if write is permitted
- ?. (is-member:grp src.bol (group-from-chat path.act)) ~
- =: author.envelope.act src.bol
- when.envelope.act now.bol
- ==
- [%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]~
-::
-++ poke-chat-hook-action
- |= act=action:hook
- ^- (quip card _state)
- ?- -.act
- %add-owned
- ?> (team:title our.bol src.bol)
- =/ chat-path [%mailbox path.act]
- =/ chat-wire [%store path.act]
- ?: (~(has by synced) path.act) [~ state]
- =: synced (~(put by synced) path.act our.bol)
- allow-history (~(put by allow-history) path.act allow-history.act)
- ==
- :_ state
- :~ [%pass chat-wire %agent [our.bol %chat-store] %watch chat-path]
- [%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
- ==
- ::
- %add-synced
- ?> (team:title our.bol src.bol)
- ?< =(ship.act our.bol)
- ?: (~(has by synced) path.act) [~ state]
- =. synced (~(put by synced) path.act ship.act)
- ?. ask-history.act
- =/ chat-path [%mailbox path.act]
- :_ state
- [%pass chat-path %agent [ship.act %chat-hook] %watch chat-path]~
- =/ mailbox=(unit mailbox:store) (chat-scry path.act)
- =/ chat-history=path
- :- %backlog
- %+ weld path.act
- ?~(mailbox /0 /(scot %ud (lent envelopes.u.mailbox)))
- :_ state
- :~ [%pass chat-history %agent [ship.act %chat-hook] %watch chat-history]
- [%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
- ==
- ::
- %remove
- =/ ship=(unit ship)
- =/ ship (~(get by synced) path.act)
- ?^ ship ship
- =? path.act ?=([%'~' *] path.act) t.path.act
- ?~ path.act ~
- (slaw %p i.path.act)
- ?~ ship
- ~& [dap.bol %unknown-host-cannot-leave path.act]
- [~ state]
- ?: &(!=(u.ship src.bol) ?!((team:title our.bol src.bol)))
- [~ state]
- =. synced (~(del by synced) path.act)
- :_ state
- :* [%give %kick ~[[%mailbox path.act]] ~]
- [%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
- (pull-wire u.ship [%mailbox path.act])
- (pull-wire u.ship [%store path.act])
- (pull-backlog-subscriptions u.ship path.act)
- ==
- ==
-::
-++ watch-synced
- |= pax=path
- ^- (list card)
- ?> (team:title our.bol src.bol)
- [%give %fact ~ %chat-hook-update !>([%initial synced])]~
-::
-++ watch-mailbox
- |= pax=path
- ^- (list card)
- ?> ?=(^ pax)
- ?> (~(has by synced) pax)
- :: check if read is permitted
- ?> (is-member:grp src.bol (group-from-chat pax))
- =/ box (chat-scry pax)
- ?~ box !!
- [%give %fact ~ %chat-update !>([%create pax])]~
-::
-++ watch-backlog
- |= pax=path
- ^- (list card)
- ?> ?=(^ pax)
- =/ last (dec (lent pax))
- =/ backlog-latest=(unit @ud) (rush (snag last `(list @ta)`pax) dem:ag)
- =/ pas `path`(oust [last 1] `(list @ta)`pax)
- ?> ?=([* ^] pas)
- ?> (is-member:grp src.bol (group-from-chat pas))
- =/ envs envelopes:(need (chat-scry pas))
- =/ length (lent envs)
- =/ latest
- ?~ backlog-latest length
- ?: (gth u.backlog-latest length) length
- (sub length u.backlog-latest)
- =. envs (scag latest envs)
- =/ =vase !>([%messages pas 0 latest envs])
- %- zing
- :~ [%give %fact ~ %chat-update !>([%create pas])]~
- ?. ?&(?=(^ backlog-latest) (~(has by allow-history) pas)) ~
- [%give %fact ~ %chat-update vase]~
- [%give %kick [%backlog pax]~ `src.bol]~
- ==
-::
-++ fact-invite-update
- |= [wir=wire fact=update:inv]
- ^- (quip card _state)
- :_ state
- ?+ -.fact ~
- %accepted
- =* resource resource.invite.fact
- =/ =path [(scot %p entity.resource) name.resource ~]
- :_ ~
- %- chat-view-poke
- :^ %join ship.invite.fact
- path
- ?=(~ (chat-scry path))
-==
-::
-++ fact-group-update
- |= [wir=wire =update:group-store]
- ^- (quip card _state)
- :_ state
- ?. ?=(%remove-members -.update)
+ =/ sty=state-11
+ :+ %11
+ :+ (remake-map ;;((tree [path ship]) +<.arc))
+ ;;(? +>-.arc)
+ (remake-map ;;((tree [path ?]) +>+.arc))
~
- =/ =path
- (en-path:resource resource.update)
- =/ chats
- (chats-of-group path)
- %- zing
- %+ turn
- chats
- |= chat=^path
- ^- (list card)
- =/ owner
- (~(get by synced) chat)
- ?~ owner ~
- ?. =(u.owner our.bol)
- ~
- %+ turn
- ~(tap in ships.update)
- |= =ship
- [%give %kick [%mailbox chat]~ `ship]
-::
-++ fact-chat-update
- |= [wir=wire =update:store]
- ^- (quip card _state)
- ?: (team:title our.bol src.bol)
- (handle-local update)
- (handle-foreign update)
-::
-++ handle-local
- |= =update:store
- ^- (quip card _state)
- ?+ -.update [~ state]
- %delete
- ?. (~(has by synced) path.update) [~ state]
- =. synced (~(del by synced) path.update)
- :_ state
- :~ [%pass [%mailbox path.update] %agent [our.bol %chat-store] %leave ~]
- [%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
- ==
- ::
- %message
- :_ state
- [%give %fact [%mailbox path.update]~ %chat-update !>(update)]~
- ::
- %messages
- :_ state
- [%give %fact [%mailbox path.update]~ %chat-update !>(update)]~
- ==
-::
-++ handle-foreign
- |= =update:store
- ^- (quip card _state)
- ?+ -.update [~ state]
- %create
- :_ state
- ?> ?=([* ^] path.update)
- =/ shp (~(get by synced) path.update)
- ?~ shp ~
- ?. =(src.bol u.shp) ~
- [(chat-poke [%create path.update])]~
- ::
- %delete
- ?> ?=([* ^] path.update)
- =/ shp (~(get by synced) path.update)
- ?~ shp [~ state]
- ?. =(u.shp src.bol) [~ state]
- =. synced (~(del by synced) path.update)
- :_ state
- :- (chat-poke [%delete path.update])
- :~ [%pass [%mailbox path.update] %agent [src.bol %chat-hook] %leave ~]
- [%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
- ==
- ::
- %message
- :_ state
- ?> ?=([* ^] path.update)
- =/ shp (~(get by synced) path.update)
- ?~ shp ~
- ?. =(src.bol u.shp) ~
- [(chat-poke [%message path.update envelope.update])]~
- ::
- %messages
- :_ state
- ?> ?=([* ^] path.update)
- =/ shp (~(get by synced) path.update)
- ?~ shp ~
- ?. =(src.bol u.shp) ~
- [(chat-poke [%messages path.update envelopes.update])]~
- ==
-::
-++ kick
- |= wir=wire
- ^- (quip card _state)
- ?: =(wir /permissions)
- :_ state
- [%pass /permissions %agent [our.bol %permission-store] %watch /updates]~
- ::
- ?+ wir !!
- [%groups ~] [~[watch-groups] state]
- ::
- [%store @ *]
- ~& store-kick+wir
- ?: =('~' i.t.wir)
- (migrate-store t.t.wir)
- ?. (~(has by synced) t.wir) [~ state]
- ~& %chat-store-resubscribe
- =/ mailbox=(unit mailbox:store)
- (chat-scry t.wir)
- :_ state
- [%pass wir %agent [our.bol %chat-store] %watch [%mailbox t.wir]]~
- ::
- [%mailbox @ *]
- ~& mailbox-kick+wir
- ?: =('~' i.t.wir)
- (migrate-listen t.t.wir)
- ?. (~(has by synced) t.wir) [~ state]
- ~& %chat-hook-resubscribe
- =/ =ship (~(got by synced) t.wir)
- =/ mailbox=(unit mailbox:store) (chat-scry t.wir)
- =/ chat-history
- %+ welp backlog+t.wir
- ?~(mailbox /0 /(scot %ud (lent envelopes.u.mailbox)))
- :_ state
- [%pass chat-history %agent [ship %chat-hook] %watch chat-history]~
- ::
- [%backlog @ @ *]
- =/ chat=path (oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
- ?: =('~' i.t.wir)
- ?> ?=(^ chat)
- (migrate-listen t.chat)
- ?. (~(has by synced) chat) [~ state]
- =/ =ship
- ?: =('~' i.t.wir)
- (slav %p i.t.t.wir)
- (slav %p i.t.wir)
- =/ =path ?~((chat-scry chat) wir [%mailbox chat])
- :_ state
- [%pass path %agent [ship %chat-hook] %watch path]~
- ==
-++ migrate-listen
- |= =wire
- ^- (quip card _state)
- ~& listen-migrate+wire
- ?> ?=([@ @ ~] wire)
- =/ =ship
- (slav %p i.wire)
- :_ state
- ~[(chat-view-poke %join ship wire %.y)]
-::
-++ migrate-store
- |= =wire
- ^- (quip card _state)
- ~& store-migrate+wire
- (kick store+wire)
-::
-++ watch-ack
- |= [wir=wire saw=(unit tang)]
- ^- (quip card _state)
- ?~ saw [~ state]
- ?+ wir [~ state]
- ::
- [%store @ *]
- ?: =('~' i.t.wir)
- (migrate-store t.t.wir)
- (poke-chat-hook-action %remove t.wir)
- ::
- [%backlog @ @ @ *]
- =/ chat=path (oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
- ?: =(i.t.wir '~')
- ?> ?=(^ chat)
- (migrate-listen t.chat)
- [~ state]
- ==
-::
-++ chat-poke
- |= act=action:store
- ^- card
- [%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]
-::
-++ chat-view-poke
- |= act=action:view
- ^- card
- [%pass / %agent [our.bol %chat-view] %poke %chat-view-action !>(act)]
+ :_ sty
+ :_ ~
+ =- [%pass /self-poke %agent [our.bol %chat-hook] %poke -]
+ noun+!>(%migrate-graph)
::
++ invite-poke
|= =action:inv
^- card
[%pass / %agent [our.bol %invite-store] %poke %invite-action !>(action)]
-::
-++ sec-to-perm
- |= [pax=path =kind]
- ^- permission-action
- [%create pax kind *(set ship)]
-::
-++ chat-scry
- |= pax=path
- ^- (unit mailbox:store)
- %^ scry (unit mailbox:store)
- %chat-store
- [%mailbox pax]
-::
-++ invite-scry
- |= uid=serial:inv
- ^- (unit invite:inv)
- %^ scry (unit invite:inv)
- %invite-store
- /invite/chat/(scot %uv uid)
-::
-++ chats-of-group
- |= =group-path
- ^- (list path)
- :: if metadata-store isn't running yet, we're still in the upgrade ota phase.
- :: we can't get chats from the metadata-store, but can make assumptions
- :: about group path shape, and the chat that would match it.
- ::TODO remove me at some point.
- ::
- ?. .^(? %gu (scot %p our.bol) %metadata-store (scot %da now.bol) ~) ~
- %+ murn
- ^- (list md-resource)
- =; resources
- %~ tap in
- %+ ~(gut by resources)
- group-path
- *(set md-resource)
- .^ (jug path md-resource)
- %gy
- (scot %p our.bol)
- %metadata-store
- (scot %da now.bol)
- /group-indices
- ==
- |= md-resource
- ^- (unit path)
- ?. =(%chat app-name) ~
- `app-path
-::
-++ groups-of-chat
- |= chat=path
- ^- (list group-path)
- :: if metadata-store isn't running yet, we're still in the upgrade ota phase.
- :: we can't get groups from the metadata-store, but can make assumptions
- :: about chat path shape, and the chat that would match it.
- ::TODO remove me at some point.
- ::
- ?. .^(? %gu (scot %p our.bol) %metadata-store (scot %da now.bol) ~) ~
- =; resources
- %~ tap in
- %+ ~(gut by resources)
- [%chat chat]
- *(set group-path)
- .^ (jug md-resource group-path)
- %gy
- (scot %p our.bol)
- %metadata-store
- (scot %da now.bol)
- /resource-indices
- ==
-::
-++ group-from-chat
- |= app-path=path
- ^- group-path
- =/ groups=(list group-path)
- (groups-of-chat app-path)
- ?> ?=(^ groups)
- i.groups
-::
-++ scry
- |* [=mold app=term =path]
- .^ mold
- %gx
- (scot %p our.bol)
- app
- (scot %da now.bol)
- (snoc `^path`path %noun)
- ==
-::
-++ pull-backlog-subscriptions
- |= [target=ship chat=path]
- ^- (list card)
- %+ murn ~(tap by wex.bol)
- |= [[=wire =ship =term] [acked=? =path]]
- ^- (unit card)
- ?. ?& =(ship target)
- ?=([%backlog *] wire)
- =(`1 (find chat wire))
- ==
- ~
- `(pull-wire target wire)
-::
-++ pull-wire
- |= [=ship =wire]
- ^- card
- ?: =(ship our.bol)
- [%pass wire %agent [our.bol %chat-store] %leave ~]
- [%pass wire %agent [ship %chat-hook] %leave ~]
-++ watch-groups
- ^- card
- [%pass /groups %agent [our.bol %group-store] %watch /groups]
--
diff --git a/pkg/arvo/app/chat-store.hoon b/pkg/arvo/app/chat-store.hoon
index 5118babbc..a21211cfc 100644
--- a/pkg/arvo/app/chat-store.hoon
+++ b/pkg/arvo/app/chat-store.hoon
@@ -2,8 +2,10 @@
::
:: data store that holds linear sequences of chat messages
::
-/+ store=chat-store, default-agent, verb, dbug, group-store
-~% %chat-store-top ..is ~
+/- *group, store=chat-store
+/+ default-agent, verb, dbug, group-store,
+ graph-store, resource, *migrate, grpl=group, mdl=metadata
+~% %chat-store-top ..part ~
|%
+$ card card:agent:gall
+$ versioned-state
@@ -11,18 +13,21 @@
state-1
state-2
state-3
+ state-4
==
::
+$ state-0 [%0 =inbox:store]
+$ state-1 [%1 =inbox:store]
+$ state-2 [%2 =inbox:store]
+$ state-3 [%3 =inbox:store]
++$ state-4 [%4 =inbox:store]
+$ admin-action
$% [%trim ~]
+ [%migrate-graph ~]
==
--
::
-=| state-3
+=| state-4
=* state -
::
%- agent:dbug
@@ -47,7 +52,11 @@
|-
^- (quip card _this)
?- -.old
- %3 [cards this(state old)]
+ %4 [cards this(state old)]
+ ::
+ %3
+ =. cards :_(cards (poke-admin %migrate-graph ~))
+ $(old [%4 inbox.old])
::
%2
=/ =inbox:store
@@ -71,6 +80,10 @@
?(%0 %1) $(old (old-to-2 inbox.old))
::
==
+ ++ poke-admin
+ |= =admin-action
+ ^- card
+ [%pass / %agent [our dap]:bowl %poke noun+!>(admin-action)]
::
++ old-to-2
|= =inbox:store
@@ -89,35 +102,12 @@
?> (team:title our.bowl src.bowl)
=^ cards state
?+ mark (on-poke:def mark vase)
- %json (poke-json:cc !<(json vase))
- %chat-action (poke-chat-action:cc !<(action:store vase))
- %noun [~ (poke-noun:cc !<(admin-action vase))]
+ %noun (poke-noun:cc !<(admin-action vase))
+ %import (poke-import:cc q.vase)
==
[cards this]
::
- ++ on-watch
- ~/ %chat-store-watch
- |= =path
- ^- (quip card _this)
- |^
- ?> (team:title our.bowl src.bowl)
- =/ cards=(list card)
- ?+ path (on-watch:def path)
- [%keys ~] (give %chat-update !>([%keys ~(key by inbox)]))
- [%all ~] (give %chat-update !>([%initial inbox]))
- [%updates ~] ~
- [%mailbox @ *]
- ?> (~(has by inbox) t.path)
- (give %chat-update !>([%create t.path]))
- ==
- [cards this]
- ::
- ++ give
- |= =cage
- ^- (list card)
- [%give %fact ~ cage]~
- --
- ::
+ ++ on-watch on-watch:def
++ on-leave on-leave:def
++ on-peek
~/ %chat-store-peek
@@ -139,6 +129,9 @@
?~ mailbox
~
``noun+!>(config.u.mailbox)
+ ::
+ [%x %export ~]
+ ``noun+!>(state)
==
::
++ on-agent on-agent:def
@@ -146,9 +139,10 @@
++ on-fail on-fail:def
--
::
-::
~% %chat-store-library ..card ~
|_ bol=bowl:gall
+++ met ~(. mdl bol)
+++ grp ~(. grpl bol)
::
++ peek-x-envelopes
|= pax=path
@@ -190,8 +184,12 @@
::
++ poke-noun
|= nou=admin-action
- ^- _state
+ ^- (quip card _state)
+ ?: ?=([%migrate-graph ~] nou)
+ :_ state
+ (migrate-inbox inbox)
~& %trimming-chat-store
+ :- ~
%_ state
inbox
%- ~(urn by inbox)
@@ -214,109 +212,12 @@
[[len len] (flop out)]
==
::
-++ poke-json
- |= jon=json
+++ poke-import
+ |= arc=*
^- (quip card _state)
- (poke-chat-action (action:dejs:store jon))
-::
-++ poke-chat-action
- |= =action:store
- ^- (quip card _state)
- ?- -.action
- %create (handle-create action)
- %delete (handle-delete action)
- %read (handle-read action)
- %messages (handle-messages action)
- %message
- ?. =(our.bol author.envelope.action)
- (handle-message action)
- =^ message-moves state (handle-message action)
- =^ read-moves state (handle-read [%read path.action])
- [(weld message-moves read-moves) state]
- ==
-::
-++ handle-create
- |= =action:store
- ^- (quip card _state)
- ?> ?=(%create -.action)
- ?: (~(has by inbox) path.action) [~ state]
- :- (send-diff path.action action)
- state(inbox (~(put by inbox) path.action *mailbox:store))
-::
-++ handle-delete
- |= =action:store
- ^- (quip card _state)
- ?> ?=(%delete -.action)
- =/ mailbox=(unit mailbox:store)
- (~(get by inbox) path.action)
- ?~ mailbox [~ state]
- :- (send-diff path.action action)
- state(inbox (~(del by inbox) path.action))
-::
-++ handle-message
- |= =action:store
- ^- (quip card _state)
- ?> ?=(%message -.action)
- =/ mailbox=(unit mailbox:store)
- (~(get by inbox) path.action)
- ?~ mailbox
- [~ state]
- =. letter.envelope.action (evaluate-letter [author letter]:envelope.action)
- =^ envelope u.mailbox (prepend-envelope u.mailbox envelope.action)
- :_ state(inbox (~(put by inbox) path.action u.mailbox))
- (send-diff path.action action(envelope envelope))
-::
-++ handle-messages
- |= act=action:store
- ^- (quip card _state)
- ?> ?=(%messages -.act)
- =/ mailbox=(unit mailbox:store)
- (~(get by inbox) path.act)
- ?~ mailbox
- [~ state]
- =. envelopes.act (flop envelopes.act)
- =| evaluated-envelopes=(list envelope:store)
- |- ^- (quip card _state)
- ?~ envelopes.act
- :_ state(inbox (~(put by inbox) path.act u.mailbox))
- %+ send-diff path.act
- [%messages path.act 0 (lent evaluated-envelopes) evaluated-envelopes]
- =. letter.i.envelopes.act (evaluate-letter [author letter]:i.envelopes.act)
- =^ envelope u.mailbox (prepend-envelope u.mailbox i.envelopes.act)
- =. evaluated-envelopes [envelope evaluated-envelopes]
- $(envelopes.act t.envelopes.act)
-::
-++ handle-read
- |= act=action:store
- ^- (quip card _state)
- ?> ?=(%read -.act)
- =/ mailbox=(unit mailbox:store) (~(get by inbox) path.act)
- ?~ mailbox
- [~ state]
- =. read.config.u.mailbox length.config.u.mailbox
- :- (send-diff path.act act)
- state(inbox (~(put by inbox) path.act u.mailbox))
-::
-++ evaluate-letter
- |= [author=ship =letter:store]
- ^- letter:store
- =? letter
- ?& ?=(%code -.letter)
- ?=(~ output.letter)
- (team:title our.bol author)
- ==
- =/ =hoon (ream expression.letter)
- letter(output (eval:store bol hoon))
- letter
-::
-++ prepend-envelope
- |= [=mailbox:store =envelope:store]
- ^+ [envelope mailbox]
- =. number.envelope +(length.config.mailbox)
- =: length.config.mailbox +(length.config.mailbox)
- envelopes.mailbox [envelope envelopes.mailbox]
- ==
- [envelope mailbox]
+ =/ sty=state-4 [%4 (remake-map ;;((tree [path mailbox:store]) +.arc))]
+ :_ sty
+ (migrate-inbox inbox.sty)
::
++ update-subscribers
|= [pax=path =update:store]
@@ -336,4 +237,98 @@
~
(update-subscribers /keys upd)
==
+::
+++ migrate-inbox
+ |= =inbox:store
+ ^- (list card)
+ %- zing
+ (turn ~(tap by inbox) mailbox-to-updates)
+::
+++ add-graph
+ |= [rid=resource =mailbox:store]
+ %- poke-graph-store
+ :+ %0 now.bol
+ :+ %add-graph rid
+ :- (mailbox-to-graph mailbox)
+ [`%graph-validator-chat %.y]
+::
+++ archive-graph
+ |= rid=resource
+ %- poke-graph-store
+ [%0 now.bol %archive-graph rid]
+::
+++ nobody
+ ^- @p
+ (bex 128)
+::
+++ path-to-resource
+ |= =path
+ ^- resource
+ ?. ?=([@ @ ~] path)
+ nobody^(spat path)
+ =/ m-ship=(unit ship)
+ (slaw %p i.path)
+ ?~ m-ship
+ nobody^(spat path)
+ [u.m-ship i.t.path]
+::
+++ mailbox-to-updates
+ |= [=path =mailbox:store]
+ ^- (list card)
+ =/ app-rid=resource
+ (path-to-resource path)
+ =/ group-rid=resource
+ (fall (group-from-app-resource:met %graph app-rid) [nobody %bad-group])
+ =/ group=(unit group)
+ (scry-group:grp group-rid)
+ :- (add-graph app-rid mailbox)
+ ?~ group (archive-graph app-rid)^~
+ ?. &(=(~ members.u.group) hidden.u.group) ~
+ ~& >>> "archiving {}"
+ :~ (archive-graph app-rid)
+ (remove-group group-rid)
+ ==
+::
+++ remove-group
+ |= group=resource
+ ^- card
+ =- [%pass / %agent [our.bol %group-store] %poke -]
+ group-update+!>([%remove-group group ~])
+::
+++ poke-graph-store
+ |= =update:graph-store
+ ^- card
+ [%pass / %agent [our.bol %graph-store] %poke %graph-update !>(update)]
+::
+++ letter-to-contents
+ |= =letter:store
+ ^- (list content:graph-store)
+ :_ ~
+ ?. ?=(%me -.letter)
+ letter
+ [%text narrative.letter]
+::
+++ envelope-to-node
+ |= =envelope:store
+ ^- [atom:graph-store node:graph-store]
+ =/ contents=(list content:graph-store)
+ (letter-to-contents letter.envelope)
+ =/ =index:graph-store
+ [when.envelope ~]
+ =, envelope
+ :- when.envelope
+ :_ [%empty ~]
+ ^- post:graph-store
+ :* author
+ index
+ when
+ contents
+ ~ ~
+ ==
+::
+++ mailbox-to-graph
+ |= =mailbox:store
+ ^- graph:graph-store
+ %+ gas:orm:graph-store *graph:graph-store
+ (turn envelopes.mailbox envelope-to-node)
--
diff --git a/pkg/arvo/app/chat-view.hoon b/pkg/arvo/app/chat-view.hoon
index 168e7c6c0..a2943d4bf 100644
--- a/pkg/arvo/app/chat-view.hoon
+++ b/pkg/arvo/app/chat-view.hoon
@@ -1,570 +1,35 @@
-:: chat-view [landscape]:
+:: chat-view [landscape]: deprecated
::
-:: sets up chat JS client, paginates data, and combines commands
-:: into semantic actions for the UI
-::
-/- *permission-store,
- *permission-hook,
- *group,
- inv=invite-store,
- *metadata-store,
- group-hook,
- *permission-group-hook,
- *chat-hook,
- *metadata-hook,
- hook=chat-hook,
- contact-view,
- pull-hook
-/+ *server, default-agent, verb, dbug,
- store=chat-store,
- view=chat-view,
- group-store,
- grpl=group,
- resource,
- mdl=metadata
-::
-~% %chat-view-top ..is ~
+/+ default-agent
|%
-+$ versioned-state
- $% state-0
- ==
-::
-+$ state-0
- $: %0
- ~
- ==
-+$ poke
- $% [%chat-action action:store]
- [%group-action action:group-store]
- [%chat-hook-action action:hook]
- [%permission-hook-action permission-hook-action]
- [%permission-group-hook-action permission-group-hook-action]
- ==
-::
+$ card card:agent:gall
--
::
-=| state-0
-=* state -
-::
-%+ verb |
-%- agent:dbug
^- agent:gall
-=<
- ~% %chat-view-agent-core ..poke-handle-http-request ~
- |_ bol=bowl:gall
- +* this .
- chat-core +>
- cc ~(. chat-core bol)
- def ~(. (default-agent this %|) bol)
- ::
- ++ on-init
- ^- (quip card _this)
- :_ this
- :~ :* %pass /srv %agent [our.bol %file-server]
- %poke %file-server-action
- !>([%serve-dir /'~chat' /app/landscape %.n %.y])
- ==
- [%pass / %arvo %e %connect [~ /'chat-view'] %chat-view]
- [%pass /updates %agent [our.bol %chat-store] %watch /updates]
- ==
- ::
- ++ on-poke
- ~/ %chat-view-poke
- |= [=mark =vase]
- ^- (quip card _this)
- ?> (team:title our.bol src.bol)
- ?+ mark (on-poke:def mark vase)
- %handle-http-request
- =+ !<([eyre-id=@ta =inbound-request:eyre] vase)
- :_ this
- %+ give-simple-payload:app eyre-id
- %+ require-authorization:app inbound-request
- poke-handle-http-request:cc
- ::
- %json
- :_ this
- (poke-chat-view-action:cc (action:dejs:view !<(json vase)))
- ::
- %chat-view-action
- :_ this
- (poke-chat-view-action:cc !<(action:view vase))
- ==
- ::
- ++ on-watch
- ~/ %chat-view-watch
- |= =path
- ^- (quip card _this)
- ?> (team:title our.bol src.bol)
- |^
- ?: ?=([%http-response *] path)
- [~ this]
- ?: =(/primary path)
- :: create inbox with 20 messages max per mailbox and send that along
- :: then quit the subscription
- :_ this
- [%give %fact ~ %json !>((update:enjs:store [%initial truncated-inbox]))]~
- (on-watch:def path)
- ::
- ++ message-limit 20
- ::
- ++ truncated-inbox
- ^- inbox:store
- =/ =inbox:store
- =/ our (scot %p our.bol)
- =/ now (scot %da now.bol)
- .^(inbox:store %gx /[our]/chat-store/[now]/all/noun)
- %- ~(run by inbox)
- |= =mailbox:store
- ^- mailbox:store
- [config.mailbox (scag message-limit envelopes.mailbox)]
- --
- ::
- ++ on-agent
- ~/ %chat-view-agent
- |= [=wire =sign:agent:gall]
- ^- (quip card _this)
- ?+ -.sign (on-agent:def wire sign)
- %poke-ack
- ?. ?=([%join-group @ @ @ @ @ ~] wire)
- (on-agent:def wire sign)
- ?^ p.sign
- (on-agent:def wire sign)
- =/ =ship
- (slav %p i.t.wire)
- =/ ask-history=?
- =('y' i.t.t.wire)
- =/ rid=resource
- (de-path:resource t.t.t.wire)
- :_ this
- (joined-group:cc rid ship ask-history)
- ::
- %kick
- :_ this
- [%pass / %agent [our.bol %chat-store] %watch /updates]~
- ::
- %fact
- ?+ p.cage.sign (on-agent:def wire sign)
- %chat-update
- :_ this
- (diff-chat-update:cc !<(update:store q.cage.sign))
- ==
- ==
- ::
- ++ on-arvo
- ~/ %chat-view-arvo
- |= [=wire =sign-arvo]
- ^- (quip card _this)
- ?: ?=(%bound +<.sign-arvo) [~ this]
- (on-arvo:def wire sign-arvo)
- ::
- ++ on-save !>(state)
- ++ on-load
- |= old-vase=vase
- ^- (quip card _this)
- =/ old ((soft state-0) q.old-vase)
- ?^ old [~ this]
- :_ this(state [%0 ~])
- :~ [%pass / %arvo %e %disconnect [~ /'~chat']]
- [%pass / %arvo %e %connect [~ /'chat-view'] %chat-view]
- :* %pass /srv %agent [our.bol %file-server]
- %poke %file-server-action
- !>([%serve-dir /'~chat' /app/landscape %.n %.y])
- ==
- ==
- ::
- ++ on-leave on-leave:def
- ++ on-peek on-peek:def
- ++ on-fail on-fail:def
- --
-::
-::
-~% %chat-view-library ..card ~
|_ bol=bowl:gall
-++ grp ~(. grpl bol)
-++ md ~(. mdl bol)
++* this .
+ def ~(. (default-agent this %|) bol)
::
-++ poke-handle-http-request
- |= =inbound-request:eyre
- ^- simple-payload:http
- =+ url=(parse-request-line url.request.inbound-request)
- ?+ site.url not-found:gen
- [%'chat-view' %paginate @t @t *]
- =/ start (need (rush i.t.t.site.url dem))
- =/ end (need (rush i.t.t.t.site.url dem))
- =/ pax t.t.t.t.site.url
- =/ envelopes (envelope-scry [(scot %ud start) (scot %ud end) pax])
- %- json-response:gen
- %- update:enjs:store
- [%messages pax start end envelopes]
- ==
-::
-++ poke-json
- |= jon=json
- ^- (list card)
- ?> (team:title our.bol src.bol)
- (poke-chat-view-action (action:dejs:view jon))
-::
-++ poke-chat-view-action
- |= act=action:view
- ^- (list card)
- |^
- ?> (team:title our.bol src.bol)
- ?- -.act
- %create
- ?> ?=(^ app-path.act)
- ?> ?| =(+:group-path.act app-path.act)
- =(~(tap in members.act) ~)
- ==
- ?^ (chat-scry app-path.act)
- ~& %chat-already-exists
- ~
- %- zing
- :~ (create-chat app-path.act allow-history.act)
- %- create-group
- :* group-path.act
- app-path.act
- policy.act
- members.act
- title.act
- description.act
- managed.act
- ==
- (create-metadata title.act description.act group-path.act app-path.act)
- ==
- ::
- %delete
- ?> ?=(^ app-path.act)
- :: always just delete the chat from chat-store
- ::
- :+ (chat-hook-poke [%remove app-path.act])
- (chat-poke [%delete app-path.act])
- :: if we still have metadata for the chat, remove it, and the associated
- :: group if it's unmanaged.
- ::
- :: we aren't guaranteed to have metadata: the chat might have been
- :: deleted by the host, which pushes metadata deletion down to us.
- ::
- =/ maybe-group-path
- (maybe-group-from-chat app-path.act)
- ?~ maybe-group-path
- ~
- =* group-path u.maybe-group-path
- =/ rid=resource
- (de-path:resource group-path)
- =/ maybe-group
- (scry-group:grp rid)
- =/ hidden
- ?~ maybe-group
- %.n
- hidden.u.maybe-group
- %- zing
- :~ ?. (is-creator group-path %chat app-path.act)
- ~
- [(metadata-poke [%remove group-path [%chat app-path.act]])]~
- ::
- ?. hidden
- ~
- :~ (group-proxy-poke %remove-members rid (sy our.bol ~))
- (group-poke [%remove-group rid ~])
- (metadata-hook-poke [%remove group-path])
- (metadata-store-poke [%remove group-path [%chat app-path.act]])
- ==
- ==
- ::
- %invite
- =/ =group-path
- (need (maybe-group-from-chat app-path.act))
- =/ rid=resource
- (de-path:resource group-path)
- =/ =group
- (need (scry-group:grp rid))
- ?> ?=(%invite -.policy.group)
- :- (group-poke %change-policy rid %invite %add-invites ships.act)
- %+ turn
- ~(tap in ships.act)
- |= =ship
- (send-invite group-path app-path.act ship)
- ::
- %join
- =/ group-path
- (maybe-group-from-chat app-path.act)
- =/ group
- ?~ group-path
- ~
- (scry-group-path:grp u.group-path)
- ?: &(?=(^ group) =(hidden.u.group %.n))
- ~[(chat-hook-poke %add-synced ship.act app-path.act ask-history.act)]
- =/ rid=resource
- (de-path:resource ship+app-path.act)
- ?: =(our.bol entity.rid) ~
- =/ =cage
- :- %group-update
- !> ^- action:group-store
- [%add-members rid (sy our.bol ~)]
- :: we need this info in the wire to continue the flow after the
- :: poke ack
- =/ =wire
- :- %join-group
- [(scot %p ship.act) ?:(ask-history.act %y %n) ship+app-path.act]
- [%pass wire %agent [entity.rid %group-push-hook] %poke cage]~
- ::
- %groupify
- =* app-path app-path.act
- =/ group-path
- (snag 0 (groups-from-resource:md %chat app-path))
- =/ scry-pax=path
- /metadata/[(scot %t (spat group-path))]/chat/[(scot %t (spat app-path))]
- =/ =metadata
- (need (scry-for (unit metadata) %metadata-store scry-pax))
- =/ old-rid=resource
- (de-path:resource group-path)
- ?< (is-managed:grp old-rid)
- ?~ existing.act
- :: just create contacts object for group
- ~[(contact-view-poke %groupify old-rid title.metadata description.metadata)]
- :: change associations
- =* group-path group-path.u.existing.act
- =/ rid=resource
- (de-path:resource group-path)
- =/ old-group=group
- (need (scry-group:grp old-rid))
- =/ =group
- (need (scry-group:grp rid))
- =/ ships=(set ship)
- (~(dif in members.old-group) members.group)
- :* (metadata-store-poke %remove ship+app-path %chat app-path)
- (metadata-store-poke %add group-path [%chat app-path] metadata)
- (group-poke %remove-group old-rid ~)
- ?. inclusive.u.existing.act
- ~
- :- (group-poke %add-members rid ships)
- %+ turn
- ~(tap in ships)
- |= =ship
- (send-invite group-path app-path ship)
- ==
- ==
- ::
- ++ create-chat
- |= [=path history=?]
- ^- (list card)
- :~ (chat-poke [%create path])
- (chat-hook-poke [%add-owned path history])
- ==
- ::
- ++ create-group
- |= [=path app-path=path =policy ships=(set ship) title=@t desc=@t managed=?]
- ^- (list card)
- ?^ (scry-group-path:grp path) ~
- =/ rid=resource
- (de-path:resource path)
- ?> =(our.bol entity.rid)
- :: do not create a contacts object if this is unmanaged
- ::
- :-
- ?. managed
- (group-poke %add-group rid policy %.y)
- (contact-view-poke %create name.rid policy title desc)
- %+ murn ~(tap in ships)
- |= =ship
- ^- (unit card)
- ?: =(ship our.bol) ~
- `(send-invite path app-path ship)
- ::
- ++ create-metadata
- |= [title=@t description=@t group-path=path app-path=path]
- ^- (list card)
- =/ =metadata
- %* . *metadata
- title title
- description description
- date-created now.bol
- creator
- (slav %p (snag 0 app-path))
+++ on-init
+ ^- (quip card _this)
+ :_ this
+ :~ :* %pass /srv %agent [our.bol %file-server]
+ %poke %file-server-action
+ !>([%serve-dir /'~chat' /app/landscape %.n %.y])
==
- :~ (metadata-poke [%add group-path [%chat app-path] metadata])
- (metadata-hook-poke [%add-owned group-path])
- ==
- ::
- ++ contact-view-poke
- |= act=contact-view-action:contact-view
- ^- card
- [%pass / %agent [our.bol %contact-view] %poke %contact-view-action !>(act)]
- ::
- ++ metadata-poke
- |= act=metadata-action
- ^- card
- [%pass / %agent [our.bol %metadata-hook] %poke %metadata-action !>(act)]
- ::
- ++ metadata-store-poke
- |= act=metadata-action
- ^- card
- [%pass / %agent [our.bol %metadata-store] %poke %metadata-action !>(act)]
- ::
- ++ send-invite
- |= [group-path=path app-path=path =ship]
- ^- card
- =/ managed=?
- !=(ship+app-path group-path)
- =/ =invite:inv
- :* our.bol
- ?:(managed %contact-hook %chat-hook)
- (de-path:resource ?:(managed group-path ship+app-path))
- ship ''
- ==
- =/ act=action:inv
- [%invite ?:(managed %contacts %chat) (shaf %msg-uid eny.bol) invite]
- [%pass / %agent [our.bol %invite-hook] %poke %invite-action !>(act)]
- ::
- ++ chat-scry
- |= pax=path
- ^- (unit mailbox:store)
- =. pax
- ;: weld
- /(scot %p our.bol)/chat-store/(scot %da now.bol)/mailbox
- pax
- /noun
- ==
- .^((unit mailbox:store) %gx pax)
- ::
- ++ maybe-group-from-chat
- |= app-path=path
- ^- (unit path)
- ?. .^(? %gu (scot %p our.bol) %metadata-store (scot %da now.bol) ~)
- ?: ?=([@ ^] app-path)
- ~& [%assuming-ported-legacy-chat app-path]
- `[%'~' app-path]
- ~& [%weird-chat app-path]
- !!
- =/ resource-indices
- .^ (jug md-resource group-path)
- %gy
- (scot %p our.bol)
- %metadata-store
- (scot %da now.bol)
- /resource-indices
- ==
- =/ groups=(set path)
- %+ fall
- (~(get by resource-indices) [%chat app-path])
- *(set path)
- ?~ groups ~
- `n.groups
- ::
- ++ group-from-chat
- (cork maybe-group-from-chat need)
- ::
- ++ is-managed
- |= =path
- ^- ?
- ?> ?=(^ path)
- !=(i.path '~')
- ::
- ++ is-creator
- |= [group-path=path app-name=@ta app-path=path]
- ^- ?
- =/ meta=(unit metadata)
- .^ (unit metadata)
- %gx
- (scot %p our.bol)
- %metadata-store
- (scot %da now.bol)
- %metadata
- (scot %t (spat group-path))
- app-name
- (scot %t (spat app-path))
- /noun
- ==
- ?~ meta !!
- =(our.bol creator.u.meta)
- --
-:: +joined-group: Successfully joined unmanaged group, continue flow
-::
-++ joined-group
- |= [rid=resource =ship ask-history=?]
- ^- (list card)
- =/ =path
- (en-path:resource rid)
- ?> ?=(^ path)
- :~ (group-pull-hook-poke %add ship rid)
- (chat-hook-poke %add-synced ship t.path ask-history)
- (metadata-hook-poke %add-synced ship path)
==
::
-++ diff-chat-update
- |= upd=update:store
- ^- (list card)
- [%give %fact ~[/primary] %json !>((update:enjs:store upd))]~
+++ on-poke on-poke:def
+++ on-watch on-watch:def
+++ on-agent on-agent:def
+++ on-arvo on-arvo:def
+++ on-save !>(~)
+++ on-load
+ |= old-vase=vase
+ ^- (quip card _this)
+ [~ this]
::
-:: +utilities
-::
-++ chat-poke
- |= act=action:store
- ^- card
- [%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]
-::
-++ group-poke
- |= upd=update:group-store
- ^- card
- [%pass / %agent [our.bol %group-store] %poke %group-update !>(upd)]
-++ group-pull-hook-poke
- |= act=action:pull-hook
- ^- card
- [%pass / %agent [our.bol %group-pull-hook] %poke %pull-hook-action !>(act)]
-::
-++ group-proxy-poke
- |= act=action:group-store
- ^- card
- [%pass / %agent [entity.resource.act %group-push-hook] %poke %group-update !>(act)]
-::
-++ permission-poke
- |= act=permission-action
- ^- card
- [%pass / %agent [our.bol %permission-store] %poke %permission-action !>(act)]
-::
-++ chat-hook-poke
- |= act=action:hook
- ^- card
- [%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action !>(act)]
-::
-++ permission-hook-poke
- |= act=permission-hook-action
- ^- card
- :* %pass / %agent [our.bol %permission-hook]
- %poke %permission-hook-action !>(act)
- ==
-::
-++ perm-group-hook-poke
- |= act=permission-group-hook-action
- ^- card
- :* %pass / %agent [our.bol %permission-group-hook]
- %poke %permission-group-hook-action !>(act)
- ==
-::
-++ metadata-hook-poke
- |= act=metadata-hook-action
- ^- card
- :* %pass / %agent
- [our.bol %metadata-hook]
- %poke %metadata-hook-action
- !>(act)
- ==
-::
-++ envelope-scry
- |= pax=path
- ^- (list envelope:store)
- (scry-for (list envelope:store) %chat-store [%envelopes pax])
-::
-
-::
-++ scry-for
- |* [=mold app=term =path]
- .^ mold
- %gx
- (scot %p our.bol)
- app
- (scot %da now.bol)
- (snoc `^path`path %noun)
- ==
+++ on-leave on-leave:def
+++ on-peek on-peek:def
+++ on-fail on-fail:def
--
diff --git a/pkg/arvo/app/claz.hoon b/pkg/arvo/app/claz.hoon
index f1feda1ff..005b7f85a 100644
--- a/pkg/arvo/app/claz.hoon
+++ b/pkg/arvo/app/claz.hoon
@@ -1,9 +1,6 @@
:: claz: command line azimuth, for the power-user
::
-/+ *claz, verb, default-agent
-::
-=, ethereum
-=, azimuth
+/+ *claz, *ethereum, *azimuth, verb, default-agent
::
|%
+$ state-0
diff --git a/pkg/arvo/app/contact-hook.hoon b/pkg/arvo/app/contact-hook.hoon
index 087120183..101e39ad4 100644
--- a/pkg/arvo/app/contact-hook.hoon
+++ b/pkg/arvo/app/contact-hook.hoon
@@ -1,15 +1,21 @@
:: contact-hook [landscape]
::
::
-/- group-hook,
- *contact-hook,
+/- *contact-hook,
*contact-view,
inv=invite-store,
*metadata-hook,
*metadata-store,
*group
-/+ *contact-json, default-agent, dbug, group-store, verb, resource, grpl=group
-~% %contact-hook-top ..is ~
+/+ *contact-json,
+ default-agent,
+ dbug,
+ group-store,
+ verb,
+ resource,
+ grpl=group,
+ *migrate
+~% %contact-hook-top ..part ~
|%
+$ card card:agent:gall
::
@@ -132,6 +138,10 @@
::
%contact-hook-action
(poke-hook-action:cc !<(contact-hook-action vase))
+ ::
+ %import
+ ?> (team:title our.bol src.bol)
+ (poke-import:cc q.vase)
==
[cards this]
::
@@ -170,8 +180,27 @@
==
::
++ on-leave on-leave:def
- ++ on-peek on-peek:def
- ++ on-arvo on-arvo:def
+ ++ on-peek
+ |= =path
+ ^- (unit (unit cage))
+ ?+ path (on-peek:def path)
+ [%x %export ~]
+ ``noun+!>(state)
+ ==
+ ++ on-arvo
+ |= [=wire =sign-arvo]
+ ^- (quip card _this)
+ ?. ?=([%try-rejoin @ @ *] wire)
+ (on-arvo:def wire sign-arvo)
+ =/ nack-count=@ud (slav %ud i.t.wire)
+ =/ who=@p (slav %p i.t.t.wire)
+ =/ pax t.t.t.wire
+ ?> ?=([%behn %wake *] sign-arvo)
+ ~? ?=(^ error.sign-arvo)
+ "behn errored in backoff timers, continuing anyway"
+ :_ this
+ [(try-rejoin:cc who pax +(nack-count))]~
+ ::
++ on-fail on-fail:def
--
::
@@ -260,6 +289,27 @@
==
==
::
+++ poke-import
+ |= arc=*
+ ^- (quip card _state)
+ =/ sty=state-three
+ [%3 (remake-map ;;((tree [path ship]) +<.arc)) ;;(? +>.arc)]
+ :_ sty
+ %+ turn ~(tap by synced.sty)
+ |= [=path =ship]
+ ^- card
+ =/ contact-path [%contacts path]
+ ?: =(our.bol ship)
+ [%pass contact-path %agent [our.bol %contact-store] %watch contact-path]
+ (try-rejoin ship contact-path 0)
+::
+++ try-rejoin
+ |= [who=@p pax=path nack-count=@ud]
+ ^- card
+ =/ =wire
+ [%try-rejoin (scot %ud nack-count) (scot %p who) pax]
+ [%pass wire %agent [who %contact-hook] %watch pax]
+::
++ watch-contacts
|= pax=path
^- (list card)
@@ -282,6 +332,13 @@
^- (quip card _state)
?~ saw
[~ state]
+ ?: ?=([%try-rejoin @ *] wir)
+ =/ nack-count=@ud (slav %ud i.t.wir)
+ =/ wakeup=@da
+ (add now.bol (mul ~s1 (bex (min 19 nack-count))))
+ :_ state
+ [%pass wir %arvo %b %wait wakeup]~
+ ::
?> ?=(^ wir)
[~ state(synced (~(del by synced) t.wir))]
::
@@ -295,6 +352,9 @@
|= wir=wire
^- (list card)
?+ wir !!
+ [%try-rejoin @ @ *]
+ $(wir t.t.t.wir)
+ ::
[%inv ~]
[%pass /inv %agent [our.bol %invite-store] %watch /invitatory/contacts]~
::
diff --git a/pkg/arvo/app/contact-store.hoon b/pkg/arvo/app/contact-store.hoon
index 6089cae80..7f4323a64 100644
--- a/pkg/arvo/app/contact-store.hoon
+++ b/pkg/arvo/app/contact-store.hoon
@@ -2,7 +2,7 @@
::
:: data store that holds group-based contact data
::
-/+ *contact-json, default-agent, dbug
+/+ *contact-json, default-agent, dbug, *migrate
|%
+$ card card:agent:gall
+$ versioned-state
@@ -121,8 +121,12 @@
?> (team:title our.bowl src.bowl)
=^ cards state
?+ mark (on-poke:def mark vase)
- ::%json (poke-json:cc !<(json vase))
- %contact-action (poke-contact-action:cc !<(contact-action vase))
+ ::%json (poke-json:cc !<(json vase))
+ %contact-action
+ (poke-contact-action:cc !<(contact-action vase))
+ ::
+ %import
+ (poke-import:cc q.vase)
==
[cards this]
::
@@ -169,6 +173,9 @@
?~ contacts
~
``noun+!>((~(get by u.contacts) ship))
+ ::
+ [%x %export ~]
+ ``noun+!>(state)
==
::
++ on-agent on-agent:def
@@ -197,6 +204,15 @@
%edit (handle-edit +.action)
==
::
+++ poke-import
+ |= arc=*
+ ^- (quip card _state)
+ =/ sty=state-three
+ :- %3
+ %- remake-map-of-map
+ ;;((tree [path (tree [ship contact])]) +.arc)
+ [~ sty]
+::
++ handle-create
|= =path
^- (quip card _state)
diff --git a/pkg/arvo/app/contact-view.hoon b/pkg/arvo/app/contact-view.hoon
index 2abbbb0f6..8b0a0d22c 100644
--- a/pkg/arvo/app/contact-view.hoon
+++ b/pkg/arvo/app/contact-view.hoon
@@ -4,13 +4,10 @@
:: into semantic actions for the UI
::
/-
- group-hook,
inv=invite-store,
*contact-hook,
*metadata-store,
*metadata-hook,
- *permission-group-hook,
- *permission-hook,
pull-hook,
push-hook
/+ *server, *contact-json, default-agent, dbug, verb,
@@ -181,22 +178,7 @@
~[(add-pending rid ship.act)]
::
%delete
- =/ rid=resource
- (de-path:resource path.act)
- =/ group-pokes=(list card)
- ?: =(our.bol entity.rid)
- ~[(group-push-poke %remove rid)]
- :~ (group-proxy-poke %remove-members rid (sy our.bol ~))
- (group-pull-poke %remove rid)
- ==
- ;: weld
- group-pokes
- :~ (contact-hook-poke [%remove path.act])
- (group-poke [%remove-group rid ~])
- (contact-poke [%delete path.act])
- ==
- (delete-metadata path.act)
- ==
+ ~
::
%remove
=/ rid=resource
@@ -324,20 +306,6 @@
^- card
[%pass / %agent [our.bol %metadata-hook] %poke %metadata-hook-action !>(act)]
::
-++ perm-group-hook-poke
- |= act=permission-group-hook-action
- ^- card
- :* %pass / %agent [our.bol %permission-group-hook]
- %poke %permission-group-hook-action !>(act)
- ==
-::
-++ permission-hook-poke
- |= act=permission-hook-action
- ^- card
- :* %pass / %agent [our.bol %permission-hook]
- %poke %permission-hook-action !>(act)
- ==
-::
++ sync-metadata
|= [=ship =path]
^- card
@@ -357,13 +325,6 @@
(metadata-hook-poke [%add-owned path])
==
::
-++ delete-metadata
- |= =path
- ^- (list card)
- :~ (metadata-poke [%remove path [%contacts path]])
- (metadata-hook-poke [%remove path])
- ==
-::
++ all-scry
^- rolodex
.^(rolodex %gx /(scot %p our.bol)/contact-store/(scot %da now.bol)/all/noun)
diff --git a/pkg/arvo/app/dbug.hoon b/pkg/arvo/app/dbug.hoon
index dd4372c3f..f7132f05f 100644
--- a/pkg/arvo/app/dbug.hoon
+++ b/pkg/arvo/app/dbug.hoon
@@ -66,7 +66,7 @@
++ on-arvo
|= [=wire =sign-arvo]
^- (quip card _this)
- ?. ?=([%e %bound *] sign-arvo)
+ ?. ?=([%eyre %bound *] sign-arvo)
(on-arvo:def wire sign-arvo)
~? !accepted.sign-arvo
[dap.bowl "bind rejected!" binding.sign-arvo]
@@ -362,7 +362,7 @@
(gth expiry-time.a expiry-time.b)
|= [cookie=@uv session:eyre]
%- pairs
- :~ 'cookie'^s+(end 3 4 (rsh 3 2 (scot %x (shax cookie))))
+ :~ 'cookie'^s+(end [3 4] (rsh [3 2] (scot %x (shax cookie))))
'expiry'^(time expiry-time)
'channels'^(numb ~(wyt in channels))
==
diff --git a/pkg/arvo/app/debug/js/index.js b/pkg/arvo/app/debug/js/index.js
index 1d5335d21..7ec1f051e 100644
--- a/pkg/arvo/app/debug/js/index.js
+++ b/pkg/arvo/app/debug/js/index.js
@@ -1 +1 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("buffer")):"function"==typeof define&&define.amd?define("index",["buffer"],t):t((e=e||self).buffer)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},n=t.performance||{},r=(n.now||n.mozNow||n.msNow||n.oNow||n.webkitNow,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{});function i(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,t){return e(t={exports:{}},t.exports),t.exports}var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;var c=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o2?n-2:0),i=2;i1?t-1:0),r=1;r2?n-2:0),i=2;i8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!e){if("undefined"!=typeof console){var o=r.map(function(e){return""+e});o.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,o)}try{var a=0,l="Warning: "+t.replace(/%s/g,function(){return r[a++]});throw new Error(l)}catch(e){}}},M={};function N(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",i=r+"."+t;M[i]||(C(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,r),M[i]=!0)}var P={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){N(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){N(e,"replaceState")},enqueueSetState:function(e,t,n,r){N(e,"setState")}},R={};function O(e,t,n){this.props=e,this.context=t,this.refs=R,this.updater=n||P}Object.freeze(R),O.prototype.isReactComponent={},O.prototype.setState=function(e,t){!function(){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw T(Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."))}(),this.updater.enqueueSetState(this,e,t,"setState")},O.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var D={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},A=function(e,t){Object.defineProperty(O.prototype,e,{get:function(){S(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var I in D)D.hasOwnProperty(I)&&A(I,D[I]);function U(){}function j(e,t,n){this.props=e,this.context=t,this.refs=R,this.updater=n||P}U.prototype=O.prototype;var z=j.prototype=new U;z.constructor=j,t(z,O.prototype),z.isPureReactComponent=!0;var L={current:null},F={suspense:null},W={current:null},B=/^(.*)[\\\/]/,Y=1;function H(e){if(null==e)return null;if("number"==typeof e.tag&&C(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case o:return"Portal";case u:return"Profiler";case l:return"StrictMode";case p:return"Suspense";case m:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case f:return"Context.Consumer";case s:return"Context.Provider";case h:return r=e,i=e.render,c="ForwardRef",d=i.displayName||i.name||"",r.displayName||(""!==d?c+"("+d+")":c);case g:return H(e.type);case v:var t=(n=e)._status===Y?n._result:null;if(t)return H(t)}var n,r,i,c,d;return null}var $={},V=null;function q(e){V=e}$.getCurrentStack=null,$.getStackAddendum=function(){var e="";if(V){var t=H(V.type),n=V._owner;e+=function(e,t,n){var r="";if(t){var i=t.fileName,o=i.replace(B,"");if(/^index\./.test(o)){var a=i.match(B);if(a){var l=a[1];l&&(o=l.replace(B,"")+"/"+o)}}r=" (at "+o+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(t,V._source,n&&H(n.type))}var r=$.getCurrentStack;return r&&(e+=r()||""),e};var G={ReactCurrentDispatcher:L,ReactCurrentBatchConfig:F,ReactCurrentOwner:W,IsSomeRendererActing:{current:!1},assign:t};t(G,{ReactDebugCurrentFrame:$,ReactComponentTreeHook:{}});var Q,K,Z=function(e,t){if(!e){for(var n=G.ReactDebugCurrentFrame.getStackAddendum(),r=arguments.length,i=new Array(r>2?r-2:0),o=2;o1){for(var c=Array(s),f=0;f.")}return t}(t);if(!xe[n]){xe[n]=!0;var r="";e&&e._owner&&e._owner!==W.current&&(r=" It was passed a child from "+H(e._owner.type)+"."),q(e),Z(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),q(null)}}}function Te(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",u=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,Z(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,u)}var f=re.apply(this,arguments);if(null==f)return f;if(l)for(var d=2;d is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||(r=!0,Z(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}}}),n.Consumer=o,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===g?C(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?C(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&C(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null!=e.defaultProps||null!=e.propTypes)&&C(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:h,render:e}},lazy:function(e){var t,n,r={$$typeof:v,_ctor:e,_status:-1,_result:null};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){Z(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){Z(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},memo:function(e,t){return _e(e)||C(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:g,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return we().useCallback(e,t)},useContext:function(e,t){var n=we();if(void 0!==t&&Z(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?Z(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&Z(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return we().useEffect(e,t)},useImperativeHandle:function(e,t,n){return we().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return we().useDebugValue(e,t)},useLayoutEffect:function(e,t){return we().useLayoutEffect(e,t)},useMemo:function(e,t){return we().useMemo(e,t)},useReducer:function(e,t,n){return we().useReducer(e,t,n)},useRef:function(e){return we().useRef(e)},useState:function(e){return we().useState(e)},Fragment:a,Profiler:u,StrictMode:l,Suspense:p,unstable_SuspenseList:m,createElement:Ce,cloneElement:function(e,n,r){for(var i=function(e,n,r){var i;!function(){if(null==e)throw T(Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+"."))}();var o,a=t({},e.props),l=e.key,u=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=n)for(i in ee(n)&&(u=n.ref,f=W.current),te(n)&&(l=""+n.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),n)X.call(n,i)&&!J.hasOwnProperty(i)&&(void 0===n[i]&&void 0!==o?a[i]=o[i]:a[i]=n[i]);var d=arguments.length-2;if(1===d)a.children=r;else if(d>1){for(var h=Array(d),p=0;p=k},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125M(a,n))void 0!==u&&0>M(u,a)?(e[r]=u,e[l]=n,r=l):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==u&&0>M(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function M(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var N=[],P=[],R=1,O=null,D=3,A=!1,I=!1,U=!1;function j(e){for(var t=S(P);null!==t;){if(null===t.callback)C(P);else{if(!(t.startTime<=e))break;C(P),t.sortIndex=t.expirationTime,T(N,t)}t=S(P)}}function z(e){if(U=!1,j(e),!I)if(null!==S(N))I=!0,n(L);else{var t=S(P);null!==t&&r(z,t.startTime-e)}}function L(e,n){I=!1,U&&(U=!1,i()),A=!0;var a=D;try{for(j(n),O=S(N);null!==O&&(!(O.expirationTime>n)||e&&!o());){var l=O.callback;if(null!==l){O.callback=null,D=O.priorityLevel;var u=l(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?O.callback=u:O===S(N)&&C(N),j(n)}else C(N);O=S(N)}if(null!==O)var s=!0;else{var c=S(P);null!==c&&r(z,c.startTime-n),s=!1}return s}finally{O=null,D=a,A=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var W=a;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=D;D=e;try{return t()}finally{D=n}},t.unstable_next=function(e){switch(D){case 1:case 2:case 3:var t=3;break;default:t=D}var n=D;D=t;try{return e()}finally{D=n}},t.unstable_scheduleCallback=function(e,o,a){var l=t.unstable_now();if("object"==typeof a&&null!==a){var u=a.delay;u="number"==typeof u&&0l?(e.sortIndex=u,T(P,e),null===S(N)&&e===S(P)&&(U?i():U=!0,r(z,u-l))):(e.sortIndex=a,T(N,e),I||A||(I=!0,n(L))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=D;return function(){var n=D;D=t;try{return e.apply(this,arguments)}finally{D=n}}},t.unstable_getCurrentPriorityLevel=function(){return D},t.unstable_shouldYield=function(){var e=t.unstable_now();j(e);var n=S(N);return n!==O&&null!==O&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=x},o=function(){},t.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):k=e>0?Math.floor(1e3/e):33.33};var E=new MessageChannel,T=E.port2;E.port1.onmessage=function(){if(null!==_){var e=t.unstable_now();x=e+k;try{_(!0,e)?T.postMessage(null):(b=!1,_=null)}catch(e){throw T.postMessage(null),e}}else b=!1},e=function(e){_=e,b||(b=!0,T.postMessage(null))},n=function(e,n){w=p(function(){e(t.unstable_now())},n)},r=function(){m(w),w=-1}}function S(e,t){var n=e.length;e.push(t),function(e,t,n){var r=n;for(;;){var i=Math.floor((r-1)/2),o=e[i];if(!(void 0!==o&&N(o,t)>0))return;e[i]=t,e[r]=o,r=i}}(e,t,n)}function C(e){var t=e[0];return void 0===t?null:t}function M(e){var t=e[0];if(void 0!==t){var n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){var r=n,i=e.length;for(;rV){if((V*=2)>$)return console.error("Scheduler Profiling: Event log exceeded maximum size. Don't forget to call `stopLoggingProfilingEvents()`."),void oe();var n=new Int32Array(4*V);n.set(G),q=n.buffer,G=n}G.set(e,t)}}function oe(){var e=q;return V=0,q=null,G=null,Q=0,e}function ae(e,t){L[Y]++,null!==G&&ie([K,t,e.id,e.priorityLevel])}function le(e,t){L[F]=P,L[W]=0,L[Y]--,null!==G&&ie([Z,t,e.id])}function ue(e,t){L[F]=P,L[W]=0,L[B]=0,null!==G&&ie([te,t,e.id,U])}var se=-1,ce=250,fe=5e3,de=1e4,he=1073741823,pe=[],me=[],ge=1,ve=null,ye=D,be=!1,_e=!1,we=!1;function ke(e){for(var t=C(me);null!==t;){if(null===t.callback)M(me);else{if(!(t.startTime<=e))return;M(me),t.sortIndex=t.expirationTime,S(pe,t),ae(t,e),t.isQueued=!0}t=C(me)}}function xe(t){if(we=!1,ke(t),!_e)if(null!==C(pe))_e=!0,e(Ee);else{var r=C(me);null!==r&&n(xe,r.startTime-t)}}function Ee(e,n){var i;i=n,null!==G&&ie([re,i,j]),_e=!1,we&&(we=!1,r()),be=!0;var o=ye;try{if(!l)return Te(e,n);try{return Te(e,n)}catch(e){if(null!==ve){var a=t.unstable_now();!function(e,t){L[F]=P,L[W]=0,L[Y]--,null!==G&&ie([X,t,e.id])}(ve,a),ve.isQueued=!1}throw e}}finally{ve=null,ye=o,be=!1,function(e){j++,null!==G&&ie([ne,e,j])}(t.unstable_now())}}function Te(e,r){var o,l,u=r;for(ke(u),ve=C(pe);null!==ve&&!a&&(!(ve.expirationTime>u)||e&&!i());){var s=ve.callback;if(null!==s){ve.callback=null,ye=ve.priorityLevel;var c=ve.expirationTime<=u;o=ve,l=u,U++,L[F]=o.priorityLevel,L[W]=o.id,L[B]=U,null!==G&&ie([ee,l,o.id,U]);var f=s(c);u=t.unstable_now(),"function"==typeof f?(ve.callback=f,ue(ve,u)):(le(ve,u),ve.isQueued=!1,ve===C(pe)&&M(pe)),ke(u)}else M(pe);ve=C(pe)}if(null!==ve)return!0;var d=C(me);return null!==d&&n(xe,d.startTime-u),!1}function Se(e){switch(e){case R:return se;case O:return ce;case I:return he;case A:return de;case D:default:return fe}}var Ce=o,Me={startLoggingProfilingEvents:function(){V=H,q=new ArrayBuffer(4*V),G=new Int32Array(q),Q=0},stopLoggingProfilingEvents:oe,sharedProfilingBuffer:z};t.unstable_ImmediatePriority=R,t.unstable_UserBlockingPriority=O,t.unstable_NormalPriority=D,t.unstable_IdlePriority=I,t.unstable_LowPriority=A,t.unstable_runWithPriority=function(e,t){switch(e){case R:case O:case D:case A:case I:break;default:e=D}var n=ye;ye=e;try{return t()}finally{ye=n}},t.unstable_next=function(e){var t;switch(ye){case R:case O:case D:t=D;break;default:t=ye}var n=ye;ye=t;try{return e()}finally{ye=n}},t.unstable_scheduleCallback=function(i,o,a){var l,u,s=t.unstable_now();if("object"==typeof a&&null!==a){var c=a.delay;l="number"==typeof c&&c>0?s+c:s,u="number"==typeof a.timeout?a.timeout:Se(i)}else u=Se(i),l=s;var f=l+u,d={id:ge++,callback:o,priorityLevel:i,startTime:l,expirationTime:f,sortIndex:-1,isQueued:!1};return l>s?(d.sortIndex=l,S(me,d),null===C(pe)&&d===C(me)&&(we?r():we=!0,n(xe,l-s))):(d.sortIndex=f,S(pe,d),ae(d,s),d.isQueued=!0,_e||be||(_e=!0,e(Ee))),d},t.unstable_cancelCallback=function(e){e.isQueued&&(function(e,t){L[Y]--,null!==G&&ie([J,t,e.id])}(e,t.unstable_now()),e.isQueued=!1),e.callback=null},t.unstable_wrapCallback=function(e){var t=ye;return function(){var n=ye;ye=t;try{return e.apply(this,arguments)}finally{ye=n}}},t.unstable_getCurrentPriorityLevel=function(){return ye},t.unstable_shouldYield=function(){var e=t.unstable_now();ke(e);var n=C(pe);return n!==ve&&null!==ve&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTimet}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!Be.call(He,e)||!Be.call(Ye,e)&&(We.test(e)?He[e]=!0:(Ye[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function Ze(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Xe(e){e._valueTracker||(e._valueTracker=function(e){var t=Ze(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Je(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ze(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function et(e,t){var n=t.checked;return c({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function tt(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Qe(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function nt(e,t){null!=(t=t.checked)&&Ke(e,"checked",t,!1)}function rt(e,t){nt(e,t);var n=Qe(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ot(e,t.type,n):t.hasOwnProperty("defaultValue")&&ot(e,t.type,Qe(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function it(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ot(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function at(e,t){return e=c({children:void 0},t),(t=function(e){var t="";return T.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function lt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i=t.length))throw U(Error(93));t=t[0]}n=t}null==n&&(n="")}e._wrapperState={initialValue:Qe(n)}}function ct(e,t){var n=Qe(t.value),r=Qe(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ft(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(qe,Ge);Ve[t]=new $e(t,1,!1,e,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(qe,Ge);Ve[t]=new $e(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(qe,Ge);Ve[t]=new $e(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(e){Ve[e]=new $e(e,1,!1,e.toLowerCase(),null,!1)}),Ve.xlinkHref=new $e("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(e){Ve[e]=new $e(e,1,!1,e.toLowerCase(),null,!0)});var dt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function ht(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pt(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ht(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var mt,gt,vt=(gt=function(e,t){if(e.namespaceURI!==dt.svg||"innerHTML"in e)e.innerHTML=t;else{for((mt=mt||document.createElement("div")).innerHTML="",t=mt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return gt(e,t)})}:gt);function yt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function bt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _t={animationend:bt("Animation","AnimationEnd"),animationiteration:bt("Animation","AnimationIteration"),animationstart:bt("Animation","AnimationStart"),transitionend:bt("Transition","TransitionEnd")},wt={},kt={};function xt(e){if(wt[e])return wt[e];if(!_t[e])return e;var t,n=_t[e];for(t in n)if(n.hasOwnProperty(t)&&t in kt)return wt[e]=n[t];return e}Ne&&(kt=document.createElement("div").style,"AnimationEvent"in window||(delete _t.animationend.animation,delete _t.animationiteration.animation,delete _t.animationstart.animation),"TransitionEvent"in window||delete _t.transitionend.transition);var Et=xt("animationend"),Tt=xt("animationiteration"),St=xt("animationstart"),Ct=xt("transitionend"),Mt="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Nt=!1,Pt=[],Rt=null,Ot=null,Dt=null,At=new Map,It=new Map,Ut="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" ");function jt(e,t,n,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:r}}function zt(e,t){switch(e){case"focus":case"blur":Rt=null;break;case"dragenter":case"dragleave":Ot=null;break;case"mouseover":case"mouseout":Dt=null;break;case"pointerover":case"pointerout":At.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":It.delete(t.pointerId)}}function Lt(e,t,n,r,i){return null===e||e.nativeEvent!==i?jt(t,n,r,i):(e.eventSystemFlags|=r,e)}function Ft(e){if(null!==e.blockedOn)return!1;var t=Zn(e.topLevelType,e.eventSystemFlags,e.nativeEvent);return null===t||(e.blockedOn=t,!1)}function Wt(e,t,n){Ft(e)&&n.delete(t)}function Bt(){for(Nt=!1;0this.eventPool.length&&this.eventPool.push(e)}function sn(e){e.eventPool=[],e.getPooled=ln,e.release=un}c(an.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){this.isPersistent=rn},isPersistent:on,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=on,this._dispatchInstances=this._dispatchListeners=null}}),an.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},an.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return c(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=c({},r.Interface,e),n.extend=r.extend,sn(n),n},sn(an);var cn=an.extend({animationName:null,elapsedTime:null,pseudoElement:null}),fn=an.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dn=an.extend({view:null,detail:null}),hn=dn.extend({relatedTarget:null});function pn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var mn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=vn[e])&&!!t[e]}function bn(){return yn}for(var _n=dn.extend({key:function(e){if(e.key){var t=mn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=pn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?gn[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:bn,charCode:function(e){return"keypress"===e.type?pn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?pn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),wn=0,kn=0,xn=!1,En=!1,Tn=dn.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:bn,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=wn;return wn=e.screenX,xn?"mousemove"===e.type?e.screenX-t:0:(xn=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=kn;return kn=e.screenY,En?"mousemove"===e.type?e.screenY-t:0:(En=!0,0)}}),Sn=Tn.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Cn=Tn.extend({dataTransfer:null}),Mn=dn.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:bn}),Nn=an.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),Pn=Tn.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),Rn=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",2],[Et,"animationEnd",2],[Tt,"animationIteration",2],[St,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress","progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[Ct,"transitionEnd",2],["waiting","waiting",2]],On={},Dn={},An=0;An=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=dr(r)}}function pr(){for(var e=window,t=fr();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=fr((e=t.contentWindow).document)}return t}function mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var gr="$",vr="/$",yr="$?",br="$!",_r=null,wr=null;function kr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function xr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Er="function"==typeof setTimeout?setTimeout:void 0,Tr="function"==typeof clearTimeout?clearTimeout:void 0;function Sr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Cr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if(n===gr||n===br||n===yr){if(0===t)return e;t--}else n===vr&&t++}e=e.previousSibling}return null}var Mr=Math.random().toString(36).slice(2),Nr="__reactInternalInstance$"+Mr,Pr="__reactEventHandlers$"+Mr,Rr="__reactContainere$"+Mr;function Or(e){var t=e[Nr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Rr]||n[Nr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Cr(e);null!==e;){if(n=e[Nr])return n;e=Cr(e)}return t}n=(e=n).parentNode}return null}function Dr(e){if(5===e.tag||6===e.tag)return e.stateNode;throw U(Error(33))}function Ar(e){return e[Pr]||null}var Ir=null,Ur=null,jr=null;function zr(){if(jr)return jr;var e,t,n=Ur,r=n.length,i="value"in Ir?Ir.value:Ir.textContent,o=i.length;for(e=0;e=Yr),Vr=String.fromCharCode(32),qr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Gr=!1;function Qr(e,t){switch(e){case"keyup":return-1!==Wr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Kr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Zr=!1;var Xr={eventTypes:qr,extractEvents:function(e,t,n,r,i){var o;if(Br)e:{switch(e){case"compositionstart":var a=qr.compositionStart;break e;case"compositionend":a=qr.compositionEnd;break e;case"compositionupdate":a=qr.compositionUpdate;break e}a=void 0}else Zr?Qr(e,r)&&(a=qr.compositionEnd):"keydown"===e&&229===r.keyCode&&(a=qr.compositionStart);return a?($r&&"ko"!==r.locale&&(Zr||a!==qr.compositionStart?a===qr.compositionEnd&&Zr&&(o=zr()):(Ur="value"in(Ir=i)?Ir.value:Ir.textContent,Zr=!0)),t=Lr.getPooled(a,n,r,i),o?t.data=o:null!==(o=Kr(r))&&(t.data=o),nn(t),o=t):o=null,(e=Hr?function(e,t){switch(e){case"compositionend":return Kr(t);case"keypress":return 32!==t.which?null:(Gr=!0,Vr);case"textInput":return(e=t.data)===Vr&&Gr?null:e;default:return null}}(e,r):function(e,t){if(Zr)return"compositionend"===e||!Br&&Qr(e,t)?(e=zr(),jr=Ur=Ir=null,Zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,ki={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},xi=null,Ei=null,Ti=null,Si=!1;function Ci(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Si||null==xi||xi!==fr(n)?null:("selectionStart"in(n=xi)&&mr(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Ti&&_i(Ti,n)?null:(Ti=n,(e=an.getPooled(ki.select,Ei,e,t)).type="select",e.target=xi,nn(e),e))}var Mi={eventTypes:ki,extractEvents:function(e,t,n,r,i){var o;if(!(o=!(t=i.window===i?i.document:9===i.nodeType?i:i.ownerDocument))){e:{t=er(t),o=H.onSelect;for(var a=0;aPi||(e.current=Ni[Pi],Ni[Pi]=null,Pi--)}function Oi(e,t){Ni[++Pi]=e.current,e.current=t}var Di={},Ai={current:Di},Ii={current:!1},Ui=Di;function ji(e,t){var n=e.type.contextTypes;if(!n)return Di;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function zi(e){return null!=(e=e.childContextTypes)}function Li(e){Ri(Ii),Ri(Ai)}function Fi(e){Ri(Ii),Ri(Ai)}function Wi(e,t,n){if(Ai.current!==Di)throw U(Error(168));Oi(Ai,t),Oi(Ii,n)}function Bi(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Di,Ui=Ai.current,Oi(Ai,t),Oi(Ii,Ii.current),!0}function Yi(e,t,n){var r=e.stateNode;if(!r)throw U(Error(169));n?(t=function(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw U(Error(108),Ce(t)||"Unknown",i);return c({},n,{},r)}(e,t,Ui),r.__reactInternalMemoizedMergedChildContext=t,Ri(Ii),Ri(Ai),Oi(Ai,t)):Ri(Ii),Oi(Ii,n)}var Hi=I.unstable_runWithPriority,$i=I.unstable_scheduleCallback,Vi=I.unstable_cancelCallback,qi=I.unstable_shouldYield,Gi=I.unstable_requestPaint,Qi=I.unstable_now,Ki=I.unstable_getCurrentPriorityLevel,Zi=I.unstable_ImmediatePriority,Xi=I.unstable_UserBlockingPriority,Ji=I.unstable_NormalPriority,eo=I.unstable_LowPriority,to=I.unstable_IdlePriority,no={},ro=void 0!==Gi?Gi:function(){},io=null,oo=null,ao=!1,lo=Qi(),uo=1e4>lo?Qi:function(){return Qi()-lo};function so(){switch(Ki()){case Zi:return 99;case Xi:return 98;case Ji:return 97;case eo:return 96;case to:return 95;default:throw U(Error(332))}}function co(e){switch(e){case 99:return Zi;case 98:return Xi;case 97:return Ji;case 96:return eo;case 95:return to;default:throw U(Error(332))}}function fo(e,t){return e=co(e),Hi(e,t)}function ho(e,t,n){return e=co(e),$i(e,t,n)}function po(e){return null===io?(io=[e],oo=$i(Zi,go)):io.push(e),no}function mo(){if(null!==oo){var e=oo;oo=null,Vi(e)}go()}function go(){if(!ao&&null!==io){ao=!0;var e=0;try{var t=io;fo(99,function(){for(;e=t&&(Ja=!0),e.firstContext=null)}function Co(e,t){if(wo!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(wo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===_o){if(null===bo)throw U(Error(308));_o=t,bo.dependencies={expirationTime:0,firstContext:t,responders:null}}else _o=_o.next=t;return e._currentValue}var Mo=!1;function No(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Po(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Ro(e,t){return{expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Oo(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function Do(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=No(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=No(e.memoizedState),i=n.updateQueue=No(n.memoizedState)):r=e.updateQueue=Po(i):null===i&&(i=n.updateQueue=Po(r));null===i||r===i?Oo(r,t):null===r.lastUpdate||null===i.lastUpdate?(Oo(r,t),Oo(i,t)):(Oo(r,t),i.lastUpdate=t)}function Ao(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=No(e.memoizedState):Io(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function Io(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=Po(t)),t}function Uo(e,t,n,r,i,o){switch(n.tag){case 1:return"function"==typeof(e=n.payload)?e.call(o,r,i):e;case 3:e.effectTag=-4097&e.effectTag|64;case 0:if(null==(i="function"==typeof(e=n.payload)?e.call(o,r,i):e))break;return c({},r,i);case 2:Mo=!0}return r}function jo(e,t,n,r,i){Mo=!1;for(var o=(t=Io(e,t)).baseState,a=null,l=0,u=t.firstUpdate,s=o;null!==u;){var c=u.expirationTime;cm?(g=p,p=null):g=p.sibling;var v=d(i,p,l[m],u);if(null===v){null===p&&(p=g);break}e&&p&&null===v.alternate&&t(i,p),a=o(v,a,m),null===c?s=v:c.sibling=v,c=v,p=g}if(m===l.length)return n(i,p),s;if(null===p){for(;mm?(g=p,p=null):g=p.sibling;var y=d(i,p,v.value,u);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(i,p),a=o(y,a,m),null===c?s=y:c.sibling=y,c=y,p=g}if(v.done)return n(i,p),s;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=f(i,v.value,u))&&(a=o(v,a,m),null===c?s=v:c.sibling=v,c=v);return s}for(p=r(i,p);!v.done;m++,v=l.next())null!==(v=h(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=o(v,a,m),null===c?s=v:c.sibling=v,c=v);return e&&p.forEach(function(e){return t(i,e)}),s}return function(e,r,o,l){var u="object"==typeof o&&null!==o&&o.type===pe&&null===o.key;u&&(o=o.props.children);var s="object"==typeof o&&null!==o;if(s)switch(o.$$typeof){case de:e:{for(s=o.key,u=r;null!==u;){if(u.key===s){if(7===u.tag?o.type===pe:u.elementType===o.type){n(e,u.sibling),(r=i(u,o.type===pe?o.props.children:o.props)).ref=Qo(e,u,o),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}o.type===pe?((r=es(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=Ju(o.type,o.key,o.props,null,e.mode,l)).ref=Qo(e,r,o),l.return=e,e=l)}return a(e);case he:e:{for(u=o.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=ns(o,e.mode,l)).return=e,e=r}return a(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=ts(o,e.mode,l)).return=e,e=r),a(e);if(Go(o))return p(e,r,o,l);if(Se(o))return m(e,r,o,l);if(s&&Ko(e,o),void 0===o&&!u)switch(e.tag){case 1:case 0:throw e=e.type,U(Error(152),e.displayName||e.name||"Component")}return n(e,r)}}var Xo=Zo(!0),Jo=Zo(!1),ea={},ta={current:ea},na={current:ea},ra={current:ea};function ia(e){if(e===ea)throw U(Error(174));return e}function oa(e,t){Oi(ra,t),Oi(na,e),Oi(ta,ea);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pt(null,"");break;default:t=pt(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}Ri(ta),Oi(ta,t)}function aa(e){Ri(ta),Ri(na),Ri(ra)}function la(e){ia(ra.current);var t=ia(ta.current),n=pt(t,e.type);t!==n&&(Oi(na,e),Oi(ta,n))}function ua(e){na.current===e&&(Ri(ta),Ri(na))}var sa={current:0};function ca(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===yr||n.data===br))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if((64&t.effectTag)!==$t)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function fa(e,t){return{responder:e,props:t}}var da=se.ReactCurrentDispatcher,ha=0,pa=null,ma=null,ga=null,va=null,ya=null,ba=null,_a=0,wa=null,ka=0,xa=!1,Ea=null,Ta=0;function Sa(){throw U(Error(321))}function Ca(e,t){if(null===t)return!1;for(var n=0;n_a&&Au(_a=c)):(Du(c,u.suspenseConfig),o=u.eagerReducer===e?u.eagerState:e(o,u.action)),a=u,u=u.next}while(null!==u&&u!==r);s||(l=a,i=o),yi(o,t.memoizedState)||(Ja=!0),t.memoizedState=o,t.baseUpdate=l,t.baseState=i,n.lastRenderedState=o}return[t.memoizedState,n.dispatch]}function Aa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===wa?(wa={lastEffect:null}).lastEffect=e.next=e:null===(t=wa.lastEffect)?wa.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,wa.lastEffect=e),e}function Ia(e,t,n,r){var i=Pa();ka|=e,i.memoizedState=Aa(t,n,void 0,void 0===r?null:r)}function Ua(e,t,n,r){var i=Ra();r=void 0===r?null:r;var o=void 0;if(null!==ma){var a=ma.memoizedState;if(o=a.destroy,null!==r&&Ca(r,a.deps))return void Aa(0,n,o,r)}ka|=e,i.memoizedState=Aa(t,n,o,r)}function ja(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function za(){}function La(e,t,n){if(!(25>Ta))throw U(Error(301));var r=e.alternate;if(e===pa||null!==r&&r===pa)if(xa=!0,e={expirationTime:ha,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===Ea&&(Ea=new Map),void 0===(n=Ea.get(t)))Ea.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{var i=ku(),o=Fo.suspense;o={expirationTime:i=xu(i,e,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var a=t.last;if(null===a)o.next=o;else{var l=a.next;null!==l&&(o.next=l),a.next=o}if(t.last=o,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var u=t.lastRenderedState,s=r(u,n);if(o.eagerReducer=r,o.eagerState=s,yi(s,u))return}catch(e){}Eu(e,i)}}var Fa={readContext:Co,useCallback:Sa,useContext:Sa,useEffect:Sa,useImperativeHandle:Sa,useLayoutEffect:Sa,useMemo:Sa,useReducer:Sa,useRef:Sa,useState:Sa,useDebugValue:Sa,useResponder:Sa},Wa={readContext:Co,useCallback:function(e,t){return Pa().memoizedState=[e,void 0===t?null:t],e},useContext:Co,useEffect:function(e,t){return Ia(516,192,e,t)},useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ia(4,36,ja.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ia(4,36,e,t)},useMemo:function(e,t){var n=Pa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pa();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=La.bind(null,pa,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Pa().memoizedState=e},useState:function(e){var t=Pa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:e}).dispatch=La.bind(null,pa,e),[t.memoizedState,e]},useDebugValue:za,useResponder:fa},Ba={readContext:Co,useCallback:function(e,t){var n=Ra();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Ca(t,r[1])?r[0]:(n.memoizedState=[e,t],e)},useContext:Co,useEffect:function(e,t){return Ua(516,192,e,t)},useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ua(4,36,ja.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ua(4,36,e,t)},useMemo:function(e,t){var n=Ra();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Ca(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:Da,useRef:function(){return Ra().memoizedState},useState:function(e){return Da(Oa)},useDebugValue:za,useResponder:fa},Ya=null,Ha=null,$a=!1;function Va(e,t){var n=Ku(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function qa(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Ga(e){if($a){var t=Ha;if(t){var n=t;if(!qa(e,t)){if(!(t=Sr(n.nextSibling))||!qa(e,t))return e.effectTag=e.effectTag&~qt|Vt,$a=!1,void(Ya=e);Va(Ya,n)}Ya=e,Ha=Sr(t.firstChild)}else e.effectTag=e.effectTag&~qt|Vt,$a=!1,Ya=e}}function Qa(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Ya=e}function Ka(e){if(e!==Ya)return!1;if(!$a)return Qa(e),$a=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!xr(t,e.memoizedProps))for(t=Ha;t;)Va(e,t),t=Sr(t.nextSibling);if(Qa(e),13===e.tag)if(null===(e=null!==(e=e.memoizedState)?e.dehydrated:null))e=Ha;else e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if(n===vr){if(0===t){e=Sr(e.nextSibling);break e}t--}else n!==gr&&n!==br&&n!==yr||t++}e=e.nextSibling}e=null}else e=Ya?Sr(e.stateNode.nextSibling):null;return Ha=e,!0}function Za(){Ha=Ya=null,$a=!1}var Xa=se.ReactCurrentOwner,Ja=!1;function el(e,t,n,r){t.child=null===e?Jo(t,null,n,r):Xo(t,e.child,n,r)}function tl(e,t,n,r,i){n=n.render;var o=t.ref;return So(t,i),r=Ma(e,t,n,r,o,i),null===e||Ja?(t.effectTag|=1,el(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),vl(e,t,i))}function nl(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!=typeof a||Zu(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ju(n.type,null,r,null,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,rl(e,t,a,r,i,o))}return a=e.child,it)&&yu.set(e,t))}}function Tu(e,t){e.expirationTime(e=e.nextKnownPendingLevel)?t:e:t}function Cu(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=po(Mu.bind(null,e));else{var t=Su(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=ku();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==no&&Vi(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?po(Mu.bind(null,e)):ho(r,function e(t,n){wu=0;if(n)return n=ku(),as(t,n),Cu(t),null;var r=Su(t);if(0!==r){if(n=t.callbackNode,(Xl&(Yl|Hl))!==Wl)throw U(Error(327));if(Bu(),t===Jl&&r===tu||Pu(t,r),null!==eu){var i=Xl;Xl|=Yl;for(var o=Ou();;)try{Uu();break}catch(e){Ru(t,e)}if(ko(),Xl=i,Ll.current=o,nu===Vl)throw n=ru,Pu(t,r),is(t,r),Cu(t),n;if(null===eu)switch(o=t.finishedWork=t.current.alternate,t.finishedExpirationTime=r,Nu(t,r),i=nu,Jl=null,i){case $l:case Vl:throw U(Error(345));case ql:if(2!==r){as(t,2);break}Fu(t);break;case Gl:if(is(t,r),i=t.lastSuspendedTime,r===i&&(t.nextKnownPendingLevel=Lu(o)),1073741823===iu&&10<(o=su+cu-uo())){if(uu){var a=t.lastPingedTime;if(0===a||a>=r){t.lastPingedTime=r,Pu(t,r);break}}if(0!==(a=Su(t))&&a!==r)break;if(0!==i&&i!==r){t.lastPingedTime=i;break}t.timeoutHandle=Er(Fu.bind(null,t),o);break}Fu(t);break;case Ql:if(is(t,r),i=t.lastSuspendedTime,r===i&&(t.nextKnownPendingLevel=Lu(o)),uu&&(0===(o=t.lastPingedTime)||o>=r)){t.lastPingedTime=r,Pu(t,r);break}if(0!==(o=Su(t))&&o!==r)break;if(0!==i&&i!==r){t.lastPingedTime=i;break}if(1073741823!==ou?i=10*(1073741821-ou)-uo():1073741823===iu?i=0:(i=10*(1073741821-iu)-5e3,o=uo(),r=10*(1073741821-r)-o,0>(i=o-i)&&(i=0),i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*zl(i/1960))-i,r=(i=0|l.busyMinDurationMs)?i=0:(o=0|l.busyDelayMs,a=uo()-(10*(1073741821-a)-(0|l.timeoutMs||5e3)),i=a<=o?0:o+i-a),10=t&&(ho(97,function(){return n._onComplete(),null}),nu=Zl)}function Pu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Tr(n)),null!==eu)for(n=eu.return;null!==n;){var r=n;switch(r.tag){case 1:var i=r.type.childContextTypes;null!=i&&Li();break;case 3:aa(),Fi();break;case 5:ua(r);break;case 4:aa();break;case 13:case 19:Ri(sa);break;case 10:Eo(r)}n=n.return}Jl=e,eu=Xu(e.current,null),tu=t,nu=$l,ru=null,ou=iu=1073741823,au=null,lu=0,uu=!1}function Ru(e,t){for(;;){try{if(ko(),Na(),null===eu||null===eu.return)return nu=Vl,ru=t,null;e:{var n=e,r=eu.return,i=eu,o=t;if(t=tu,i.effectTag|=2048,i.firstEffect=i.lastEffect=null,null!==o&&"object"==typeof o&&"function"==typeof o.then){var a=o,l=0!=(1&sa.current),u=r;do{var s;if(s=13===u.tag){var c=u.memoizedState;if(null!==c)s=null!==c.dehydrated;else{var f=u.memoizedProps;s=void 0!==f.fallback&&(!0!==f.unstable_avoidThisFallback||!l)}}if(s){var d=u.updateQueue;if(null===d){var h=new Set;h.add(a),u.updateQueue=h}else d.add(a);if(0==(2&u.mode)){if(u.effectTag|=64,i.effectTag&=-2981,1===i.tag)if(null===i.alternate)i.tag=17;else{var p=Ro(1073741823,null);p.tag=2,Do(i,p)}i.expirationTime=1073741823;break e}o=void 0,i=t;var m=n.pingCache;if(null===m?(m=n.pingCache=new Al,o=new Set,m.set(a,o)):void 0===(o=m.get(a))&&(o=new Set,m.set(a,o)),!o.has(i)){o.add(i);var g=Vu.bind(null,n,a,i);a.then(g,g)}u.effectTag|=4096,u.expirationTime=t;break e}u=u.return}while(null!==u);o=Error((Ce(i.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display."+Me(i))}nu!==Kl&&(nu=ql),o=wl(o,i),u=r;do{switch(u.tag){case 3:a=o,u.effectTag|=4096,u.expirationTime=t,Ao(u,Il(u,a,t));break e;case 1:a=o;var v=u.type,y=u.stateNode;if((64&u.effectTag)===$t&&("function"==typeof v.getDerivedStateFromError||null!==y&&"function"==typeof y.componentDidCatch&&(null===pu||!pu.has(y)))){u.effectTag|=4096,u.expirationTime=t,Ao(u,Ul(u,a,t));break e}}u=u.return}while(null!==u)}eu=zu(eu)}catch(e){t=e;continue}break}}function Ou(){var e=Ll.current;return Ll.current=Fa,null===e?Fa:e}function Du(e,t){elu&&(lu=e)}function Iu(){for(;null!==eu;)eu=ju(eu)}function Uu(){for(;null!==eu&&!qi();)eu=ju(eu)}function ju(e){var t=jl(e.alternate,e,tu);return e.memoizedProps=e.pendingProps,null===t&&(t=zu(e)),Fl.current=null,t}function zu(e){eu=e;do{var t=eu.alternate;if(e=eu.return,(2048&eu.effectTag)===$t){e:{var n=t,r=tu,i=(t=eu).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:zi(t.type)&&Li();break;case 3:aa(),Fi(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(null===n||null===n.child)&&Ka(t)&&yl(t),cl(t);break;case 5:ua(t),r=ia(ra.current);var o=t.type;if(null!==n&&null!=t.stateNode)fl(n,t,o,i,r),n.ref!==t.ref&&(t.effectTag|=128);else if(i){var a=ia(ta.current);if(Ka(t)){o=void 0,n=(i=t).stateNode;var l=i.type,u=i.memoizedProps;switch(n[Nr]=i,n[Pr]=u,l){case"iframe":case"object":case"embed":qn("load",n);break;case"video":case"audio":for(var s=0;s<\/script>",s=u.removeChild(u.firstChild)):"string"==typeof n.is?s=s.createElement(u,{is:n.is}):(s=s.createElement(u),"select"===u&&(u=s,n.multiple?u.multiple=!0:n.size&&(u.size=n.size))):s=s.createElementNS(a,u),(u=s)[Nr]=l,u[Pr]=n,sl(n=u,t,!1,!1),t.stateNode=n,a=r;var f=ur(o,i);switch(o){case"iframe":case"object":case"embed":qn("load",n),r=i;break;case"video":case"audio":for(r=0;ri.tailExpiration&&1i&&(i=n),(l=o.childExpirationTime)>i&&(i=l),o=o.sibling;r.childExpirationTime=i}if(null!==t)return t;null!==e&&(2048&e.effectTag)===$t&&(null===e.firstEffect&&(e.firstEffect=eu.firstEffect),null!==eu.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=eu.firstEffect),e.lastEffect=eu.lastEffect),1(e=e.childExpirationTime)?t:e}function Fu(e){var t=so();return fo(99,function(e,t){if(Bu(),(Xl&(Yl|Hl))!==Wl)throw U(Error(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw U(Error(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Lu(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Jl&&(eu=Jl=null,tu=0),1l&&(s=l,l=a,a=s),s=hr(b,a),c=hr(b,l),s&&c&&(1!==w.rangeCount||w.anchorNode!==s.node||w.anchorOffset!==s.offset||w.focusNode!==c.node||w.focusOffset!==c.offset)&&((_=_.createRange()).setStart(s.node,s.offset),w.removeAllRanges(),a>l?(w.addRange(_),w.extend(c.node,c.offset)):(_.setEnd(c.node,c.offset),w.addRange(_))))),_=[];for(w=b;w=w.parentNode;)1===w.nodeType&&_.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<_.length;b++)(w=_[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}wr=null,Vn=!!_r,_r=null,e.current=n,fu=i;do{try{for(b=r;null!==fu;){var k=fu.effectTag;if(36&k){var x=fu.alternate;switch(w=b,(_=fu).tag){case 0:case 11:case 15:Sl(16,32,_);break;case 1:var E=_.stateNode;if(4&_.effectTag)if(null===x)E.componentDidMount();else{var T=_.elementType===_.type?x.memoizedProps:vo(_.type,x.memoizedProps);E.componentDidUpdate(T,x.memoizedState,E.__reactInternalSnapshotBeforeUpdate)}var S=_.updateQueue;null!==S&&zo(0,S,E);break;case 3:var C=_.updateQueue;if(null!==C){if(a=null,null!==_.child)switch(_.child.tag){case 5:a=_.child.stateNode;break;case 1:a=_.child.stateNode}zo(0,C,a)}break;case 5:var M=_.stateNode;null===x&&4&_.effectTag&&(w=M,kr(_.type,_.memoizedProps)&&w.focus());break;case 6:case 4:case 12:break;case 13:if(null===_.memoizedState){var N=_.alternate;if(null!==N){var P=N.memoizedState;if(null!==P){var R=P.dehydrated;null!==R&&Ht(R)}}}break;case 19:case 17:case 20:case 21:break;default:throw U(Error(163))}}if(128&k){var O=(_=fu).ref;if(null!==O){var D=_.stateNode;switch(_.tag){case 5:var A=D;break;default:A=D}"function"==typeof O?O(A):O.current=A}}fu=fu.nextEffect}}catch(e){if(null===fu)throw U(Error(330));$u(fu,e),fu=fu.nextEffect}}while(null!==fu);fu=null,ro(),Xl=o}else e.current=n;if(mu)mu=!1,gu=e,vu=t;else for(fu=i;null!==fu;)t=fu.nextEffect,fu.nextEffect=null,fu=t;if(0===(t=e.firstPendingTime)&&(pu=null),1073741823===t?e===_u?bu++:(bu=0,_u=e):bu=0,"function"==typeof qu&&qu(n.stateNode,r),Cu(e),du)throw du=!1,e=hu,hu=null,e;return(Xl&Bl)!==Wl?null:(mo(),null)}.bind(null,e,t)),null}function Wu(){for(;null!==fu;){var e=fu.effectTag;(256&e)!==$t&&Tl(fu.alternate,fu),(512&e)===$t||mu||(mu=!0,ho(97,function(){return Bu(),null})),fu=fu.nextEffect}}function Bu(){if(90!==vu){var e=97=n?pl(e,t,n):(Oi(sa,1&sa.current),null!==(t=vl(e,t,n))?t.sibling:null);Oi(sa,1&sa.current);break;case 19:if(r=t.childExpirationTime>=n,(64&e.effectTag)!==$t){if(r)return gl(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),Oi(sa,sa.current),!r)return null}return vl(e,t,n)}Ja=!1}}else Ja=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=Vt),e=t.pendingProps,i=ji(t,Ai.current),So(t,n),i=Ma(null,t,r,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,Na(),zi(r)){var o=!0;Bi(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var a=r.getDerivedStateFromProps;"function"==typeof a&&Bo(t,r,a,e),i.updater=Yo,t.stateNode=i,i._reactInternalFiber=t,qo(t,r,e,n),t=ll(null,t,r,!0,o,n)}else t.tag=0,el(null,t,i,n),t=t.child;return t;case 16:if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=Vt),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)})}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=function(e){if("function"==typeof e)return Zu(e)?1:0;if(null!=e){if((e=e.$$typeof)===_e)return 11;if(e===xe)return 14}return 2}(i),e=vo(i,e),o){case 0:t=ol(null,t,i,e,n);break;case 1:t=al(null,t,i,e,n);break;case 11:t=tl(null,t,i,e,n);break;case 14:t=nl(null,t,i,vo(i.type,e),r,n);break;default:throw U(Error(306),i,"")}return t;case 0:return r=t.type,i=t.pendingProps,ol(e,t,r,i=t.elementType===r?i:vo(r,i),n);case 1:return r=t.type,i=t.pendingProps,al(e,t,r,i=t.elementType===r?i:vo(r,i),n);case 3:if(ul(t),null===(r=t.updateQueue))throw U(Error(282));if(i=null!==(i=t.memoizedState)?i.element:null,jo(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i)Za(),t=vl(e,t,n);else{if((i=t.stateNode.hydrate)&&(Ha=Sr(t.stateNode.containerInfo.firstChild),Ya=t,i=$a=!0),i)for(n=Jo(t,null,r,n),t.child=n;n;)n.effectTag=n.effectTag&~Vt|qt,n=n.sibling;else el(e,t,r,n),Za();t=t.child}return t;case 5:return la(t),null===e&&Ga(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,xr(r,i)?a=null:null!==o&&xr(r,o)&&(t.effectTag|=16),il(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(el(e,t,a,n),t=t.child),t;case 6:return null===e&&Ga(t),null;case 13:return pl(e,t,n);case 4:return oa(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Xo(t,null,r,n):el(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,tl(e,t,r,i=t.elementType===r?i:vo(r,i),n);case 7:return el(e,t,t.pendingProps,n),t.child;case 8:case 12:return el(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,xo(t,o=i.value),null!==a){var l=a.value;if(0===(o=yi(l,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(a.children===i.children&&!Ii.current){t=vl(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var u=l.dependencies;if(null!==u){a=l.child;for(var s=u.firstContext;null!==s;){if(s.context===r&&0!=(s.observedBits&o)){1===l.tag&&((s=Ro(n,null)).tag=2,Do(l,s)),l.expirationTime=t&&e<=t}function is(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function os(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function as(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}Pe=function(e,t,n){switch(t){case"input":if(rt(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t3&&void 0!==arguments[3]?arguments[3]:e,l={__count:1,id:n++,name:r,timestamp:i},u=t.__interactionsRef.current,s=new Set(u);s.add(l),t.__interactionsRef.current=s;var c,f=t.__subscriberRef.current;try{null!==f&&f.onInteractionTraced(l)}finally{try{null!==f&&f.onWorkStarted(s,a)}finally{try{c=o()}finally{t.__interactionsRef.current=u;try{null!==f&&f.onWorkStopped(s,a)}finally{l.__count--,null!==f&&0===l.__count&&f.onInteractionScheduledWorkCompleted(l)}}}}return c},t.unstable_wrap=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=t.__interactionsRef.current,o=t.__subscriberRef.current;null!==o&&o.onWorkScheduled(i,r),i.forEach(function(e){e.__count++});var a=!1;function l(){var e=t.__interactionsRef.current;t.__interactionsRef.current=i,o=t.__subscriberRef.current;try{var l;try{null!==o&&o.onWorkStarted(i,r)}finally{try{l=n.apply(void 0,arguments)}finally{t.__interactionsRef.current=e,null!==o&&o.onWorkStopped(i,r)}}return l}finally{a||(a=!0,i.forEach(function(e){e.__count--,null!==o&&0===e.__count&&o.onInteractionScheduledWorkCompleted(e)}))}}return l.cancel=function(){o=t.__subscriberRef.current;try{null!==o&&o.onWorkCanceled(i,r)}finally{i.forEach(function(e){e.__count--,o&&0===e.__count&&o.onInteractionScheduledWorkCompleted(e)})}},l},t.unstable_subscribe=function(e){i.add(e),1===i.size&&(t.__subscriberRef.current={onInteractionScheduledWorkCompleted:a,onInteractionTraced:o,onWorkCanceled:c,onWorkScheduled:l,onWorkStarted:u,onWorkStopped:s})},t.unstable_unsubscribe=function(e){i.delete(e),0===i.size&&(t.__subscriberRef.current=null)}}()});o(us);us.__interactionsRef,us.__subscriberRef,us.unstable_clear,us.unstable_getCurrent,us.unstable_getThreadID,us.unstable_trace,us.unstable_wrap,us.unstable_subscribe,us.unstable_unsubscribe;var ss=a(function(e){e.exports=us}),cs=a(function(e){!function(){var t=T,n=c,r=I,i=x,o=ss;function a(e){return e.name="Invariant Violation",e}!function(){if(!t)throw a(Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM."))}();var l=null,u={};function s(){if(l)for(var e in u){var t=u[e],n=l.indexOf(e);if(function(){if(!(n>-1))throw a(Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `"+e+"`."))}(),!h[n]){!function(){if(!t.extractEvents)throw a(Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `"+e+"` does not."))}(),h[n]=t;var r=t.eventTypes;for(var i in r)!function(){if(!f(r[i],t,i))throw a(Error("EventPluginRegistry: Failed to publish event `"+i+"` for plugin `"+e+"`."))}()}}}function f(e,t,n){!function(){if(p.hasOwnProperty(n))throw a(Error("EventPluginHub: More than one plugin attempted to publish the same event name, `"+n+"`."))}(),p[n]=e;var r=e.phasedRegistrationNames;if(r){for(var i in r){if(r.hasOwnProperty(i))d(r[i],t,n)}return!0}return!!e.registrationName&&(d(e.registrationName,t,n),!0)}function d(e,t,n){!function(){if(m[e])throw a(Error("EventPluginHub: More than one plugin attempted to publish the same registration name, `"+e+"`."))}(),m[e]=t,g[e]=t.eventTypes[n].dependencies;var r=e.toLowerCase();v[r]=e,"onDoubleClick"===e&&(v.ondblclick=e)}var h=[],p={},m={},g={},v={};var y=function(e,t,n,r,i,o,a,l,u){var s=Array.prototype.slice.call(arguments,3);try{t.apply(n,s)}catch(e){this.onError(e)}};if("undefined"!=typeof window&&"function"==typeof window.dispatchEvent&&"undefined"!=typeof document&&"function"==typeof document.createEvent){var b=document.createElement("react");y=function(e,t,n,r,i,o,l,u,s){!function(){if("undefined"==typeof document)throw a(Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous."))}();var c,f=document.createEvent("Event"),d=!0,h=window.event,p=Object.getOwnPropertyDescriptor(window,"event"),m=Array.prototype.slice.call(arguments,3);var g=!1,v=!1;function y(e){if(c=e.error,g=!0,null===c&&0===e.colno&&0===e.lineno&&(v=!0),e.defaultPrevented&&null!=c&&"object"==typeof c)try{c._suppressLogging=!0}catch(e){}}var _="react-"+(e||"invokeguardedcallback");window.addEventListener("error",y),b.addEventListener(_,function e(){b.removeEventListener(_,e,!1),void 0!==window.event&&window.hasOwnProperty("event")&&(window.event=h),t.apply(n,m),d=!1},!1),f.initEvent(_,!1,!1),b.dispatchEvent(f),p&&Object.defineProperty(window,"event",p),d&&(g?v&&(c=new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://fb.me/react-crossorigin-error for more information.")):c=new Error("An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the \"Pause on exceptions\" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue."),this.onError(c)),window.removeEventListener("error",y)}}var _=y,w=!1,k=null,E=!1,S=null,C={onError:function(e){w=!0,k=e}};function M(e,t,n,r,i,o,a,l,u){w=!1,k=null,_.apply(C,arguments)}function N(){return w}function P(){if(w){var e=k;return w=!1,k=null,e}!function(){throw a(Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."))}()}var R,O=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!e){if("undefined"!=typeof console){var o=r.map(function(e){return""+e});o.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,o)}try{var a=0,l="Warning: "+t.replace(/%s/g,function(){return r[a++]});throw new Error(l)}catch(e){}}},D=null,A=null,U=null;function j(e,t,n){var r=e.type||"unknown-event";e.currentTarget=U(n),function(e,t,n,r,i,o,a,l,u){if(M.apply(this,arguments),w){var s=P();E||(E=!0,S=s)}}(r,t,void 0,e),e.currentTarget=null}function z(e,t){return function(){if(null==t)throw a(Error("accumulateInto(...): Accumulated items must not be null or undefined."))}(),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function L(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}R=function(e){var t=e._dispatchListeners,n=e._dispatchInstances,r=Array.isArray(t),i=r?t.length:t?1:0,o=Array.isArray(n),a=o?n.length:n?1:0;(o!==r||a!==i)&&O(!1,"EventPluginUtils: Invalid `event`.")};var F=null,W=function(e){e&&(!function(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(R(e),Array.isArray(t))for(var r=0;r2?r-2:0),o=2;o2&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1]))}function Ut(e,t,n,r){if(null!==n&&n.type===wt)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":if(r)return!1;if(null!==n)return!n.acceptsBooleans;var i=e.toLowerCase().slice(0,5);return"data-"!==i&&"aria-"!==i;default:return!1}}function jt(e,t,n,r){if(null==t)return!0;if(Ut(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case xt:return!t;case Et:return!1===t;case Tt:return isNaN(t);case St:return isNaN(t)||t<1}return!1}function zt(e){return Ft.hasOwnProperty(e)?Ft[e]:null}function Lt(e,t,n,r,i,o){this.acceptsBooleans=t===kt||t===xt||t===Et,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o}var Ft={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(function(e){Ft[e]=new Lt(e,wt,!1,e,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0],n=e[1];Ft[t]=new Lt(t,1,!1,n,null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ft[e]=new Lt(e,kt,!1,e.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ft[e]=new Lt(e,kt,!1,e,null,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(e){Ft[e]=new Lt(e,xt,!1,e.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Ft[e]=new Lt(e,xt,!0,e,null,!1)}),["capture","download"].forEach(function(e){Ft[e]=new Lt(e,Et,!1,e,null,!1)}),["cols","rows","size","span"].forEach(function(e){Ft[e]=new Lt(e,St,!1,e,null,!1)}),["rowSpan","start"].forEach(function(e){Ft[e]=new Lt(e,Tt,!1,e.toLowerCase(),null,!1)});var Wt=/[\-\:]([a-z])/g,Bt=function(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(e){var t=e.replace(Wt,Bt);Ft[t]=new Lt(t,1,!1,e,null,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(e){var t=e.replace(Wt,Bt);Ft[t]=new Lt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Wt,Bt);Ft[t]=new Lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(e){Ft[e]=new Lt(e,1,!1,e.toLowerCase(),null,!1)});Ft.xlinkHref=new Lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(e){Ft[e]=new Lt(e,1,!1,e.toLowerCase(),null,!0)});me.ReactDebugCurrentFrame;var Yt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,Ht=!1;function $t(e){!Ht&&Yt.test(e)&&(Ht=!0,Ie(!1,"A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(e)))}function Vt(e){return""+e}function qt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}var Gt=Vt;function Qt(e,t,n){e.setAttribute(t,n)}function Kt(e,t,n,r){if(r.mustUseProperty)return e[r.propertyName];r.sanitizeURL&&$t(""+n);var i=r.attributeName,o=null;if(r.type===Et){if(e.hasAttribute(i)){var a=e.getAttribute(i);return""===a||(jt(t,n,r,!1)?a:a===""+n?n:a)}}else if(e.hasAttribute(i)){if(jt(t,n,r,!1))return e.getAttribute(i);if(r.type===xt)return n;o=e.getAttribute(i)}return jt(t,n,r,!1)?null===o?n:o:o===""+n?n:o}function Zt(e,t,n){if(At(t)){if(!e.hasAttribute(t))return void 0===n?void 0:null;var r=e.getAttribute(t);return r===""+n?n:r}}function Xt(e,t,n,r){var i=zt(t);if(!It(t,i,r))if(jt(t,n,i,r)&&(n=null),r||null===i){if(At(t)){var o=t;null===n?e.removeAttribute(o):Qt(e,o,Gt(n))}}else if(i.mustUseProperty){var a=i.propertyName;if(null===n){var l=i.type;e[a]=l!==xt&&""}else e[a]=n}else{var u=i.attributeName,s=i.attributeNamespace;if(null===n)e.removeAttribute(u);else{var c,f=i.type;f===xt||f===Et&&!0===n?c="":(c=Gt(n),i.sanitizeURL&&$t(c.toString())),s?function(e,t,n,r){e.setAttributeNS(t,n,r)}(e,s,u,c):Qt(e,u,c)}}}var Jt,en={checkPropTypes:null};Jt=me.ReactDebugCurrentFrame;var tn={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},nn={value:function(e,t,n){return tn[e.type]||e.onChange||e.readOnly||e.disabled||null==e[t]||ut&&e.listeners?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return e.onChange||e.readOnly||e.disabled||null==e[t]||ut&&e.listeners?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}};function rn(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function on(e){return e._valueTracker}function an(e){on(e)||(e._valueTracker=function(e){var t=rn(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){!function(e){e._valueTracker=null}(e),delete e[t]}}}}(e))}function ln(e){if(!e)return!1;var t=on(e);if(!t)return!0;var n=t.getValue(),r=function(e){var t="";return e?t=rn(e)?e.checked?"true":"false":e.value:t}(e);return r!==n&&(t.setValue(r),!0)}en.checkPropTypes=function(e,t){i(nn,t,"prop",e,Jt.getStackAddendum)};var un=!1,sn=!1,cn=!1,fn=!1;function dn(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}function hn(e,t){var r=e,i=t.checked;return n({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=i?i:r._wrapperState.initialChecked})}function pn(e,t){en.checkPropTypes("input",t),void 0===t.checked||void 0===t.defaultChecked||sn||(Ie(!1,"%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://fb.me/react-controlled-components",qe()||"A component",t.type),sn=!0),void 0===t.value||void 0===t.defaultValue||un||(Ie(!1,"%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://fb.me/react-controlled-components",qe()||"A component",t.type),un=!0);var n=e,r=null==t.defaultValue?"":t.defaultValue;n._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:qt(null!=t.value?t.value:r),controlled:dn(t)}}function mn(e,t){var n=e,r=t.checked;null!=r&&Xt(n,"checked",r,!1)}function gn(e,t){var n=e,r=dn(t);n._wrapperState.controlled||!r||fn||(Ie(!1,"A component is changing an uncontrolled input of type %s to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components",t.type),fn=!0),!n._wrapperState.controlled||r||cn||(Ie(!1,"A component is changing a controlled input of type %s to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components",t.type),cn=!0),mn(e,t);var i=qt(t.value),o=t.type;if(null!=i)"number"===o?(0===i&&""===n.value||n.value!=i)&&(n.value=Vt(i)):n.value!==Vt(i)&&(n.value=Vt(i));else if("submit"===o||"reset"===o)return void n.removeAttribute("value");t.hasOwnProperty("value")?bn(n,t.type,i):t.hasOwnProperty("defaultValue")&&bn(n,t.type,qt(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(n.defaultChecked=!!t.defaultChecked)}function vn(e,t,n){var r=e;if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(("submit"===i||"reset"===i)&&(void 0===t.value||null===t.value))return;var o=Vt(r._wrapperState.initialValue);n||o!==r.value&&(r.value=o),r.defaultValue=o}var a=r.name;""!==a&&(r.name=""),r.defaultChecked=!r.defaultChecked,r.defaultChecked=!!r._wrapperState.initialChecked,""!==a&&(r.name=a)}function yn(e,t){var n=e;gn(n,t),function(e,t){var n=t.name;if("radio"===t.type&&null!=n){for(var r=e;r.parentNode;)r=r.parentNode;for(var i=r.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),o=0;o children.")))}),null==n.selected||wn||(Ie(!1,"Use the `defaultValue` or `value` props on