Skip to content

Merge dev. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 14 additions & 96 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,124 +6,42 @@ on:

jobs:

build-dist:
build:

runs-on: ubuntu-latest

steps:

#--------------------------------------------collect--------------------------------------------
- uses: actions/checkout@v3

- name: 🏷️ Get infomations
run: |
tag="${GITHUB_REF#refs/tags/}"
echo "tag=$tag" >> $GITHUB_ENV
echo "pkgname=cppp-platform-$tag" >> $GITHUB_ENV
echo "srcdir=$(pwd)" >> $GITHUB_ENV
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: 📁 Collect dependencies
run: |
sudo apt-get update
sudo apt-get install p7zip-full zip xz-utils -y
sudo apt-get install cmake gcc python3 -y

#--------------------------------------------build--------------------------------------------
- name: 🧳 Prepare for source distribution building
run: |
mkdir -p ./dist
./setup.sh

- name: 🛠️ Build source distribution
run: |
./cpppdist.py

- name: 📦 Make packages
run: |
tar cvf ${{ env.pkgname }}.tar ${{ env.pkgname }}
zip -r -9 dist/${{ env.pkgname }}.zip ${{ env.pkgname }}
7z a dist/${{ env.pkgname }}.7z ${{ env.pkgname }}
xz -c -9 -k ${{ env.pkgname }}.tar > dist/${{ env.pkgname }}.tar.xz
gzip -c -9 -k ${{ env.pkgname }}.tar > dist/${{ env.pkgname }}.tar.gz

cd dist
for i in $(ls) ; do md5sum $i > $i.md5 ; done
cd ..

#--------------------------------------------publish--------------------------------------------

- name: ⬆️ Create release and upload assets
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.tag }}
files: ./dist/*
python -m pip install --upgrade pip
python -m pip install rubisco

build:

needs: build-dist

strategy:
fail-fast: false
matrix:
arch: [
any-any-any
]

runs-on: ubuntu-latest

steps:

#--------------------------------------------collect--------------------------------------------
- name: 🏷️ Get infomations
run: |
tag="${GITHUB_REF#refs/tags/}"
echo "tag=$tag" >> $GITHUB_ENV
echo "pkgname=cppp-platform-$tag" >> $GITHUB_ENV
echo "srcdir=$(pwd)" >> $GITHUB_ENV

- name: 📁 Collect dependencies
run: |
sudo apt-get update
sudo apt-get install p7zip-full zip xz-utils wget -y
sudo apt-get install cmake -y
sudo apt-get install gcc g++ -y

- name: 📁 Get source distribution tarball
run: |
wget https://github.com/${{ github.repository }}/releases/download/${{ env.tag }}/${{ env.pkgname }}.tar.gz
tar zxvf ${{ env.pkgname }}.tar.gz
mv ${{ env.pkgname }}/* .

#--------------------------------------------build--------------------------------------------
- name: 🧳 Prepare for binary distribution building
- name: 🛠️ Build distribution
run: |
mkdir -p dist

- name: 🛠️ Build binary distribution
run: |
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${{ env.srcdir }}/${{ env.pkgname }}-${{ matrix.arch }}
cmake --build . --config=Release
cmake --install .
cd ..
rubisco build

- name: 📦 Make packages
run: |
tar cvf ${{ env.pkgname }}-${{ matrix.arch }}.tar ${{ env.pkgname }}-${{ matrix.arch }}
zip -r -9 dist/${{ env.pkgname }}-${{ matrix.arch }}.zip ${{ env.pkgname }}-${{ matrix.arch }}
7z a dist/${{ env.pkgname }}-${{ matrix.arch }}.7z ${{ env.pkgname }}-${{ matrix.arch }}
xz -c -9 -k ${{ env.pkgname }}-${{ matrix.arch }}.tar > dist/${{ env.pkgname }}-${{ matrix.arch }}.tar.xz
gzip -c -9 -k ${{ env.pkgname }}-${{ matrix.arch }}.tar > dist/${{ env.pkgname }}-${{ matrix.arch }}.tar.gz

cd dist
for i in $(ls) ; do md5sum $i > $i.md5 ; done
for i in $(ls) ; do sha256sum $i > $i.sha256 ; done
cd ..

#--------------------------------------------publish--------------------------------------------

- name: ⬆️ Create release and upload assets
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ env.tag }}
files: ./dist/*
files: ./dist/*
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CMake build files
build/
dist/
install/
CMakeFiles
*.so
*.so.*.*.*
Expand Down Expand Up @@ -33,9 +35,6 @@ Testing
.vscode
.cache

# Autopull modules
build-aux

# Dist directory and temps
cppp-platform-v*
cppp-platform-*
__pycache__
43 changes: 43 additions & 0 deletions .rubisco/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 🛠️ Build cppp-platfrom

steps:
- name: 📦 Make source distribution directory
mkdir: ${{ project.name }}-${{ project.version }}
- mkdir: dist

- name: 📦 Copy files to source distribution directory
copy: ${{ cwd }}
to: ${{ project.name }}-${{ project.version }}
excludes:
[
".git*",
"build",
"dist",
"*.7z",
"*.gz",
"*.xz",
"*.zip",
".vscode",
".rubisco/extensions",
"${{ project.name }}-*",
]

- name: 📦 Packing the source distribution
compress: ${{ project.name }}-${{ project.version }}
to: dist/${{ project.name }}-${{ project.version }}
format: [zip, tar.xz]

- name: 🛠️ Build the project.
mkdir: build
- cwd: build
run: ["cmake", "..", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_INSTALL_PREFIX=install"]
- cwd: build
run: ["cmake", "--build", ".", "--config", "Release"]
- cwd: build
run: ["cmake", "--install", ".", "--config", "Release"]

- name: 📦 Packing the binary distribution.
compress: build/install
start: build
to: dist/${{ project.name }}-${{ project.version }}-unknown-unknown-unknown
format: [zip, tar.xz]
57 changes: 15 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1,28 @@
# Copyright (C) 2023 The C++ Plus Project.
# This file is part of the cppp-platform library.
#
# The cppp-platform library is free software; you can redistribute it
# and/or modify it under the terms of the The Unlicense as published
# by the unlicense.org
#
# The cppp-platform library is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the The
# Unlicense for more details.
#
# You should have received a copy of the The Unlicense along with the
# cppp-platform library; see the file COPYING.
# If not, see <http://unlicense.org/>.

cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.10)
project(cppp-platform VERSION 1.3.0)

# Set C++ standard
set(CMAKE_CXX_STANDARD 11)

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/build-aux")
set(BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR}/build-aux")
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../build-aux")
set(BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR}/../build-aux")
else()
message(FATAL_ERROR "CMake build-aux directory is not exists, try to execute 'setup.cmd' or './setup.sh' to get it.")
endif()
set(AUX_DIR "${BUILD_AUX}/cmake")

message(STATUS "Using '${BUILD_AUX}' for C++ Plus build-aux directory.")
add_subdirectory("${BUILD_AUX}")

include("${AUX_DIR}/cppp.cmake")
option(BUILD_EXAMPLE "Build example" OFF)

# Read source files
file(READ "${srcdir}/src/architectures.h" ARCHITECTURES)
file(READ "${srcdir}/src/compilers.h" COMPILERS)
file(READ "${srcdir}/src/languagestandards.h" LANGUAGESTANDARDS)
file(READ "${srcdir}/src/platforms.h" PLATFORMS)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/architectures.h" ARCHITECTURES)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/compilers.h" COMPILERS)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/languagestandards.h" LANGUAGESTANDARDS)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/platforms.h" PLATFORMS)

# Genetate header
configure_file("${srcdir}/include/cppp/cppp-platform.h.in" "${output_includedir}/cppp/cppp-platform.h")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/cppp/cppp-platform.h.in" "${CMAKE_BINARY_DIR}/include/cppp/cppp-platform.h")

# Build example
if(BUILD_EXAMPLE)
add_executable(example "${CMAKE_CURRENT_SOURCE_DIR}/src/example.c")
target_include_directories(example PRIVATE "${CMAKE_BINARY_DIR}/include")
endif()

# Generate header file for install
cppp_nls_autotranslate("${output_includedir}/cppp/cppp-platform.h" "${srcdir}/lang")

# Install
# Includes
# PERMISSIONS 0644
install(FILES "${output_includedir}/cppp/cppp-platform.h"
DESTINATION "${install_includedir}"
install(FILES "${CMAKE_BINARY_DIR}/include/cppp/cppp-platform.h"
DESTINATION "${CMAKE_INSTALL_PREFIX}/include"
RENAME "cppp/cppp-platform.h"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ )
17 changes: 0 additions & 17 deletions CPPPPKG

This file was deleted.

74 changes: 0 additions & 74 deletions ChangeLog

This file was deleted.

19 changes: 0 additions & 19 deletions FILELIST

This file was deleted.

File renamed without changes.
Loading