aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lang/node-arduino-firmata/Makefile66
-rw-r--r--lang/node-arduino-firmata/files/usr/lib/node/arduino-firmata/lib/arduino-firmata.js487
-rw-r--r--lang/node-hid/Makefile73
-rw-r--r--libs/libssh2/Makefile1
-rw-r--r--libs/nspr/Makefile86
-rw-r--r--libs/nspr/patches/001-Makefile.in_rm_BUILD_STRING_and_BUILD_TIME.patch103
-rw-r--r--libs/nspr/patches/002-Add-ARC-support.patch88
-rw-r--r--libs/nspr/patches/003-native_and_musl_fix.patch23
-rw-r--r--libs/nss/Makefile138
-rw-r--r--libs/nss/files/blank-cert9.dbbin0 -> 28672 bytes
-rw-r--r--libs/nss/files/blank-key4.dbbin0 -> 36864 bytes
-rw-r--r--libs/nss/files/system-pkcs11.txt5
-rw-r--r--libs/nss/patches/001-nss_standalone.patch247
-rw-r--r--libs/nss/patches/002-os_test.patch18
-rw-r--r--libs/nss/patches/003-openwrt_fix.patch86
-rw-r--r--libs/protobuf-c/Makefile5
-rw-r--r--libs/protobuf/Makefile8
-rw-r--r--net/aircrack-ng/Makefile23
-rw-r--r--net/nginx/Makefile11
-rw-r--r--net/prosody/Makefile20
-rw-r--r--net/snort3/Makefile3
21 files changed, 1140 insertions, 351 deletions
diff --git a/lang/node-arduino-firmata/Makefile b/lang/node-arduino-firmata/Makefile
index 84629ac8d..fd2b3f4c1 100644
--- a/lang/node-arduino-firmata/Makefile
+++ b/lang/node-arduino-firmata/Makefile
@@ -10,19 +10,16 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=arduino-firmata
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.3.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/shokai/node-arduino-firmata.git
-PKG_MIRROR_HASH:=1aef93dc704ea771b9eab51cb64103533f829aee5b2886ad55d173adf3f11ede
-PKG_SOURCE_VERSION:=v0.3.4
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
+PKG_HASH:=d7157e02867eae82887cb5e17b90c963fe7489bacd464110bfd20c672b8d5a98
PKG_BUILD_DEPENDS:=node/host
-PKG_NODE_VERSION:=`$(STAGING_DIR_HOSTPKG)/bin/node --version`
+PKG_USE_MIPS16:=0
-PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE.txt
@@ -32,47 +29,44 @@ define Package/node-arduino-firmata
SUBMENU:=Node.js
SECTION:=lang
CATEGORY:=Languages
- TITLE:=Node.js package to access serial ports for reading and writing
- URL:=https://www.npmjs.org/package/serialport
+ TITLE:=Arduino Firmata implementation for Node.js
+ URL:=https://www.npmjs.com/package/arduino-firmata
DEPENDS:=+node +node-npm +node-serialport
endef
define Package/node-arduino-firmata/description
- Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
+ Arduino Firmata protocol (http://firmata.org) implementation on Node.js.
endef
-define Build/Prepare
- /bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
- $(Build/Patch)
-endef
+TAR_OPTIONS+= --strip-components 1
+TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
-EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
+NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
define Build/Compile
- cd $(PKG_BUILD_DIR) ; \
+ $(MAKE_VARS) \
$(MAKE_FLAGS) \
- npm_config_arch=$(CONFIG_ARCH) \
- npm_config_nodedir=$(BUILD_DIR)/node-$(PKG_NODE_VERSION)/ \
- npm_config_cache=$(BUILD_DIR)/node-$(PKG_NODE_VERSION)/npm-cache \
- PREFIX="$(PKG_INSTALL_DIR)/usr/" \
- npm install -g `npm pack $(PKG_BUILD_DIR) | tail -n 1`
+ npm_config_arch=$(NODEJS_CPU) \
+ npm_config_target_arch=$(NODEJS_CPU) \
+ npm_config_build_from_source=true \
+ npm_config_nodedir=$(STAGING_DIR)/usr/ \
+ npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
+ npm_config_cache=$(TMP_DIR)/npm-cache \
+ npm_config_tmp=$(TMP_DIR)/npm-tmp \
+ npm install -g $(PKG_BUILD_DIR)
+ rm -rf $(TMP_DIR)/npm-tmp
+ rm -rf $(TMP_DIR)/npm-cache
endef
define Package/node-arduino-firmata/install
- mkdir -p $(1)/usr/lib/node
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/. $(1)/usr/lib/node
- rm -rf $(1)/usr/lib/node/arduino-firmata/node_modules/serialport/ \
- $(1)/usr/lib/node/arduino-firmata/patches \
- $(1)/usr/lib/node/arduino-firmata/.p* \
- $(1)/usr/lib/node/arduino-firmata/.quilt* \
- $(1)/usr/lib/node/arduino-firmata/.built* \
- $(1)/usr/lib/node/arduino-firmata/.config*
- # Strip PKG_BUILD_DIR from useless metadata inserted by npm install
- # https://github.com/npm/npm/issues/10393
- # https://github.com/npm/npm/issues/12110
- find $(1)/usr/lib/node -name package.json -exec sed -i -e 's,$(PKG_BUILD_DIR),,g' {} +
+ $(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,README.md} \
+ $(1)/usr/lib/node/$(PKG_NPM_NAME)/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{tests,*.txt} \
+ $(1)/usr/lib/node/$(PKG_NPM_NAME)/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{node_modules,lib} \
+ $(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,node-arduino-firmata))
-
diff --git a/lang/node-arduino-firmata/files/usr/lib/node/arduino-firmata/lib/arduino-firmata.js b/lang/node-arduino-firmata/files/usr/lib/node/arduino-firmata/lib/arduino-firmata.js
index 578bd402b..2f9bcf7c1 100644
--- a/lang/node-arduino-firmata/files/usr/lib/node/arduino-firmata/lib/arduino-firmata.js
+++ b/lang/node-arduino-firmata/files/usr/lib/node/arduino-firmata/lib/arduino-firmata.js
@@ -1,306 +1,295 @@
(function() {
'use strict';
- var ArduinoFirmata, SerialPort, debug, events, exports, serialport,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
+ var ArduinoFirmata, debug, events, exports, serialport;
events = require('eventemitter2');
- SerialPort = (serialport = require('serialport')).SerialPort;
+ serialport = require('serialport');
debug = require('debug')('arduino-firmata');
- exports = module.exports = ArduinoFirmata = (function(superClass) {
- extend(ArduinoFirmata, superClass);
-
- ArduinoFirmata.Status = {
- CLOSE: 0,
- OPEN: 1
- };
-
- ArduinoFirmata.INPUT = 0;
-
- ArduinoFirmata.OUTPUT = 1;
-
- ArduinoFirmata.ANALOG = 2;
-
- ArduinoFirmata.PWM = 3;
-
- ArduinoFirmata.SERVO = 4;
-
- ArduinoFirmata.SHIFT = 5;
-
- ArduinoFirmata.I2C = 6;
-
- ArduinoFirmata.LOW = 0;
-
- ArduinoFirmata.HIGH = 1;
-
- ArduinoFirmata.MAX_DATA_BYTES = 32;
-
- ArduinoFirmata.DIGITAL_MESSAGE = 0x90;
-
- ArduinoFirmata.ANALOG_MESSAGE = 0xE0;
-
- ArduinoFirmata.REPORT_ANALOG = 0xC0;
-
- ArduinoFirmata.REPORT_DIGITAL = 0xD0;
-
- ArduinoFirmata.SET_PIN_MODE = 0xF4;
-
- ArduinoFirmata.REPORT_VERSION = 0xF9;
-
- ArduinoFirmata.SYSTEM_RESET = 0xFF;
-
- ArduinoFirmata.START_SYSEX = 0xF0;
-
- ArduinoFirmata.END_SYSEX = 0xF7;
-
- ArduinoFirmata.list = function(callback) {
- return serialport.list(function(err, ports) {
- var devices, j, len, port;
- if (err) {
- return callback(err);
- }
- devices = [];
- for (j = 0, len = ports.length; j < len; j++) {
- port = ports[j];
- if (/usb|acm|com\d+/i.test(port.comName)) {
- devices.push(port.comName);
+ exports = module.exports = ArduinoFirmata = (function() {
+ class ArduinoFirmata extends events.EventEmitter2 {
+ static list(callback) {
+ return serialport.list(function(err, ports) {
+ var devices, j, len, port;
+ if (err) {
+ return callback(err);
}
- }
- return callback(null, devices);
- });
- };
-
- function ArduinoFirmata() {
- this.status = ArduinoFirmata.Status.CLOSE;
- this.wait_for_data = 0;
- this.execute_multi_byte_command = 0;
- this.multi_byte_channel = 0;
- this.stored_input_data = [];
- this.parsing_sysex = false;
- this.sysex_bytes_read = 0;
- this.digital_output_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
- this.digital_input_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
- this.analog_input_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
- this.boardVersion = null;
- }
-
- ArduinoFirmata.prototype.isOldArduinoDevice = function() {
- return /usbserial|USB/.test(this.serialport_name);
- };
+ devices = [];
+ for (j = 0, len = ports.length; j < len; j++) {
+ port = ports[j];
+ if (/usb|acm|com|ama\d+/i.test(port.comName)) {
+ devices.push(port.comName);
+ }
+ }
+ return callback(null, devices);
+ });
+ }
- ArduinoFirmata.prototype.connect = function(serialport_name, opts) {
- this.serialport_name = serialport_name;
- if (opts == null) {
- opts = {
- baudrate: 57600
- };
+ constructor() {
+ super();
+ this.status = ArduinoFirmata.Status.CLOSE;
+ this.wait_for_data = 0;
+ this.execute_multi_byte_command = 0;
+ this.multi_byte_channel = 0;
+ this.stored_input_data = [];
+ this.parsing_sysex = false;
+ this.sysex_bytes_read = 0;
+ this.digital_output_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ this.digital_input_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ this.analog_input_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ this.boardVersion = null;
}
- opts.parser = serialport.parsers.raw;
- if (!this.serialport_name) {
- ArduinoFirmata.list((function(_this) {
- return function(err, devices) {
- return _this.connect(devices[0], opts);
- };
- })(this));
- return this;
+
+ isOldArduinoDevice() {
+ return /usbserial|USB/.test(this.serialport_name);
}
- this.once('boardReady', function() {
- var io_init_wait;
- debug('boardReady');
- io_init_wait = this.isOldArduinoDevice() ? (debug("old arduino device found " + this.serialport_name), 3000) : (debug("new arduino device found " + this.serialport_name), 100);
- debug("wait " + io_init_wait + "(msec)");
- return setTimeout((function(_this) {
- return function() {
+
+ connect(serialport_name, opts = {
+ baudRate: 57600
+ }) {
+ this.serialport_name = serialport_name;
+ opts.parser = serialport.parsers.raw;
+ if (!this.serialport_name) {
+ ArduinoFirmata.list((err, devices) => {
+ return this.connect(devices[0], opts);
+ });
+ return this;
+ }
+ this.once('boardReady', function() {
+ var io_init_wait;
+ debug('boardReady');
+ io_init_wait = this.isOldArduinoDevice() ? (debug(`old arduino device found ${this.serialport_name}`), 3000) : (debug(`new arduino device found ${this.serialport_name}`), 100);
+ debug(`wait ${io_init_wait}(msec)`);
+ return setTimeout(() => {
var i, j, k;
for (i = j = 0; j < 6; i = ++j) {
- _this.write([ArduinoFirmata.REPORT_ANALOG | i, 1]);
+ this.write([ArduinoFirmata.REPORT_ANALOG | i, 1]);
}
for (i = k = 0; k < 2; i = ++k) {
- _this.write([ArduinoFirmata.REPORT_DIGITAL | i, 1]);
+ this.write([ArduinoFirmata.REPORT_DIGITAL | i, 1]);
}
debug('init IO ports');
- return _this.emit('connect');
- };
- })(this), io_init_wait);
- });
- this.serialport = new SerialPort(this.serialport_name, opts);
- this.serialport.once('open', (function(_this) {
- return function() {
+ return this.emit('connect');
+ }, io_init_wait);
+ });
+ this.serialport = new serialport(this.serialport_name, opts);
+ this.serialport.once('open', () => {
var cid;
- cid = setInterval(function() {
+ cid = setInterval(() => {
debug('request REPORT_VERSION');
- return _this.write([ArduinoFirmata.REPORT_VERSION]);
+ return this.write([ArduinoFirmata.REPORT_VERSION]);
}, 500);
- _this.once('boardVersion', function(version) {
+ this.once('boardVersion', (version) => {
clearInterval(cid);
- _this.status = ArduinoFirmata.Status.OPEN;
- return _this.emit('boardReady');
+ this.status = ArduinoFirmata.Status.OPEN;
+ return this.emit('boardReady');
});
- return _this.serialport.on('data', function(data) {
+ return this.serialport.on('data', (data) => {
var byte, j, len, results;
results = [];
for (j = 0, len = data.length; j < len; j++) {
byte = data[j];
- results.push(_this.process_input(byte));
+ results.push(this.process_input(byte));
}
return results;
});
- };
- })(this));
- return this;
- };
+ });
+ return this;
+ }
- ArduinoFirmata.prototype.isOpen = function() {
- return this.status === ArduinoFirmata.Status.OPEN;
- };
+ isOpen() {
+ return this.status === ArduinoFirmata.Status.OPEN;
+ }
- ArduinoFirmata.prototype.close = function(callback) {
- this.status = ArduinoFirmata.Status.CLOSE;
- return this.serialport.close(callback);
- };
+ close(callback) {
+ this.status = ArduinoFirmata.Status.CLOSE;
+ return this.serialport.close(callback);
+ }
- ArduinoFirmata.prototype.reset = function(callback) {
- return this.write([ArduinoFirmata.SYSTEM_RESET], callback);
- };
+ reset(callback) {
+ return this.write([ArduinoFirmata.SYSTEM_RESET], callback);
+ }
- ArduinoFirmata.prototype.write = function(bytes, callback) {
- return this.serialport.write(bytes, callback);
- };
+ write(bytes, callback) {
+ return this.serialport.write(bytes, callback);
+ }
- ArduinoFirmata.prototype.sysex = function(command, data, callback) {
- var write_data;
- if (data == null) {
- data = [];
+ sysex(command, data = [], callback) {
+ var write_data;
+ //# http://firmata.org/wiki/V2.1ProtocolDetails#Sysex_Message_Format
+ data = data.map(function(i) {
+ return i & 0b1111111; // 7bit
+ });
+ write_data = [ArduinoFirmata.START_SYSEX, command].concat(data, [ArduinoFirmata.END_SYSEX]);
+ return this.write(write_data, callback);
}
- data = data.map(function(i) {
- return i & 0x7f;
- });
- write_data = [ArduinoFirmata.START_SYSEX, command].concat(data, [ArduinoFirmata.END_SYSEX]);
- return this.write(write_data, callback);
- };
- ArduinoFirmata.prototype.pinMode = function(pin, mode, callback) {
- switch (mode) {
- case true:
- mode = ArduinoFirmata.OUTPUT;
- break;
- case false:
- mode = ArduinoFirmata.INPUT;
+ pinMode(pin, mode, callback) {
+ switch (mode) {
+ case true:
+ mode = ArduinoFirmata.OUTPUT;
+ break;
+ case false:
+ mode = ArduinoFirmata.INPUT;
+ }
+ return this.write([ArduinoFirmata.SET_PIN_MODE, pin, mode], callback);
}
- return this.write([ArduinoFirmata.SET_PIN_MODE, pin, mode], callback);
- };
- ArduinoFirmata.prototype.digitalWrite = function(pin, value, callback) {
- var port_num;
- this.pinMode(pin, ArduinoFirmata.OUTPUT);
- port_num = (pin >>> 3) & 0x0F;
- if (value === 0 || value === false) {
- this.digital_output_data[port_num] &= ~(1 << (pin & 0x07));
- } else {
- this.digital_output_data[port_num] |= 1 << (pin & 0x07);
+ digitalWrite(pin, value, callback) {
+ var port_num;
+ this.pinMode(pin, ArduinoFirmata.OUTPUT);
+ port_num = (pin >>> 3) & 0x0F;
+ if (value === 0 || value === false) {
+ this.digital_output_data[port_num] &= ~(1 << (pin & 0x07));
+ } else {
+ this.digital_output_data[port_num] |= 1 << (pin & 0x07);
+ }
+ return this.write([ArduinoFirmata.DIGITAL_MESSAGE | port_num, this.digital_output_data[port_num] & 0x7F, this.digital_output_data[port_num] >>> 7], callback);
}
- return this.write([ArduinoFirmata.DIGITAL_MESSAGE | port_num, this.digital_output_data[port_num] & 0x7F, this.digital_output_data[port_num] >>> 7], callback);
- };
- ArduinoFirmata.prototype.analogWrite = function(pin, value, callback) {
- value = Math.floor(value);
- this.pinMode(pin, ArduinoFirmata.PWM);
- return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), value & 0x7F, value >>> 7], callback);
- };
+ analogWrite(pin, value, callback) {
+ value = Math.floor(value);
+ this.pinMode(pin, ArduinoFirmata.PWM);
+ return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), value & 0x7F, value >>> 7], callback);
+ }
- ArduinoFirmata.prototype.servoWrite = function(pin, angle, callback) {
- this.pinMode(pin, ArduinoFirmata.SERVO);
- return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), angle & 0x7F, angle >>> 7], callback);
- };
+ servoWrite(pin, angle, callback) {
+ this.pinMode(pin, ArduinoFirmata.SERVO);
+ return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), angle & 0x7F, angle >>> 7], callback);
+ }
- ArduinoFirmata.prototype.digitalRead = function(pin) {
- return ((this.digital_input_data[pin >>> 3] >>> (pin & 0x07)) & 0x01) > 0;
- };
+ digitalRead(pin) {
+ return ((this.digital_input_data[pin >>> 3] >>> (pin & 0x07)) & 0x01) > 0;
+ }
- ArduinoFirmata.prototype.analogRead = function(pin) {
- return this.analog_input_data[pin];
- };
+ analogRead(pin) {
+ return this.analog_input_data[pin];
+ }
- ArduinoFirmata.prototype.process_input = function(input_data) {
- var analog_value, command, diff, i, j, old_analog_value, results, stat, sysex_command, sysex_data;
- if (this.parsing_sysex) {
- if (input_data === ArduinoFirmata.END_SYSEX) {
- this.parsing_sysex = false;
- sysex_command = this.stored_input_data[0];
- sysex_data = this.stored_input_data.slice(1, this.sysex_bytes_read);
- return this.emit('sysex', {
- command: sysex_command,
- data: sysex_data
- });
- } else {
- this.stored_input_data[this.sysex_bytes_read] = input_data;
- return this.sysex_bytes_read += 1;
- }
- } else if (this.wait_for_data > 0 && input_data < 128) {
- this.wait_for_data -= 1;
- this.stored_input_data[this.wait_for_data] = input_data;
- if (this.execute_multi_byte_command !== 0 && this.wait_for_data === 0) {
- switch (this.execute_multi_byte_command) {
- case ArduinoFirmata.DIGITAL_MESSAGE:
- input_data = (this.stored_input_data[0] << 7) + this.stored_input_data[1];
- diff = this.digital_input_data[this.multi_byte_channel] ^ input_data;
- this.digital_input_data[this.multi_byte_channel] = input_data;
- if (this.listeners('digitalChange').length > 0) {
- results = [];
- for (i = j = 0; j <= 13; i = ++j) {
- if (((0x01 << i) & diff) > 0) {
- stat = (input_data & diff) > 0;
- results.push(this.emit('digitalChange', {
- pin: i + this.multi_byte_channel * 8,
- value: stat,
- old_value: !stat
- }));
- } else {
- results.push(void 0);
+ process_input(input_data) {
+ var analog_value, command, diff, i, j, old_analog_value, results, stat, sysex_command, sysex_data;
+ if (this.parsing_sysex) {
+ if (input_data === ArduinoFirmata.END_SYSEX) {
+ this.parsing_sysex = false;
+ sysex_command = this.stored_input_data[0];
+ sysex_data = this.stored_input_data.slice(1, this.sysex_bytes_read);
+ return this.emit('sysex', {
+ command: sysex_command,
+ data: sysex_data
+ });
+ } else {
+ this.stored_input_data[this.sysex_bytes_read] = input_data;
+ return this.sysex_bytes_read += 1;
+ }
+ } else if (this.wait_for_data > 0 && input_data < 128) {
+ this.wait_for_data -= 1;
+ this.stored_input_data[this.wait_for_data] = input_data;
+ if (this.execute_multi_byte_command !== 0 && this.wait_for_data === 0) {
+ switch (this.execute_multi_byte_command) {
+ case ArduinoFirmata.DIGITAL_MESSAGE:
+ input_data = (this.stored_input_data[0] << 7) + this.stored_input_data[1];
+ diff = this.digital_input_data[this.multi_byte_channel] ^ input_data;
+ this.digital_input_data[this.multi_byte_channel] = input_data;
+ if (this.listeners('digitalChange').length > 0) {
+ results = [];
+ for (i = j = 0; j <= 13; i = ++j) {
+ if (((0x01 << i) & diff) > 0) {
+ stat = (input_data & diff) > 0;
+ results.push(this.emit('digitalChange', {
+ pin: i + this.multi_byte_channel * 8,
+ value: stat,
+ old_value: !stat
+ }));
+ } else {
+ results.push(void 0);
+ }
}
+ return results;
+ }
+ break;
+ case ArduinoFirmata.ANALOG_MESSAGE:
+ analog_value = (this.stored_input_data[0] << 7) + this.stored_input_data[1];
+ old_analog_value = this.analogRead(this.multi_byte_channel);
+ this.analog_input_data[this.multi_byte_channel] = analog_value;
+ if (old_analog_value !== analog_value) {
+ return this.emit('analogChange', {
+ pin: this.multi_byte_channel,
+ value: analog_value,
+ old_value: old_analog_value
+ });
}
- return results;
- }
- break;
- case ArduinoFirmata.ANALOG_MESSAGE:
- analog_value = (this.stored_input_data[0] << 7) + this.stored_input_data[1];
- old_analog_value = this.analogRead(this.multi_byte_channel);
- this.analog_input_data[this.multi_byte_channel] = analog_value;
- if (old_analog_value !== analog_value) {
- return this.emit('analogChange', {
- pin: this.multi_byte_channel,
- value: analog_value,
- old_value: old_analog_value
- });
- }
- break;
- case ArduinoFirmata.REPORT_VERSION:
- this.boardVersion = this.stored_input_data[1] + "." + this.stored_input_data[0];
- return this.emit('boardVersion', this.boardVersion);
+ break;
+ case ArduinoFirmata.REPORT_VERSION:
+ this.boardVersion = `${this.stored_input_data[1]}.${this.stored_input_data[0]}`;
+ return this.emit('boardVersion', this.boardVersion);
+ }
}
- }
- } else {
- if (input_data < 0xF0) {
- command = input_data & 0xF0;
- this.multi_byte_channel = input_data & 0x0F;
} else {
- command = input_data;
- }
- if (command === ArduinoFirmata.START_SYSEX) {
- this.parsing_sysex = true;
- return this.sysex_bytes_read = 0;
- } else if (command === ArduinoFirmata.DIGITAL_MESSAGE || command === ArduinoFirmata.ANALOG_MESSAGE || command === ArduinoFirmata.REPORT_VERSION) {
- this.wait_for_data = 2;
- return this.execute_multi_byte_command = command;
+ if (input_data < 0xF0) {
+ command = input_data & 0xF0;
+ this.multi_byte_channel = input_data & 0x0F;
+ } else {
+ command = input_data;
+ }
+ if (command === ArduinoFirmata.START_SYSEX) {
+ this.parsing_sysex = true;
+ return this.sysex_bytes_read = 0;
+ } else if (command === ArduinoFirmata.DIGITAL_MESSAGE || command === ArduinoFirmata.ANALOG_MESSAGE || command === ArduinoFirmata.REPORT_VERSION) {
+ this.wait_for_data = 2;
+ return this.execute_multi_byte_command = command;
+ }
}
}
+
+ };
+
+ ArduinoFirmata.Status = {
+ CLOSE: 0,
+ OPEN: 1
};
+ ArduinoFirmata.INPUT = 0;
+
+ ArduinoFirmata.OUTPUT = 1;
+
+ ArduinoFirmata.ANALOG = 2;
+
+ ArduinoFirmata.PWM = 3;
+
+ ArduinoFirmata.SERVO = 4;
+
+ ArduinoFirmata.SHIFT = 5;
+
+ ArduinoFirmata.I2C = 6;
+
+ ArduinoFirmata.LOW = 0;
+
+ ArduinoFirmata.HIGH = 1;
+
+ ArduinoFirmata.MAX_DATA_BYTES = 32;
+
+ ArduinoFirmata.DIGITAL_MESSAGE = 0x90; // send data for a digital port
+
+ ArduinoFirmata.ANALOG_MESSAGE = 0xE0; // send data for an analog pin (or PWM)
+
+ ArduinoFirmata.REPORT_ANALOG = 0xC0; // enable analog input by pin
+
+ ArduinoFirmata.REPORT_DIGITAL = 0xD0; // enable digital input by port
+
+ ArduinoFirmata.SET_PIN_MODE = 0xF4; // set a pin to INPUT/OUTPUT/PWM/etc
+
+ ArduinoFirmata.REPORT_VERSION = 0xF9; // report firmware version
+
+ ArduinoFirmata.SYSTEM_RESET = 0xFF; // reset from MIDI
+
+ ArduinoFirmata.START_SYSEX = 0xF0; // start a MIDI SysEx message
+
+ ArduinoFirmata.END_SYSEX = 0xF7; // end a MIDI SysEx message
+
return ArduinoFirmata;
- })(events.EventEmitter2);
+ }).call(this);
}).call(this);
diff --git a/lang/node-hid/Makefile b/lang/node-hid/Makefile
index ec5b19fe7..be75cc49d 100644
--- a/lang/node-hid/Makefile
+++ b/lang/node-hid/Makefile
@@ -7,23 +7,20 @@
include $(TOPDIR)/rules.mk
-PKG_NPM_NAME:=hid
-PKG_NAME:=node-$(PKG_NPM_NAME)
-PKG_VERSION:=0.7.2
-PKG_RELEASE:=2
+PKG_NPM_NAME:=node-hid
+PKG_NAME:=$(PKG_NPM_NAME)
+PKG_VERSION:=0.7.7
+PKG_RELEASE:=1
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/node-hid/node-hid.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=v0.7.2
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MIRROR_HASH:=ede801a26a23290ab76d64ab636c3c3e2788030bb830af7006d37444c2a7b2c4
+PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
+PKG_HASH:=ac14467265a64116114e99091cd557ca7953500285c78cb4bdf6b82fe262cca6
PKG_BUILD_DEPENDS:=node/host
-PKG_NODE_VERSION:=`$(STAGING_DIR_HOSTPKG)/bin/node --version`
+PKG_USE_MIPS16:=0
-PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
-PKG_LICENSE:=Custom
+PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>
+PKG_LICENSE:=MIT or X11
PKG_LICENSE_FILES:=
include $(INCLUDE_DIR)/package.mk
@@ -34,43 +31,49 @@ define Package/node-hid
CATEGORY:=Languages
TITLE:=Node.js package to access HID devices
URL:=https://github.com/node-hid/node-hid
- DEPENDS:=+node +node-npm +libusb-1.0 +hidapi +libstdcpp +libudev-fbsd
+ DEPENDS:=+node +node-npm +libusb-1.0 +hidapi +libudev-fbsd
endef
define Package/node-hid/description
Node.js package to access HID devices
endef
-CPU:=$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))
+TAR_OPTIONS+= --strip-components 1
+TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
-EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include/libusb-1.0
+NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
+
+TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/libusb-1.0
define Build/Compile
git init $(PKG_BUILD_DIR)
- cd $(PKG_BUILD_DIR) ; \
$(MAKE_VARS) \
$(MAKE_FLAGS) \
- npm_config_arch=$(CONFIG_ARCH) \
- npm_config_nodedir=$(BUILD_DIR)/node-$(PKG_NODE_VERSION)/ \
- npm_config_cache=$(BUILD_DIR)/node-$(PKG_NODE_VERSION)/npm-cache \
- PREFIX="$(PKG_INSTALL_DIR)/usr/" \
- npm install --build-from-source --target_arch=$(CPU) -g \
- `npm pack $(PKG_BUILD_DIR) | tail -n 1`
+ npm_config_arch=$(NODEJS_CPU) \
+ npm_config_target_arch=$(NODEJS_CPU) \
+ npm_config_build_from_source=true \
+ npm_config_nodedir=$(STAGING_DIR)/usr/ \
+ npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
+ npm_config_cache=$(TMP_DIR)/npm-cache \
+ npm_config_tmp=$(TMP_DIR)/npm-tmp \
+ npm install -g $(PKG_BUILD_DIR)
+ rm -rf $(TMP_DIR)/npm-tmp
+ rm -rf $(TMP_DIR)/npm-cache
endef
define Package/node-hid/install
- mkdir -p $(1)/usr/lib/node/node-hid/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/. $(1)/usr/lib/node/
- $(RM) -rf $(1)/usr/lib/node/node-hid/patches \
- $(1)/usr/lib/node/node-hid/.p* \
- $(1)/usr/lib/node/node-hid/.quilt* \
- $(1)/usr/lib/node/node-hid/.built* \
- $(1)/usr/lib/node/node-hid/.config*
- # Strip PKG_BUILD_DIR from useless metadata inserted by npm install
- # https://github.com/npm/npm/issues/10393
- # https://github.com/npm/npm/issues/12110
- find $(1)/usr/lib/node -name package.json -exec sed -i -e 's,$(PKG_BUILD_DIR),,g' {} +
+ $(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,*.md} \
+ $(1)/usr/lib/node/$(PKG_NPM_NAME)/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{binding.gyp,*.js} \
+ $(1)/usr/lib/node/$(PKG_NPM_NAME)/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{node_modules,src} \
+ $(1)/usr/lib/node/$(PKG_NPM_NAME)/
+ $(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)/build/Release
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/build/Release/HID.node \
+ $(1)/usr/lib/node/$(PKG_NPM_NAME)/build/Release/
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(LN) ../lib/node/node-hid/src/show-devices.js $(1)/usr/bin/hid-showdevices
endef
$(eval $(call BuildPackage,node-hid))
-
diff --git a/libs/libssh2/Makefile b/libs/libssh2/Makefile
index 7b06436ef..c2d29ae3a 100644
--- a/libs/libssh2/Makefile
+++ b/libs/libssh2/Makefile
@@ -21,6 +21,7 @@ PKG_INSTALL:=1
PKG_LICENSE:=BSD
PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:libssh2:libssh2
PKG_CONFIG_DEPENDS:= \
CONFIG_LIBSSH2_MBEDTLS \
diff --git a/libs/nspr/Makefile b/libs/nspr/Makefile
new file mode 100644
index 000000000..a01ba131f
--- /dev/null
+++ b/libs/nspr/Makefile
@@ -0,0 +1,86 @@
+#
+# Copyright (C) 2019 Lucian Cristian
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nspr
+PKG_VERSION:=4.21
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
+PKG_LICENCE:=MPL-2.0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:= \
+ https://download.cdn.mozilla.net/pub/$(PKG_NAME)/releases/v$(PKG_VERSION)/src/ \
+ https://archive.mozilla.org/pub/$(PKG_NAME)/releases/v$(PKG_VERSION)/src/
+PKG_HASH:=15ea32c7b100217b6e3193bc03e77f485d9bf7504051443ba9ce86d1c17c6b5a
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+CONFIGURE_PATH = ./nspr
+MAKE_PATH = ./nspr
+PKG_AUTOMAKE_PATHS = $(PKG_BUILD_DIR)/nspr
+LBITS = $(shell $(TARGET_CC) -dM -E - </dev/null | grep -q "__LP64__" && echo 64 || echo 32)
+
+ifeq ($(LBITS),64)
+ conf=--enable-64bit
+endif
+
+export MUSL=$(if $(CONFIG_LIBC_USE_GLIBC),0,1)
+TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+
+CONFIGURE_ARGS += \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --disable-debug \
+ --with-pthreads \
+ $(if $(CONFIG_IPV6),--enable-ipv6,--disable-ipv6) \
+ $(conf)
+
+define Build/Compile
+ CROSS_COMPILE=1 CFLAGS="-DXP_UNIX $(HOST_CFLAGS)" LDFLAGS="" CC="$(HOSTCC)" \
+ $(MAKE) -C $(PKG_BUILD_DIR)/nspr/config
+ $(call Build/Compile/Default)
+endef
+
+define Package/nspr
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Netscape Portable Runtime (NSPR)
+ URL:=https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR
+ DEPENDS:=+libpthread
+endef
+
+define Package/nspr/description
+ Netscape Portable Runtime (NSPR) provides a platform-neutral API for system
+ level and libc-like functions. The API is used in the Mozilla clients, many
+ of Red Hat's and Oracle's server applications, and other software offerings.
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) \
+ $(1)/usr/include \
+ $(1)/usr/lib/ \
+ $(1)/usr/lib/pkgconfig/ \
+ $(1)/usr/share/aclocal/
+
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/nspr $(1)/usr/include/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/
+endef
+
+define Package/nspr/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,nspr))
diff --git a/libs/nspr/patches/001-Makefile.in_rm_BUILD_STRING_and_BUILD_TIME.patch b/libs/nspr/patches/001-Makefile.in_rm_BUILD_STRING_and_BUILD_TIME.patch
new file mode 100644
index 000000000..4ab1df58e
--- /dev/null
+++ b/libs/nspr/patches/001-Makefile.in_rm_BUILD_STRING_and_BUILD_TIME.patch
@@ -0,0 +1,103 @@
+From 8a592e4ead4ed6befe6044da3dd2dc7523c33905 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Fri, 16 Nov 2018 13:52:49 +0800
+Subject: [PATCH] Makefile.in: remove _BUILD_STRING and _BUILD_TIME
+
+Remove _BUILD_STRING and _BUILD_TIME to avoid
+adding timestamp to _pl_bld.h which can result
+in adding timestamp in library file such as
+libnspr4.so.
+ $ readelf --wide --decompress --hex-dump=.rodata libnspr4.so
+ [snip]
+ 0x00004000 32303138 2d31312d 31352030 353a3439 2018-11-15 05:49
+ [snip]
+
+Upstream-Status: Pending
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+---
+ lib/ds/Makefile.in | 8 +-------
+ lib/libc/src/Makefile.in | 8 +-------
+ lib/prstreams/Makefile.in | 8 +-------
+ pr/src/Makefile.in | 8 +-------
+ 4 files changed, 4 insertions(+), 28 deletions(-)
+
+diff --git a/lib/ds/Makefile.in b/lib/ds/Makefile.in
+index e737791..b578476 100644
+--- a/nspr/lib/ds/Makefile.in
++++ b/nspr/lib/ds/Makefile.in
+@@ -114,13 +114,7 @@ GARBAGE += $(TINC)
+
+ $(TINC):
+ @$(MAKE_OBJDIR)
+- @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
+- @if test ! -z "$(SH_NOW)"; then \
+- $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
+- else \
+- true; \
+- fi
+- @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
++ @$(ECHO) '#define _PRODUCTION "$(PROD)"' > $(TINC)
+
+
+ $(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
+diff --git a/lib/libc/src/Makefile.in b/lib/libc/src/Makefile.in
+index e8a6d9f..978ed28 100644
+--- a/nspr/lib/libc/src/Makefile.in
++++ b/nspr/lib/libc/src/Makefile.in
+@@ -116,13 +116,7 @@ GARBAGE += $(TINC)
+
+ $(TINC):
+ @$(MAKE_OBJDIR)
+- @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
+- @if test ! -z "$(SH_NOW)"; then \
+- $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
+- else \
+- true; \
+- fi
+- @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
++ @$(ECHO) '#define _PRODUCTION "$(PROD)"' > $(TINC)
+
+
+ $(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
+diff --git a/lib/prstreams/Makefile.in b/lib/prstreams/Makefile.in
+index aeb2944..f318097 100644
+--- a/nspr/lib/prstreams/Makefile.in
++++ b/nspr/lib/prstreams/Makefile.in
+@@ -116,13 +116,7 @@ endif
+
+ $(TINC):
+ @$(MAKE_OBJDIR)
+- @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
+- @if test ! -z "$(SH_NOW)"; then \
+- $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
+- else \
+- true; \
+- fi
+- @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
++ @$(ECHO) '#define _PRODUCTION "$(PROD)"' > $(TINC)
+
+
+ $(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
+diff --git a/pr/src/Makefile.in b/pr/src/Makefile.in
+index 19c5a69..b4ac31c 100644
+--- a/nspr/pr/src/Makefile.in
++++ b/nspr/pr/src/Makefile.in
+@@ -326,13 +326,7 @@ GARBAGE += $(TINC)
+
+ $(TINC):
+ @$(MAKE_OBJDIR)
+- @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
+- @if test ! -z "$(SH_NOW)"; then \
+- $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
+- else \
+- true; \
+- fi
+- @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
++ @$(ECHO) '#define _PRODUCTION "$(PROD)"' > $(TINC)
+
+
+ $(OBJDIR)/prvrsion.$(OBJ_SUFFIX): prvrsion.c $(TINC)
+--
+2.7.4
+
diff --git a/libs/nspr/patches/002-Add-ARC-support.patch b/libs/nspr/patches/002-Add-ARC-support.patch
new file mode 100644
index 000000000..92785cc20
--- /dev/null
+++ b/libs/nspr/patches/002-Add-ARC-support.patch
@@ -0,0 +1,88 @@
+From 6cb5b0be8837222a1e01745f2cf57cd0e593186d Mon Sep 17 00:00:00 2001
+From: Antoine Tenart <antoine.tenart@free-electrons.com>
+Date: Mon, 23 Oct 2017 10:28:20 +0200
+Subject: [PATCH] Add ARC support
+
+[Alexey: Rebased on top of other patches like RiscV, NIOS2 etc].
+
+Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
+Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
+
+Upstream-Status: Submitted [ https://bugzilla.mozilla.org/show_bug.cgi?id=1492378 ]
+---
+ pr/include/md/_linux.cfg | 45 ++++++++++++++++++++++++++++++++++++++++
+ pr/include/md/_linux.h | 2 ++
+ 2 files changed, 47 insertions(+)
+
+diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg
+index fec8525378dc..5f4fa0eac783 100644
+--- a/nspr/pr/include/md/_linux.cfg
++++ b/nspr/pr/include/md/_linux.cfg
+@@ -1157,6 +1157,51 @@
+ #define PR_BYTES_PER_WORD_LOG2 3
+ #define PR_BYTES_PER_DWORD_LOG2 3
+
++#elif defined(__arc__)
++
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 4
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 4
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
+ #else
+
+ #error "Unknown CPU architecture"
+diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
+index 8e04fad479a1..628b1217e9c8 100644
+--- a/nspr/pr/include/md/_linux.h
++++ b/nspr/pr/include/md/_linux.h
+@@ -63,6 +63,8 @@
+ #define _PR_SI_ARCHITECTURE "riscv32"
+ #elif defined(__riscv) && (__riscv_xlen == 64)
+ #define _PR_SI_ARCHITECTURE "riscv64"
++#elif defined(__arc__)
++#define _PR_SI_ARCHITECTURE "arc"
+ #else
+ #error "Unknown CPU architecture"
+ #endif
+--
+2.17.1
+
diff --git a/libs/nspr/patches/003-native_and_musl_fix.patch b/libs/nspr/patches/003-native_and_musl_fix.patch
new file mode 100644
index 000000000..c5485dbfe
--- /dev/null
+++ b/libs/nspr/patches/003-native_and_musl_fix.patch
@@ -0,0 +1,23 @@
+--- a/nspr/config/config.mk 2017-10-31 13:13:22.692343122 +0200
++++ b/nspr/config/config.mk 2017-10-31 13:13:58.758016378 +0200
+@@ -126,6 +126,9 @@
+
+ ifeq ($(USE_IPV6),1)
+ DEFINES += -D_PR_INET6
++ifeq ($(MUSL),1)
++CFLAGS += -D_PR_POLL_AVAILABLE -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO -D_PR_INET6_PROBE
++endif
+ endif
+
+ ifeq ($(MOZ_UNICODE),1)
+--- a/nspr/config/Makefile.in 2019-03-31 13:44:56.919871810 +0300
++++ b/nspr/config/Makefile.in 2019-03-31 13:45:21.560545948 +0300
+@@ -30,7 +30,7 @@
+
+ # This version hasn't been ported for us; the one in mozilla/config has
+ ifneq ($(OS_ARCH),OS2)
+-CSRCS += nsinstall.c
++#CSRCS += nsinstall.c
+
+ PLSRCS = nfspwd.pl
+ endif
diff --git a/libs/nss/Makefile b/libs/nss/Makefile
new file mode 100644
index 000000000..724af3893
--- /dev/null
+++ b/libs/nss/Makefile
@@ -0,0 +1,138 @@
+#
+# Copyright (C) 2019 Lucian Cristian
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nss
+PKG_VERSION:=3.43
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
+PKG_LICENCE:=MPL-2.0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:= \
+ https://download.cdn.mozilla.net/pub/security/$(PKG_NAME)/releases/NSS_$(subst .,_,$(PKG_VERSION))_RTM/src \
+ https://archive.mozilla.org/pub/security/$(PKG_NAME)/releases/NSS_$(subst .,_,$(PKG_VERSION))_RTM/src
+PKG_HASH:=f30bc1b7330887b75de9fec37dbc173001758dc43fb095ffbc45dac4093fe2ca
+
+PKG_BUILD_PARALLEL:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libnss
+ SECTION:=libs
+ SUBMENU:=SSL
+ CATEGORY:=Libraries
+ TITLE:=Mozilla's SSL and TLS implementation
+ URL:=https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
+ DEPENDS:=+libpthread +librt +libsqlite3 +nspr
+endef
+
+define Package/nss-utils
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Utilities for Mozilla's SSL and TLS implementation
+ URL:=https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
+ DEPENDS:=+libnss
+endef
+
+define Package/libnss/description
+ Network Security Services (NSS) is a set of libraries designed to support
+ cross-platform development of security-enabled client and server applications.
+ Applications built with NSS can support SSL v2 and v3, TLS, PKCS 5, PKCS 7,
+ PKCS 11, PKCS 12, S/MIME, X.509 v3 certificates, and other security standards.
+endef
+
+CONFIGURE_PATH = ./nss
+MAKE_PATH = ./nss
+
+LBITS = $(shell $(TARGET_CC) -dM -E - </dev/null | grep -q "__LP64__" && echo 64 || echo 32)
+
+ifeq ($(LBITS),64)
+ export USE_64=1
+endif
+
+TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+
+export CROSS_COMPILE=1
+export BUILD_OPT=1
+export NATIVE_CC=$(HOSTCC)
+export NATIVE_FLAGS=$(HOST_CFLAGS)
+export NSS_ENABLE_WERROR=0
+export NSS_DISABLE_GTESTS=1
+export NSS_USE_SYSTEM_SQLITE=1
+export OS_TARGET=Linux
+export OS_ARCH=Linux
+export OS_TEST=$(ARCH)
+export CPU_ARCH=$(ARCH)
+export fpic=$(FPIC)
+export NSPR_INCLUDE_DIR=$(STAGING_DIR)/usr/include/nspr
+export SEED_ONLY_DEV_URANDOM=1
+export OS_REL_CFLAGS=$(TARGET_CFLAGS)
+export NS_USE_GCC=1
+#size optimisation, seems to not impact speed
+export NSS_DISABLE_DBM=1
+export NSS_PKIX_NO_LDAP=1
+export ALLOW_OPT_CODE_SIZE=1
+export OPT_CODE_SIZE=1
+
+#native compile nsinstall
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ USE_NATIVE=1 OS_REL_CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" CC="$(HOSTCC)" \
+ $(MAKE) -C $(PKG_BUILD_DIR)/nss/coreconf/nsinstall
+# $(if $(CONFIG_LIBC_USE_GLIBC),, \
+# $(SED) '/-DHAVE_SYS_CDEFS_H/d' $(PKG_BUILD_DIR)/nss/lib/dbm/config/config.mk)
+endef
+
+define Package/libnss/conffiles
+/etc/pki/nssdb
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) \
+ $(1)/usr/include/nss \
+ $(1)/usr/lib \
+ $(1)/usr/lib/pkgconfig
+ $(FIND) $(PKG_BUILD_DIR)/nss -type f -name *.h \
+ -exec $(CP) -a {} $(1)/usr/include/nss/ \;
+ $(FIND) $(PKG_BUILD_DIR)/nss -type f -name *.so \
+ -exec $(CP) -a {} $(1)/usr/lib/ \;
+ $(FIND) $(PKG_BUILD_DIR)/nss -type f -name *.pc \
+ -exec $(CP) -a {} $(1)/usr/lib/pkgconfig/ \;
+endef
+
+define Package/nss-utils/install
+ $(INSTALL_DIR) \
+ $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/nss/cmd/certutil/build_dir/certutil $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/nss/cmd/pk12util/build_dir/pk12util $(1)/usr/bin
+endef
+
+#for now pack only libreswan needed libs
+define Package/libnss/install
+ $(INSTALL_DIR) \
+ $(1)/usr/lib \
+ $(1)/etc/pki/nssdb \
+ $(1)/etc/ipsec.d
+
+ $(CP) $(PKG_BUILD_DIR)/nss/lib/nss/build_dir/libnss3.so $(1)/usr/lib/
+ $(CP) $(PKG_BUILD_DIR)/nss/lib/smime/build_dir/libsmime3.so $(1)/usr/lib/
+ $(CP) $(PKG_BUILD_DIR)/nss/lib/ssl/build_dir/libssl3.so $(1)/usr/lib/
+ $(CP) $(PKG_BUILD_DIR)/nss/lib/util/build_dir/libnssutil3.so $(1)/usr/lib/
+ $(CP) $(PKG_BUILD_DIR)/nss/lib/softoken/build_dir/libsoftokn3.so $(1)/usr/lib/
+ $(CP) $(PKG_BUILD_DIR)/nss/lib/freebl/build_dir/$(OS_TARGET)_SINGLE_SHLIB/libfreeblpriv3.so $(1)/usr/lib/
+# Pprovide databases with a blank certificate
+ $(CP) ./files/blank-cert9.db $(1)/etc/pki/nssdb/cert9.db
+ $(CP) ./files/blank-key4.db $(1)/etc/pki/nssdb/key4.db
+ $(CP) ./files/system-pkcs11.txt $(1)/etc/pki/nssdb/pkcs11.txt
+ ln -s /etc/pki/nssdb/cert9.db $(1)/etc/ipsec.d/cert9.db
+ ln -s /etc/pki/nssdb/key4.db $(1)/etc/ipsec.d/key4.db
+ ln -s /etc/pki/nssdb/pkcs11.txt $(1)/etc/ipsec.d/pkcs11.txt
+endef
+
+$(eval $(call BuildPackage,nss-utils))
+$(eval $(call BuildPackage,libnss))
diff --git a/libs/nss/files/blank-cert9.db b/libs/nss/files/blank-cert9.db
new file mode 100644
index 000000000..7d4bcf258
--- /dev/null
+++ b/libs/nss/files/blank-cert9.db
Binary files differ
diff --git a/libs/nss/files/blank-key4.db b/libs/nss/files/blank-key4.db
new file mode 100644
index 000000000..d47f08d04
--- /dev/null
+++ b/libs/nss/files/blank-key4.db
Binary files differ
diff --git a/libs/nss/files/system-pkcs11.txt b/libs/nss/files/system-pkcs11.txt
new file mode 100644
index 000000000..1a264e9cc
--- /dev/null
+++ b/libs/nss/files/system-pkcs11.txt
@@ -0,0 +1,5 @@
+library=
+name=NSS Internal PKCS #11 Module
+parameters=configdir='sql:/etc/pki/nssdb' certPrefix='' keyPrefix='' secmod='secmod.db' flags= updatedir='' updateCertPrefix='' updateKeyPrefix='' updateid='' updateTokenDescription=''
+NSS=Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={slotFlags=[ECC,RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512] askpw=any timeout=30})
+
diff --git a/libs/nss/patches/001-nss_standalone.patch b/libs/nss/patches/001-nss_standalone.patch
new file mode 100644
index 000000000..eb3b6fd00
--- /dev/null
+++ b/libs/nss/patches/001-nss_standalone.patch
@@ -0,0 +1,247 @@
+Submitted By: DJ Lucas <dj_AT_linuxfromscratch_DOT_org>
+Date: 2016-12-27
+Initial Package Version: 3.12.4
+Upstream Status: Not applicable
+Origin: Self, rediffed for nss-3.28.
+Description: Adds auto-generated nss.pc and nss-config script, and
+ allows building without nspr in the source tree.
+ For 3.40.1, Requires: updated to nspr >= 4.20.
+
+diff -Naurp nss-3.28-orig/nss/Makefile nss-3.28/nss/Makefile
+--- nss-3.28-orig/nss/Makefile 2016-12-21 05:56:27.000000000 -0600
++++ nss-3.28/nss/Makefile 2016-12-26 22:24:52.695146032 -0600
+@@ -46,7 +46,7 @@ include $(CORE_DEPTH)/coreconf/rules.mk
+ # (7) Execute "local" rules. (OPTIONAL). #
+ #######################################################################
+
+-nss_build_all: build_nspr all latest
++nss_build_all: all latest
+
+ nss_clean_all: clobber_nspr clobber
+
+diff -Naurp nss-3.28-orig/nss/config/Makefile nss-3.28/nss/config/Makefile
+--- nss-3.28-orig/nss/config/Makefile 1969-12-31 18:00:00.000000000 -0600
++++ nss-3.28/nss/config/Makefile 2016-12-26 22:20:40.008205774 -0600
+@@ -0,0 +1,40 @@
++CORE_DEPTH = ..
++DEPTH = ..
++
++include $(CORE_DEPTH)/coreconf/config.mk
++
++NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
++NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
++NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
++PREFIX = /usr
++
++all: export libs
++
++export:
++ # Create the nss.pc file
++ mkdir -p $(DIST)/lib/pkgconfig
++ sed -e "s,@prefix@,$(PREFIX)," \
++ -e "s,@exec_prefix@,\$${prefix}," \
++ -e "s,@libdir@,\$${prefix}/lib," \
++ -e "s,@includedir@,\$${prefix}/include/nss," \
++ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
++ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
++ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
++ nss.pc.in > nss.pc
++ chmod 0644 nss.pc
++ ln -sf ../../../../nss/config/nss.pc $(DIST)/lib/pkgconfig
++
++ # Create the nss-config script
++ mkdir -p $(DIST)/bin
++ sed -e "s,@prefix@,$(PREFIX)," \
++ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
++ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
++ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
++ nss-config.in > nss-config
++ chmod 0755 nss-config
++ ln -sf ../../../nss/config/nss-config $(DIST)/bin
++
++libs:
++
++dummy: all export libs
++
+diff -Naurp nss-3.28-orig/nss/config/nss-config.in nss-3.28/nss/config/nss-config.in
+--- nss-3.28-orig/nss/config/nss-config.in 1969-12-31 18:00:00.000000000 -0600
++++ nss-3.28/nss/config/nss-config.in 2016-12-26 22:20:40.008205774 -0600
+@@ -0,0 +1,153 @@
++#!/bin/sh
++
++prefix=@prefix@
++
++major_version=@NSS_MAJOR_VERSION@
++minor_version=@NSS_MINOR_VERSION@
++patch_version=@NSS_PATCH_VERSION@
++
++usage()
++{
++ cat <<EOF
++Usage: nss-config [OPTIONS] [LIBRARIES]
++Options:
++ [--prefix[=DIR]]
++ [--exec-prefix[=DIR]]
++ [--includedir[=DIR]]
++ [--libdir[=DIR]]
++ [--version]
++ [--libs]
++ [--cflags]
++Dynamic Libraries:
++ nss
++ nssutil
++ smime
++ ssl
++ softokn
++EOF
++ exit $1
++}
++
++if test $# -eq 0; then
++ usage 1 1>&2
++fi
++
++lib_nss=yes
++lib_nssutil=yes
++lib_smime=yes
++lib_ssl=yes
++lib_softokn=yes
++
++while test $# -gt 0; do
++ case "$1" in
++ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
++ *) optarg= ;;
++ esac
++
++ case $1 in
++ --prefix=*)
++ prefix=$optarg
++ ;;
++ --prefix)
++ echo_prefix=yes
++ ;;
++ --exec-prefix=*)
++ exec_prefix=$optarg
++ ;;
++ --exec-prefix)
++ echo_exec_prefix=yes
++ ;;
++ --includedir=*)
++ includedir=$optarg
++ ;;
++ --includedir)
++ echo_includedir=yes
++ ;;
++ --libdir=*)
++ libdir=$optarg
++ ;;
++ --libdir)
++ echo_libdir=yes
++ ;;
++ --version)
++ echo ${major_version}.${minor_version}.${patch_version}
++ ;;
++ --cflags)
++ echo_cflags=yes
++ ;;
++ --libs)
++ echo_libs=yes
++ ;;
++ nss)
++ lib_nss=yes
++ ;;
++ nssutil)
++ lib_nssutil=yes
++ ;;
++ smime)
++ lib_smime=yes
++ ;;
++ ssl)
++ lib_ssl=yes
++ ;;
++ softokn)
++ lib_softokn=yes
++ ;;
++ *)
++ usage 1 1>&2
++ ;;
++ esac
++ shift
++done
++
++# Set variables that may be dependent upon other variables
++if test -z "$exec_prefix"; then
++ exec_prefix=`pkg-config --variable=exec_prefix nss`
++fi
++if test -z "$includedir"; then
++ includedir=`pkg-config --variable=includedir nss`
++fi
++if test -z "$libdir"; then
++ libdir=`pkg-config --variable=libdir nss`
++fi
++
++if test "$echo_prefix" = "yes"; then
++ echo $prefix
++fi
++
++if test "$echo_exec_prefix" = "yes"; then
++ echo $exec_prefix
++fi
++
++if test "$echo_includedir" = "yes"; then
++ echo $includedir
++fi
++
++if test "$echo_libdir" = "yes"; then
++ echo $libdir
++fi
++
++if test "$echo_cflags" = "yes"; then
++ echo -I$includedir
++fi
++
++if test "$echo_libs" = "yes"; then
++ libdirs="-L$libdir"
++ if test -n "$lib_nss"; then
++ libdirs="$libdirs -lnss${major_version}"
++ fi
++ if test -n "$lib_nssutil"; then
++ libdirs="$libdirs -lnssutil${major_version}"
++ fi
++ if test -n "$lib_smime"; then
++ libdirs="$libdirs -lsmime${major_version}"
++ fi
++ if test -n "$lib_ssl"; then
++ libdirs="$libdirs -lssl${major_version}"
++ fi
++ if test -n "$lib_softokn"; then
++ libdirs="$libdirs -lsoftokn${major_version}"
++ fi
++ echo $libdirs
++fi
++
+diff -Naurp nss-3.28-orig/nss/config/nss.pc.in nss-3.28/nss/config/nss.pc.in
+--- nss-3.28-orig/nss/config/nss.pc.in 1969-12-31 18:00:00.000000000 -0600
++++ nss-3.28/nss/config/nss.pc.in 2016-12-26 22:22:53.300694346 -0600
+@@ -0,0 +1,12 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: NSS
++Description: Network Security Services
++Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
++Requires: nspr >= 4.20
++Libs: -L@libdir@ -lnss@NSS_MAJOR_VERSION@ -lnssutil@NSS_MAJOR_VERSION@ -lsmime@NSS_MAJOR_VERSION@ -lssl@NSS_MAJOR_VERSION@ -lsoftokn@NSS_MAJOR_VERSION@
++Cflags: -I${includedir}
++
+diff -Naurp nss-3.28-orig/nss/manifest.mn nss-3.28/nss/manifest.mn
+--- nss-3.28-orig/nss/manifest.mn 2016-12-21 05:56:27.000000000 -0600
++++ nss-3.28/nss/manifest.mn 2016-12-26 22:24:12.278991843 -0600
+@@ -10,4 +10,4 @@ IMPORTS = nspr20/v4.8 \
+
+ RELEASE = nss
+
+-DIRS = coreconf lib cmd cpputil gtests
++DIRS = coreconf lib cmd cpputil gtests config
diff --git a/libs/nss/patches/002-os_test.patch b/libs/nss/patches/002-os_test.patch
new file mode 100644
index 000000000..ce2b683d1
--- /dev/null
+++ b/libs/nss/patches/002-os_test.patch
@@ -0,0 +1,18 @@
+--- a/nss/coreconf/arch.mk 2019-04-01 22:20:32.470080052 +0300
++++ b/nss/coreconf/arch.mk 2019-04-01 22:21:01.730987548 +0300
+@@ -20,13 +20,13 @@
+ # Macros for getting the OS architecture
+ #
+
+-OS_ARCH := $(subst /,_,$(shell uname -s))
++OS_ARCH ?= $(subst /,_,$(shell uname -s))
+
+ #
+ # Attempt to differentiate between sparc and x86 Solaris
+ #
+
+-OS_TEST := $(shell uname -m)
++OS_TEST ?= $(shell uname -m)
+ ifeq ($(OS_TEST),i86pc)
+ OS_RELEASE := $(shell uname -r)_$(OS_TEST)
+ else
diff --git a/libs/nss/patches/003-openwrt_fix.patch b/libs/nss/patches/003-openwrt_fix.patch
new file mode 100644
index 000000000..d4af64253
--- /dev/null
+++ b/libs/nss/patches/003-openwrt_fix.patch
@@ -0,0 +1,86 @@
+--- a/nss/lib/dbm/src/dirent.h 2017-10-19 17:15:14.797053528 +0300
++++ b/nss/lib/dbm/src/dirent.h 2017-10-19 17:15:26.156310432 +0300
+@@ -30,7 +30,7 @@
+ #define MAXNAMLEN FILENAME_MAX
+
+ #else
+-#include <param.h>
++#include <sys/param.h>
+ #endif
+ #endif
+
+--- a/nss/coreconf/rules.mk 2019-03-31 22:39:06.741609534 +0300
++++ b/nss/coreconf/rules.mk 2019-03-31 22:36:13.260356949 +0300
+@@ -261,7 +261,7 @@
+ ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
+ $(AR) $(subst /,\\,$(OBJS))
+ else
+- $(AR) $(OBJS)
++ $(AR) rcs $@ $(OBJS)
+ endif
+ $(RANLIB) $@
+
+--- a/nss/coreconf/arch.mk 2019-03-31 23:38:34.374931416 +0300
++++ b/nss/coreconf/arch.mk 2019-03-31 23:38:44.667236102 +0300
+@@ -305,7 +305,7 @@
+ OBJDIR_NAME_COMPILER = $(COMPILER_TAG)
+ endif
+ OBJDIR_NAME_BASE = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(OBJDIR_NAME_COMPILER)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG)
+-OBJDIR_NAME = $(OBJDIR_NAME_BASE).OBJ
++OBJDIR_NAME = build_dir
+
+
+ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+--- a/nss/coreconf/Linux.mk 2019-04-01 10:08:59.129269177 +0300
++++ b/nss/coreconf/Linux.mk 2019-04-01 10:09:15.557782574 +0300
+@@ -139,6 +139,7 @@
+ DEFINES += -D_REENTRANT
+ endif
+
++ifndef USE_NATIVE
+ DSO_CFLAGS = -fPIC
+ DSO_LDOPTS = -shared $(ARCHFLAG) -Wl,--gc-sections
+ # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
+@@ -149,6 +150,7 @@
+ ZDEFS_FLAG = -Wl,-z,defs
+ DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
+ LDFLAGS += $(ARCHFLAG) -z noexecstack
++endif
+
+ # On Maemo, we need to use the -rpath-link flag for even the standard system
+ # library directories.
+--- a/nss/coreconf/Linux.mk 2019-04-01 23:10:19.091912203 +0300
++++ b/nss/coreconf/Linux.mk 2019-04-06 14:07:13.499169075 +0300
+@@ -140,7 +140,7 @@
+ endif
+
+ ifndef USE_NATIVE
+-DSO_CFLAGS = -fPIC
++DSO_CFLAGS = $(fpic)
+ DSO_LDOPTS = -shared $(ARCHFLAG) -Wl,--gc-sections
+ # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
+ # incorrectly reports undefined references in the libraries we link with, so
+--- a/nss/coreconf/Linux.mk 2019-04-06 20:25:36.431663894 +0300
++++ b/nss/coreconf/Linux.mk 2019-04-06 20:26:23.397129525 +0300
+@@ -107,11 +107,6 @@
+ endif
+
+ ifdef BUILD_OPT
+-ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
+- OPTIMIZER = -Os
+-else
+- OPTIMIZER = -O2
+-endif
+ ifdef MOZ_DEBUG_SYMBOLS
+ ifdef MOZ_DEBUG_FLAGS
+ OPTIMIZER += $(MOZ_DEBUG_FLAGS)
+--- a/nss/coreconf/UNIX.mk 2019-04-06 20:34:24.284157646 +0300
++++ b/nss/coreconf/UNIX.mk 2019-04-06 20:34:34.760485327 +0300
+@@ -10,7 +10,6 @@
+ LDOPTS += -L$(SOURCE_LIB_DIR)
+
+ ifdef BUILD_OPT
+- OPTIMIZER += -O
+ DEFINES += -UDEBUG -DNDEBUG
+ else
+ OPTIMIZER += -g
diff --git a/libs/protobuf-c/Makefile b/libs/protobuf-c/Makefile
index 6199766c3..e1f61e962 100644
--- a/libs/protobuf-c/Makefile
+++ b/libs/protobuf-c/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libprotobuf-c
PKG_VERSION:=1.3.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=protobuf-c-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/protobuf-c/protobuf-c/releases/download/v$(PKG_VERSION)
@@ -43,6 +43,9 @@ define Package/libprotobuf-c/description
internal RPC protocols and file formats.
endef
+HOST_CONFIGURE_ARGS += \
+ --disable-protoc
+
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
diff --git a/libs/protobuf/Makefile b/libs/protobuf/Makefile
index c93527f05..3d0a16f28 100644
--- a/libs/protobuf/Makefile
+++ b/libs/protobuf/Makefile
@@ -8,19 +8,19 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=protobuf
-PKG_VERSION:=3.5.1
+PKG_VERSION:=3.7.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-cpp-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/google/protobuf/releases/download/v$(PKG_VERSION)
-PKG_HASH:=c28dba8782da2cfea1e11c61d335958c31a9c1bc553063546af9cbe98f204092
+PKG_HASH:=97f6cdaa0724d5a8cd3375d5f5cf4bd253d5ad5291154f533ed0d94a9d501ef3
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=protobuf/host
-PKG_USE_MIPS16:=0# MIPS16 prevents protobuf's usage of the 'sync' asm-opcode
+PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
@@ -31,7 +31,7 @@ define Package/protobuf/Default
CATEGORY:=Libraries
TITLE:=A structured data encoding library
URL:=https://github.com/google/protobuf
- DEPENDS:=+zlib +libpthread +libstdcpp
+ DEPENDS:=+zlib +libpthread +libatomic +libstdcpp
MAINTAINER:=Ken Keys <kkeys@caida.org>
endef
diff --git a/net/aircrack-ng/Makefile b/net/aircrack-ng/Makefile
index 51ce5e998..c4f5d8dab 100644
--- a/net/aircrack-ng/Makefile
+++ b/net/aircrack-ng/Makefile
@@ -9,13 +9,16 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=aircrack-ng
PKG_VERSION:=1.5.2
-PKG_RELEASE:=1
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/aircrack-ng/aircrack-ng/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=7e03f9828495a3a1a781ad79e41805971bf7347c092df852820232bca866a19b
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/aircrack-ng/aircrack-ng.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=42f2b48d7f46b39e0d5d2f2a64cbf63f87416a70
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=17893e05278635675a77a3cb0927202ec4df2fc9a742689a7a88e4a8f27a69b6
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
@@ -33,12 +36,13 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_AIRCRACK_NG_HWLOC \
CONFIG_AIRCRACK_NG_SQLITE3
+include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
define Package/aircrack-ng
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+AIRCRACK_NG_HWLOC:libhwloc +libpcap +libpcre +libpthread +libstdcpp
+ DEPENDS:=+AIRCRACK_NG_HWLOC:libhwloc +libpcap +libpcre +libpthread $(CXX_DEPENDS)
DEPENDS += +AIRCRACK_NG_OPENSSL:libopenssl
DEPENDS += +AIRCRACK_NG_GCRYPT:libgcrypt
DEPENDS += +AIRCRACK_NG_SQLITE3:libsqlite3
@@ -69,6 +73,11 @@ define Package/airmon-ng/description
Bash script designed to turn wireless cards into monitor mode.
endef
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ echo "$(PKG_VERSION)_rev$(PKG_SOURCE_VERSION)" > $(PKG_BUILD_DIR)/VERSION
+endef
+
CONFIGURE_ARGS += \
--disable-silent-rules \
--enable-shared \
@@ -79,10 +88,10 @@ CONFIGURE_ARGS += \
\
PYTHON=$(PYTHON) \
\
- $(if $(CONFIG_AIRCRACK_NG_OPENSSL),--with-openssl,--without-openssl) \
+ $(if $(CONFIG_AIRCRACK_NG_OPENSSL),,--without-openssl) \
$(if $(CONFIG_AIRCRACK_NG_GCRYPT),--with-gcrypt,--without-gcrypt) \
$(if $(CONFIG_AIRCRACK_NG_HWLOC),--enable-hwloc,--disable-hwloc) \
- $(if $(CONFIG_AIRCRACK_NG_SQLITE3),--with-sqlite3,--without-sqlite3)
+ $(if $(CONFIG_AIRCRACK_NG_SQLITE3),--with-sqlite3=$(STAGING_DIR)/usr,--without-sqlite3)
TARGET_CFLAGS += -Wall -Wextra -ffunction-sections -fdata-sections
diff --git a/net/nginx/Makefile b/net/nginx/Makefile
index 4a5272059..17794f87f 100644
--- a/net/nginx/Makefile
+++ b/net/nginx/Makefile
@@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=nginx
-PKG_VERSION:=1.15.8
+PKG_VERSION:=1.15.10
PKG_RELEASE:=1
PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://nginx.org/download/
-PKG_HASH:=a8bdafbca87eb99813ae4fcac1ad0875bf725ce19eb265d28268c309b2b40787
+PKG_HASH:=b865743abd52bce4745d0f7e7fedde3cafbaaab617b022c105e3e4e456537c3c
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> \
Ansuel Smith <ansuelsmth@gmail.com>
@@ -71,6 +71,7 @@ PKG_CONFIG_DEPENDS := \
CONFIG_NGINX_STREAM_SSL_PREREAD_MODULE \
CONFIG_NGINX_RTMP_MODULE \
CONFIG_NGINX_TS_MODULE \
+ CONFIG_OPENSSL_ENGINE \
include $(INCLUDE_DIR)/package.mk
@@ -80,7 +81,7 @@ define Package/nginx/default
SUBMENU:=Web Servers/Proxies
TITLE:=Nginx web server
URL:=http://nginx.org/
- DEPENDS:=+NGINX_PCRE:libpcre +(NGINX_SSL||NGINX_HTTP_CACHE||NGINX_HTTP_AUTH_BASIC):libopenssl \
+ DEPENDS:=+NGINX_PCRE:libpcre +NGINX_SSL:libopenssl \
+NGINX_HTTP_GZIP:zlib +NGINX_LUA:liblua +libpthread +NGINX_DAV:libexpat
endef
@@ -104,7 +105,7 @@ define Package/nginx-ssl
endef
Package/nginx-ssl/description = $(Package/nginx/description) \
- This varian is compiled with SSL support enabled. To enable additional module \
+ This variant is compiled with SSL support enabled. To enable additional module \
select them in the nginx default configuration menu.
define Package/nginx-all-module
@@ -116,7 +117,7 @@ define Package/nginx-all-module
endef
Package/nginx-all-module/description = $(Package/nginx/description) \
- This varian is compiled with ALL module selected.
+ This variant is compiled with ALL module selected.
define Package/nginx/config
source "$(SOURCE)/Config.in"
diff --git a/net/prosody/Makefile b/net/prosody/Makefile
index f102735de..c5c0d8913 100644
--- a/net/prosody/Makefile
+++ b/net/prosody/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=prosody
PKG_VERSION:=0.11.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://prosody.im/downloads/source
@@ -30,7 +30,7 @@ define Package/prosody
SUBMENU:=Instant Messaging
DEPENDS:=+luafilesystem +libidn +luaexpat +luasec +libopenssl +libidn +liblua +luabitop
TITLE:=XMPP server
- URL:=http://prosody.im/
+ URL:=https://prosody.im/
USERID:=prosody=54:prosody=54
endef
@@ -44,10 +44,10 @@ define Package/prosody/conffiles
/etc/prosody/prosody.cfg.lua
endef
-TARGET_CFLAGS += $(FPIC)
-
-TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
+TARGET_CFLAGS += $(FPIC) -std=gnu99
+TARGET_LDFLAGS += -shared
+MAKE_FLAGS += LD="$(TARGET_CC)"
define Build/Configure
# this is *NOT* GNU autoconf stuff
@@ -57,17 +57,11 @@ define Build/Configure
--with-lua-include="$(STAGING_DIR)/usr/include" \
--with-lua-lib="$(STAGING_DIR)/usr/lib" \
--cflags="$(TARGET_CFLAGS)" \
- --ldflags="$(TARGET_LDFLAGS) -llua -lm -ldl -shared" \
+ --ldflags="$(TARGET_LDFLAGS)" \
--c-compiler="$(CC)" \
- --linker="$(LD)" \
--datadir="/etc/prosody/data" \
)
endef
-# LDFLAGS="$(TARGET_LDFLAGS) -llua -lm -ldl" \
-
-MAKE_FLAGS += \
- CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -std=gnu99" \
- PREFIX="/usr" \
define Package/prosody/install
$(INSTALL_DIR) $(1)/etc/init.d
@@ -124,7 +118,7 @@ define Package/prosody/postinst
paxctl -v /usr/bin/ > /dev/null 2>&1
[ $$? -ne 0 ] && {
cp /usr/bin/lua /tmp
- paxctl -c -m /tmp/lua > /dev/null 2>&1
+ paxctl -c -m /tmp/lua > /dev/null 2>&1
cp -f /tmp/lua /usr/bin/lua
}
}
diff --git a/net/snort3/Makefile b/net/snort3/Makefile
index f5f3d8807..34efb7a9d 100644
--- a/net/snort3/Makefile
+++ b/net/snort3/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=snort3
PKG_VERSION:=3.0.0-beta
PKG_VERSION_SHORT:=3.0.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
@@ -50,6 +50,7 @@ CMAKE_OPTIONS += \
-DMAKE_HTML_DOC:BOOL=NO \
-DMAKE_PDF_DOC:BOOL=NO \
-DMAKE_TEXT_DOC:BOOL=NO \
+ -DHAVE_LZMA=OFF
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc
TARGET_LDFLAGS += -ltirpc