blob: 69647321ab8e2e649858a967aea11121eb84c4d6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
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
BuildRequires: git
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
|