Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into lazarus-i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
lighterowl committed Sep 21, 2024
2 parents 729c538 + b371e5a commit d9c2a7e
Show file tree
Hide file tree
Showing 59 changed files with 2,961 additions and 19,363 deletions.
21 changes: 21 additions & 0 deletions .github/build_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -xe

readonly build=$(git rev-list --abbrev-commit --max-count=1 HEAD)
sed -i "s/@GIT_COMMIT@/$build/" buildinfo.pas

pushd test
lazbuild transguitest.lpi "--lazarusdir=${TRANSGUI_LAZARUS_DIR}"
./units/transguitest -a
popd

lazbuild transgui.lpi --ws=qt5 --build-mode=Release "--lazarusdir=${TRANSGUI_LAZARUS_DIR}"
cd units

readonly app_ver=$(xmllint --xpath 'string(//StringTable/@ProductVersion)' ../transgui.lpi)
LINUXDEPLOY_OUTPUT_VERSION=$app_ver linuxdeploy-x86_64.AppImage \
-e transgui --create-desktop-file --appdir AppDir \
--output appimage -i ../transgui.png --plugin qt
sha256sum transgui-${app_ver}-x86_64.AppImage
mv transgui-${app_ver}-x86_64.AppImage transgui-x86_64.AppImage
39 changes: 20 additions & 19 deletions .github/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -xe

readonly repo_dir=$PWD
readonly sdk_dir=~/.transgui_sdk
readonly fpc_installdir="${sdk_dir}/fpc-3.2.3"
readonly fpc_basepath="${fpc_installdir}/lib/fpc/3.2.3"
readonly fpc_installdir="${sdk_dir}/fpc-3.2.4-rc1"
readonly fpc_basepath="${fpc_installdir}/lib/fpc/3.2.4"
readonly brew_prefix=$(brew --prefix)
readonly macosx_libdir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
readonly macosx_frameworkdir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks
Expand All @@ -17,6 +17,7 @@ fixup_fpc_cfg() {

echo "-Fl${macosx_libdir}" >> "$fpc_cfg_path"
echo "-k-F${macosx_frameworkdir}" >> "$fpc_cfg_path"
echo "-k-weak_framework UserNotifications" >> "$fpc_cfg_path"
}

make_fpc_cfg() {
Expand All @@ -31,32 +32,37 @@ fpc_lazarus_build_install() {

mkdir -p "$sdk_dir"
cd "$sdk_dir"
readonly fpc323_commit='0c5256300a323c78caa0b1a9cb772ac137f5aa8e'
curl -O "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc323_commit}/source-${fpc323_commit}.tar.gz"
tar xf "source-${fpc323_commit}.tar.gz"
cd "source-${fpc323_commit}"

readonly fpc324_rc1_commit='d78e2897014a69f56a1cfb53c75335c4cc37ba0e'
curl -L -o fpc-src.tar.bz2 "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc324_rc1_commit}/source-${fpc324_rc1_commit}.tar.bz2"
tar xf fpc-src.tar.bz2
mv "source-${fpc324_rc1_commit}" fpc-src
cd fpc-src

mkdir -p "${fpc_installdir}"

make_opts_native=(
local -r make_opts_native=(
COMPILER_LIBRARYDIR=${macosx_libdir}
COMPILER_OPTIONS=-k-F${macosx_frameworkdir}
)
make "${make_opts_native[@]}" all
make PREFIX=${fpc_installdir} install

make_opts_cross=("${make_opts_native[@]}" CPU_SOURCE=x86_64 CPU_TARGET=aarch64)
make "${make_opts_cross[@]}" all
make PREFIX=${fpc_installdir} "${make_opts_cross[@]}" crossinstall
if [[ $(uname -m) != arm64 ]]; then
local -r make_opts_cross=("${make_opts_native[@]}" CPU_SOURCE=x86_64 CPU_TARGET=aarch64)
make "${make_opts_cross[@]}" all
make PREFIX=${fpc_installdir} "${make_opts_cross[@]}" crossinstall
fi

export PATH=${fpc_installdir}/bin:${fpc_basepath}:$PATH

make_fpc_cfg

cd "$sdk_dir"
curl -L -o lazarus-src.tar.gz 'https://gitlab.com/dkk089/lazarus/-/archive/transgui/lazarus-transgui.tar.gz'
tar xf lazarus-src.tar.gz
mv lazarus-transgui lazarus
local -r lazarus_commit='4e69368d79e3801ad26a7bc7c1eda0ad3cf7dcc4'
curl -L -o lazarus-src.tar.bz2 "https://gitlab.com/dkk089/lazarus/-/archive/${lazarus_commit}/lazarus-${lazarus_commit}.tar.bz2"
tar xf lazarus-src.tar.bz2
mv "lazarus-${lazarus_commit}" lazarus
cd lazarus
make bigide
export PATH=$PWD:$PATH
Expand Down Expand Up @@ -105,7 +111,7 @@ package_openssl() {
}

my_lazbuild() {
lazbuild --compiler=${fpc_installdir}/lib/fpc/3.2.3/${compiler} \
lazbuild "--compiler=${fpc_basepath}/${compiler}" \
--lazarusdir=${sdk_dir}/lazarus "$@"
}

Expand Down Expand Up @@ -147,8 +153,3 @@ cp ../units/transgui .
strip transgui
install_name_tool -add_rpath '@executable_path' transgui
package_openssl "$PWD"
if [[ $compiler == ppca64 || $compiler == ppcrossa64 ]]; then
for i in transgui *.dylib; do
codesign --force -s - "$i"
done
fi
68 changes: 0 additions & 68 deletions .github/build_ubuntu.sh

This file was deleted.

28 changes: 14 additions & 14 deletions .github/build_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function My-Download {

$sdk_dir = "${HOME}\transgui_sdk"
$fpc322 = "${sdk_dir}\fpc-3.2.2"
$fpc323 = "${sdk_dir}\fpc-3.2.3"
$fpc324 = "${sdk_dir}\fpc-3.2.4-rc1"
$lazarus = "${sdk_dir}\lazarus"
$openssl = "${sdk_dir}\OpenSSL"

Expand All @@ -28,31 +28,31 @@ function FPC-Lazarus-Build-Install {

$env:Path = "${fpc322}\bin\i386-win32;" + $env:Path

# top of fixes_3_2 at the time of writing
$fpc323_commit = '0c5256300a323c78caa0b1a9cb772ac137f5aa8e'
My-Download -Uri "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc323_commit}/source-${fpc323_commit}.zip" -OutFile fpc-fixes.zip
$fpc324_commit = 'd78e2897014a69f56a1cfb53c75335c4cc37ba0e'
My-Download -Uri "https://gitlab.com/freepascal.org/fpc/source/-/archive/${fpc324_commit}/source-${fpc324_commit}.zip" -OutFile fpc-324-rc1.zip

# we could use Expand-Archive but it takes an eternity and then some
7z x fpc-fixes.zip
7z x fpc-324-rc1.zip

cd "source-${fpc323_commit}"
cd "source-${fpc324_commit}"
make all
mkdir "$fpc323"
make PREFIX=${fpc323} install
mkdir "$fpc324"
make PREFIX=${fpc324} install

$env:Path = "${fpc323}\bin\i386-win32;" + $env:Path
fpcmkcfg -d basepath=${fpc323} -o "${fpc323}\bin\i386-win32\fpc.cfg"
$env:Path = "${fpc324}\bin\i386-win32;" + $env:Path
fpcmkcfg -d basepath=${fpc324} -o "${fpc324}\bin\i386-win32\fpc.cfg"

cd "$sdk_dir"
My-Download -Uri "https://gitlab.com/dkk089/lazarus/-/archive/transgui/lazarus-transgui.zip" -OutFile lazarus-src.zip
$lazarus_commit = '4e69368d79e3801ad26a7bc7c1eda0ad3cf7dcc4'
My-Download -Uri "https://gitlab.com/dkk089/lazarus/-/archive/${lazarus_commit}/lazarus-${lazarus_commit}.zip" -OutFile lazarus-src.zip
7z x lazarus-src.zip

mv lazarus-transgui lazarus
mv lazarus-${lazarus_commit} lazarus
cd lazarus
make bigide
$env:Path = "${lazarus};" + $env:Path

My-Download -Uri "https://slproweb.com/download/Win32OpenSSL_Light-3_1_4.exe" -OutFile openssl-install.exe
My-Download -Uri "https://slproweb.com/download/Win32OpenSSL_Light-3_1_7.exe" -OutFile openssl-install.exe
Start-Process -FilePath openssl-install.exe -Wait -ArgumentList "/sp-","/verysilent","/suppressmsgboxes","/norestart","/dir=${openssl}"
}

Expand All @@ -61,7 +61,7 @@ $ErrorActionPreference = "Stop"

if (Test-Path -Path "$sdk_dir")
{
$env:Path = "${lazarus};${fpc323}\bin\i386-win32;" + $env:Path
$env:Path = "${lazarus};${fpc324}\bin\i386-win32;" + $env:Path
}
else
{
Expand Down
36 changes: 36 additions & 0 deletions .github/macosx/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
<array>
<string>torrent</string>
</array>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>org.bittorrent.torrent</string>
</array>
</dict>
</array>
<key>CFBundleURLTypes</key>
Expand All @@ -64,5 +70,35 @@
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.item</string>
<string>com.bittorrent.torrent</string>
</array>
<key>UTTypeDescription</key>
<string>BitTorrent Document</string>
<key>UTTypeIconFile</key>
<string>transgui.icns</string>
<key>UTTypeIdentifier</key>
<string>org.bittorrent.torrent</string>
<key>UTTypeReferenceURL</key>
<string>http://www.bittorrent.org/beps/bep_0000.html</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<string>TORR</string>
<key>public.filename-extension</key>
<array>
<string>torrent</string>
</array>
<key>public.mime-type</key>
<string>application/x-bittorrent</string>
</dict>
</dict>
</array>
</dict>
</plist>
6 changes: 5 additions & 1 deletion .github/package_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ mkdir -p "$appfolder/Contents/MacOS"
mkdir -p "$appfolder/Contents/Resources"

for i in libcrypto.3.dylib libssl.3.dylib transgui; do
lipo -create -output "$appfolder/Contents/MacOS/$i" transgui_{ppca64,ppcx64}/"$i"
files=(transgui_{ppca64,ppcx64}/"$i")
codesign --verbose --force -s - "${files[@]}"
lipo -create -output "$appfolder/Contents/MacOS/$i" "${files[@]}"
chmod +x "$appfolder/Contents/MacOS/$i"
done

cp "${macosx_dir}/PkgInfo" "${appfolder}/Contents"
cp "${macosx_dir}/transgui.icns" "${appfolder}/Contents/Resources"
sed -e "s/@prog_ver@/$prog_ver/" "${macosx_dir}/Info.plist" > "${appfolder}/Contents/Info.plist"

codesign --deep --force --verify --verbose --sign '-' "$appfolder"
hdiutil create -ov -anyowners -volname "transgui-v${prog_ver}" -format UDRW -srcfolder "$dmgfolder" -fs HFS+ tmp.dmg

mount_device=$(hdiutil attach -readwrite -noautoopen tmp.dmg | awk 'NR==1{print$1}')
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linux Build

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
build-linux:

runs-on: ubuntu-latest
container: lighterowl/transgui-sdk:1.0

steps:
- uses: actions/checkout@v1
with:
submodules: recursive

- run: |
export HOME=/root
git config --global --add safe.directory '*'
source /root/.transgui_sdk/source.me
./.github/build_linux.sh
- uses: actions/upload-artifact@v4
with:
name: TransGUI Linux
path: units/transgui-x86_64.AppImage
if-no-files-found: error
Loading

0 comments on commit d9c2a7e

Please sign in to comment.