Skip to content

Commit

Permalink
rpm: merge packages and use build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyxogen authored and yuri91 committed Jan 23, 2024
1 parent 3aa9ffc commit bded38e
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 232 deletions.
215 changes: 45 additions & 170 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,13 @@ jobs:
name: Check asan
working_directory: ~/project/cheerp-compiler/compiler-rt/build
command: make -j check-asan
RPM-cheerp-compiler:
RPM-cheerp-toolchain:
docker:
- image: leaningtech/cheerp_rpm_base:8
- image: leaningtech/cheerp_rpm_base:9
resource_class: large
environment:
- THREADS: 6
- CCACHE_DISABLE: 1
steps:
- attach_workspace:
at: ~/
Expand Down Expand Up @@ -178,103 +179,45 @@ jobs:
echo "export REPO_DIR=$REPO_DIR" >> ~/version
- add-yum-configuration
- get-rpm-repo
- run:
name: Get sources
command: |
git clone [email protected]:leaningtech/cheerp-internal.git
git clone https://github.com/leaningtech/cheerp-compiler.git cheerp-llvm-clang
cd cheerp-llvm-clang
if [ << pipeline.parameters.release-tag >> != master ]; then
git checkout << pipeline.parameters.release-tag >>
else
git checkout << pipeline.parameters.cheerp-compiler-commit >>
fi
- clone-toolchain
- shallow-clone:
ref: master
dir: cheerp-internal
remote: [email protected]:leaningtech/cheerp-internal.git
- set-up-rpm-workspace
- add-rpm-sources:
directory: cheerp-llvm-clang
package-name: llvm-clang
branch-name: << pipeline.parameters.cheerp-compiler-commit >>
- build-deploy-rpm:
directory: cheerp-llvm-clang
package-name: llvm-clang
- persist_to_workspace:
root: ~/
paths:
- version/
RPM-libraries:
docker:
- image: leaningtech/cheerp_rpm_base:8
resource_class: large
steps:
- attach_workspace:
at: ~/
- run: cat ~/version >> $BASH_ENV
- add_ssh_keys:
fingerprints:
- "86:3b:c9:a6:d1:b9:a8:dc:0e:00:db:99:8d:19:c4:3e"
- run:
name: Add known hosts
command: |
echo $GH_HOST >> ~/.ssh/known_hosts
echo $RPM_HOST >> ~/.ssh/known_hosts
- run:
name: Get repos
command: |
git clone [email protected]:leaningtech/cheerp-internal.git
git clone https://github.com/leaningtech/cheerp-compiler.git
git clone https://github.com/leaningtech/cheerp-utils.git
git clone https://github.com/leaningtech/cheerp-libs.git
git clone https://github.com/leaningtech/cheerp-musl.git
if [ << pipeline.parameters.release-tag >> != master ]; then
cd cheerp-compiler && git checkout << pipeline.parameters.release-tag >> && cd ..
cd cheerp-utils && git checkout << pipeline.parameters.release-tag >> && cd ..
cd cheerp-libs && git checkout << pipeline.parameters.release-tag >> && cd ..
cd cheerp-musl && git checkout << pipeline.parameters.release-tag >>
else
cd cheerp-compiler && git checkout << pipeline.parameters.cheerp-compiler-commit >> && cd ..
cd cheerp-utils && git checkout << pipeline.parameters.cheerp-utils-commit >> && cd ..
cd cheerp-libs && git checkout << pipeline.parameters.cheerp-libs-commit >> && cd ..
cd cheerp-musl && git checkout << pipeline.parameters.cheerp-musl-commit >>
fi
- get-rpm-repo
- add-yum-configuration
- set-up-rpm-workspace
- run: dnf install -y cheerp-llvm-clang-${VERSION_NO}-1.el8
- create-rpm-package:
directory: cheerp-utils
package-name: utils
branch-name: << pipeline.parameters.cheerp-utils-commit >>
- create-rpm-package:
directory: cheerp-musl
package-name: musl
branch-name: << pipeline.parameters.cheerp-musl-commit >>
- run:
name: Set up for libcxx-libcxxabi
working_directory: ~/project/cheerp-compiler
command: |
rm -rf rpmbuild
cp -r runtimes/rpmbuild .
- create-rpm-package:
directory: cheerp-compiler
package-name: libcxx-libcxxabi
branch-name: << pipeline.parameters.cheerp-compiler-commit >>
- create-rpm-package:
directory: cheerp-libs
package-name: libs
branch-name: << pipeline.parameters.cheerp-libs-commit >>
- run:
name: Set up for compiler-rt
working_directory: ~/project/cheerp-compiler
command: |
rm -rf rpmbuild
cp -r compiler-rt/rpmbuild .
- create-rpm-package:
directory: cheerp-compiler
package-name: compiler-rt
branch-name: << pipeline.parameters.cheerp-compiler-commit >>
- build-deploy-rpm:
directory: cheerp-internal/tools/releasing/cheerp-core
package-name: core
name: Setup tarball
command: |
cp -r cheerp-compiler/rpmbuild ~
mv cheerp-compiler "cheerp-core-$VERSION_NO"
tar -czvf "cheerp-core_$VERSION_NO.orig.tar.gz" \
"cheerp-core-$VERSION_NO/clang" \
"cheerp-core-$VERSION_NO/llvm" \
"cheerp-core-$VERSION_NO/cmake" \
"cheerp-core-$VERSION_NO/compiler-rt" \
"cheerp-core-$VERSION_NO/libcxx" \
"cheerp-core-$VERSION_NO/libcxxabi" \
"cheerp-core-$VERSION_NO/runtimes" \
"cheerp-core-$VERSION_NO/third-party" \
"cheerp-core-$VERSION_NO/cheerp-libs" \
"cheerp-core-$VERSION_NO/cheerp-musl" \
"cheerp-core-$VERSION_NO/cheerp-utils" \
"cheerp-core-$VERSION_NO/debian"
mkdir ~/rpmbuild/SOURCES
mv -v "cheerp-core_$VERSION_NO.orig.tar.gz" ~/rpmbuild/SOURCES
- run:
name: Build cheerp-toolchain
working_directory: ~
command: |
sed -i "s/Version: .*/Version: $VERSION_NO/" ~/rpmbuild/SPECS/cheerp-core.spec
rpmbuild -ba ~/rpmbuild/SPECS/cheerp-core.spec
rpm --addsign ~/rpmbuild/RPMS/x86_64/cheerp-core-$VERSION_NO-1.el9.x86_64.rpm
- run:
name: Deploy rpm package
command: |
cp ~/rpmbuild/RPMS/x86_64/cheerp-core-$VERSION_NO-1.el9.x86_64.rpm "$REPO_DIR/$CHAN"
. ~/project/cheerp-internal/tools/releasing/rpm_utils.sh
repo_update
- when:
condition:
equal: [ master, << pipeline.parameters.release-tag >> ]
Expand All @@ -285,15 +228,13 @@ jobs:
command: |
if [ ${CHAN} == 'nightly' ]; then
. ~/project/cheerp-internal/tools/releasing/rpm_utils.sh
repo_remove_old llvm-clang
repo_remove_old utils
repo_remove_old musl
repo_remove_old libcxx-libcxxabi
repo_remove_old compiler-rt
repo_remove_old libs
repo_remove_old core
repo_update
fi
- persist_to_workspace:
root: ~/
paths:
- version/
PPA:
docker:
- image: cimg/base:2022.04
Expand Down Expand Up @@ -958,72 +899,6 @@ commands:
working_directory: ~/
command: |
rsync -a --delete-after -e 'ssh -p 2223' [email protected]:/srv/web/rpm/$CHAN ${REPO_DIR}/
create-rpm-package:
parameters:
directory:
type: string
package-name:
type: string
branch-name:
type: string
default: master
steps:
- add-rpm-sources:
directory: << parameters.directory >>
package-name: << parameters.package-name >>
branch-name: << parameters.branch-name >>
- build-deploy-rpm:
directory: << parameters.directory >>
package-name: << parameters.package-name >>
add-rpm-sources:
parameters:
directory:
type: string
package-name:
type: string
branch-name:
type: string
default: master
steps:
- run:
name: Add cheerp-<< parameters.package-name >> sources
working_directory: ~/project/<< parameters.directory >>
command: |
if [ << pipeline.parameters.release-tag >> != master ]; then
../cheerp-internal/tools/releasing/<< parameters.package-name >>_debian_archives.sh ${VERSION_NO} << pipeline.parameters.release-tag >>
else
../cheerp-internal/tools/releasing/<< parameters.package-name >>_debian_archives.sh ${VERSION_NO} << parameters.branch-name >>
fi
rm -rf rpmbuild/SOURCES
mkdir rpmbuild/SOURCES
mv ../pkg/* rpmbuild/SOURCES
build-deploy-rpm:
parameters:
directory:
type: string
package-name:
type: string
steps:
- run:
name: Build cheerp-<< parameters.package-name >>
working_directory: ~/project/<< parameters.directory >>
command: |
sed -i "s/Version: .*/Version: ${VERSION_NO}/" rpmbuild/SPECS/cheerp-<< parameters.package-name >>.spec
rpmbuild -ba rpmbuild/SPECS/cheerp-<< parameters.package-name >>.spec --define "_topdir ${PWD}/rpmbuild"
rpm --addsign rpmbuild/RPMS/x86_64/cheerp-<< parameters.package-name >>-${VERSION_NO}-1.el8.x86_64.rpm
- run:
name: Deploy cheerp-<< parameters.package-name >>
working_directory: ~/
command: |
cp ~/project/<< parameters.directory >>/rpmbuild/RPMS/x86_64/cheerp-<< parameters.package-name >>-${VERSION_NO}-1.el8.x86_64.rpm ${REPO_DIR}/${CHAN}
. ~/project/cheerp-internal/tools/releasing/rpm_utils.sh
repo_update
- run:
name: Install cheerp-<< parameters.package-name >>-${VERSION_NO}-1.el8
working_directory: ~/
command: |
dnf clean all
dnf install -y cheerp-<< parameters.package-name >>-${VERSION_NO}-1.el8
build-tblgen:
steps:
- run:
Expand Down Expand Up @@ -1119,7 +994,7 @@ workflows:
- run-asan-tests:
requires:
- build-cheerp-toolchain
- RPM-cheerp-compiler:
- RPM-cheerp-toolchain:
requires:
- define-version-no
- test
Expand Down
39 changes: 39 additions & 0 deletions rpmbuild/SPECS/cheerp-core.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Name: cheerp-core
Version: 3.0
Release: 1%{?dist}
Summary: A C++ compiler for the web

License: Apache-2.0 WITH LLVM-exception OR NCSA
URL: https://leaningtech.com/cheerp
Source0: %{NAME}_%{VERSION}.orig.tar.gz

BuildRequires: clang lld cmake ninja-build python3

%description
Cheerp is a tool to bring C++ programming to the Web. It can generate a seamless
combination of JavaScript, WebAssembly and Asm.js from a single C++ codebase.

%define debug_package %{nil}

%prep
%autosetup

%build
./debian/build.sh all

%install
echo %{buildroot}
CHEERP_DEST=%{buildroot} ./debian/build.sh install

%files
/opt/cheerp

%changelog
* Mon Jan 22 2024 Daan Meijer <[email protected]>
- Merge packages into a single binary package using new build script
* Fri Mar 03 2023 Yuri Iozzelli <[email protected]>
- Update license
* Wed Feb 03 2021 Yuri Iozzelli <[email protected]>
- Update to new monorepo
* Tue Dec 10 2019 Yuri Iozzelli <[email protected]>
- First RPM version
62 changes: 0 additions & 62 deletions rpmbuild/SPECS/cheerp-llvm-clang.spec

This file was deleted.

0 comments on commit bded38e

Please sign in to comment.