mirror of
https://github.com/rozniak/xfce-winxp-tc.git
synced 2026-05-01 03:31: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."
|
||||
|
||||
@@ -21,19 +21,34 @@ install(FILES ${CMAKE_BINARY_DIR}/scheme.rc DESTINATION ${THEME_PROJECT_INSTALL_
|
||||
configure_file(${THEMES_BUILD_COMMON_GTK3_DIR}/scheme.scss.in scheme.scss @ONLY)
|
||||
configure_file(gtk-3.0/main.scss.in main.scss @ONLY)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/gtk.css
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${SASS}
|
||||
ARGS
|
||||
${CMAKE_BINARY_DIR}/main.scss
|
||||
${CMAKE_BINARY_DIR}/gtk.css
|
||||
--sourcemap=none
|
||||
VERBATIM
|
||||
MAIN_DEPENDENCY ${CMAKE_BINARY_DIR}/main.scss
|
||||
DEPENDS
|
||||
${CMAKE_BINARY_DIR}/scheme.scss
|
||||
)
|
||||
if (NOT (${SASS} STREQUAL SASS-NOTFOUND))
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/gtk.css
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${SASS}
|
||||
ARGS
|
||||
${CMAKE_BINARY_DIR}/main.scss
|
||||
${CMAKE_BINARY_DIR}/gtk.css
|
||||
--sourcemap=none
|
||||
VERBATIM
|
||||
MAIN_DEPENDENCY ${CMAKE_BINARY_DIR}/main.scss
|
||||
DEPENDS
|
||||
${CMAKE_BINARY_DIR}/scheme.scss
|
||||
)
|
||||
else()
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/gtk.css
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${SASSC}
|
||||
ARGS
|
||||
${CMAKE_BINARY_DIR}/main.scss
|
||||
${CMAKE_BINARY_DIR}/gtk.css
|
||||
VERBATIM
|
||||
MAIN_DEPENDENCY ${CMAKE_BINARY_DIR}/main.scss
|
||||
DEPENDS
|
||||
${CMAKE_BINARY_DIR}/scheme.scss
|
||||
)
|
||||
endif()
|
||||
|
||||
add_custom_target(
|
||||
theme-gtk3 ALL
|
||||
@@ -52,4 +67,4 @@ install(DIRECTORY ${PROJECT_ROOT}/xfwm4 DESTINATION ${THEME_PROJECT_INSTALL_PATH
|
||||
install(DIRECTORY ${PROJECT_ROOT}/Resources DESTINATION ${THEME_PROJECT_INSTALL_PATH})
|
||||
install(DIRECTORY ${CMAKE_BINARY_DIR}/composed DESTINATION ${THEME_PROJECT_INSTALL_PATH}/Resources)
|
||||
|
||||
wintc_configure_and_install_packaging()
|
||||
wintc_configure_and_install_packaging()
|
||||
25
tools/bldutils/depmap/apk-maps
Normal file
25
tools/bldutils/depmap/apk-maps
Normal file
@@ -0,0 +1,25 @@
|
||||
garcon-->bt-->garcon-dev
|
||||
garcon-->rt-->garcon
|
||||
garcon-gtk3-->bt-->garcon-dev
|
||||
garcon-gtk3-->rt-->garcon
|
||||
gdk-pixbuf2-->bt-->gdk-pixbuf-dev
|
||||
gdk-pixbuf2-->rt-->gdk-pixbuf
|
||||
glib2-->bt-->glib-dev
|
||||
glib2-->rt-->glib
|
||||
gtk3-->bt-->gtk+3.0-dev
|
||||
gtk3-->rt-->gtk+3.0
|
||||
lightdm-->bt-->lightdm-dev
|
||||
lightdm-->rt-->lightdm
|
||||
msgfmt-->bt,rt-->gettext
|
||||
plymouth-->bt,rt-->plymouth
|
||||
python3-venv-->bt,rt-->py3-virtualenv
|
||||
sass-->bt,rt-->sassc
|
||||
wintc-comctl-->bt,rt-->libwintc-comctl
|
||||
wintc-comgtk-->bt,rt-->libwintc-comgtk
|
||||
wintc-exec-->bt,rt-->libwintc-exec
|
||||
wintc-msgina-->bt,rt-->libwintc-msgina
|
||||
wintc-shelldpa-->bt,rt-->libwintc-shelldpa
|
||||
wintc-shllang-->bt,rt-->libwintc-shllang
|
||||
wintc-winbrand-->bt,rt-->libwintc-winbrand
|
||||
xcursorgen-->bt,rt-->xcursorgen
|
||||
xdg-mime-->bt,rt-->xdg-utils
|
||||
@@ -3,7 +3,7 @@ import argparse
|
||||
from pathlib import Path
|
||||
|
||||
def main():
|
||||
VALID_DISTROS=["archpkg", "deb"]
|
||||
VALID_DISTROS=["apk", "archpkg", "deb"]
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="Dependency Mapper Utility",
|
||||
|
||||
Reference in New Issue
Block a user