Skip to content

Commit

Permalink
Regenerate from zproject
Browse files Browse the repository at this point in the history
  • Loading branch information
benjdero committed Aug 5, 2024
1 parent f2fd725 commit 90ec613
Show file tree
Hide file tree
Showing 17 changed files with 222 additions and 67 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,41 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: ubuntu-20.04
BUILD_TYPE: default
DRAFT: enabled
CLANG_FORMAT: clang-format-11
PACKAGES: automake autoconf clang-format-11 git libzmq3-dev libunwind-dev libczmq-dev asciidoc xmlto
- os: ubuntu-latest
PACKAGES: automake autoconf clang-format-11 git libzmq3-dev libczmq-dev asciidoc xmlto
- os: ubuntu-20.04
BUILD_TYPE: default
DRAFT: disabled
CLANG_FORMAT: clang-format-11
PACKAGES: automake autoconf clang-format-11 git libzmq3-dev libunwind-dev libczmq-dev
- os: ubuntu-latest
PACKAGES: automake autoconf clang-format-11 git libzmq3-dev libczmq-dev
- os: ubuntu-20.04
BUILD_TYPE: valgrind
DRAFT: enabled
PACKAGES: automake autoconf valgrind git libzmq3-dev libunwind-dev libczmq-dev
- os: ubuntu-latest
PACKAGES: automake autoconf valgrind git libzmq3-dev libczmq-dev
- os: ubuntu-20.04
BUILD_TYPE: cmake
DRAFT: enabled
PACKAGES: cmake git libzmq3-dev libunwind-dev libczmq-dev
PACKAGES: cmake git libzmq3-dev libczmq-dev
- os: macos-latest
BUILD_TYPE: default
PACKAGES: automake autoconf zeromq
PACKAGES: automake autoconf libtool zeromq
DRAFT: enabled
- os: macos-latest
BUILD_TYPE: default
DRAFT: disabled
PACKAGES: automake autoconf zeromq
PACKAGES: automake autoconf libtool zeromq
# For non-cmake users, there is an autotools solution with a bit more overhead
# to have dependencies ready and pass configure script before making this check).
# Note that the autotools variant will also require dependencies preinstalled to
# pass its configure script:
- os: ubuntu-latest
- os: ubuntu-20.04
BUILD_TYPE: cmake
DO_CLANG_FORMAT_CHECK: 1
CLANG_FORMAT: clang-format-11
PACKAGES: cmake clang-format-11 git libzmq3-dev libunwind-dev libczmq-dev
PACKAGES: cmake clang-format-11 git libzmq3-dev libczmq-dev
env:
# Set CI_TIME: true to enable build-step profiling
# Set CI_TRACE: true to enable shell script tracing
Expand All @@ -72,12 +72,12 @@ jobs:
CI_SELFTEST: ${{ matrix.CI_SELFTEST }}
steps:
- name: Add debian packages
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-20.04'
uses: myci-actions/add-deb-repo@10
with:
repo-name: obs
repo: deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_22.04/ ./
keys-asc: https://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_22.04/Release.key
repo: deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_20.04/ ./
keys-asc: https://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_20.04/Release.key
install: ${{ matrix.PACKAGES }}
- name: Add brew packages
if: matrix.os == 'macos-latest'
Expand All @@ -87,7 +87,7 @@ jobs:
with:
path: zyre
- name: build
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-latest'
shell: bash
working-directory: zyre
run: ./ci_build.sh
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ set(OPTIONAL_LIBRARIES_STATIC)
########################################################################
# LIBZMQ dependency
########################################################################
find_package(libzmq REQUIRED)
IF (NOT libzmq_FOUND)
find_package(libzmq REQUIRED)
ENDIF(NOT libzmq_FOUND)
IF (libzmq_FOUND)
include_directories(${libzmq_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${libzmq_LIBRARIES})
Expand All @@ -143,7 +145,9 @@ ENDIF (libzmq_FOUND)
########################################################################
# CZMQ dependency
########################################################################
find_package(czmq REQUIRED)
IF (NOT czmq_FOUND)
find_package(czmq REQUIRED)
ENDIF(NOT czmq_FOUND)
IF (czmq_FOUND)
include_directories(${czmq_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${czmq_LIBRARIES})
Expand Down
16 changes: 12 additions & 4 deletions bindings/jni/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@
################################################################################
*/

buildscript {
configurations.configureEach {
resolutionStrategy {
force 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
}
exclude group: 'xerces', module: 'xercesImpl'
}
}

plugins {
id 'java'
id 'maven-publish'
id 'com.jfrog.artifactory' version '4.21.0'
id 'com.jfrog.artifactory' version '5.2.3'
id 'com.jfrog.bintray' version '1.8.5'
id 'com.google.osdetector' version '1.7.0'
id 'com.google.osdetector' version '1.7.3'
}

wrapper.gradleVersion = '7.5.1'
wrapper.gradleVersion = '8.9'

subprojects {
apply plugin: 'java'
Expand Down Expand Up @@ -47,7 +56,6 @@ artifactory {
repoKey = 'oss-snapshot-local'
username = System.getenv('ARTIFACTORY_USERNAME')
password = System.getenv('ARTIFACTORY_PASSWORD')
maven = true
}
}
}
Expand Down
1 change: 0 additions & 1 deletion bindings/jni/zyre-jni-all/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ artifactoryPublish {
publications ('mavenJava')
}


bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
Expand Down
6 changes: 3 additions & 3 deletions bindings/jni/zyre-jni-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
// ------------------------------------------------------------------
// Build section

task copyLibs(type: Copy) {
tasks.register('copyLibs', Copy) {
def libraryPaths = []
if (project.hasProperty('buildPrefix')) {
if (osdetector.os == 'windows') {
Expand All @@ -24,7 +24,7 @@ task copyLibs(type: Copy) {
}

def javaLibraryPaths = System.getProperty('java.library.path').split(File.pathSeparator).toList()
libraryPaths.addAll (javaLibraryPaths)
libraryPaths.addAll(javaLibraryPaths)

libraryPaths.add('/usr/local/lib')
if (osdetector.os == 'windows') {
Expand Down Expand Up @@ -54,7 +54,7 @@ task copyLibs(type: Copy) {
duplicatesStrategy = oldStrategy
}

jar.baseName = "zyre-jni-${osdetector.classifier}"
jar.archiveBaseName = "zyre-jni-${osdetector.classifier}"
jar.dependsOn copyLibs

jar {
Expand Down
46 changes: 25 additions & 21 deletions bindings/jni/zyre-jni/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ ext.hasNotEmptyProperty = { propertyName ->

dependencies {
implementation "org.zeromq.czmq:czmq-jni:$jni_dependencies_version"
implementation 'org.scijava:native-lib-loader:2.4.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
implementation 'org.scijava:native-lib-loader:2.5.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:2.2'
}

// ------------------------------------------------------------------
// Build section

task generateJniHeaders(type: Exec, dependsOn: 'classes') {
tasks.register('generateJniHeaders', Exec) {
dependsOn 'classes'
def classpath = sourceSets.main.output.classesDirs
def appclasspath = configurations.runtimeClasspath.files*.getAbsolutePath().join(File.pathSeparator)
def nativeIncludes = 'src/native/include'
Expand All @@ -34,14 +35,14 @@ task generateJniHeaders(type: Exec, dependsOn: 'classes') {
commandLine("javac", "-h", "$nativeIncludes", "-classpath", "$classpath${File.pathSeparator}$appclasspath", *jniClasses, *utilityClasses)
}

tasks.withType(Test) {
tasks.withType(Test).configureEach {
def defaultJavaLibraryPath = System.getProperty("java.library.path")
if (osdetector.os == 'windows') {
def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix\\bin;$project.buildPrefix\\lib" : ''
extraJavaLibraryPath = extraJavaLibraryPath.replace("/", "\\")
systemProperty "java.library.path", "${projectDir}\\build\\Release${File.pathSeparator}" +
"${extraJavaLibraryPath}${File.pathSeparator}" +
"${defaultJavaLibraryPath}"
def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix\\bin;$project.buildPrefix\\lib" : ''
extraJavaLibraryPath = extraJavaLibraryPath.replace("/", "\\")
systemProperty "java.library.path", "${projectDir}\\build\\Release${File.pathSeparator}" +
"${extraJavaLibraryPath}${File.pathSeparator}" +
"${defaultJavaLibraryPath}"
} else {
def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix/lib" : ''
systemProperty "java.library.path", "${projectDir}/build${File.pathSeparator}" +
Expand All @@ -52,22 +53,24 @@ tasks.withType(Test) {
}
}

task initCMake(type: Exec, dependsOn: 'generateJniHeaders') {
workingDir 'build'
tasks.register('initCMake', Exec) {
dependsOn 'generateJniHeaders'
workingDir 'build'
def prefixPath = hasNotEmptyProperty('buildPrefix') ? "-DCMAKE_PREFIX_PATH=$project.buildPrefix" : ''
commandLine 'cmake', "$prefixPath", '..'
}

task buildNative(type: Exec, dependsOn: 'initCMake') {
tasks.register('buildNative', Exec) {
dependsOn 'initCMake'
if (osdetector.os == 'windows') {
commandLine 'cmake',
'--build', 'build',
'--build', 'build',
'--config', 'Release',
'--target', 'zyrejni',
'--', '-verbosity:Minimal', '-maxcpucount'
'--', '-verbosity:Minimal', '-maxcpucount'
} else {
commandLine 'cmake',
'--build', 'build'
'--build', 'build'
}
}

Expand All @@ -77,13 +80,15 @@ test.dependsOn buildNative
// ------------------------------------------------------------------
// Install and Publish section

task sourcesJar(type: Jar, dependsOn: 'classes') {
classifier = 'sources'
tasks.register('sourcesJar', Jar) {
dependsOn 'classes'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: 'javadoc') {
classifier = 'javadoc'
tasks.register('javadocJar', Jar) {
dependsOn 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

Expand Down Expand Up @@ -119,7 +124,6 @@ artifactoryPublish {
publications ('mavenJava')
}


bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
Expand Down
35 changes: 26 additions & 9 deletions bindings/python_cffi/zyre_cffi/cdefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,11 @@
zlist_t *
zdir_list (zdir_t *self);
// Returns a sorted list of char*; Each entry in the list is a path of a file
// or directory contained in self.
zlist_t *
zdir_list_paths (zdir_t *self);
// Remove directory, optionally including all files that it contains, at
// all levels. If force is false, will only remove the directory if empty.
// If force is true, will remove all files and all subdirectories.
Expand Down Expand Up @@ -1635,6 +1640,10 @@
const char *
ziflist_netmask (ziflist_t *self);
// Return the current interface MAC address as a printable string
const char *
ziflist_mac (ziflist_t *self);
// Return the list of interfaces.
void
ziflist_print (ziflist_t *self);
Expand Down Expand Up @@ -1694,13 +1703,13 @@
zlist_item (zlist_t *self);
// Append an item to the end of the list, return 0 if OK or -1 if this
// failed for some reason (out of memory). Note that if a duplicator has
// failed for some reason (invalid input). Note that if a duplicator has
// been set, this method will also duplicate the item.
int
zlist_append (zlist_t *self, void *item);
// Push an item to the start of the list, return 0 if OK or -1 if this
// failed for some reason (out of memory). Note that if a duplicator has
// failed for some reason (invalid input). Note that if a duplicator has
// been set, this method will also duplicate the item.
int
zlist_push (zlist_t *self, void *item);
Expand Down Expand Up @@ -1791,13 +1800,13 @@
// Add an item to the head of the list. Calls the item duplicator, if any,
// on the item. Resets cursor to list head. Returns an item handle on
// success, NULL if memory was exhausted.
// success.
void *
zlistx_add_start (zlistx_t *self, void *item);
// Add an item to the tail of the list. Calls the item duplicator, if any,
// on the item. Resets cursor to list head. Returns an item handle on
// success, NULL if memory was exhausted.
// success.
void *
zlistx_add_end (zlistx_t *self, void *item);
Expand Down Expand Up @@ -1902,8 +1911,7 @@
// duplicator, if any, on the item. If low_value is true, starts searching
// from the start of the list, otherwise searches from the end. Use the item
// comparator, if any, to find where to place the new node. Returns a handle
// to the new node, or NULL if memory was exhausted. Resets the cursor to the
// list head.
// to the new node. Resets the cursor to the list head.
void *
zlistx_insert (zlistx_t *self, void *item, bool low_value);
Expand Down Expand Up @@ -2360,19 +2368,19 @@
// Connects process stdin with a readable ('>', connect) zeromq socket. If
// socket argument is NULL, zproc creates own managed pair of inproc
// sockets. The writable one is then accessbile via zproc_stdin method.
// sockets. The writable one is then accessible via zproc_stdin method.
void
zproc_set_stdin (zproc_t *self, void *socket);
// Connects process stdout with a writable ('@', bind) zeromq socket. If
// socket argument is NULL, zproc creates own managed pair of inproc
// sockets. The readable one is then accessbile via zproc_stdout method.
// sockets. The readable one is then accessible via zproc_stdout method.
void
zproc_set_stdout (zproc_t *self, void *socket);
// Connects process stderr with a writable ('@', bind) zeromq socket. If
// socket argument is NULL, zproc creates own managed pair of inproc
// sockets. The readable one is then accessbile via zproc_stderr method.
// sockets. The readable one is then accessible via zproc_stderr method.
void
zproc_set_stderr (zproc_t *self, void *socket);
Expand Down Expand Up @@ -4649,6 +4657,11 @@
zosc_t *
zosc_frommem (char *data, size_t size);
// Create a new zosc message from a string. This the same syntax as
// zosc_create but written as a single line string.
zosc_t *
zosc_fromstring (const char *oscstring);
// Create a new zosc message from the given format and arguments.
// The format type tags are as follows:
// i - 32bit integer
Expand Down Expand Up @@ -4752,6 +4765,10 @@
zosc_t *
zosc_unpack (zframe_t *frame);
// Return a string describing the the OSC message. The returned string must be freed by the caller.
char *
zosc_dump (zosc_t *self);
// Dump OSC message to stdout, for debugging and tracing.
void
zosc_print (zosc_t *self);
Expand Down
Loading

0 comments on commit 90ec613

Please sign in to comment.