Compile for Openbsd


#1

Hello Damencho,

I didn’t understand what you said in this topic

Hum, why are you trying to run from source and daemonize when running from source? You should do that from a binary distribution.

Create an assembly of jitsi-videobridge and use the shellscript that is already available to run it.
mvn -U install -DskipTests -Dassembly.skipAssembly=false
I suppose you can use the resuling archive of target/jitsi-videobridge-linux-x64-1.1-SNAPSHOT.zip .

Right now I use jitsi-videobridge-linux-x64-1.1-SNAPSHOT.zip unzipped

What’s the difference between all these zip ?
What would be right, to use the linux x64 on an Openbsd plaform ? To have something specific for Openbsd ?

I also really didn’t understand this

Hum, why are you trying to run from source and daemonize when running from source? You should do that from a binary distribution.

The topic was


#2

You were showing me in that topic that you are running jvb from source, using mvn command. The assemblies produced by mvn are binaries, for every distribution, the difference is the lib/native folder containing the native for the appropriate OS and the start script that is included.

So the native libs in jvb itself I think are not so important, one of them is getting the cpu to push it in the stats.
But libjitsi also have native libraries, which you are not loading. One of the libraries is used for the datachannels, so basically you will not be able to have datachannels, you need to compile that native library and produce your own libjitsi and use that jar inside jvb.

That you should not use the source code for running jvb like a daemon, you should use some shell script to start it, the same way we have jvb.sh for linux bianries.


#3

Thank you for your answer. My ignorance in that field prevents me to understand everything.

You wrote that if I use the mvn command it means I run it from source. And it’s better not to run it from source.
Did I understand correctly ?

You told me to use a shell script like jvb.sh
I looked at it and I see something like

LD_LIBRARY_PATH=$libs exec java -Xmx$VIDEOBRIDGE_MAX_MEMORY $VIDEOBRIDGE_DEBUG_OPTIONS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Djava.library.path=$libs $LOGGING_CONFIG_PARAM $JAVA_SYS_PROPS -cp $cp mainClass @

So is it the command I should run ?

I see one important parameter

libs="$SCRIPT_DIR/lib/native/linux-64"

You’re telling me to compile the native libraries to produce my own libjitsi and use the jar in jvb
How do I do that ?
I didn’t see a jar in that folder but some .so

libhwaddressretriever.so libsigar-amd64-linux.so

One of the libraries is used for the datachannels, so basically you will not be able to have datachannels

What does it mean if I don’t have the datachannels ?


#4

For example datachannels are used for notifying who is the dominant speaker and to send information to the bridge who is the participant on stage so the bridge can switch to higher resolution video for that participant.

The datachannels binary is bundled inside libjitsi library jar, the source is at https://github.com/jitsi/libjitsi


#5

Regarding all parameters such as

net.java.sip.communicator.service.media.DISABLE_AUDIO_SUPPORT= boolean

Should they be placed in the sip-communicator.properties file ?

About my other questions, should I compile from source ?

libhwaddressretriever.so libsigar-amd64-linux.so

Is that what you said ?

But you wrote

you need to compile that native library and produce your own libjitsi and use that jar inside jvb.

So I don’t understand if I have to compile a .so or a .jar


#6

These are the binaries for the jvb.

I was explaining about datachannels, which binaries are in another library called libjitsi. You need to recompile them, make sure you edit manifest file so jna can load it on your OS and rebuuld the libjitsi jar and use that jar inside videobridge. The native binaries are inside the resulted jar.


#7

Hello Damencho,

I don’t understand how to do that.

I did

# git clone https://github.com/jitsi/lib-jitsi-meet
# cd lib-jitsi-meet
# npm install

But I don’t find any .jar file there.


#8

It is not lib-jitsi-meet, it is libjitsi. Look at the link I sent you earlier.


#9

Thank you damencho for this clarification.

So Far I did this

# cd /usr/local && git clone https://github.com/jitsi/libjitsi
# cd libjitsi
# mvn install -Dmaven.test.skip=true
# ls /usr/local/libjitsi/target/libjitsi-1.0-SNAPSHOT.jar
/usr/local/libjitsi/target/libjitsi-1.0-SNAPSHOT.jar

But how should I use /usr/local/libjitsi/target/libjitsi-1.0-SNAPSHOT.jar ?

I have this on my system

ls /usr/local/jicofo/target/jicofo-linux-x64-1.1-SNAPSHOT/lib/libjitsi-1.0-20180829.231707-362.jar

Should I do

mkdir /usr/local/jicofo/target/jicofo-openbsd-x64-1.1-SNAPSHOT/

And copy the .jar there ?


#10

It is libjitsi in jvb not jicofo. Did you compile sctp? https://github.com/jitsi/libjitsi/tree/master/src/native/sctp
Did you bundle your openbsd specific binaries checkout the pom file.


#11

Thank you for your answer.

No I didn’t compile sctp

# cd /usr/local && git clone https://github.com/sctplab/usrsctp.git
# cd usrsctp
# ./configure --with-pic
ksh: ./configure: not found

But for some reason I can’t use the configure command.

I really don’t understand your sentence

Did you bundle your openbsd specific binaries checkout the pom file.

What should i do ?


#12

Look at the Bundle-NativeCode tag:


You will see how the natives are bundled into the jar. You need to check which is the appropriate name for your OS.
About the configure, I don’t know, you need to figure it out how that thing can be compiled on your OS.


#13

I did extract the /usr/local/libjitsi/target/libjitsi-1.0-SNAPSHOT.jar after the mvn install

ls
META-INF libjitsi-1.0-SNAPSHOT.jar linux-x86-64 win32-x86
darwin linux-x86 org win32-x86-64

But I just see linux/windows…

You will see how the natives are bundled into the jar. You need to check which is the appropriate name for your OS.

What do youmean ? Does it have a link with /usr/local/libjitsi/target/libjitsi-1.0-SNAPSHOT.jar ?

Or with usrsctp ?


#14

I followed that page

But I’m stuck with

[antlib:org.apache.maven.artifact.ant] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.

Do you know what this means ?

ant -v -lib ~/.m2/repository/org/apache/maven/maven-ant-tasks/2.1.3 sctp -Dusrsctp=/usr/local/usrsctp/usrsctp/
Apache Ant™ version 1.10.3 compiled on March 24 2018
Trying the default build file: build.xml
Buildfile: /usr/local/libjitsi/build.xml
Detected Java version: 1.8 in: /usr/local/jdk-1.8.0/jre
Detected OS: OpenBSD
parsing buildfile /usr/local/libjitsi/build.xml with URI = file:/usr/local/libjitsi/build.xml
Project base dir set to: /usr/local/libjitsi
parsing buildfile jar:file:/usr/local/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/usr/local/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
[property] Loading /usr/local/libjitsi/local.properties
[property] Unable to find property file: /usr/local/libjitsi/local.properties
[property] Loading Environment system.
[antlib:org.apache.maven.artifact.ant] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.

BUILD FAILED
/usr/local/libjitsi/build.xml:29: Problem: failed to create task or type antlib:org.apache.maven.artifact.ant:dependencies
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-/usr/local/ant/lib
-/root/.ant/lib
-a directory added on the command line with the -lib argument

    at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:497)
    at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:429)
    at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:165)
    at org.apache.tools.ant.Task.perform(Task.java:349)
    at org.apache.tools.ant.Target.execute(Target.java:448)
    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:183)
    at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
    at org.apache.tools.ant.Main.runBuild(Main.java:824)
    at org.apache.tools.ant.Main.startAnt(Main.java:228)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:283)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

Total time: 0 seconds


#15

Yep, that command, make sure you have installed maven-ant-tasks.
You need to create a folder for your OS, check jna documentation what should be the name of that folder for OS. And describe that folder inside the pom.xml file.


#16

Thank you.

I have installed maven-ant-tasks and it made a difference when i relaunched the command.

You need to create a folder for your OS

Where should I create this folder ?

I found this page


and they wrote

<condition property=“os.prefix” value=“openbsd-{jre.arch}"&gt; &lt;equals arg1="{build.os.name}” arg2=“OpenBSD”/>
</condition>

So I suppose the right name is openbsd-x86-64

And describe that folder inside the pom.xml file.

I added this

               openbsd-x86-64/libjnawtrenderer.so;
               openbsd-x86-64/libjnopenssl.so;
               openbsd-x86-64/libjnopus.so;
               openbsd-x86-64/libjnportaudio.so;
               openbsd-x86-64/libjnpulseaudio.so;
               openbsd-x86-64/libjnscreencapture.so;
               openbsd-x86-64/libjnsctp.so;
               openbsd-x86-64/libjnspeex.so;
               openbsd-x86-64/libjnvideo4linux2.so;
               openbsd-x86-64/libjnvpx.so;osname=OpenBSD;processor=x86-64,

in /usr/local/libjitsi/pom.xml

I saw this message when I launched the ant command
[maven-artifact:dependencies] [WARNING] POM for ‘org.osgi:org.osgi.core:pom:4.3.1:compile’ is invalid.

But what should I do next ?

Overriding previous definition of reference to org.jetbrains:annotations:jar
Property “label” has not been set
Importing file /usr/local/libjitsi/src/native/build.xml from /usr/local/libjitsi/build.xml
Overriding previous definition of reference to ant.projectHelper
parsing buildfile /usr/local/libjitsi/src/native/build.xml with URI = file:/usr/local/libjitsi/src/native/build.xml
Importing file /usr/local/libjitsi/build.xml from /usr/local/libjitsi/src/native/build.xml
Skipped already imported file:
/usr/local/libjitsi/build.xml
Overriding previous definition of reference to ant.projectHelper
Importing file /usr/local/libjitsi/resources/install/build-debian.xml from /usr/local/libjitsi/build.xml
Overriding previous definition of reference to ant.projectHelper
parsing buildfile /usr/local/libjitsi/resources/install/build-debian.xml with URI = file:/usr/local/libjitsi/resources/install/build-debian.xml
Overriding previous definition of reference to ant.projectHelper
Build sequence for target(s) `sctp’ is [init-native, -sctp-macosx, -sctp-win, -sctp-linux, sctp]
Complete build sequence is [init-native, -sctp-macosx, -sctp-win, -sctp-linux, sctp, deb-copy-libjitsi, deb-src, compile, jar, make, dist, speex, portaudio, libjitsi-native.pulseaudio, -init-deb, ffmpeg, run-example, libvpx, libjitsi-native.ffmpeg, win-coreaudio, compile-with-g729, deb-32, libjitsi-native.libvpx, libjitsi-debian.-init-deb, compile-test, libjitsi-native.quicktime, libjitsi-native.init-native, libjitsi-debian.deb-32, libjitsi-native.jnopenssl, deb-src-rebuild, webrtc-aec, help-native, compile-with-benchmark, libjitsi-native.directshow, clean-native, make-and-copy-to-jitsi, libjitsi-debian.deb-src-rebuild, libjitsi-native.clean-native, make-with-g729, libjitsi-native.wasapi, libjitsi-debian.deb-copy-libjitsi, jawtrenderer, wasapi, libjitsi-native.jawtrenderer, libjitsi-native.mac-coreaudio, libjitsi-native.-sctp-win, deb-64, libjitsi-debian.deb, libjitsi-native.sctp, libjitsi-native.libvpx-debian, test, libjitsi-native.-sctp-macosx, libjitsi-native.help-native, clean-debuild, quicktime, clean, rebuild, libjitsi-native.portaudio, jnopenssl, libjitsi-debian.deb-src, libjitsi-native.speex, libjitsi-native.webrtc-aec, libjitsi-debian.deb-64, libjitsi-native.screencapture, pulseaudio, mac-coreaudio, opus, javadoc, libjitsi-debian.clean-debuild, libjitsi-native.-sctp-linux, -make-deb-package, libjitsi-native.opus, video4linux2, libvpx-debian, directshow, libjitsi-native.win-coreaudio, libjitsi-native.video4linux2, deb, copy-runtime-dependencies-from-maven, libjitsi-debian.-make-deb-package, screencapture, ]

init-native:
[mkdir] Created dir: /usr/local/libjitsi/src/native/native_obj

-sctp-macosx:
Skipped because property ‘is.running.macos’ not set.

-sctp-win:
Skipped because property ‘is.running.windows’ not set.

-sctp-linux:
Skipped because property ‘is.running.linux’ not set.

sctp:

BUILD SUCCESSFUL


#17

Hello, you told me to create a folder for my OS, but where ?
Should I put something in that folder ?


#18

In https://github.com/jitsi/libjitsi/tree/master/lib/native you need to create your openbsd folder and put in it a pre-compiled binary of libjnsctp, this way the packaging can get the binary and bundle it in the jar.


#19

Thank you for your answer, I’ll be able to move forward.
I did create the folder

mkdir /usr/local/libjitsi/lib/native/openbsd-x86-64

But I dont understand where should I grab the precompiled binaries of libjnsctp ?

I read this message
http://lists.jitsi.org/pipermail/commits/2014-July/010670.html

And according to this message I should find it in lib/native/mac/libjnsctp.jnilib-64
There is no lib directory

ls /usr/local/usrsctp/lib
ls: /usr/local/usrsctp/lib: No such file or directory

You also talk about the --host=i386-darwin option, should I use - -host=x86-openbsd ?


#20

You need to follow this https://github.com/jitsi/libjitsi/blob/master/src/native/sctp/README.md, which will produce the binary you need.