mirror of
https://github.com/rozniak/xfce-winxp-tc.git
synced 2026-05-01 19:51:33 +00:00
Enhancement: Fixes #198, Packaging port for Alpine Linux
This commit is contained in:
@@ -6,6 +6,8 @@ The contents of this directory is as follows:
|
||||
|
||||
`cmake-inc/` - common CMake scripts to be included by components in their builds
|
||||
|
||||
`apk/` - Alpine Linux (`.apk`) packaging implementation
|
||||
|
||||
`archpkg/` - Arch Linux (`.pkg.tar.zst`) packaging implementation
|
||||
|
||||
`deb/` - Debian (`.deb`) packaging implementation
|
||||
@@ -24,7 +26,7 @@ The contents of this directory is as follows:
|
||||
|
||||
## TL;DR on Building
|
||||
If you are new and simply want to compile everything, you should:
|
||||
- Ensure you have the typical tools installed: `cmake`, `fakeroot`, `gcc`, `make`, `pkg-config`, `python3`
|
||||
- Ensure you have the typical tools installed: `bash`, `cmake`, `coreutils`, `fakeroot`, `gcc`, `make`, `pkg-config`, `python3`
|
||||
- Run `./chkdeps.sh -l` - this will inform you if you're missing any build-time dependencies
|
||||
- This script should output the package names, so you can bung it straight into your package manager, eg. `apt install $(./chkdeps.sh -l | cut -d':' -f2 | tr '\n' ' ')`
|
||||
- Run `./buildall.sh` - this should build the entire project by default under the `xpclient-pro` SKU, outputting in `./xptc`
|
||||
@@ -33,6 +35,7 @@ This is intended to *Just Work(TM)*, if you have any problems, please raise an i
|
||||
|
||||
## Support?
|
||||
Supported distros/package formats:
|
||||
- Alpine Linux (`.apk`)
|
||||
- Arch Linux (`.pkg.tar.zst`)
|
||||
- Debian (`.deb`)
|
||||
|
||||
|
||||
44
packaging/apk/pkgimpl.sh
Executable file
44
packaging/apk/pkgimpl.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# pkgimpl.sh - Packaging Implementation (Alpine Linux)
|
||||
#
|
||||
# This source-code is part of Windows XP stuff for XFCE:
|
||||
# <<https://www.oddmatics.uk>>
|
||||
#
|
||||
# Author(s): Rory Fewell <roryf@oddmatics.uk>
|
||||
#
|
||||
# Special Thanks:
|
||||
# Martijn Braam <martijn@brixit.nl> (early Alpine/APK support)
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# FUNCTIONS
|
||||
#
|
||||
do_packaging()
|
||||
{
|
||||
# Build package now
|
||||
#
|
||||
cd "${full_component_dir}"
|
||||
abuild rootpkg
|
||||
|
||||
pkg_res=$?
|
||||
|
||||
cd "${CURDIR}"
|
||||
|
||||
if [[ $pkg_res -gt 0 ]]
|
||||
then
|
||||
echo "Package build failure!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Move package to output
|
||||
#
|
||||
clean_pkg_name=`cat ${full_component_dir}/APKBUILD | grep 'pkgname' | cut -d'=' -f2 | xargs echo -n`
|
||||
|
||||
find ~/packages -iname "${clean_pkg_name}*.apk" -exec mv '{}' "${OPT_OUTPUT_DIR}/${clean_pkg_name}.apk" \;
|
||||
|
||||
echo "Packaged ${clean_pkg_name}"
|
||||
}
|
||||
@@ -8,6 +8,9 @@
|
||||
#
|
||||
# Author(s): Rory Fewell <roryf@oddmatics.uk>
|
||||
#
|
||||
# Special Thanks:
|
||||
# Kris/SelfRef <github@selfref.dev> (help and contributions)
|
||||
#
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -161,12 +161,19 @@ check_deps()
|
||||
# It's a new dep, check whether it is already installed
|
||||
#
|
||||
case "${dist_id}" in
|
||||
apk)
|
||||
apk info --installed "${pkg_name}" >/dev/null 2>&1
|
||||
;;
|
||||
archpkg)
|
||||
pacman -Q -i "${pkg_name}" >/dev/null 2>&1
|
||||
;;
|
||||
deb)
|
||||
dpkg -s "${pkg_name}" >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
echo "Package format not implemented!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ $? -gt 0 ]]
|
||||
|
||||
20
packaging/cmake-inc/packaging/APKBUILD.in
Normal file
20
packaging/cmake-inc/packaging/APKBUILD.in
Normal file
@@ -0,0 +1,20 @@
|
||||
# Maintainer: Rory Fewell <roryf@oddmatics.uk>
|
||||
pkgname="@PROJECT_NAME@"
|
||||
pkgver="@PROJECT_VERSION@"
|
||||
pkgrel=1
|
||||
pkgdesc="@PROJECT_DESCRIPTION@"
|
||||
arch="@ALPINE_ARCHITECTURE@"
|
||||
license="@ALPINE_LICENCE@"
|
||||
depends="@DEPENDS@"
|
||||
url="https://github.com/rozniak/xfce-winxp-tc"
|
||||
options="!check"
|
||||
|
||||
build()
|
||||
{
|
||||
echo "Build intentionally left blank."
|
||||
}
|
||||
|
||||
package()
|
||||
{
|
||||
make install DESTDIR="$pkgdir/"
|
||||
}
|
||||
@@ -81,27 +81,55 @@ endfunction()
|
||||
|
||||
# Do special stuff for the target package format, if needed
|
||||
#
|
||||
set(WINTC_ARCH_PKGBUILD_IN_PATH ${CMAKE_CURRENT_LIST_DIR}/PKGBUILD.in)
|
||||
set(WINTC_DEBIAN_CONTROL_IN_PATH ${CMAKE_CURRENT_LIST_DIR}/debian-control.in)
|
||||
set(WINTC_ALPINE_APKBUILD_IN_PATH ${CMAKE_CURRENT_LIST_DIR}/APKBUILD.in)
|
||||
set(WINTC_ARCH_PKGBUILD_IN_PATH ${CMAKE_CURRENT_LIST_DIR}/PKGBUILD.in)
|
||||
set(WINTC_DEBIAN_CONTROL_IN_PATH ${CMAKE_CURRENT_LIST_DIR}/debian-control.in)
|
||||
|
||||
function(wintc_configure_and_install_packaging)
|
||||
# Provide 'ALT_PROJECT_NAME' - basically some distros skip the 'lib' in
|
||||
# library names, so this alternative name is generated here
|
||||
#
|
||||
if (${PROJECT_NAME} MATCHES "^lib(.+)")
|
||||
set(ALT_PROJECT_NAME ${CMAKE_MATCH_1} PARENT_SCOPE)
|
||||
else()
|
||||
set(ALT_PROJECT_NAME ${PROJECT_NAME} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Handle the package formats here
|
||||
#
|
||||
if (${WINTC_PKGMGR} STREQUAL "raw")
|
||||
message(STATUS "Outputting raw build (no package manager)")
|
||||
elseif (${WINTC_PKGMGR} STREQUAL "archpkg")
|
||||
message(STATUS "Outputting build for Arch Linux packaging")
|
||||
elseif (${WINTC_PKGMGR} STREQUAL "apk")
|
||||
message(STATUS "Outputting build for Alpine Linux packaging")
|
||||
|
||||
# LIB_DIR is always /lib - /lib64 is not a valid target on Arch
|
||||
# No /lib64 on Alpine
|
||||
#
|
||||
set(LIB_DIR lib PARENT_SCOPE)
|
||||
|
||||
# Set the project name, we drop the 'lib' prefix for Arch
|
||||
# Set the architecture
|
||||
#
|
||||
set(ARCH_PROJECT_NAME ${PROJECT_NAME})
|
||||
set(ALPINE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
|
||||
if (${PROJECT_NAME} MATCHES "^lib(.+)")
|
||||
set(ARCH_PROJECT_NAME ${CMAKE_MATCH_1})
|
||||
if (${PROJECT_ANYARCH})
|
||||
set(ALPINE_ARCHITECTURE noarch)
|
||||
endif()
|
||||
|
||||
# Set the licence
|
||||
#
|
||||
if (${PROJECT_FREESTATUS})
|
||||
set(ALPINE_LICENCE GPL-2.0-or-later)
|
||||
else()
|
||||
set(ALPINE_LICENCE non-free) # Unsure if correct
|
||||
endif()
|
||||
|
||||
configure_file(${WINTC_ALPINE_APKBUILD_IN_PATH} APKBUILD @ONLY)
|
||||
elseif (${WINTC_PKGMGR} STREQUAL "archpkg")
|
||||
message(STATUS "Outputting build for Arch Linux packaging")
|
||||
|
||||
# No /lib64 on Arch
|
||||
#
|
||||
set(LIB_DIR lib PARENT_SCOPE)
|
||||
|
||||
# Set the architecture
|
||||
#
|
||||
set(ARCH_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
@@ -244,4 +272,4 @@ function(wintc_install_icons_into_package)
|
||||
DESTINATION share/icons/hicolor/${ICON_SIZE}/apps
|
||||
)
|
||||
endforeach()
|
||||
endfunction()
|
||||
endfunction()
|
||||
@@ -1,4 +1,4 @@
|
||||
pkgname="@ARCH_PROJECT_NAME@"
|
||||
pkgname="@ALT_PROJECT_NAME@"
|
||||
pkgver="@PROJECT_VERSION@"
|
||||
pkgrel=1
|
||||
pkgdesc="@PROJECT_DESCRIPTION@"
|
||||
|
||||
@@ -22,7 +22,8 @@ endfunction()
|
||||
|
||||
# Ensure SASS program available for GTK3 build
|
||||
#
|
||||
find_program(SASS scss)
|
||||
find_program(SASS scss NAMES sass)
|
||||
find_program(SASSC sassc)
|
||||
|
||||
# Set up venv for bldtheme tool
|
||||
#
|
||||
|
||||
@@ -37,6 +37,16 @@ then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check Alpine Linux
|
||||
#
|
||||
which apk >/dev/null 2>&1
|
||||
|
||||
if [[ $? -eq 0 ]]
|
||||
then
|
||||
echo -n "apk"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Nothing else to probe, it's over!
|
||||
#
|
||||
echo "Unsupported distribution."
|
||||
|
||||
Reference in New Issue
Block a user