<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1032</bug_id>
          
          <creation_ts>2014-07-11 15:28:15 +0200</creation_ts>
          <short_desc>Add fallback for native-jar-file location via classpath</short_desc>
          <delta_ts>2015-03-10 10:48:54 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>General</product>
          <component>builds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>1024</blocked>
    
    <blocked>1145</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs>gluegen f5c48efcf546ba4e08e197ccced6df83b57e1755
joal 3c2409e9cc23b0f22c813b6903277997b46db826
jocl 0253aaf391faeed95b45fe92ff76fa71041eb511
jogl 37760af388303834e359703aad9562ce6165845f</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4022</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-07-11 15:28:15 +0200</bug_when>
    <thetext>See Bug 1024 Comment 0:
  2. &quot;classpath&quot;
and
  Bug 1024 Comment 3
  Bug 1024 Comment 4

In situations, where the native-jar file is not located within
the same parent URI as it&apos;s java-jar file, our location mechanism fails.
    
This enhancement shall adds a classloader based native-jar 
file location mechanism as a fallback,
requiring the native jar file to be included in the users CLASSPATH.

The native jar file shall have a TAG denominating:
  - module,
  - OS and
  - ARCH</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4023</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-07-11 15:30:47 +0200</bug_when>
    <thetext>Classloader based location algorithm in JNILibLoaderBase.addNativeJarLibsImpl(..):
    - Extract the &apos;module-name&apos; from the given classFromJavaJar&apos;s package name,
    i.e. the last package-part: &apos;jogamp.common.Debug&apos; -&gt; &apos;common&apos;

    Hence it is important to pass a &apos;classFromJavaJar&apos;,
    which last package segment reflects the module-name!

    - &lt;os.and.arch&gt; -&gt; &lt;os_and_arch_dot&gt;, 
      e.g. linux-amd64 -&gt; linux.amd64 (linux/amd64)

    - Locate class &apos;jogamp.nativetag.&lt;module-name&gt;.&lt;os_and_arch_dot&gt;.TAG&apos;,
      e.g. &apos;jogamp.nativetag.common.linux.amd64.TAG&apos;

    - Use located class&apos;s JarFile URI .. continue as usual

Injection of above mentioned TAG class via gluegen-cpptasks-base.xml macro &apos;native.tag.jar&apos;:
    - Creates dummy TAG.java code
    - Compiles TAG.java
    - Creates the native-jar file

Example:
   &lt;native.tag.jar objdir=&quot;${build}/obj&quot;
     nativejarfile=&quot;${build}/gluegen-rt-natives-${os.and.arch}.jar&quot;
     manifestfile=&quot;${build}/Manifest-rt-natives.temp&quot;
     module=&quot;common&quot;
     includelibs=&quot;*gluegen-rt.${native.library.suffix}&quot; /&gt;

Note that the manifest file uses a matching Extension-Name:
    Extension-Name: jogamp.nativetag.common</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>