Skip to content

Commit dc990ec

Browse files
committed
Prepare modern packaging of historical release
1 parent c543986 commit dc990ec

File tree

2 files changed

+15
-30
lines changed

2 files changed

+15
-30
lines changed

fetch-native-libs.sh

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,33 @@
22

33
set -euo pipefail
44

5-
LMDB_VERSION="0.9.33"
5+
LMDB_VERSION="0.9.18-3"
66
DEST="${DEST:-src/main/resources/org/lmdbjava/native}"
77
TMP=$(mktemp -d)
88
trap "rm -rf $TMP" EXIT
99

1010
mkdir -p "$DEST"
1111

12-
# Arch Linux x86_64
12+
# Extract from old Maven Central artifacts and rename to new format
13+
# Linux x86_64
1314
if [ ! -f "$DEST/x86_64-linux-gnu.so" ]; then
14-
curl -sL "https://archive.archlinux.org/packages/l/lmdb/lmdb-${LMDB_VERSION}-1-x86_64.pkg.tar.zst" -o "$TMP/x64.tar.zst"
15-
zstd -d "$TMP/x64.tar.zst" -o "$TMP/x64.tar"
16-
tar xf "$TMP/x64.tar" -C "$TMP" usr/lib/liblmdb.so --strip-components=2
17-
mv -f "$TMP/liblmdb.so" "$DEST/x86_64-linux-gnu.so"
15+
curl -sL "https://repo1.maven.org/maven2/org/lmdbjava/lmdbjava-native-linux-x86_64/${LMDB_VERSION}/lmdbjava-native-linux-x86_64-${LMDB_VERSION}.jar" -o "$TMP/linux.jar"
16+
unzip -q "$TMP/linux.jar" -d "$TMP/linux"
17+
mv -f "$TMP/linux/org/lmdbjava/lmdbjava-native-linux-x86_64.so" "$DEST/x86_64-linux-gnu.so"
1818
fi
1919

20-
# Arch Linux ARM aarch64
21-
if [ ! -f "$DEST/aarch64-linux-gnu.so" ]; then
22-
curl -sL "http://mirror.archlinuxarm.org/aarch64/extra/lmdb-${LMDB_VERSION}-1-aarch64.pkg.tar.xz" -o "$TMP/arm64.tar.xz"
23-
tar xf "$TMP/arm64.tar.xz" -C "$TMP" usr/lib/liblmdb.so --strip-components=2
24-
mv -f "$TMP/liblmdb.so" "$DEST/aarch64-linux-gnu.so"
25-
fi
26-
27-
# Homebrew macOS x86_64
20+
# macOS x86_64
2821
if [ ! -f "$DEST/x86_64-macos-none.so" ]; then
29-
curl -sL "https://mirrors.sustech.edu.cn/homebrew-bottles/bottles/lmdb-${LMDB_VERSION}.sonoma.bottle.tar.gz" -o "$TMP/brew-x64.tar.gz"
30-
tar xzf "$TMP/brew-x64.tar.gz" -C "$TMP" lmdb/${LMDB_VERSION}/lib/liblmdb.dylib --strip-components=3
31-
mv -f "$TMP/liblmdb.dylib" "$DEST/x86_64-macos-none.so"
32-
fi
33-
34-
# Homebrew macOS arm64
35-
if [ ! -f "$DEST/aarch64-macos-none.so" ]; then
36-
curl -sL "https://mirrors.sustech.edu.cn/homebrew-bottles/bottles/lmdb-${LMDB_VERSION}.arm64_sonoma.bottle.tar.gz" -o "$TMP/brew-arm.tar.gz"
37-
tar xzf "$TMP/brew-arm.tar.gz" -C "$TMP" lmdb/${LMDB_VERSION}/lib/liblmdb.dylib --strip-components=3
38-
mv -f "$TMP/liblmdb.dylib" "$DEST/aarch64-macos-none.so"
22+
curl -sL "https://repo1.maven.org/maven2/org/lmdbjava/lmdbjava-native-osx-x86_64/${LMDB_VERSION}/lmdbjava-native-osx-x86_64-${LMDB_VERSION}.jar" -o "$TMP/osx.jar"
23+
unzip -q "$TMP/osx.jar" -d "$TMP/osx"
24+
mv -f "$TMP/osx/org/lmdbjava/lmdbjava-native-osx-x86_64.dylib" "$DEST/x86_64-macos-none.so"
3925
fi
4026

41-
# MSYS2 Windows x86_64
27+
# Windows x86_64
4228
if [ ! -f "$DEST/x86_64-windows-gnu.dll" ]; then
43-
curl -sL "https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-lmdb-${LMDB_VERSION}-1-any.pkg.tar.zst" -o "$TMP/win.tar.zst"
44-
zstd -d "$TMP/win.tar.zst" -o "$TMP/win.tar"
45-
tar xf "$TMP/win.tar" -C "$TMP" mingw64/bin/liblmdb.dll --strip-components=2
46-
mv -f "$TMP/liblmdb.dll" "$DEST/x86_64-windows-gnu.dll"
29+
curl -sL "https://repo1.maven.org/maven2/org/lmdbjava/lmdbjava-native-windows-x86_64/${LMDB_VERSION}/lmdbjava-native-windows-x86_64-${LMDB_VERSION}.jar" -o "$TMP/windows.jar"
30+
unzip -q "$TMP/windows.jar" -d "$TMP/windows"
31+
mv -f "$TMP/windows/org/lmdbjava/lmdbjava-native-windows-x86_64.dll" "$DEST/x86_64-windows-gnu.dll"
4732
fi
4833

4934
ls -lh "$DEST"

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.lmdbjava</groupId>
55
<artifactId>native</artifactId>
6-
<version>0.9.33-3-SNAPSHOT</version>
6+
<version>0.9.18-1-SNAPSHOT</version>
77
<packaging>jar</packaging>
88
<name>LmdbJava Native Libraries</name>
99
<description>Native LMDB libraries for all supported platforms</description>

0 commit comments

Comments
 (0)