Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
bitxeno committed May 22, 2024
1 parent 0b8852b commit 67069f8
Show file tree
Hide file tree
Showing 5 changed files with 369 additions and 13 deletions.
13 changes: 0 additions & 13 deletions .github/FUNDING.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build

on:
workflow_dispatch:

jobs:
openwrt:
name: OpenWrt Package - ${{ matrix.target.arch }}
runs-on: ubuntu-20.04
environment: OpenWrt
strategy:
fail-fast: false
matrix:
target:
- arch: "x86_64"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/x86/64/openwrt-sdk-22.03.2-x86-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
path: "src"
- name: Install build requirements
run: |
set -e
sudo apt-get update
sudo apt-get install -y build-essential ccache ecj fastjar file g++ gawk \
gettext java-propose-classpath libelf-dev libncurses5-dev \
libncursesw5-dev libssl-dev python2.7-dev python3 unzip wget \
python3-distutils python3-setuptools python3-dev rsync subversion \
swig time xsltproc zlib1g-dev systemd build-essential wget curl \
git psmisc automake autoconf libtool
- name: Install OpenWrt SDK
run: |
set -e
wget -O openwrt-sdk.tar.xz ${{ matrix.target.sdk }}
xz -q -d openwrt-sdk.tar.xz
tar -xvf openwrt-sdk.tar && mv -f openwrt-sdk-* openwrt-sdk
- name: Build Package
run: |
set -e
mv src/openwrt/libgeneral openwrt-sdk/package/
mv src/openwrt/usbmuxd2 openwrt-sdk/package/
rm -rf src/openwrt
mv src openwrt-sdk/package/usbmuxd2/src
cd openwrt-sdk
cp feeds.conf.default feeds.conf
./scripts/feeds update -a > /dev/null
make defconfig
./scripts/feeds install -d y -f -a
make package/usbmuxd2/compile V=s
- name: Archive package
uses: actions/upload-artifact@v3
with:
name: usbmuxd2-openwrt-${{ matrix.target.arch }}
path: |
openwrt-sdk/bin/packages/*/base/usbmuxd*.ipk
openwrt-sdk/bin/packages/*/base/libgeneral*.ipk
if-no-files-found: error
281 changes: 281 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
name: Release

on:
push:
tags: ["v*"]
workflow_dispatch:

jobs:
linux-x86_64:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
target:
- arch: "x86_64"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install build requirements
run: |
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev \
git automake autoconf libtool \
pkg-config libudev-dev udev libavahi-client-dev checkinstall rename
- name: Build dependencies
run: |
mkdir build
cd build
git clone https://github.com/libusb/libusb.git -b v1.0.26
cd libusb
./autogen.sh --prefix=/usr --disable-static
make
sudo checkinstall -y --pkgname=libusb --pkgversion=1.0.26 --pkgarch=amd64
cd ..
git clone https://github.com/tihmstar/libgeneral.git -b 64
cd libgeneral
./autogen.sh --prefix=/usr
make
sudo checkinstall -y --pkgname=libgeneral --pkgversion=1.0.0 --pkgarch=amd64
cd ..
git clone https://github.com/libimobiledevice/libplist.git -b 2.3.0
cd libplist
./autogen.sh --prefix=/usr --disable-static --without-cython
make
sudo checkinstall -y --pkgname=libplist --pkgversion=2.3.0 --pkgarch=amd64
cd ..
git clone https://github.com/libimobiledevice/libimobiledevice-glue -b 1.0.0
cd libimobiledevice-glue
./autogen.sh --prefix=/usr --disable-static --without-cython
make
sudo checkinstall -y --pkgname=libimobiledevice-glue --pkgversion=1.0.0 --pkgarch=amd64
cd ..
git clone https://github.com/bitxeno/libusbmuxd.git
cd libusbmuxd
./autogen.sh --prefix=/usr --disable-static
make
sudo checkinstall -y --pkgname=libusbmuxd --pkgversion=2.3.0 --pkgarch=amd64
cd ..
git clone https://github.com/bitxeno/libimobiledevice.git
cd libimobiledevice
./autogen.sh --prefix=/usr --disable-static --without-cython
make
sudo checkinstall -y --pkgname=libimobiledevice --pkgversion=1.3.1 --pkgarch=amd64
cd ../../
- name: Build
run: |
./autogen.sh --prefix=/usr
make
sudo checkinstall -y --pkgname=usbmuxd2 --pkgversion=1.0.0 --pkgarch=amd64
- name: Compress build files
run: |
mkdir artifact
mv build/libusb/libusb*.deb artifact/
mv build/libgeneral/libgeneral*.deb artifact/
mv build/libplist/libplist*.deb artifact/
mv build/libimobiledevice-glue/libimobiledevice-glue*.deb artifact/
mv build/libusbmuxd/libusbmuxd*.deb artifact/
mv build/libimobiledevice/libimobiledevice*.deb artifact/
mv usbmuxd*.deb artifact/
rename "s/amd64/${{ matrix.target.arch }}/" ./artifact/*
tar -czvf usbmuxd2-ubuntu-${{ matrix.target.arch }}.tar.gz -C artifact .
- name: Archive package
uses: actions/upload-artifact@v3
with:
name: usbmuxd2-ubuntu-${{ matrix.target.arch }}
path: |
artifact/*.deb
if-no-files-found: error
- name: Upload package to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
usbmuxd2-ubuntu-*.tar.gz
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true

linux-aarch64:
if: ${{ github.event.act }}
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- arch: "aarch64"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Cross-Compile Support
uses: bitxeno/gha-ubuntu-cross@master
with:
arch: arm64
- name: Install build requirements
run: |
sudo apt-get install -y pkg-config:arm64 libssl-dev:arm64 libudev-dev:arm64 \
udev:arm64 libavahi-client-dev:arm64 checkinstall rename
- name: Build dependencies
run: |
mkdir build
cd build
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
git clone https://github.com/libusb/libusb.git -b v1.0.26
cd libusb
./autogen.sh --prefix=/usr --disable-static --host=aarch64-linux
make
sudo checkinstall -y --pkgname=libusb --pkgversion=1.0.26 --pkgarch=arm64
cd ..
git clone https://github.com/tihmstar/libgeneral.git -b 64
cd libgeneral
./autogen.sh --prefix=/usr --host=aarch64-linux
make
sudo checkinstall -y --pkgname=libgeneral --pkgversion=1.0.0 --pkgarch=arm64
cd ..
git clone https://github.com/libimobiledevice/libplist.git -b 2.3.0
cd libplist
./autogen.sh --prefix=/usr --disable-static --without-cython --host=aarch64-linux
make
sudo checkinstall -y --pkgname=libplist --pkgversion=2.3.0 --pkgarch=arm64
cd ..
git clone https://github.com/libimobiledevice/libimobiledevice-glue -b 1.0.0
cd libimobiledevice-glue
./autogen.sh --prefix=/usr --disable-static --without-cython --host=aarch64-linux
make
sudo checkinstall -y --pkgname=libimobiledevice-glue --pkgversion=1.0.0 --pkgarch=arm64
cd ..
git clone https://github.com/bitxeno/libusbmuxd.git
cd libusbmuxd
./autogen.sh --prefix=/usr --disable-static --host=aarch64-linux
make
sudo checkinstall -y --pkgname=libusbmuxd --pkgversion=2.3.0 --pkgarch=arm64
cd ..
git clone https://github.com/bitxeno/libimobiledevice.git
cd libimobiledevice
./autogen.sh --prefix=/usr --disable-static --without-cython --host=aarch64-linux
make
sudo checkinstall -y --pkgname=libimobiledevice --pkgversion=1.3.1 --pkgarch=arm64
cd ../../
- name: Build
run: |
./autogen.sh --prefix=/usr --host=aarch64-linux
make
sudo checkinstall -y --pkgname=usbmuxd2 --pkgversion=1.0.0 --pkgarch=arm64
- name: Compress build files
run: |
mkdir artifact
mv build/libusb/libusb*.deb artifact/
mv build/libgeneral/libgeneral*.deb artifact/
mv build/libplist/libplist*.deb artifact/
mv build/libimobiledevice-glue/libimobiledevice-glue*.deb artifact/
mv build/libusbmuxd/libusbmuxd*.deb artifact/
mv build/libimobiledevice/libimobiledevice*.deb artifact/
mv usbmuxd*.deb artifact/
rename "s/arm64/${{ matrix.target.arch }}/" ./artifact/*
tar -czvf usbmuxd2-ubuntu-${{ matrix.target.arch }}.tar.gz -C artifact .
- name: Archive package
uses: actions/upload-artifact@v3
with:
name: usbmuxd2-ubuntu-${{ matrix.target.arch }}
path: |
artifact/*.deb
if-no-files-found: error
- name: Upload package to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
usbmuxd2-ubuntu-*.tar.gz
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true

openwrt:
name: OpenWrt Package - ${{ matrix.target.arch }}
runs-on: ubuntu-20.04
environment: OpenWrt
strategy:
fail-fast: false
matrix:
target:
- arch: "x86_64"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/x86/64/openwrt-sdk-22.03.2-x86-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
path: "src"
- name: Install build requirements
run: |
set -e
sudo apt-get update
sudo apt-get install -y build-essential ccache ecj fastjar file g++ gawk \
gettext java-propose-classpath libelf-dev libncurses5-dev \
libncursesw5-dev libssl-dev python3 unzip rsync \
python3-distutils python3-setuptools python3-dev \
swig time xsltproc zlib1g-dev systemd wget curl \
git psmisc automake autoconf libtool
- name: Install OpenWrt SDK
run: |
set -e
wget -O openwrt-sdk.tar.xz ${{ matrix.target.sdk }}
xz -q -d openwrt-sdk.tar.xz
tar -xvf openwrt-sdk.tar && mv -f openwrt-sdk-* openwrt-sdk
- name: Build Package
run: |
set -e
mv src/openwrt/libgeneral openwrt-sdk/package/
mv src/openwrt/libplist openwrt-sdk/package/
mv src/openwrt/libusbmuxd openwrt-sdk/package/
mv src/openwrt/libimobiledevice openwrt-sdk/package/
mv src/openwrt/libimobiledevice-glue openwrt-sdk/package/
mv src/openwrt/usbmuxd2 openwrt-sdk/package/
rm -rf src/openwrt
mv src openwrt-sdk/package/usbmuxd2/src
cd openwrt-sdk
cp feeds.conf.default feeds.conf
./scripts/feeds update -a > /dev/null
make defconfig
./scripts/feeds install -d y -f -a
# 删除官方默认旧版软件包
./scripts/feeds uninstall libusbmuxd
./scripts/feeds uninstall libimobiledevice
./scripts/feeds uninstall libplist
make package/usbmuxd2/compile V=s
- name: Compress build files
run: |
mkdir artifact
mv openwrt-sdk/bin/packages/*/base/usbmuxd*.ipk artifact/
mv openwrt-sdk/bin/packages/*/base/libgeneral*.ipk artifact/
mv openwrt-sdk/bin/packages/*/base/libplist*.ipk artifact/
mv openwrt-sdk/bin/packages/*/base/libimobiledevice*.ipk artifact/
mv openwrt-sdk/bin/packages/*/base/libusbmuxd*.ipk artifact/
tar -czvf usbmuxd2-openwrt-${{ matrix.target.arch }}.tar.gz -C artifact .
- name: Archive package
uses: actions/upload-artifact@v3
with:
name: usbmuxd2-openwrt-${{ matrix.target.arch }}
path: |
artifact/*.ipk
if-no-files-found: error
- name: Upload package to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
usbmuxd2-openwrt-*.tar.gz
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true
11 changes: 11 additions & 0 deletions openwrt/libimobiledevice/patches/010-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/conf.c
+++ b/src/conf.c
@@ -126,7 +126,7 @@ const char *config_get_config_dir()
#ifdef __APPLE__
base_config_dir = strdup("/var/db");
#else
- base_config_dir = strdup("/var/lib");
+ base_config_dir = strdup("/etc");
#endif
#endif
__config_dir = string_concat(base_config_dir, DIR_SEP_S, CONFIG_DIR, NULL);
17 changes: 17 additions & 0 deletions openwrt/usbmuxd2/files/usbmuxd2.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh /etc/rc.common

START=94

USE_PROCD=1
PROG=/usr/sbin/usbmuxd

start_service() {
procd_open_instance
procd_set_param command $PROG --systemd
procd_set_param stderr 1
procd_close_instance
}

reload_service() {
procd_send_signal $PROG
}

0 comments on commit 67069f8

Please sign in to comment.