Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ matrix:
- sh -c 'cd setup/macosx && ./compilers.sh'
script:
- echo -en 'travis_fold:start:build'
- sh -c 'cd setup/macosx && ./create_app_new.sh'
- sh -c 'cd setup/macosx && ./create_app.sh'
- echo -en 'travis_fold:end:build'
after_success:
- md5 ./setup/macosx/transgui-$PROG_VER.dmg
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
- [macOS](#macos)
- [Without a package manager](#without-a-package-manager)
- [Homebrew-Cask](#homebrew-cask)
- [Compilation](#compilation)
- [macOS](#macos-1)
- [Command line parameters](#command-line-parameters)
- [Portable mode](#portable-mode)
- [Fixed hotkeys](#fixed-hotkeys)
Expand Down Expand Up @@ -108,6 +110,19 @@ With Homebrew-Cask, directly execute this command to install Transmission Remote

- `brew cask install transmission-remote-gui`

## Compilation

### macOS

**Note: Currently Transmission Remote GUI can't be compiled if fpc and lazarus were installed using Homebrew. You can uninstall them using** `brew uninstall fpc` and `brew cask uninstall lazarus`

1. In Terminal navigate to the transgui folder containing the source code. So if you have it in Documents/transgui type `cd ~/Documents/transgui`
2. Type `cd setup/macosx`
3. Run the create_app shell script by typing `./create_app.sh` (Note the dot at the start of the line).
This will install fpc and lazarus if needed and build Transmission Remote GUI and move it in a .dmg image file.

You can install the fpc and lazarus without compiling using the compilers.sh script, to run it type `./compilers.sh` while in the setup/macosx folder.

## Command line parameters

You can specify path to a .torrent file or a magnet link as a command line parameter. The program will add the specified torrent.
Expand Down
52 changes: 39 additions & 13 deletions setup/macosx/create_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,38 @@
set -x

prog_ver="$(cat ../../VERSION.txt)"
build="$(git rev-list --abbrev-commit --max-count=1 HEAD ../..)"
lazarus_ver="$(lazbuild -v)"
fpc_ver="$(fpc -i V | head -n 1)"
exename=../../transgui
appname="Transmission Remote GUI"
appfolder="../../$appname.app"
dmgfolder=./Release
appfolder="$dmgfolder/$appname.app"
lazdir="${1:-/Developer/lazarus/}"

if [ -z "${CI-}" ]; then
./compilers.sh
fi

if [ ! "$lazdir" = "" ]
then
lazdir=LAZARUS_DIR="$lazdir"
fi

sed -i.bak "s/'Version %s'/'Version %s Build $build'#13#10'Compiled by: $fpc_ver, Lazarus v$lazarus_ver'/" ../../about.lfm

lazbuild -B ../../transgui.lpi --lazarusdir=/Developer/lazarus/

# Building Intel version
make -j"$(sysctl -n hw.ncpu)" -C ../.. clean CPU_TARGET=i386 "$lazdir"
make -j"$(sysctl -n hw.ncpu)" -C ../.. CPU_TARGET=i386 "$lazdir"
strip "$exename"
mv "$exename" "$exename.386"

# Building PowerPC version
make -j"$(sysctl -n hw.ncpu)" -C ../.. clean CPU_TARGET=powerpc "$lazdir"
make -j"$(sysctl -n hw.ncpu)" -C ../.. CPU_TARGET=powerpc "$lazdir"
strip "$exename"
mv "$exename" "$exename.ppc"

# Creating universal executable
lipo -create "$exename.ppc" "$exename.386" -output "$exename"
rm "$exename.386" "$exename.ppc"

if ! [ -e $exename ]
then
echo "$exename does not exist"
exit 1
fi
strip "$exename"

rm -rf "$appfolder"

Expand All @@ -44,6 +45,31 @@ mkdir -p "$appfolder/Contents/Resources"
mv "$exename" "$appfolder/Contents/MacOS"
cp ../../lang/transgui.* "$appfolder/Contents/MacOS/lang"

cp ../../history.txt "$dmgfolder"
cp ../../README.md "$dmgfolder"

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

ln -s /Applications "$dmgfolder/Drag \"Transmission Remote GUI\" here!"

hdiutil create -ov -anyowners -volname "transgui-v$prog_ver" -format UDRW -srcfolder ./Release "tmp.dmg"

mount_device="$(hdiutil attach -readwrite -noautoopen "tmp.dmg" | awk 'NR==1{print$1}')"
mount_volume="$(mount | grep "$mount_device" | sed 's/^[^ ]* on //;s/ ([^)]*)$//')"
cp transgui.icns "$mount_volume/.VolumeIcon.icns"
SetFile -c icnC "$mount_volume/.VolumeIcon.icns"
SetFile -a C "$mount_volume"

hdiutil detach "$mount_device"
rm -f "transgui-$prog_ver.dmg"
hdiutil convert tmp.dmg -format UDBZ -imagekey zlib-level=9 -o "transgui-$prog_ver.dmg"

rm tmp.dmg
rm -rf "$dmgfolder"
mv ../../about.lfm.bak ../../about.lfm

if [ -z "${CI-}" ]; then
open "transgui-$prog_ver.dmg"
fi
75 changes: 0 additions & 75 deletions setup/macosx/create_app_new.sh

This file was deleted.

40 changes: 0 additions & 40 deletions setup/macosx/create_package.sh

This file was deleted.