Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Sep 6, 2024
2 parents 5312a59 + 936b2d0 commit 38f84ed
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ jobs:
export Qt6_DIR=/usr/lib/`uname -a`-linux-gnu/cmake/Qt6
./build_debpackage.sh
cp ../lunarcalendar_*.deb .
cp ../lunarcalendar-dev*.deb .
- name: Update artifact for application
if: ${{ matrix.BUILD_TYPE == 'Release' }}
Expand All @@ -109,3 +110,4 @@ jobs:
name: ${{ env.artifact_name }}
path: |
${{github.workspace}}/lunarcalendar_*.deb
${{github.workspace}}/lunarcalendar-dev*.deb
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,10 @@ include(cmake/DownloadFile.cmake)
if(NOT RabbitCommon_DIR)
set(RabbitCommon_DIR $ENV{RabbitCommon_DIR})
if(NOT RabbitCommon_DIR)
set(RabbitCommon_DIR ${CMAKE_SOURCE_DIR}/../RabbitCommon)
endif()
if(NOT EXISTS ${RabbitCommon_DIR}/Src)
set(RabbitCommon_DIR ${CMAKE_SOURCE_DIR}/../../../RabbitCommon)
endif()
endif()
if(RabbitCommon_DIR AND EXISTS ${RabbitCommon_DIR}/Src)
if(RabbitCommon_DIR AND EXISTS ${RabbitCommon_DIR}/Src/CMakeLists.txt)
message("Use RabbitCommon source code")
add_subdirectory(${RabbitCommon_DIR}/Src ${CMAKE_BINARY_DIR}/RabbitCommon)
else()
Expand All @@ -98,7 +95,7 @@ endif()
GET_VERSION(OUT_VERSION LunarCalendar_VERSION
OUT_REVISION LunarCalendar_REVISION)
if(NOT LunarCalendar_VERSION)
SET(LunarCalendar_VERSION "v1.0.4")
SET(LunarCalendar_VERSION "1.0.4")
endif()
message("LunarCalendar_VERSION:${LunarCalendar_VERSION}")

Expand All @@ -116,7 +113,8 @@ if(BUILD_DOCS)
find_package(Doxygen)
if(DOXYGEN_FOUND)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Doxygen)
configure_file(${CMAKE_SOURCE_DIR}/Docs/doxygen/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/Docs/doxygen/Doxyfile.in
${CMAKE_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile # &> doxygen.log
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- v1.0.5
- 修复自动化编译打包没有打包库deb文件错误

- v1.0.4
- 使用 [RabbitCommon v2.2.1](https://github.com/KangLin/RabbitCommon/releases/tag/v2.2.1)
- 删除 vcpkg.json 中 baseline
Expand Down
7 changes: 5 additions & 2 deletions Src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ endif()
GET_VERSION(OUT_VERSION LunarCalendar_VERSION
OUT_REVISION LunarCalendar_REVISION)
if(NOT LunarCalendar_VERSION)
SET(LunarCalendar_VERSION "v1.0.4")
SET(LunarCalendar_VERSION "1.0.4")
endif()
message("LunarCalendar_VERSION:${LunarCalendar_VERSION}")
message("LunarCalendar_REVISION:${LunarCalendar_REVISION}")
Expand Down Expand Up @@ -145,4 +145,7 @@ INSTALL_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/Resource/database/holidays.sql
DESTINATION "${CMAKE_INSTALL_DATADIR}/db")

INSTALL_ICON_THEME(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Resource/icons)
INSTALL_ICON_THEME(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/Resource/icons
PARAMETERS PATTERN "*.theme" EXCLUDE
)
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
22 changes: 12 additions & 10 deletions cmake/LunarCalendarConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}")

# Install data directory. It include resource(icon theme, style etc).
set_and_check(data ${PACKAGE_PREFIX_DIR}/data)
if(NOT PROJECT_NAME)
message(FATAL_ERROR "Move the find_package(RabbitCommon) to the back of the project(...)")
else()
INSTALL_DIR(SOURCES ${data})

# Install translations
INSTALL_DIR(SOURCES ${PACKAGE_PREFIX_DIR}/translations)
include("${CMAKE_CURRENT_LIST_DIR}/LunarCalendarTargets.cmake")
if((NOT (LINUX OR UNIX)) OR ANDROID)
# Install data directory. It include resource(icon theme, style etc).
set_and_check(data ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_DATADIR@)
if(NOT PROJECT_NAME)
message(FATAL_ERROR "Move the find_package(RabbitCommon) to the back of the project(...)")
else()
INSTALL_DIR(SOURCES ${data})

# Install translations
INSTALL_DIR(SOURCES ${PACKAGE_PREFIX_DIR}/translations)
include("${CMAKE_CURRENT_LIST_DIR}/LunarCalendarTargets.cmake")
endif()
endif()

include(CMakeFindDependencyMacro)
Expand Down
4 changes: 1 addition & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Priority: optional
Maintainer: Kang Lin <[email protected]>
Standards-Version: 4.6.2
Build-Depends: debhelper (>=13~), debhelper-compat (=13), fakeroot, cmake,
rabbitcommon-dev (>=2), qt6-tools-dev, qt6-tools-dev-tools,
rabbitcommon-dev(>=2.2.6), qt6-tools-dev, qt6-tools-dev-tools,
qt6-base-dev, qt6-base-dev-tools, qt6-l10n-tools,
qt6-translations-l10n, qt6-scxml-dev, qt6-webengine-dev,
qt6-webengine-dev-tools, libsqlite3-dev
Expand All @@ -22,7 +22,6 @@ Architecture: any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Replaces: rabbitcommon (>=2)
Description: The lunar calendar library using Qt
- A lunar calendar library of Qt GUI, support QSS.
+ solar calendar
Expand All @@ -46,7 +45,6 @@ Package: lunarcalendar-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Recommends: rabbitcommon-dev (>=2)
Depends: lunarcalendar (= ${binary:Version}), ${misc:Depends}
Description: The lunar calendar devel library using Qt
- A lunar calendar devel library of Qt GUI, support QSS.
Expand Down
25 changes: 17 additions & 8 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ export DH_VERBOSE = 1
#export QT_SELECT=qt5

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
BUILD_DIR = "build_$(DEB_HOST_MULTIARCH)"
PACKAGE_DIR = "debian/lunarcalendar"
PACKAGE_dev_DIR = "debian/lunarcalendar-dev"
BUILD_DIR = build_$(DEB_HOST_MULTIARCH)
PACKAGE_DIR = debian/lunarcalendar
PACKAGE_DEV_DIR = debian/lunarcalendar-dev

ifeq ($(strip $(shell pkg-config --libs RabbitCommon)), -lRabbitCommon)
PACKAGE_PREFIX = $(PACKAGE_DIR)/usr
PACKAGE_DEV_PREFIX = $(PACKAGE_DEV_DIR)/usr
else
PACKAGE_PREFIX = $(PACKAGE_DIR)/opt/LunarCalendar
PACKAGE_DEV_PREFIX = $(PACKAGE_DEV_DIR)/opt/LunarCalendar
endif

%:
dh $@
Expand All @@ -28,19 +36,20 @@ PACKAGE_dev_DIR = "debian/lunarcalendar-dev"
# This is example for Cmake (See https://bugs.debian.org/641051 )
override_dh_auto_configure:
dh_auto_configure -B$(BUILD_DIR) -- \
-DCMAKE_BUILD_TYPE=Release -DBUILD_APP=OFF
-DCMAKE_BUILD_TYPE=Release -DBUILD_APP=OFF

override_dh_auto_build:
cmake --build $(BUILD_DIR) --config Release --parallel $(if "`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`", `cat /proc/cpuinfo |grep 'cpu cores' |wc -l`, 1)
cmake --build $(BUILD_DIR) --config Release \
--parallel $(if "`cat /proc/cpuinfo |grep 'processor' |wc -l`", `cat /proc/cpuinfo |grep 'processor' |wc -l`, 1)

override_dh_auto_install:
cmake --install $(BUILD_DIR) --config Release \
--component Runtime \
--prefix $(PACKAGE_DIR)/usr
--prefix $(PACKAGE_PREFIX)
cmake --install $(BUILD_DIR) --config Release \
--component Development \
--prefix $(PACKAGE_dev_DIR)/usr
--prefix $(PACKAGE_DEV_PREFIX)

override_dh_builddeb:
dh_builddeb --package=lunarcalendar -P$(PACKAGE_DIR)
dh_builddeb --package=lunarcalendar-dev -P$(PACKAGE_dev_DIR)
dh_builddeb --package=lunarcalendar-dev -P$(PACKAGE_DEV_DIR)
2 changes: 1 addition & 1 deletion debian/source/format
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0 (native)
3.0 (quilt)
27 changes: 21 additions & 6 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,37 @@ set -e

SOURCE_DIR=`pwd`

PRE_TAG=`git tag --sort=-creatordate | head -n 1`

if [ -n "$1" ]; then
VERSION=`git describe --tags`
if [ -z "$VERSION" ]; then
VERSION=` git rev-parse HEAD`
VERSION=`git rev-parse HEAD`
fi

echo "Current version: $VERSION, The version to will be set: $1"

if [ -n "$2" ]; then
MESSAGE="Release $1 $2"
else
MESSAGE="Release $1"
fi

PRE_TAG=`git tag --sort=-taggerdate | head -n 1`
echo "Current version: $VERSION, current tag: $PRE_TAG. The version to will be set tag version: $1 message: $MESSAGE"
echo "Please check the follow list:"
echo " - Test is ok ?"
echo " - Translation is ok ?"
echo " - Setup file is ok ?"
echo " - Update_*.xml is ok ?"

read -t 30 -p "Be sure to input Y, not input N: " INPUT
if [ "$INPUT" != "Y" -a "$INPUT" != "y" ]; then
exit 0
fi
git tag -a $1 -m "Release $1"
git tag -a $1 -m "Release $1 ${MESSAGE}"
else
echo "Usage: $0 release_version [release_message]"
echo " release_version format: [v][0-9].[0-9].[0-9]"
exit -1
fi

VERSION=`git describe --tags`
Expand All @@ -42,8 +56,6 @@ EOF

#mkchangelog $VERSION ChangeLog.md

sed -i "s/ SET(LunarCalendar_VERSION.*/ SET(LunarCalendar_VERSION \"${VERSION}\")/g" ${SOURCE_DIR}/CMakeLists.txt
sed -i "s/ SET(LunarCalendar_VERSION.*/ SET(LunarCalendar_VERSION \"${VERSION}\")/g" ${SOURCE_DIR}/Src/CMakeLists.txt
sed -i "s/^\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"${VERSION}\"/g" ${SOURCE_DIR}/Install/Install.nsi
sed -i "s/^version: '.*{build}'/version: '${VERSION}.{build}'/g" ${SOURCE_DIR}/appveyor.yml
sed -i "s/^\ - export VERSION=.*/\ - export VERSION=\"${VERSION}\"/g" ${SOURCE_DIR}/.travis.yml
Expand All @@ -60,6 +72,9 @@ sed -i "s/v[0-9]\+\.[0-9]\+\.[0-9]\+/${VERSION}/g" ${SOURCE_DIR}/README*.md
DEBIAN_VERSION=`echo ${VERSION}|cut -d "v" -f 2`
#sed -i "s/lunarcalendar_[0-9]\+\.[0-9]\+\.[0-9]\+/lunarcalendar_${DEBIAN_VERSION}/g" ${SOURCE_DIR}/README*.md

sed -i "s/ SET(LunarCalendar_VERSION.*/ SET(LunarCalendar_VERSION \"${DEBIAN_VERSION}\")/g" ${SOURCE_DIR}/CMakeLists.txt
sed -i "s/ SET(LunarCalendar_VERSION.*/ SET(LunarCalendar_VERSION \"${DEBIAN_VERSION}\")/g" ${SOURCE_DIR}/Src/CMakeLists.txt

sed -i "s/lunarcalendar (.*)/lunarcalendar (${DEBIAN_VERSION})/g" ${SOURCE_DIR}/debian/changelog
sed -i "s/[0-9]\+\.[0-9]\+\.[0-9]\+/${DEBIAN_VERSION}/g" ${SOURCE_DIR}/App/android/AndroidManifest.xml
sed -i "s/LunarCalendar_VERSION:.*/LunarCalendar_VERSION: ${DEBIAN_VERSION}/g" ${SOURCE_DIR}/.github/workflows/ubuntu.yml
Expand Down

0 comments on commit 38f84ed

Please sign in to comment.