Skip to content

Commit ffd617d

Browse files
authored
v2.1.0 (#207)
1 parent 1675eb8 commit ffd617d

5 files changed

Lines changed: 136 additions & 3 deletions

File tree

.github/workflows/build-test-push.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- "1.2-py2"
3939
- "1.2-py3"
4040
- "2.0"
41+
- "2.1"
4142
steps:
4243
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
4344
- name: Run hadolint
@@ -72,6 +73,7 @@ jobs:
7273
"1.2-py2": "1.2-py2/**"
7374
"1.2-py3": "1.2-py3/**"
7475
"2.0": "2.0/**"
76+
"2.1": "2.1/**"
7577
7678
- name: Select directories to build
7779
id: select
@@ -87,7 +89,8 @@ jobs:
8789
{"directory": "1.1", "version": "1.1.14", "tags": "1.1 1.1-alpine"},
8890
{"directory": "1.2-py2", "version": "1.2.11", "tags": ""},
8991
{"directory": "1.2-py3", "version": "1.2.20", "tags": "1.2 1.2-alpine 1 1-alpine"},
90-
{"directory": "2.0", "version": "2.0.13", "tags": "2.0 2.0-alpine 2 2-alpine latest"}
92+
{"directory": "2.0", "version": "2.0.13", "tags": "2.0 2.0-alpine"},
93+
{"directory": "2.1", "version": "2.1.0", "tags": "2.1 2.1-alpine 2 2-alpine latest"}
9194
]
9295
run: |
9396
SELECTED='[]'

2.1/.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Repo strucutre
2+
.circleci/
3+
.git/
4+
LICENSE*
5+
README*
6+
*.json
7+
*.yaml
8+
9+
# Docker files
10+
.dockerignore
11+
Dockerfile

2.1/Dockerfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Instructions on building libtorrent:
2+
# https://github.com/arvidn/libtorrent/blob/RC_2_1/docs/building.rst
3+
4+
FROM alpine:3.24.0@sha256:a2d49ea686c2adfe3c992e47dc3b5e7fa6e6b5055609400dc2acaeb241c829f4
5+
6+
ARG VERSION=2.1.[0-9]\\+
7+
8+
SHELL ["/bin/ash", "-euo", "pipefail", "-c"]
9+
10+
# Build libtorrent-rasterbar-dev
11+
# hadolint ignore=DL3003,DL3018,SC2086
12+
RUN apk --update add --no-cache boost-python3 libgcc libstdc++ openssl python3 && \
13+
apk --update add --no-cache --virtual build-dependencies boost-dev cmake coreutils g++ gcc git jq py3-setuptools python3-dev openssl-dev samurai && \
14+
# Checkout from source
15+
cd "$(mktemp -d)" && \
16+
git clone --branch "$( \
17+
wget -qO - https://api.github.com/repos/arvidn/libtorrent/tags?per_page=100 | jq -r '.[].name' | \
18+
awk '{print $1" "$1}' | \
19+
# Get rid of prefixes
20+
sed 's/^libtorrent[^0-9]//i' | \
21+
sed 's/^v//i' | \
22+
# Use periods for major.minor.patch
23+
sed 's/[^a-zA-Z0-9.]\([0-9]\+.* .*\)/.\1/g' | \
24+
sed 's/[^a-zA-Z0-9.]\([0-9]\+.* .*\)/.\1/g' | \
25+
# Make sure patch version exists
26+
sed 's/^\([0-9]\+\.[0-9]\+\)\([^0-9.].\+\)/\1.0\2/' | \
27+
# Get the right version
28+
sort --version-sort --key=1,1 | \
29+
grep "${VERSION}" | \
30+
# Ignore pre-releases (release candidates, betas, etc.)
31+
grep -viE -- '-(rc|alpha|beta)' | \
32+
tail -1 | \
33+
awk '{print $2}' \
34+
)" --depth 1 https://github.com/arvidn/libtorrent.git && \
35+
cd libtorrent && \
36+
git clean --force && \
37+
git submodule update --depth=1 --init --recursive && \
38+
# Build shared libraries
39+
mkdir build-shared && \
40+
cd build-shared && \
41+
cmake \
42+
-DCMAKE_INSTALL_PREFIX=/usr \
43+
# https://github.com/arvidn/libtorrent/blob/RC_2_1/docs/building.rst#building-with-cmake
44+
-G Ninja \
45+
-DCMAKE_BUILD_TYPE=Release \
46+
-DCMAKE_CXX_STANDARD=20 \
47+
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
48+
-Dpython-bindings=ON \
49+
-Dpython-egg-info=ON \
50+
-Dpython-install-system-dir=ON \
51+
.. && \
52+
ninja "-j$(nproc)" && \
53+
ninja install && \
54+
cd .. && \
55+
# Build static libraries
56+
mkdir build-static && \
57+
cd build-static && \
58+
cmake \
59+
-DCMAKE_INSTALL_PREFIX=/usr \
60+
# https://github.com/arvidn/libtorrent/blob/RC_2_1/docs/building.rst#building-with-cmake
61+
-G Ninja \
62+
-DCMAKE_BUILD_TYPE=Release \
63+
-DCMAKE_CXX_STANDARD=20 \
64+
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
65+
-DBUILD_SHARED_LIBS=OFF \
66+
.. && \
67+
ninja "-j$(nproc)" && \
68+
ninja install && \
69+
cd .. && \
70+
# Remove temp files
71+
cd && \
72+
apk del --purge build-dependencies && \
73+
rm -rf /tmp/*

2.1/container-structure-test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
schemaVersion: 2.0.0
2+
3+
fileExistenceTests:
4+
# libtorrent files
5+
- name: "libtorrent-rasterbar.a"
6+
path: "/usr/lib/libtorrent-rasterbar.a"
7+
shouldExist: true
8+
permissions: "-rw-r--r--"
9+
- name: "libtorrent-rasterbar.so"
10+
path: "/usr/lib/libtorrent-rasterbar.so"
11+
shouldExist: true
12+
permissions: "Lrwxrwxrwx"
13+
- name: "libtorrent-rasterbar.so.2.1"
14+
path: "/usr/lib/libtorrent-rasterbar.so.2.1"
15+
shouldExist: true
16+
permissions: "Lrwxrwxrwx"
17+
# CMake files (required for qBittorrent v5.0)
18+
- name: "LibtorrentRasterbarConfig.cmake"
19+
path: "/usr/lib/cmake/LibtorrentRasterbar/LibtorrentRasterbarConfig.cmake"
20+
shouldExist: true
21+
permissions: "-rw-r--r--"
22+
23+
commandTests:
24+
- name: "pkgconfig"
25+
setup: [["apk", "add", "pkgconfig"]]
26+
command: "pkg-config"
27+
args: ["--list-all"]
28+
expectedOutput: ["libtorrent-rasterbar"]
29+
excludedError: [".+"]
30+
exitCode: 0
31+
# Python tests (https://dev.deluge-torrent.org/wiki/Building/libtorrent#UbuntuDebian)
32+
- name: "Python 3"
33+
command: "python3"
34+
args: ["-c", "import libtorrent; print(libtorrent.__version__)"]
35+
expectedOutput: ["2.1"]
36+
excludedError: [".+"]
37+
exitCode: 0
38+
39+
# https://github.com/arvidn/libtorrent/issues/5865
40+
fileContentTests:
41+
- name: "pkgconfig"
42+
path: "/usr/lib/pkgconfig/libtorrent-rasterbar.pc"
43+
expectedContents: ["Libs:.*-ltorrent-rasterbar"]

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![libtorrent logo](https://raw.githubusercontent.com/emmercm/docker-libtorrent/refs/heads/assets/libtorrent.png)](https://www.libtorrent.org/)
2+
13
[![](https://badgen.net/badge/emmercm/libtorrent/blue?icon=docker)](https://hub.docker.com/r/emmercm/libtorrent)
24
[![](https://badgen.net/docker/pulls/emmercm/libtorrent?icon=docker&label=pulls)](https://hub.docker.com/r/emmercm/libtorrent)
35
[![](https://badgen.net/docker/stars/emmercm/libtorrent?icon=docker&label=stars)](https://hub.docker.com/r/emmercm/libtorrent)
@@ -11,7 +13,8 @@ Base images with libtorrent compiled.
1113

1214
| Tags | Python Bindings | Size |
1315
|-|-|-|
14-
| `2.0.13`, `2.0.13-alpine`, `2.0`, `2.0-alpine`, `2`, `2-alpine`, `latest` | v3 | [![](https://img.shields.io/docker/image-size/emmercm/libtorrent/2.0.13?logo=docker&logoColor=white&label=size)](https://hub.docker.com/r/emmercm/libtorrent/tags?name=2.0.13) |
16+
| `2.1.0`, `2.1.0-alpine`, `2.1`, `2.1-alpine`, `2`, `2-alpine`, `latest` | v3 | [![](https://img.shields.io/docker/image-size/emmercm/libtorrent/2.1.0?logo=docker&logoColor=white&label=size)](https://hub.docker.com/r/emmercm/libtorrent/tags?name=2.1.0) |
17+
| `2.0.13`, `2.0.13-alpine`, `2.0`, `2.0-alpine` | v3 | [![](https://img.shields.io/docker/image-size/emmercm/libtorrent/2.0.13?logo=docker&logoColor=white&label=size)](https://hub.docker.com/r/emmercm/libtorrent/tags?name=2.0.13) |
1518
| `1.2.20`, `1.2.20-alpine`, `1.2`, `1.2-alpine`, `1`, `1-alpine` | v3 | [![](https://img.shields.io/docker/image-size/emmercm/libtorrent/1.2.20?logo=docker&logoColor=white&label=size)](https://hub.docker.com/r/emmercm/libtorrent/tags?name=1.2.20) |
1619
| <span title="Unmaintained">⚠️</span> `1.2.11`, `1.2.11-alpine` | v2, v3 | [![](https://img.shields.io/docker/image-size/emmercm/libtorrent/1.2.11?logo=docker&logoColor=white&label=size)](https://hub.docker.com/r/emmercm/libtorrent/tags?name=1.2.11) |
1720
| <span title="Unmaintained">⚠️</span> `1.1.14`, `1.1.14-alpine`, `1.1`, `1.1-alpine` | v2, v3 | [![](https://img.shields.io/docker/image-size/emmercm/libtorrent/1.1.14?logo=docker&logoColor=white&label=size)](https://hub.docker.com/r/emmercm/libtorrent/tags?name=1.1.14) |
@@ -41,7 +44,7 @@ These images contain 4 main things:
4144

4245
# Why full images?
4346

44-
As of writing the `libtorrent`/`libtorrent-dev` in the Alpine main repository is many years out of date. It can be time-consuming or difficult to compile libtorrent so this saves the end user time and headache.
47+
As of writing, the `libtorrent`/`libtorrent-dev` in the Alpine main repository is many years out of date. It can be time-consuming or difficult to compile libtorrent so this saves the end user time and headache.
4548

4649
# How to use these images
4750

0 commit comments

Comments
 (0)