From acc54d48357f1d3e784f4d0adab069d8ca2e5221 Mon Sep 17 00:00:00 2001 From: Andrei Astafev Date: Thu, 14 Sep 2023 14:17:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82=20?= =?UTF-8?q?=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B8,=20=D0=B2=20=D0=BA=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=BE=D0=BC=20=D1=84=D1=83=D0=BD=D0=BA=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=B4=D0=B8=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B2=20=D0=BE=D0=B4=D0=B8=D0=BD=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 14 +++++++++- MyxCMake/MyxCMakeConfigVersion.cmake | 2 +- README.md | 2 +- VERSION | 2 +- debian/CMakeLists.txt | 2 +- debian/changelog | 2 +- myx-unity.py | 38 ++++++++++++++++++++++++++++ myx_setup.cmake | 4 +-- 8 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 myx-unity.py diff --git a/Makefile b/Makefile index 4478635..30bab50 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,10 @@ TOP_DIR:=$(shell pwd) BUILD_DIR:=$(TOP_DIR)/build DEB_DIR:=$(BUILD_DIR)/deb/myx-cmake-$(V) PACK_DIR:=$(BUILD_DIR)/pack/myx-cmake-$(V) +UNITY_DIR:=$(BUILD_DIR)/unity +UNITY_V_DIR:=$(BUILD_DIR)/myx-cmake-unity-$(V) -all: v deb pack +all: v deb pack unity v: sed -i "s/\/[0-9][0-9.]\+/\/$V/g" $(TOP_DIR)/README.md @@ -30,6 +32,15 @@ pack: cp -ap $(TOP_DIR)/myx_setup.cmake $(PACK_DIR) cd $(PACK_DIR); tar acf $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz * +unity: + rm -rf $(UNITY_DIR) + rm -rf $(UNITY_V_DIR) + mkdir -p $(UNITY_DIR) + python3 myx-unity.py > $(UNITY_DIR)/m.cmake + mv $(UNITY_DIR)/m.cmake $(UNITY_DIR)/myx/MyxCMakeConfig.cmake + mv $(UNITY_DIR) $(UNITY_V_DIR) + cd $(UNITY_V_DIR); tar acf $(BUILD_DIR)/myx-cmake-unity-$(V).tar.xz * + upload: git tag $(V) gitea-tea r c --repo cmake/myx -t $(V) --tag $(V) \ @@ -37,5 +48,6 @@ upload: -a $(BUILD_DIR)/myx-cmake_$(V).tar.xz \ -a $(BUILD_DIR)/myx-cmake_$(V)_all.deb \ -a $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz + -a $(BUILD_DIR)/myx-cmake-unity-$(V).tar.xz git tag -d $(V) git push diff --git a/MyxCMake/MyxCMakeConfigVersion.cmake b/MyxCMake/MyxCMakeConfigVersion.cmake index c432434..e6e5d65 100644 --- a/MyxCMake/MyxCMakeConfigVersion.cmake +++ b/MyxCMake/MyxCMakeConfigVersion.cmake @@ -1,4 +1,4 @@ -set(MYX_CMAKE_PACKAGE_VERSION "2.4.14") +set(MYX_CMAKE_PACKAGE_VERSION "2.4.15") if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() diff --git a/README.md b/README.md index 6022fbc..20f9ae9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Установка В корневом каталоге проекта создать каталог `cmake` и распаковать в него -[архив](../../../releases/download/2.4.14/myx-cmake-local-2.4.14.tar.xz ). +[архив](../../../releases/download/2.4.15/myx-cmake-local-2.4.15.tar.xz ). ## Использование diff --git a/VERSION b/VERSION index e5f3129..84cc65e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.4.14 +2.4.15 diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index ba7c116..6edc910 100644 --- a/debian/CMakeLists.txt +++ b/debian/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.6 FATAL_ERROR) -project(myx-cmake VERSION 2.4.14 LANGUAGES) +project(myx-cmake VERSION 2.4.15 LANGUAGES) include(GNUInstallDirs) file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake diff --git a/debian/changelog b/debian/changelog index 440724e..82d19ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -myx-cmake (2.4.14) unstable; urgency=medium +myx-cmake (2.4.15) unstable; urgency=medium * New version. diff --git a/myx-unity.py b/myx-unity.py new file mode 100644 index 0000000..e2643d8 --- /dev/null +++ b/myx-unity.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +"""MyxCMake unity.""" + +import re +import os +from distutils.dir_util import copy_tree +from shutil import copyfile + +D1 = 'MyxCMake' +D2 = 'build/unity/myx' +copy_tree(D1, D2) +copyfile('myx_setup.cmake', 'build/unity/myx_setup.cmake') + +with open(D2 + '/MyxCMakeConfig.cmake', encoding='utf-8') as f: + lines = list(f) + for line in lines: + line = line.rstrip() + b1 = re.match('.*include.*_BACKPORTS_DIR}/(.*cmake)', line) + l1 = re.match('.*include.*_LIB_DIR}/(.*cmake)', line) + if b1: + fname = D2 + "/backports/" + b1.group(1) + with open(fname, encoding='utf-8') as g: + print(g.read()) + os.remove(fname) + elif l1: + if l1.group(1) in ['DownloadContent.cmake', + 'ProjectIsTopLevel.cmake', + 'generators/PrivateConfigHeader.cmake', + 'generators/GitInfoHeader.cmake']: + print(line) + continue + fname = D2 + "/lib/" + l1.group(1) + with open(fname, encoding='utf-8') as g: + print(g.read()) + os.remove(fname) + else: + print(line) diff --git a/myx_setup.cmake b/myx_setup.cmake index eb75f4b..a2b0831 100644 --- a/myx_setup.cmake +++ b/myx_setup.cmake @@ -20,11 +20,11 @@ if(ENV{MYX_CMAKE_DIR}) set(MYX_CMAKE_DIR $ENV{MYX_CMAKE_DIR}) endif() if(MYX_CMAKE_DIR) - find_package(MyxCMake 2.4.14 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) + find_package(MyxCMake 2.4.15 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==") else() if(MYX_CMAKE_USE_SYSTEM) - find_package(MyxCMake 2.4.14 REQUIRED) + find_package(MyxCMake 2.4.15 REQUIRED) myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==") else() include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)