Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
lighterowl committed Aug 23, 2024
2 parents 9c5e57a + d886ab3 commit 467b10e
Show file tree
Hide file tree
Showing 40 changed files with 615 additions and 11,272 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
31 changes: 15 additions & 16 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,10 +32,12 @@ 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}"

Expand All @@ -45,7 +48,7 @@ fpc_lazarus_build_install() {
make "${make_opts_native[@]}" all
make PREFIX=${fpc_installdir} install

if [[ $cross_build ]]; then
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
Expand All @@ -56,9 +59,10 @@ fpc_lazarus_build_install() {
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 @@ -107,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 @@ -149,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.

26 changes: 13 additions & 13 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,26 +28,26 @@ 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
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>
5 changes: 4 additions & 1 deletion .github/package_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ mkdir -p "$appfolder/Contents/MacOS/lang"
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

Expand All @@ -22,6 +24,7 @@ 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
20 changes: 9 additions & 11 deletions .github/workflows/ubuntu.yml → .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ubuntu Build
name: Linux Build

on:
push:
Expand All @@ -7,23 +7,21 @@ on:
branches: [main, develop]

jobs:
build-ubuntu:
build-linux:

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

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

- uses: actions/cache@v4
with:
path: |
~/.transgui_sdk/lazarus
~/.transgui_sdk/fpc-3.2.3
key: ubuntu-fpc-lazarus

- run: .github/build_ubuntu.sh
- 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:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
path: |
~/.transgui_sdk/lazarus
~/.transgui_sdk/fpc-3.2.3
~/.transgui_sdk/fpc-3.2.4-rc1
key: macos-arm64-fpc-lazarus

- run: .github/build_macos.sh
Expand All @@ -44,7 +44,7 @@ jobs:
with:
path: |
~/.transgui_sdk/lazarus
~/.transgui_sdk/fpc-3.2.3
~/.transgui_sdk/fpc-3.2.4-rc1
key: macos-x64-fpc-lazarus

- run: .github/build_macos.sh
Expand All @@ -61,9 +61,11 @@ jobs:
runs-on: macos-12

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: recursive
sparse-checkout: |
.github
lang
# no cache needed here as we don't compile anything
- uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/cache@v4
with:
path: |
~\transgui_sdk\fpc-3.2.3
~\transgui_sdk\fpc-3.2.4-rc1
~\transgui_sdk\lazarus
~\transgui_sdk\OpenSSL\bin\libcrypto-3.dll
~\transgui_sdk\OpenSSL\bin\libssl-3.dll
Expand Down
13 changes: 4 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@

# snap package build via snapcraft
/*.snap
/snap/.snapcraft/
/stage/
/parts/
/prime/

### https://raw.github.com/github/gitignore/8edb8a95c4c4b3dce71a378aaaf89275510b9cef/Global/Lazarus.gitignore

# Lazarus compiler-generated binaries (safe to delete)
Expand Down Expand Up @@ -40,7 +32,6 @@ units
# Application bundle for Mac OS
*.app/


# Free Pascal compiler made files
fpcmade*

Expand All @@ -52,3 +43,7 @@ Release/

# transgui binary
/transgui

# binaries on macos
/transgui_*/
.DS_Store
Loading

0 comments on commit 467b10e

Please sign in to comment.