Skip to content

Commit ef8f6aa

Browse files
committed
packaging update
1 parent e9401d6 commit ef8f6aa

File tree

8 files changed

+126
-32
lines changed

8 files changed

+126
-32
lines changed

.github/workflows/cmake.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,13 @@ jobs:
110110
build/package/
111111
UnCSO2-*.7z
112112
UnCSO2-*.AppImage
113+
114+
- name: Install
115+
run: DESTDIR="build/install/" cmake --install build
116+
117+
- name: Upload install artifacts
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: install-${{ matrix.c_compiler }}-${{ matrix.os }}
121+
path: |
122+
build/install/

.github/workflows/flatpak.yml

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,32 @@ jobs:
1818
# Don't fail the whole workflow if one architecture fails
1919
fail-fast: false
2020
steps:
21-
- uses: actions/checkout@v4
22-
with:
23-
submodules: 'recursive'
24-
- name: Install deps
25-
if: ${{ matrix.arch != 'x86_64' }}
26-
run: |
27-
# Use the static binaries because it's unable to use a package manager
28-
curl https://download.docker.com/linux/static/stable/x86_64/docker-26.0.0.tgz --output ./docker.tgz
29-
tar xzvf docker.tgz
30-
mv docker/* /usr/bin
31-
- name: Set up QEMU
32-
if: ${{ matrix.arch != 'x86_64' }}
33-
id: qemu
34-
uses: docker/setup-qemu-action@v3
35-
with:
36-
platforms: arm64
37-
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
38-
with:
39-
bundle: UnCSO2.flatpak
40-
manifest-path: tf.harmony.UnCSO2.yml
41-
cache-key: flatpak-builder-${{ matrix.arch }}-${{ github.sha }}
42-
arch: ${{ matrix.arch }}
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: 'recursive'
24+
25+
- name: Set output
26+
id: read_version
27+
run: echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT
28+
29+
- name: Install deps
30+
if: ${{ matrix.arch != 'x86_64' }}
31+
run: |
32+
# Use the static binaries because it's unable to use a package manager
33+
curl https://download.docker.com/linux/static/stable/x86_64/docker-26.0.0.tgz --output ./docker.tgz
34+
tar xzvf docker.tgz
35+
mv docker/* /usr/bin
36+
37+
- name: Set up QEMU
38+
if: ${{ matrix.arch != 'x86_64' }}
39+
id: qemu
40+
uses: docker/setup-qemu-action@v3
41+
with:
42+
platforms: arm64
43+
44+
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
45+
with:
46+
bundle: UnCSO2-${{ steps.read_version.outputs.version }}-linux-${{ matrix.arch }}.flatpak
47+
manifest-path: tf.harmony.UnCSO2.yml
48+
cache-key: flatpak-builder-${{ matrix.arch }}-${{ github.sha }}
49+
arch: ${{ matrix.arch }}

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,19 @@ CMakeLists.txt.user*
406406
# CMake build directory
407407
/build
408408

409-
# appimage executables
409+
# AppImage executables
410410
*.AppImage
411411

412412
/CMakeUserPresets.json
413413

414+
# Flatpak
414415
/.flatpak-builder
415416
/repo
416417
/builddir
417418
*.flatpak
419+
420+
# Arch Linux
421+
/.SRCINFO
422+
/src
423+
/pkg
424+
*.tar.zst

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,14 @@ target_link_libraries(uc2 uncso2)
243243

244244
# link Qt6
245245
target_link_libraries(uc2 Qt::Widgets)
246+
247+
#
248+
# Installation rules
249+
#
250+
251+
install(TARGETS uc2 DESTINATION bin)
252+
253+
install(FILES tf.harmony.UnCSO2.desktop DESTINATION share/applications)
254+
install(FILES tf.harmony.UnCSO2.svg DESTINATION share/icons/hicolor/scalable/apps)
255+
install(FILES tf.harmony.UnCSO2.metainfo.xml DESTINATION share/metainfo)
256+
#install(FILES tf.harmony.UnCSO2-mime.xml DESTINATION share/mime/packages)

PKGBUILD

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
pkgname=uncso2
2+
pkgver=2.1.1
3+
pkgrel=1
4+
pkgdesc='Extract Counter-Strike: Online 2 and Titanfall Online game files'
5+
arch=(any)
6+
url="https://github.com/harmonytf/UnCSO2"
7+
license=(GPL-3.0-only)
8+
depends=(libuncso2)
9+
makedepends=(cmake)
10+
source=()
11+
_sourcedir="UnCSO2"
12+
13+
prepare() {
14+
ln -snf "$startdir" "$srcdir"
15+
}
16+
17+
build() {
18+
cmake -B build -S "$_sourcedir" \
19+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
20+
-DCMAKE_INSTALL_PREFIX=/usr \
21+
-Wno-dev
22+
cmake --build build
23+
}
24+
25+
package() {
26+
DESTDIR="$pkgdir" cmake --install build
27+
install -Dm644 "$_sourcedir/COPYING" -t "$pkgdir/usr/share/licenses/$pkgname"
28+
29+
rm -rf "$pkgdir/usr/bin/cryptest"
30+
rm -rf "$pkgdir/usr/include"
31+
rm -rf "$pkgdir/usr/lib/libcryptopp.a"
32+
rm -rf "$pkgdir/usr/share/cmake"
33+
rm -rf "$pkgdir/usr/share/cryptopp"
34+
rm -rf "$pkgdir/usr/share/pkgconfig/cryptopp.pc"
35+
36+
# those belong to libuncso2 package
37+
rm -rf "$pkgdir/usr/lib"
38+
}

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,35 @@ cmake -G "Ninja" \
9595
ninja all
9696
```
9797

98+
#### Flatpak build
99+
100+
```sh
101+
flatpak run --command=flathub-build org.flatpak.Builder --install tf.harmony.UnCSO2.yml
102+
```
103+
104+
Lint:
105+
106+
```sh
107+
flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest tf.harmony.UnCSO2.yml
108+
flatpak run --command=flatpak-builder-lint org.flatpak.Builder repo repo
109+
```
110+
111+
Single-file bundle (for sharing a dev build):
112+
113+
```sh
114+
flatpak build-bundle repo UnCSO2.flatpak tf.harmony.UnCSO2 --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
115+
```
116+
117+
More information: <https://docs.flatpak.org/en/latest/first-build.html>
118+
119+
#### Arch Linux build
120+
121+
Assuming you cloned to a dir named `UnCSO2`...
122+
123+
```sh
124+
paru -Bi .
125+
```
126+
98127
## Libraries used
99128

100129
UnCSO2 uses the following libraries:

tf.harmony.UnCSO2.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,10 @@ modules:
2020
- /share/cryptopp
2121
- /include
2222
- /bin/cryptest
23-
- /lib/debug/source
2423
- '*.a'
2524
sources:
2625
- type: dir
2726
path: .
2827
#- type: git
2928
# url: https://github.com/harmonytf/UnCSO2.git
3029
# commit: 34f1d268b5baf0ff983670b33e2f39cec6aa99ab
31-
post-install:
32-
- install -Dm644 ${FLATPAK_ID}.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml
33-
- install -Dm644 ${FLATPAK_ID}.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
34-
- install -Dm644 ${FLATPAK_ID}.svg ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/${FLATPAK_ID}.svg
35-
#- install -Dm644 ${FLATPAK_ID}-mime.xml ${FLATPAK_DEST}/share/mime/packages/${FLATPAK_ID}-mime.xml
36-
- install -Dm755 uncso2 ${FLATPAK_DEST}/bin/uncso2
37-
- install -Dm755 libuncso2/libuncso2.so* -t ${FLATPAK_DEST}/lib/

0 commit comments

Comments
 (0)