0
0
Fork 0
haikuports/www-client/qutebrowser/qutebrowser-1.13.1.recipe

100 lines
2.8 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

SUMMARY="A VIM-like web browser"
DESCRIPTION="QuteBrowser is a keyboard-focused browser with a minimal GUI. \
Its based on Python and PyQt5 and free software, licensed under the GPL. \
It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl."
HOMEPAGE="https://qutebrowser.org/"
COPYRIGHT="2014-2020 Florian Bruhin (The Compiler)"
LICENSE="GNU GPL v3"
REVISION="3"
SOURCE_URI="https://github.com/qutebrowser/qutebrowser/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="126afbc9325ff45bc2886545d61f74ba321569bd39090513e9fc6536fa5b900e"
PATCHES="qutebrowser-$portVersion.patchset"
PYTHON_VERSION="3.8"
ADDITIONAL_FILES="qutebrowser.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
qutebrowser$secondaryArchSuffix = $portVersion
app:QuteBrowser$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
attrs_python38
jinja_python38
pygments_python38
pypeg2_python38
pyqt5_python38
pyyaml_python38
setuptools_python38
cmd:python$PYTHON_VERSION
lib:libQt5Core$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
attrs_python38
jinja_python38
pygments_python38
pypeg2_python38
pyyaml_python38
setuptools_python38
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:python$PYTHON_VERSION
"
BUILD()
{
python=$portPackageLinksDir/cmd~python$PYTHON_VERSION/bin/python$PYTHON_VERSION
$python ./setup.py build $jobArgs
}
INSTALL()
{
# Add Haiku resources
local APP_SIGNATURE="application/x-vnd.qutebrowser"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/qutebrowser.rdef.in \
> qutebrowser.rdef
# GENERIC: all python_setuptools-based installs need this
python=$portPackageLinksDir/cmd~python$PYTHON_VERSION/bin/python$PYTHON_VERSION
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c3)
installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation $appsDir
$python setup.py install --prefix $prefix
mv $prefix/bin/qutebrowser $appsDir/QuteBrowser
rm -rf $prefix/bin
sed -i '/import sys/a import os\nimport signal' $appsDir/QuteBrowser
sed -i '/sys.exit(/d' $appsDir/QuteBrowser
sed -i '$d' $appsDir/QuteBrowser
sed -i 's/ load/load/g' $appsDir/QuteBrowser
sed -i '$a\ os.kill(os.getpid(), signal.SIGTERM)' $appsDir/QuteBrowser
settype -t application/x-vnd.Be-elfexecutable \
$appsDir/QuteBrowser
# Installing extra-attribs
rc qutebrowser.rdef
resattr -o $appsDir/QuteBrowser \
qutebrowser.rsrc
addAppDeskbarSymlink $appsDir/QuteBrowser
}