summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-11-27 14:41:30 +0000
committerCoprDistGit <infra@openeuler.org>2025-11-27 14:41:30 +0000
commitc3c543e66aa2f6f7eb0ca23063d34e03bdcb2c76 (patch)
tree8fcb4a93a0a63134a45109b744b7b3d8c7332d68
parent91ca6d384ad44eef5143616c44ec9d88091a7549 (diff)
automatic import of cangjie-lts-compiler
-rw-r--r--.gitignore1
-rw-r--r--cangjie-lts-compiler.spec170
-rw-r--r--sources1
3 files changed, 172 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..04cf02c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/v1.0.7.tar.gz
diff --git a/cangjie-lts-compiler.spec b/cangjie-lts-compiler.spec
new file mode 100644
index 0000000..21024ef
--- /dev/null
+++ b/cangjie-lts-compiler.spec
@@ -0,0 +1,170 @@
+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: cpio
+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
diff --git a/sources b/sources
new file mode 100644
index 0000000..9c63142
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+48acb3bcfe4c2d98f71ae3f55a65d524 v1.0.7.tar.gz