mirror of
https://github.com/CCF100/chloverlay.git
synced 2026-11-08 14:58:39 -06:00
add dkms to vendor-reset, add popcorntime
This commit is contained in:
1 parent
731419761e
commit
8cbbafc53b
7 files changed
+909
-2
No files matched your search
@@ -3,8 +3,7 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
#inherit dkms
|
||||
inherit git-r3
|
||||
inherit dkms git-r3
|
||||
EGIT_REPO_URI="https://github.com/CCF100/vendor-reset.git"
|
||||
EGIT_BRANCH="master"
|
||||
|
||||
|
||||
@@ -0,0 +1,592 @@
|
||||
# Copyright 2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: dkms.eclass
|
||||
# @MAINTAINER:
|
||||
# Nowa Ammerlaan <nowa@gentoo.org>
|
||||
# @AUTHOR:
|
||||
# Nowa Ammerlaan <nowa@gentoo.org>
|
||||
# @SUPPORTED_EAPIS: 8
|
||||
# @PROVIDES: linux-mod-r1
|
||||
# @BLURB: Helper eclass to manage DKMS modules
|
||||
# @DESCRIPTION:
|
||||
# Registers, builds and installs kernel modules using the DKMS
|
||||
# (Dynamic Kernel Module Support) system provided by sys-kernel/dkms.
|
||||
#
|
||||
# The dkms_autoconf may be used to translate the modlist and modargs
|
||||
# arrays from linux-mod-r1.eclass to a DKMS configuration file.
|
||||
#
|
||||
# If the upstream sources already contain a DKMS configuration file
|
||||
# this may be used instead of the dkms_autoconf function. In this
|
||||
# case dkms_gentoofy_conf function may be used to insert the users
|
||||
# compiler, MAKEOPTS and *FLAGS preferences into the DKMS
|
||||
# configuration file.
|
||||
#
|
||||
# The dkms_dopackage function is used to install a DKMS package, this
|
||||
# function expects to find a dkms.conf file at the path specified
|
||||
# by the argument passed to this function. If no path is specified
|
||||
# then the current working directory is used.
|
||||
#
|
||||
# For convenience this eclass exports a src_compile function that runs
|
||||
# dkms_autoconf if the dkms USE flag is enabled, and if the flag is
|
||||
# disabled it runs linux-mod-r1_src_compile instead. Similarly,
|
||||
# the src_install function exported by this eclass finds any
|
||||
# dkms.conf files in the current working directory or one of its
|
||||
# subdirectories and then calls dkms_dopackage for these packages.
|
||||
# And if the dkms USE flag is disabled it runs
|
||||
# linux-mod-r1_src_install instead.
|
||||
#
|
||||
# The pkg_postinst and pkg_postrm functions then take care of
|
||||
# (de)registering, (un)building, removing, and/or adding the DKMS
|
||||
# packages. For convenience the eclass also exports a pkg_config
|
||||
# function that rebuilds and reinstalls any DKMS packages the ebuild
|
||||
# owns for the currently running kernel.
|
||||
#
|
||||
# @EXAMPLE:
|
||||
#
|
||||
# To add DKMS support to an ebuild currently using only linux-mod-r1.
|
||||
#
|
||||
# Change:
|
||||
#
|
||||
# @CODE
|
||||
# inherit linux-mod-r1
|
||||
#
|
||||
# src_compile() {
|
||||
# local modlist=(
|
||||
# gentoo
|
||||
# gamepad=kernel/drivers/hid:gamepad:gamepad/obj
|
||||
# )
|
||||
# local modargs=( NIH_SOURCE="${KV_OUT_DIR}" )
|
||||
#
|
||||
# linux-mod-r1_src_compile
|
||||
# }
|
||||
# @CODE
|
||||
#
|
||||
# To:
|
||||
#
|
||||
# @CODE
|
||||
# inherit dkms
|
||||
#
|
||||
# src_compile() {
|
||||
# local modlist=(
|
||||
# gentoo
|
||||
# gamepad=kernel/drivers/hid:gamepad:gamepad/obj
|
||||
# )
|
||||
# local modargs=( NIH_SOURCE="${KV_OUT_DIR}" )
|
||||
#
|
||||
# dkms_src_compile
|
||||
# }
|
||||
# @CODE
|
||||
#
|
||||
# Note that due to the inherit order the src_install and pkg_postinst
|
||||
# phase functions may have to be defined explicitly.
|
||||
#
|
||||
# @EXAMPLE:
|
||||
#
|
||||
# A more complex example is the case of an ebuild that is currently
|
||||
# inheriting linux-mod-r1, but is not using any of its phase
|
||||
# functions. In this case there is usually no modlist for
|
||||
# dkms_autoconf to convert into a DKMS configuration file.
|
||||
# Instead the ebuild must utilize a dkms.conf provided by upstream
|
||||
# in the sources, or alternatively create one from scratch and
|
||||
# include it in FILESDIR.
|
||||
#
|
||||
# Tip: Check if there is a rpm/deb spec or similar script that can
|
||||
# create a dkms.conf to find a hint of what it should look like and
|
||||
# where it should be created for this particular package.
|
||||
#
|
||||
# @CODE
|
||||
# inherit dkms linux-mod-r1
|
||||
#
|
||||
# src_prepare() {
|
||||
# default
|
||||
# sed -e "s/@VERSION@/${PV}/" -i modules/dkms.conf || die
|
||||
# }
|
||||
#
|
||||
# src_compile() {
|
||||
# if use dkms; then
|
||||
# dkms_gentoofy_conf modules/dkms.conf
|
||||
# else
|
||||
# emake "${MODULES_MAKEARGS[@]}" modules
|
||||
# fi
|
||||
# }
|
||||
#
|
||||
# src_install() {
|
||||
# if use dkms; then
|
||||
# dkms_dopackage modules
|
||||
# else
|
||||
# linux_domodule modules/mymodule.ko
|
||||
# modules_post_process
|
||||
# fi
|
||||
# einstalldocs
|
||||
# }
|
||||
#
|
||||
# pkg_postinst() {
|
||||
# dkms_pkg_postinst
|
||||
# }
|
||||
# @CODE
|
||||
|
||||
case ${EAPI} in
|
||||
8) ;;
|
||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||
esac
|
||||
|
||||
if [[ -z ${_DKMS_ECLASS} ]]; then
|
||||
_DKMS_ECLASS=1
|
||||
|
||||
inherit linux-mod-r1
|
||||
|
||||
IUSE="dkms"
|
||||
|
||||
RDEPEND="dkms? ( sys-kernel/dkms ${BDEPEND} )"
|
||||
IDEPEND="dkms? ( sys-kernel/dkms ${BDEPEND} )"
|
||||
|
||||
# @ECLASS_VARIABLE: DKMS_PACKAGES
|
||||
# @OUTPUT_VARIABLE
|
||||
# @DESCRIPTION:
|
||||
# After dkms_src_install or dkms_dopackage this array will be
|
||||
# populated with all dkms packages installed by the ebuild. The names
|
||||
# and versions of each package are separated with a ':'.
|
||||
DKMS_PACKAGES=()
|
||||
|
||||
# @FUNCTION: dkms_gentoofy_conf
|
||||
# @USAGE: <list of files>
|
||||
# @DESCRIPTION:
|
||||
# Adds linux-mod-r1's MODULES_MAKEARGS and the ebuilds modargs to any
|
||||
# make calls in an existing dkms.conf. This function must be called
|
||||
# for every dkms.conf that will be installed to ensure that the users
|
||||
# compiler choice and flags are respected by DKMS at runtime.
|
||||
# Multiple files may be passed to this function as arguments. If no
|
||||
# arguments are given than this function runs on the dkms.conf in the
|
||||
# present working directory. Does nothing if USE=dkms is disabled.
|
||||
dkms_gentoofy_conf() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
use dkms || return 0
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
local file input=( "${@}" )
|
||||
[[ ${#} -eq 0 ]] && input=( dkms.conf )
|
||||
|
||||
# This will set edkmsargs
|
||||
dkms_sanitize_makeargs
|
||||
|
||||
for file in "${input[@]}"; do
|
||||
[[ -f ${file} ]] ||
|
||||
die "${FUNCNAME}: DKMS conf does not exist: ${file}"
|
||||
|
||||
sed -i "${file}" \
|
||||
-e "/^MAKE/ s:make :make ${edkmsargs[*]} :" \
|
||||
-e "/^MAKE/ s:make$:make ${edkmsargs[*]}:" \
|
||||
-e "/^MAKE/ s:make\":make ${edkmsargs[*]}\":" \
|
||||
-e "/^MAKE/ s:'make' :'make' ${edkmsargs[*]} : " \
|
||||
-e "/^MAKE/ s:'make'$:'make' ${edkmsargs[*]}:" \
|
||||
-e "/^MAKE/ s:'make'\":'make' ${edkmsargs[*]}\":" ||
|
||||
die "${FUNCNAME}: failed to Gentoo'fy ${file}"
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_sanitize_makeargs
|
||||
# @DESCRIPTION:
|
||||
# Uses linux-mod-r1's MODULES_MAKEARGS and modargs to set the
|
||||
# edkmsargs array. This array contains all variables from the two
|
||||
# input arrays except those referencing the current kernel version.
|
||||
# Quotes are added to the variables to prevent parsing problems at
|
||||
# DKMS runtime. Does nothing if USE=dkms is disabled.
|
||||
dkms_sanitize_makeargs() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
use dkms || return 0
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
local -a args=( "${MODULES_MAKEARGS[@]}" )
|
||||
[[ ${modargs@a} == *a* ]] && args+=( "${modargs[@]}" )
|
||||
|
||||
edkmsargs=( ${MAKEOPTS} )
|
||||
local arg
|
||||
for arg in "${args[@]}"; do
|
||||
# Replace Gentoo kernel targets with DKMS variables
|
||||
case ${arg} in
|
||||
*=${KV_OUT_DIR}|*=${KV_DIR})
|
||||
edkmsargs+=( "${arg%%=*}=\${kernel_source_dir}" )
|
||||
;;
|
||||
${KV_OUT_DIR}|${KV_DIR})
|
||||
edkmsargs+=( "\${kernel_source_dir}" )
|
||||
;;
|
||||
*=${KV_FULL})
|
||||
edkmsargs+=( "${arg%%=*}=\${kernelver}" )
|
||||
;;
|
||||
${KV_FULL})
|
||||
edkmsargs+=( "\${kernelver}" )
|
||||
;;
|
||||
*${KV_FULL}*|*${KV_DIR}*|*${KV_OUT_DIR}*)
|
||||
# Skip other arguments pointing to the current target
|
||||
continue
|
||||
;;
|
||||
*=*)
|
||||
# Quote values for variables to avoid parsing problems
|
||||
edkmsargs+=( "${arg%%=*}='${arg#*=}'" )
|
||||
;;
|
||||
*)
|
||||
edkmsargs+=( "${arg}" )
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_autoconf
|
||||
# @USAGE: [--no-kernelrelease|--no-autoinstall]
|
||||
# @DESCRIPTION:
|
||||
# Uses linux-mod-r1's modlist and modargs to construct a DKMS
|
||||
# configuration file. By default DKMS adds the 'KERNELRELEASE='
|
||||
# variable to all make commands. Some Makefiles will behave
|
||||
# differently when this variable is set, if this leads to problems
|
||||
# pass the --no-kernelrelease argument to this function to suppress
|
||||
# the addition of 'KERNELRELEASE=' to the calls to make at runtime.
|
||||
# By default the created DKMS configuration file will enable
|
||||
# automatic installation of all kernel modules. To disable this add
|
||||
# the --no-autoinstall argument. Does nothing if USE=dkms is disabled.
|
||||
dkms_autoconf() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
use dkms || return 0
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
local arg autoinstall=1 make_command=make
|
||||
[[ ${#} -gt 2 ]] && die "${FUNCNAME}: too many arguments"
|
||||
for arg in "${@}"; do
|
||||
case ${arg} in
|
||||
--no-kernelrelease)
|
||||
# Per DKMS manual, quoting disables setting KERNELRELEASE
|
||||
make_command=\'make\'
|
||||
;;
|
||||
--no-autoinstall)
|
||||
autoinstall=
|
||||
;;
|
||||
*)
|
||||
die "${FUNCNAME}: invalid argument ${arg}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ ${modlist@a} == *a* && ${#modlist[@]} -gt 0 ]] ||
|
||||
die "${FUNCNAME[0]} was called without a 'modlist' array"
|
||||
|
||||
emakeargs=( "${MODULES_MAKEARGS[@]}" )
|
||||
[[ ${modargs@a} == *a* ]] && emakeargs+=( "${modargs[@]}" )
|
||||
|
||||
local index mod name package target dkms_config_files=()
|
||||
for mod in "${modlist[@]}"; do
|
||||
name=${mod%%=*}
|
||||
[[ -n ${name} && ${name} != *:* ]] || die "invalid mod entry '${mod}'"
|
||||
|
||||
# 0:install-dir 1:source-dir 2:build-dir 3:make-target(s)
|
||||
mod=${mod#"${name}"}
|
||||
IFS=: read -ra mod <<<"${mod#=}"
|
||||
[[ ${#mod[@]} -le 4 ]] || die "too many ':' in ${name}'s modlist"
|
||||
|
||||
[[ ${mod[1]:=${PWD}} != /* ]] && mod[1]=${PWD}/${mod[1]}
|
||||
[[ ${mod[2]:=${mod[1]}} != /* ]] && mod[2]=${PWD}/${mod[2]}
|
||||
|
||||
pushd "${mod[1]}" >/dev/null || die
|
||||
|
||||
if [[ -z ${mod[3]} ]]; then
|
||||
# guess between commonly used targets if none given, fallback to
|
||||
# an empty target without trying to see the error output
|
||||
for target in module{s,} "${name}".ko default all; do
|
||||
nonfatal emake "${emakeargs[@]}" -q "${target}" &>/dev/null
|
||||
if [[ ${?} -eq 1 ]]; then
|
||||
mod[3]=${target}
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -f dkms.conf ]]; then
|
||||
# Find the index of an existing module, else find the
|
||||
# first available index.
|
||||
index=$(
|
||||
source dkms.conf &>/dev/null ||
|
||||
die "${FUNCNAME}: invalid dkms.conf at ${PWD}"
|
||||
for i in "${!BUILT_MODULE_NAME[@]}"; do
|
||||
if [[ ${name} == ${BUILT_MODULE_NAME[${i}]} ]]
|
||||
then
|
||||
echo ${i} || die
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo ${#BUILT_MODULE_NAME[@]} || die
|
||||
) || continue
|
||||
else
|
||||
# If the kernel modules are in a subdir add this to the
|
||||
# DKMS package name identifier to ensure it is unique.
|
||||
# There may be multiple subdirs with kernel modules.
|
||||
if [[ ${PWD} == ${S} ]]; then
|
||||
package=${PN}
|
||||
else
|
||||
package=${PN}_${name}
|
||||
fi
|
||||
cat <<-EOF > dkms.conf || die
|
||||
PACKAGE_NAME=${package}
|
||||
PACKAGE_VERSION=${PV}
|
||||
EOF
|
||||
if [[ -n ${autoinstall} ]]; then
|
||||
echo "AUTOINSTALL=yes" >> dkms.conf || die
|
||||
else
|
||||
echo "AUTOINSTALL=no" >> dkms.conf || die
|
||||
fi
|
||||
index=0
|
||||
fi
|
||||
|
||||
# If there is no MAKE command in this dkms.conf yet, add one
|
||||
if ! grep -qE "^MAKE(\[0\]|)=" dkms.conf; then
|
||||
echo "MAKE[0]=\"${make_command} ${mod[3]}\"" >> dkms.conf || die
|
||||
fi
|
||||
|
||||
# DKMS enforces that the install target starts with one of
|
||||
# these options.
|
||||
local dest=${mod[0]}
|
||||
if ! [[ ${dest} == /kernel* || ${dest} == /updates* ||
|
||||
${dest} == /extra* ]]
|
||||
then
|
||||
dest=/extra/${dest}
|
||||
fi
|
||||
|
||||
# Add one empty line in case upstream provided dkms.conf is
|
||||
# missing a line ending on the final line. Also looks nicer
|
||||
# because now all the settings for each kernel module are
|
||||
# grouped together.
|
||||
cat <<-EOF >> dkms.conf || die
|
||||
|
||||
BUILT_MODULE_NAME[${index}]=${name}
|
||||
BUILT_MODULE_LOCATION[${index}]=.${mod[2]#"${mod[1]%/.}"}/
|
||||
DEST_MODULE_NAME[${index}]=${name}
|
||||
DEST_MODULE_LOCATION[${index}]=${dest}
|
||||
EOF
|
||||
if use strip; then
|
||||
echo "STRIP[${index}]=yes" >> dkms.conf || die
|
||||
else
|
||||
echo "STRIP[${index}]=no" >> dkms.conf || die
|
||||
fi
|
||||
|
||||
# Append this dkms.conf to our tracker array
|
||||
if ! has "${PWD}/dkms.conf" "${dkms_config_files[@]}"; then
|
||||
dkms_config_files+=( "${PWD}/dkms.conf" )
|
||||
fi
|
||||
popd >/dev/null || die
|
||||
done
|
||||
|
||||
# Add the users compiler *FLAGS and MAKEOPTS to all dkms.conf's
|
||||
dkms_gentoofy_conf "${dkms_config_files[@]}"
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_dopackage
|
||||
# @USAGE: <dkms package root>
|
||||
# @DESCRIPTION:
|
||||
# Installs a DKMS package to ${ED}/usr/src. If no path is specified
|
||||
# as the first argument, then the root of the package is assumed to
|
||||
# be the pwd. Appends the installed package to the global
|
||||
# DKMS_PACKAGES array. Does nothing if USE=dkms is disabled.
|
||||
dkms_dopackage() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
use dkms || return 0
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
[[ ${#} -gt 1 ]] && die "${FUNCNAME}: too many arguments"
|
||||
local package_root=${1:-"${PWD}"}
|
||||
[[ ${package_root} != /* ]] && package_root=${PWD}/${package_root}
|
||||
[[ -f ${package_root}/dkms.conf ]] ||
|
||||
die "${FUNCNAME}: no DKMS conf at ${package_root}"
|
||||
# subshell to avoid polluting the environment with the dkms.conf.
|
||||
local package="$(
|
||||
source "${package_root}/dkms.conf" &>/dev/null ||
|
||||
die "${FUNCNAME}: invalid DKMS conf at ${package_root}"
|
||||
dest=/usr/src/${PACKAGE_NAME}-${PACKAGE_VERSION}
|
||||
# Replace references to current dir with merged dir
|
||||
sed -i "${package_root}/dkms.conf" \
|
||||
-e "s#${package_root}#${EPREFIX}${dest}#g" || die
|
||||
mkdir -p "${ED}${dest}" || die
|
||||
cp -a "${package_root}"/* "${ED}${dest}" || die
|
||||
insinto /usr/lib/dracut/dracut.conf.d
|
||||
[[ ${MODULES_INITRAMFS_IUSE} ]] && use ${MODULES_INITRAMFS_IUSE#+} &&
|
||||
: add || : omit
|
||||
newins - 10-${PN}.conf <<<"${_}_drivers+=\" ${BUILT_MODULE_NAME[*]%.ko} \""
|
||||
echo "${PACKAGE_NAME}:${PACKAGE_VERSION}"
|
||||
)"
|
||||
if has "${package}" "${DKMS_PACKAGES[@]}"; then
|
||||
die "${FUNCNAME}: DKMS package with the same name is already installed"
|
||||
elif [[ ${package} == :* || ${package} == *: ]]; then
|
||||
die "${FUNCNAME}: DKMS conf did not set a package name or version"
|
||||
else
|
||||
DKMS_PACKAGES+=( "${package}" )
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_pkg_setup
|
||||
# @DESCRIPTION:
|
||||
# Runs linux-info_pkg_setup for binary merges with USE=dkms enabled.
|
||||
# This ensure that the kernel environment variables are reset, which
|
||||
# would otherwise be intentionally skipped by linux-mod-r1.eclass
|
||||
dkms_pkg_setup() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
linux-mod-r1_pkg_setup
|
||||
if use dkms; then
|
||||
unset SKIP_KERNEL_BINPKG_ENV_RESET
|
||||
if [[ ${MERGE_TYPE} == binary ]]; then
|
||||
linux-info_pkg_setup
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_src_compile
|
||||
# @DESCRIPTION:
|
||||
# Runs dkms_autoconf if USE=dkms is enabled, otherwise runs
|
||||
# linux-mod-r1_src_compile. Arguments given to this function are
|
||||
# passed onto dkms_autoconf.
|
||||
dkms_src_compile() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
if ! use dkms; then
|
||||
linux-mod-r1_src_compile
|
||||
return 0
|
||||
fi
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
dkms_autoconf "${@}"
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_src_install
|
||||
# @DESCRIPTION:
|
||||
# Runs dkms_dopackage for each dkms.conf found in the pwd or any
|
||||
# sub-directories. Then runs einstalldocs. If USE=dkms is disabled
|
||||
# then linux-mod-r1_src_install is run instead.
|
||||
dkms_src_install() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
if ! use dkms; then
|
||||
linux-mod-r1_src_install
|
||||
return 0
|
||||
fi
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
while IFS= read -r -d '' file; do
|
||||
dkms_dopackage $(dirname "${file}")
|
||||
done < <(find "${PWD}" -type f -name dkms.conf -print0 || die)
|
||||
|
||||
einstalldocs
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_pkg_config
|
||||
# @DESCRIPTION:
|
||||
# Rebuilds and reinstalls all DKMS packages owned by the ebuild.
|
||||
# Does nothing if USE=dkms is disabled.
|
||||
dkms_pkg_config() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
use dkms || return 0
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
local package ARCH=$(tc-arch-kernel)
|
||||
for package in "${DKMS_PACKAGES[@]}"; do
|
||||
IFS=: read -ra package <<<"${package#}"
|
||||
[[ ${#package[@]} -eq 2 ]] ||
|
||||
die "${FUNCNAME}: incorrect package in ${DKMS_PACKAGES[*]}"
|
||||
einfo "Building ${package[0]} version ${package[1]}"
|
||||
dkms build -m ${package[0]} -v ${package[1]} --force ||
|
||||
die "${FUNCNAME}: failed to build ${package} with DKMS"
|
||||
einfo "Installing ${package[0]} version ${package[1]}"
|
||||
dkms install -m ${package[0]} -v ${package[1]} --force ||
|
||||
die "${FUNCNAME}: failed to install ${package} with DKMS"
|
||||
done
|
||||
|
||||
if [[ ${MODULES_INITRAMFS_IUSE} ]] && use dist-kernel &&
|
||||
use ${MODULES_INITRAMFS_IUSE#+}
|
||||
then
|
||||
dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" --all
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_postinst
|
||||
# @DESCRIPTION:
|
||||
# Registers, builds and installs all DKMS packages owned by the
|
||||
# ebuild. Calls dist-kernel_reinstall_initramfs if requested by the
|
||||
# ebuild via linux-mod-r1's MODULES_INITRAMFS_IUSE. Runs
|
||||
# linux-mod-r1_pkg_postinst if USE=dkms is disabled.
|
||||
dkms_pkg_postinst() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
if ! use dkms; then
|
||||
linux-mod-r1_pkg_postinst
|
||||
return 0
|
||||
fi
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
local package ARCH=$(tc-arch-kernel)
|
||||
for package in "${DKMS_PACKAGES[@]}"; do
|
||||
IFS=: read -ra package <<<"${package#}"
|
||||
[[ ${#package[@]} -eq 2 ]] ||
|
||||
die "${FUNCNAME}: incorrect package in ${DKMS_PACKAGES[*]}"
|
||||
einfo "Registering ${package[0]} version ${package[1]}"
|
||||
dkms add -m ${package[0]} -v ${package[1]} ||
|
||||
die "${FUNCNAME}: failed to register ${package[0]} with DKMS"
|
||||
einfo "Building ${package[0]} version ${package[1]}"
|
||||
dkms build -m ${package[0]} -v ${package[1]} \
|
||||
-k ${KV_FULL} --force ||
|
||||
die "${FUNCNAME}: failed to build ${package[0]} with DKMS"
|
||||
einfo "Installing ${package[0]} version ${package[1]}"
|
||||
dkms install -m ${package[0]} -v ${package[1]} \
|
||||
-k ${KV_FULL} --force ||
|
||||
die "${FUNCNAME}: failed to install ${package[0]} with DKMS"
|
||||
done
|
||||
|
||||
if [[ ${MODULES_INITRAMFS_IUSE} ]] && use dist-kernel &&
|
||||
use ${MODULES_INITRAMFS_IUSE#+}
|
||||
then
|
||||
dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" --all
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: dkms_pkg_prerm
|
||||
# @DESCRIPTION:
|
||||
# Uninstalls, unbuilds and deregisters all DKMS packages owned by the
|
||||
# ebuild. Does nothing if USE=dkms is disabled.
|
||||
dkms_pkg_prerm() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
|
||||
use dkms || return 0
|
||||
[[ -z ${MODULES_OPTIONAL_IUSE} ]] ||
|
||||
use "${MODULES_OPTIONAL_IUSE#+}" || return 0
|
||||
|
||||
local package ARCH=$(tc-arch-kernel)
|
||||
for package in "${DKMS_PACKAGES[@]}"; do
|
||||
IFS=: read -ra package <<<"${package#}"
|
||||
[[ ${#package[@]} -eq 2 ]] ||
|
||||
die "${FUNCNAME}: incorrect package in ${DKMS_PACKAGES[*]}"
|
||||
einfo "Uninstalling ${package[0]} version ${package[1]}"
|
||||
dkms uninstall -m ${package[0]} -v ${package[1]} --all ||
|
||||
ewarn "${FUNCNAME}: failed to uninstall ${package[0]} with DKMS"
|
||||
einfo "Unbuilding ${package[0]} version ${package[1]}"
|
||||
dkms unbuild -m ${package[0]} -v ${package[1]} --all ||
|
||||
ewarn "${FUNCNAME}: failed to unbuild ${package[0]} with DKMS"
|
||||
einfo "Deregistering ${package[0]} version ${package[1]}"
|
||||
dkms remove -m ${package[0]} -v ${package[1]} --all ||
|
||||
ewarn "${FUNCNAME}: failed to deregister ${package[0]} with DKMS"
|
||||
done
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_config pkg_postinst pkg_prerm
|
||||
@@ -0,0 +1,5 @@
|
||||
DIST Popcorn-Time-0.4.9-amd64.deb 101127660 BLAKE2B bf4f527994acfc62aa7fa91a04164d8c2d0af0bd0be946cccd11d9f6492ea5aedf2e9db6be9842d51f783efe50643b717d54cbb5ddacad970e668f6d45785da5 SHA512 fbd738e31149bedba52c8cb6fe33ad9e0d79b37fae5add200da243e33ddddaff969eea5b58f849bcbb6cb60fe62c9f27e5306a5c840a005c8ef70c8462f1caab
|
||||
DIST Popcorn-Time-0.4.9-i386.deb 104246828 BLAKE2B 73e2e6959a72fef8e0980b2ddad7a9aad5a57bf6ec32d9db7fd7947edcbf40336558b6f571ca48559a637ad79e0298dda6e454bdbf75b34141f81a65ce7b249f SHA512 f23e34ffbc8b20f48b74a4aed94d43e7709f26bd16093cca395dc9d703c590da5cdf4d7ec6787c21fcd1a3ac065372e79420567178bb49f92182507a05ade21e
|
||||
DIST Popcorn-Time-0.5.0-amd64.deb 154053420 BLAKE2B 891b70dd1759996c64550e6189497f7f1fefd68aabde1a191f2c290ff8926519934a32be820f24f2c58aeef2b7b0558eb35fc8cb3ea323cec2dc04e20821c070 SHA512 91ef528ec4e31ad569d32ab04b70bd6832dbe60c152316e1561d6543b65aaef37f58e840d4f79c9ca02ae1b1435c4d23f87e803d2a819e6437c5098f39d6541c
|
||||
DIST Popcorn-Time-0.5.0-i386.deb 159144680 BLAKE2B bb188463513feb6f00a12cbc6b65a678488c293d1957433e260005dc2d1a45a3557802c395164b9868b6aa498e0989f9c282f870b26b452800527e49f626df56 SHA512 e447facc1fe9603dba2b2954482bcdcfd2d096ca19256da0ca4952178d4f6d36eba8e0acf73852d66a73a733f9a3ae4867f615a26600334f44dae51486ae7a62
|
||||
DIST Popcorn-Time-0.5.1-amd64.deb 150327218 BLAKE2B 230fa548d2f47fa774164704aef703f75bf543fb666ce73300bc1c56b1ee1b3133e229d02608c7584b72f81550c1bc480b8368128efdb38b77ee4061dac44224 SHA512 de2a3538da8e98d5d8ba3adc88355adec1c6c681a6bf82a46c678a38e1989d5754659e6f9f9dab9c197ec507d0c90b6b60ca3a068f861abb0cbbbf7020f68a97
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<upstream>
|
||||
<remote-id type="github">popcorn-official/popcorn-desktop</remote-id>
|
||||
<bugs-to>https://github.com/popcorn-official/popcorn-desktop/issues</bugs-to>
|
||||
</upstream>
|
||||
<maintainer type="person">
|
||||
<email>nowa@gentoo.org</email>
|
||||
<name>Nowa Ammerlaan</name>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
||||
@@ -0,0 +1,92 @@
|
||||
# Copyright 2019-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
CHROMIUM_LANGS="
|
||||
am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
|
||||
hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv
|
||||
sw ta te th tr uk vi zh-CN zh-TW
|
||||
"
|
||||
|
||||
inherit chromium-2 desktop unpacker xdg
|
||||
|
||||
DESCRIPTION="BitTorrent client that includes an integrated media player"
|
||||
HOMEPAGE="https://github.com/popcorn-official/popcorn-desktop"
|
||||
SRC_URI="
|
||||
amd64? ( https://github.com/popcorn-time-ru/popcorn-desktop/releases/download/v${PV}/Popcorn-Time-${PV}-amd64.deb )
|
||||
x86? ( https://github.com/popcorn-time-ru/popcorn-desktop/releases/download/v${PV}/Popcorn-Time-${PV}-i386.deb )
|
||||
"
|
||||
S="${WORKDIR}"
|
||||
|
||||
KEYWORDS="-* ~amd64 ~x86"
|
||||
# Electron bundles a bunch of things
|
||||
LICENSE="
|
||||
MIT BSD BSD-2 BSD-4 AFL-2.1 Apache-2.0 Ms-PL GPL-2 LGPL-2.1 APSL-2
|
||||
unRAR OFL-1.1 CC-BY-SA-3.0 MPL-2.0 android public-domain all-rights-reserved
|
||||
"
|
||||
SLOT="0"
|
||||
RESTRICT="bindist mirror"
|
||||
|
||||
RDEPEND="
|
||||
app-accessibility/at-spi2-core:2
|
||||
dev-libs/atk
|
||||
dev-libs/expat
|
||||
dev-libs/nspr
|
||||
dev-libs/nss
|
||||
media-libs/alsa-lib
|
||||
net-print/cups
|
||||
sys-apps/dbus
|
||||
sys-libs/glibc
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf
|
||||
x11-libs/gtk+:3
|
||||
x11-libs/libX11
|
||||
x11-libs/libxcb
|
||||
x11-libs/libXcomposite
|
||||
x11-libs/libXcursor
|
||||
x11-libs/libXdamage
|
||||
x11-libs/libXext
|
||||
x11-libs/libXfixes
|
||||
x11-libs/libXi
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXrender
|
||||
x11-libs/libXScrnSaver
|
||||
x11-libs/libXtst
|
||||
x11-libs/pango
|
||||
"
|
||||
|
||||
QA_PREBUILT="opt/Popcorn-Time/*"
|
||||
|
||||
pkg_pretend() {
|
||||
chromium_suid_sandbox_check_kernel_config
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
# cleanup languages
|
||||
pushd "opt/Popcorn-Time/locales" || die
|
||||
chromium_remove_language_paks
|
||||
popd || die
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
chromium_suid_sandbox_check_kernel_config
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
doicon -s 256 "usr/share/icons/butter.png"
|
||||
|
||||
domenu usr/share/applications/Popcorn-Time.desktop
|
||||
|
||||
local DESTDIR="/opt/Popcorn-Time"
|
||||
pushd "opt/Popcorn-Time" || die
|
||||
|
||||
# Copy all the things in
|
||||
dodir "${DESTDIR}"
|
||||
mv * "${ED}/${DESTDIR}" || die
|
||||
|
||||
dosym "${DESTDIR}"/Popcorn-Time /opt/bin/Popcorn-Time
|
||||
popd || die
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
# Copyright 2019-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
CHROMIUM_LANGS="
|
||||
af am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
|
||||
hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv
|
||||
sw ta te th tr uk ur vi zh-CN zh-TW
|
||||
"
|
||||
|
||||
inherit chromium-2 desktop unpacker xdg
|
||||
|
||||
DESCRIPTION="BitTorrent client that includes an integrated media player"
|
||||
HOMEPAGE="https://github.com/popcorn-official/popcorn-desktop"
|
||||
SRC_URI="
|
||||
amd64? ( https://github.com/popcorn-time-ru/popcorn-desktop/releases/download/v${PV}/Popcorn-Time-${PV}-amd64.deb )
|
||||
x86? ( https://github.com/popcorn-time-ru/popcorn-desktop/releases/download/v${PV}/Popcorn-Time-${PV}-i386.deb )
|
||||
"
|
||||
S="${WORKDIR}"
|
||||
|
||||
KEYWORDS="-* ~amd64 ~x86"
|
||||
# Electron bundles a bunch of things
|
||||
LICENSE="
|
||||
MIT BSD BSD-2 BSD-4 AFL-2.1 Apache-2.0 Ms-PL GPL-2 LGPL-2.1 APSL-2
|
||||
unRAR OFL-1.1 CC-BY-SA-3.0 MPL-2.0 android public-domain all-rights-reserved
|
||||
"
|
||||
SLOT="0"
|
||||
RESTRICT="bindist mirror"
|
||||
|
||||
RDEPEND="
|
||||
>=app-accessibility/at-spi2-core-2.46.0:2
|
||||
dev-libs/expat
|
||||
dev-libs/nspr
|
||||
dev-libs/nss
|
||||
media-libs/alsa-lib
|
||||
net-print/cups
|
||||
sys-apps/dbus
|
||||
sys-libs/glibc
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf
|
||||
x11-libs/gtk+:3
|
||||
x11-libs/libX11
|
||||
x11-libs/libxcb
|
||||
x11-libs/libxkbcommon
|
||||
x11-libs/libXcomposite
|
||||
x11-libs/libXcursor
|
||||
x11-libs/libXdamage
|
||||
x11-libs/libXext
|
||||
x11-libs/libXfixes
|
||||
x11-libs/libXi
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXrender
|
||||
x11-libs/libXScrnSaver
|
||||
x11-libs/libXtst
|
||||
x11-libs/pango
|
||||
"
|
||||
|
||||
QA_PREBUILT="opt/Popcorn-Time/*"
|
||||
|
||||
pkg_pretend() {
|
||||
chromium_suid_sandbox_check_kernel_config
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
# cleanup languages
|
||||
pushd "opt/Popcorn-Time/locales" || die
|
||||
# No l10n use entries for these langs
|
||||
rm ar-XB.pak* en-XA.pak* || die
|
||||
chromium_remove_language_paks
|
||||
popd || die
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
chromium_suid_sandbox_check_kernel_config
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
doicon -s 256 "usr/share/icons/butter.png"
|
||||
|
||||
domenu usr/share/applications/Popcorn-Time.desktop
|
||||
|
||||
local DESTDIR="/opt/Popcorn-Time"
|
||||
pushd "opt/Popcorn-Time" || die
|
||||
|
||||
exeinto "${DESTDIR}/lib"
|
||||
doexe lib/*.so
|
||||
|
||||
insinto "${DESTDIR}/lib"
|
||||
doins *.json
|
||||
|
||||
exeinto "${DESTDIR}"
|
||||
doexe Popcorn-Time nwjc minidump_stackwalk chromedriver chrome_crashpad_handler
|
||||
|
||||
insinto "${DESTDIR}"
|
||||
doins *.pak *.bin *.json *.dat
|
||||
insopts -m0755
|
||||
doins -r locales src node_modules
|
||||
|
||||
dosym "${DESTDIR}"/Popcorn-Time /opt/bin/Popcorn-Time
|
||||
|
||||
popd || die
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
# Copyright 2019-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
CHROMIUM_LANGS="
|
||||
af am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
|
||||
hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv
|
||||
sw ta te th tr uk ur vi zh-CN zh-TW
|
||||
"
|
||||
|
||||
inherit chromium-2 desktop unpacker xdg
|
||||
|
||||
DESCRIPTION="BitTorrent client that includes an integrated media player"
|
||||
HOMEPAGE="https://github.com/popcorn-time-ru/popcorn-desktop"
|
||||
SRC_URI="https://github.com/popcorn-time-ru/popcorn-desktop/releases/download/v${PV}/Popcorn-Time-${PV}-amd64.deb"
|
||||
S="${WORKDIR}"
|
||||
|
||||
# Electron bundles a bunch of things
|
||||
LICENSE="
|
||||
MIT BSD BSD-2 BSD-4 AFL-2.1 Apache-2.0 Ms-PL GPL-2 LGPL-2.1 APSL-2
|
||||
unRAR OFL-1.1 CC-BY-SA-3.0 MPL-2.0 android public-domain all-rights-reserved
|
||||
"
|
||||
SLOT="0"
|
||||
KEYWORDS="-* ~amd64"
|
||||
RESTRICT="bindist mirror"
|
||||
|
||||
RDEPEND="
|
||||
>=app-accessibility/at-spi2-core-2.46.0:2
|
||||
dev-libs/expat
|
||||
dev-libs/nspr
|
||||
dev-libs/nss
|
||||
media-libs/alsa-lib
|
||||
net-print/cups
|
||||
sys-apps/dbus
|
||||
sys-libs/glibc
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf
|
||||
x11-libs/gtk+:3
|
||||
x11-libs/libX11
|
||||
x11-libs/libxcb
|
||||
x11-libs/libxkbcommon
|
||||
x11-libs/libXcomposite
|
||||
x11-libs/libXcursor
|
||||
x11-libs/libXdamage
|
||||
x11-libs/libXext
|
||||
x11-libs/libXfixes
|
||||
x11-libs/libXi
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXrender
|
||||
x11-libs/libXScrnSaver
|
||||
x11-libs/libXtst
|
||||
x11-libs/pango
|
||||
"
|
||||
|
||||
QA_PREBUILT="opt/Popcorn-Time/*"
|
||||
|
||||
pkg_pretend() {
|
||||
chromium_suid_sandbox_check_kernel_config
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
# cleanup languages
|
||||
pushd "opt/Popcorn-Time/locales" || die
|
||||
# No l10n use entries for these langs
|
||||
rm ar-XB.pak* en-XA.pak* || die
|
||||
chromium_remove_language_paks
|
||||
popd || die
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
chromium_suid_sandbox_check_kernel_config
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
doicon -s 256 "usr/share/icons/butter.png"
|
||||
|
||||
domenu usr/share/applications/Popcorn-Time.desktop
|
||||
|
||||
local DESTDIR="/opt/Popcorn-Time"
|
||||
pushd "opt/Popcorn-Time" || die
|
||||
|
||||
exeinto "${DESTDIR}/lib"
|
||||
doexe lib/*.so
|
||||
|
||||
insinto "${DESTDIR}/lib"
|
||||
doins *.json
|
||||
|
||||
exeinto "${DESTDIR}"
|
||||
doexe Popcorn-Time nwjc minidump_stackwalk chromedriver chrome_crashpad_handler
|
||||
|
||||
insinto "${DESTDIR}"
|
||||
doins *.pak *.bin *.json *.dat
|
||||
insopts -m0755
|
||||
doins -r locales src node_modules
|
||||
|
||||
dosym "${DESTDIR}"/Popcorn-Time /opt/bin/Popcorn-Time
|
||||
|
||||
popd || die
|
||||
}
|
||||
Reference in new issue
Block a user