Skip to content

Commit

Permalink
release:1.18.3
Browse files Browse the repository at this point in the history
   1. add filterPolicy
   2. update snappy
   3. support arm64
   4. remove 32bit,remove win
  • Loading branch information
halibobo1205 committed Jan 11, 2023
1 parent fc297ad commit 4b8cb8d
Show file tree
Hide file tree
Showing 36 changed files with 3,385 additions and 87 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ executors:
HOMEBREW_NO_AUTO_UPDATE: true
amd64-macos:
macos:
xcode: "14.0.0"
resource_class: macos.x86.medium
xcode: "13.3.0"
resource_class: macos.x86.medium.gen2
working_directory: ~/project
environment:
HOMEBREW_NO_AUTO_UPDATE: true
Expand Down Expand Up @@ -110,6 +110,5 @@ workflows:
jobs:
- amd64-ubuntu
- arm64-ubuntu
- i386-ubuntu
- arm64-macos
- amd64-macos
34 changes: 11 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
#NOTE
this repo is fork from [leveldbjni](https://github.com/fusesource/leveldbjni)

#Build
#Build leveldb
```shell
wget https://src.fedoraproject.org/lookaside/pkgs/snappy/snappy-1.0.5.tar.gz/4c0af044e654f5983f4acbf00d1ac236/snappy-1.0.5.tar.gz
wget https://github.com/google/snappy/releases/download/1.1.4/snappy-1.1.4.tar.gz
tar -zxvf snappy-1.1.4.tar.gz
git clone https://github.com/chirino/leveldb.git
git clone -b dev https://github.com/halibobor/leveldbjni.git

tar -zxvf snappy-1.0.5.tar.gz

git clone [email protected]:chirino/leveldb.git
git clone [email protected]:fusesource/leveldbjni.git


export SNAPPY_HOME=`cd snappy-1.0.5; pwd`
export SNAPPY_HOME=`cd snappy-1.1.4; pwd`
export LEVELDB_HOME=`cd leveldb; pwd`
export LEVELDBJNI_HOME=`cd leveldbjni; pwd`

Expand All @@ -24,24 +21,15 @@ export LIBRARY_PATH=${SNAPPY_HOME}
export C_INCLUDE_PATH=${LIBRARY_PATH}
export CPLUS_INCLUDE_PATH=${LIBRARY_PATH}
git apply ../leveldbjni/leveldb.patch
git apply ../leveldbjni/arm64.patch
git apply ../leveldbjni/MIPS.patch
make libleveldb.a
```

#Special for M1
```shell script
brew install maven
set $JAVA_HOME
update pom.xml
1. 1.5 -> 1.8
2. add java_home, remove with-universal
<arg>--with-jni-jdk=${env.JAVA_HOME}</arg>
<arg>--with-leveldb=${env.LEVELDB_HOME}</arg>
<arg>--with-snappy=${env.SNAPPY_HOME}</arg>
<!--<arg>--with-universal</arg>-->
```



#Build jni
```shell
mvn clean install -P download -P osx
cd ${LEVELDBJNI_HOME}
mvn clean install -P platform
```
48 changes: 16 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,17 @@
<version>1.9</version>
</parent>

<groupId>io.github.tronprotocol</groupId>
<groupId>com.halibobor</groupId>
<artifactId>leveldbjni-all</artifactId>
<version>1.18.2</version>
<version>1.18.3</version>
<packaging>bundle</packaging>

<properties>
<forge-project-id>leveldbjni</forge-project-id>
<forge-project-id-uc>LEVELDBJNI</forge-project-id-uc>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hawtjni-version>1.18</hawtjni-version>
<leveldb-api-version>1.18.2</leveldb-api-version>
<leveldbjni-version>1.8</leveldbjni-version>
<leveldb-api-version>1.18.3</leveldb-api-version>
<junit-version>4.13.2</junit-version>
<jacoco.version>0.8.8</jacoco.version>
<gpg.keyname>0xEF7F2D6C</gpg.keyname>
Expand Down Expand Up @@ -109,22 +108,7 @@
<version>${hawtjni-version}</version>
</dependency>
<dependency>
<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni</artifactId>
<version>${leveldbjni-version}</version>
<exclusions>
<exclusion>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>hawtjni-runtime</artifactId>
</exclusion>
<exclusion>
<groupId>org.iq80.leveldb</groupId>
<artifactId>leveldb-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.tronprotocol</groupId>
<groupId>com.halibobor</groupId>
<artifactId>leveldb-api</artifactId>
<version>${leveldb-api-version}</version>
</dependency>
Expand All @@ -134,6 +118,13 @@
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.6.0</version>
<scope>test</scope>
</dependency>

</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -182,8 +173,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<source>5</source>
<target>5</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -227,11 +218,7 @@
<instructions>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Export-Package>
org.fusesource.leveldbjni*;version=${leveldbjni-version},
org.iq80.leveldb*;version=${leveldb-api-version},
org.fusesource.hawtjni*;version=${hawtjni-version},
</Export-Package>
<Export-Package/>
<Import-Package/>
<DynamicImport-Package/>
<Implementation-Title>LevelDB JNI</Implementation-Title>
Expand All @@ -241,12 +228,9 @@
</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Bundle-NativeCode>
META-INF/native/windows32/leveldbjni.dll;osname=Win32;processor=x86,
META-INF/native/windows64/leveldbjni.dll;osname=Win32;processor=x86-64,
META-INF/native/osx/libleveldbjni.jnilib;osname=macosx;processor=x86,
META-INF/native/osx/libleveldbjni.jnilib;osname=macosx;processor=x86-64,
META-INF/native/osx64/aarch64/libleveldbjni.jnilib;osname=macosx;processor=aarch64,
META-INF/native/linux32/libleveldbjni.so;osname=Linux;processor=x86,
META-INF/native/linux64/libleveldbjni.so;osname=Linux;processor=x86-64,
META-INF/native/linux64/aarch64/libleveldbjni.so;osname=Linux;processor=aarch64
</Bundle-NativeCode>
Expand Down Expand Up @@ -301,8 +285,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<source>5</source>
<target>5</target>
<fork>true</fork>
<verbose>true</verbose>
<encoding>UTF-8</encoding>
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/fusesource/leveldbjni/All.java

This file was deleted.

Loading

0 comments on commit 4b8cb8d

Please sign in to comment.