diff options
| author | CoprDistGit <infra@openeuler.org> | 2025-11-27 14:22:45 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2025-11-27 14:22:45 +0000 |
| commit | 7331d7aab31aea62019b218b8b91d21b227ce152 (patch) | |
| tree | 9941bf1d898d6f19eefb6ddfbd5fe7c3787c3a60 /cangjie-lts-compiler.spec | |
| parent | 91ca6d384ad44eef5143616c44ec9d88091a7549 (diff) | |
automatic import of cangjie-lts-compileropeneuler22.03_LTS_SP4
Diffstat (limited to 'cangjie-lts-compiler.spec')
| -rw-r--r-- | cangjie-lts-compiler.spec | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/cangjie-lts-compiler.spec b/cangjie-lts-compiler.spec new file mode 100644 index 0000000..17acdd1 --- /dev/null +++ b/cangjie-lts-compiler.spec @@ -0,0 +1,172 @@ +Name: cangjie-lts-compiler +Version: 1.0.7 +Release: 1%{?dist} +Summary: Cangjie program language compiler (LTS Channel) +Packager: OpenCJ + +License: Apache-V2 +URL: https://cangjie-lang.cn +Source0: https://github.com/cangjielanguage/cangjie_compiler/archive/refs/tags/v%{version}.tar.gz + +BuildRequires: tar +BuildRequires: unzip +BuildRequires: wget +BuildRequires: curl +BuildRequires: libcurl +BuildRequires: expat +BuildRequires: openssl +BuildRequires: make +BuildRequires: gcc > 7.3.0 +BuildRequires: gcc-c++ +BuildRequires: gettext +BuildRequires: nfs-utils +BuildRequires: libtool +BuildRequires: sqlite +BuildRequires: zlib-devel +BuildRequires: openssl-devel +BuildRequires: cmake > 3.16.5 +BuildRequires: ninja-build > 1.10 +BuildRequires: libcurl-devel +BuildRequires: autoconf +BuildRequires: rapidjson-devel +BuildRequires: texinfo +BuildRequires: binutils > 2.38 +BuildRequires: expat-devel +BuildRequires: elfutils-libelf-devel +BuildRequires: libdwarf-devel +BuildRequires: openssh-clients +BuildRequires: dos2unix +BuildRequires: libXext-devel +BuildRequires: libXtst-devel +BuildRequires: libXt-devel +BuildRequires: cups-devel +BuildRequires: clang +BuildRequires: clang-tools-extra +BuildRequires: libedit-devel +BuildRequires: libXrender-devel +BuildRequires: zip +BuildRequires: bzip2 +BuildRequires: openmpi-devel +BuildRequires: vim +BuildRequires: gdb +BuildRequires: lldb +BuildRequires: clang-devel +BuildRequires: gtest-devel +BuildRequires: rpm +BuildRequires: patch +BuildRequires: libtinfo +BuildRequires: cpio +BuildRequires: rpm2cpio +BuildRequires: ncurses-compat-libs +BuildRequires: ncurses-devel +BuildRequires: strace +BuildRequires: net-tools +BuildRequires: python3 > 3.7 +BuildRequires: clang15-devel +BuildRequires: clang15 +Requires: binutils > 2.38 +Requires: glibc-devel +Requires: libstdc++-devel +Requires: gcc > 7.3.0 + +%description +Cangjie is a modern programming language developed by Huawei. This package +provides the Cangjie compiler (cjc), debugger (cjdb), and core development tools +for building Cangjie applications on Linux systems. + +The compiler supports native Linux compilation with LLVM backend and includes +full debugging capabilities through cjdb/lldb integration. + + +%prep +%autosetup -n cangjie_compiler-%{version} + + +%build +# Setup build environment +export PATH=/usr/lib/llvm-15/bin:$PATH +export OPENSSL_PATH=%{_libdir} +export CANGJIE_VERSION=%{version} + +# Determine architecture +%ifarch x86_64 +export ARCH=x86_64 +export SDK_NAME=linux-x64 +%endif +%ifarch aarch64 +export ARCH=aarch64 +export SDK_NAME=linux-aarch64 +%endif + +# Build compiler and debugger +python3 build.py clean +python3 build.py build -t release --no-test --build-cjdb + + +%install +# Run compiler installation +python3 build.py install + +# Create installation directory +mkdir -p %{buildroot}/opt/cangjie-lts + +# Copy all output files to installation directory +cp -r output/* %{buildroot}/opt/cangjie-lts/ + +# Create symlinks in /usr/bin for common commands +mkdir -p %{buildroot}%{_bindir} +ln -sf /opt/cangjie-lts/bin/cjc %{buildroot}%{_bindir}/cjc +ln -sf /opt/cangjie-lts/bin/cjdb %{buildroot}%{_bindir}/cjdb + +# Create environment setup script in /etc/profile.d +mkdir -p %{buildroot}/etc/profile.d +cat > %{buildroot}/etc/profile.d/cangjie-lts.sh << 'EOF' +# Cangjie LTS environment setup +export CANGJIE_HOME=/opt/cangjie-lts +export PATH=$CANGJIE_HOME/bin:$PATH +export LD_LIBRARY_PATH=$CANGJIE_HOME/lib:$LD_LIBRARY_PATH +EOF + + +%files +# Main installation directory +/opt/cangjie-lts + +# Symlinks in /usr/bin +%{_bindir}/cjc +%{_bindir}/cjdb + +# Environment setup script +/etc/profile.d/cangjie-lts.sh + +# License and documentation +%license LICENSE +%doc README.md + + +%post +echo "================================================================" +echo "Cangjie LTS Compiler %{version} has been installed successfully!" +echo "" +echo "To use Cangjie compiler, please either:" +echo " 1. Logout and login again to load the environment, or" +echo " 2. Run: source /etc/profile.d/cangjie-lts.sh" +echo "" +echo "Then verify the installation with: cjc -v" +echo "================================================================" + + +%postun +if [ $1 -eq 0 ]; then + # This is a complete uninstall + echo "Cangjie LTS Compiler has been removed from your system." +fi + + + +%changelog +* Thu Nov 27 2025 yms +- Initial RPM package for Cangjie LTS Compiler version 1.0.7 +- Include cjc compiler and cjdb debugger +- Setup environment configuration in /etc/profile.d +- Create convenient symlinks in /usr/bin |
