init
This commit is contained in:
parent
d50a4d3088
commit
69207ee685
24
vscode-name.patch
Normal file
24
vscode-name.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff --git a/package.json b/package.json
|
||||
index 13fc4f4cabe..5751b32edba 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
- "name": "code-oss-dev",
|
||||
+ "name": "Code",
|
||||
"version": "1.93.1",
|
||||
"distro": "2560b0e8d341a0b6734d28ef71b08e1920ff2501",
|
||||
"author": {
|
||||
diff --git a/product.json b/product.json
|
||||
index 908be250245..bddd849e97b 100644
|
||||
--- a/product.json
|
||||
+++ b/product.json
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
- "nameShort": "Code - OSS",
|
||||
- "nameLong": "Code - OSS",
|
||||
+ "nameShort": "Code",
|
||||
+ "nameLong": "Visual Studio Code",
|
||||
"applicationName": "code-oss",
|
||||
"dataFolderName": ".vscode-oss",
|
||||
"win32MutexName": "vscodeoss",
|
||||
152
vscode.spec
Normal file
152
vscode.spec
Normal file
@ -0,0 +1,152 @@
|
||||
%define debug_package %{nil}
|
||||
|
||||
Name: code
|
||||
Version: 1.93.1
|
||||
Release: 1
|
||||
License: MIT
|
||||
Group: Development/Tools
|
||||
Summary: Code editing. Redefined.
|
||||
Url: https://github.com/microsoft/vscode
|
||||
AutoReq: 0
|
||||
|
||||
%global __provides_exclude_from ^%{_datadir}/%{name}/.*\\.so.*$
|
||||
|
||||
Patch1: vscode-name.patch
|
||||
|
||||
|
||||
BuildRequires: python3
|
||||
BuildRequires: git
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: make
|
||||
BuildRequires: npm
|
||||
BuildRequires: wget
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: libX11-devel
|
||||
BuildRequires: libxkbfile-devel
|
||||
BuildRequires: libsecret-devel
|
||||
BuildRequires: krb5-devel
|
||||
BuildRequires: nss
|
||||
BuildRequires: dbus-devel
|
||||
BuildRequires: atk-devel
|
||||
BuildRequires: at-spi2-atk-devel
|
||||
BuildRequires: cups-libs
|
||||
BuildRequires: pango
|
||||
BuildRequires: mesa-libgbm
|
||||
BuildRequires: alsa-lib
|
||||
BuildRequires: nodejs-devel
|
||||
BuildRequires: nodejs-yarn
|
||||
|
||||
%description
|
||||
Visual Studio Code, also commonly referred to as VS Code, is a source-code editor
|
||||
made by Microsoft with the Electron Framework, for Windows, Linux and macOS.
|
||||
Features include support for debugging, syntax highlighting, intelligent code completion,
|
||||
snippets, code refactoring, and embedded Git.
|
||||
|
||||
%prep
|
||||
mkdir -p vscode-%{version}
|
||||
pushd vscode-%{version}
|
||||
git clone https://gitee.com/microsoft/vscode .
|
||||
git checkout %{version}
|
||||
|
||||
%patch1 -p1
|
||||
cp -r %{_sourcedir}/%{name}.png resources/linux/%{name}.png
|
||||
cp -r %{_sourcedir}/%{name}.png resources/server/%{name}-192.png
|
||||
cp -r %{_sourcedir}/%{name}.png resources/server/%{name}-512.png
|
||||
|
||||
popd
|
||||
|
||||
%build
|
||||
pushd vscode-%{version}
|
||||
npm config set registry https://repo.huaweicloud.com/repository/npm/
|
||||
yarn config set registry https://repo.huaweicloud.com/repository/npm/
|
||||
set +e
|
||||
for i in {1..10}; do
|
||||
yarn install --verbose --network-timeout 6000
|
||||
if [ $? -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
npm run compile
|
||||
npm run electron
|
||||
bash ./scripts/code-cli.sh | true
|
||||
popd
|
||||
|
||||
%install
|
||||
pushd vscode-%{version}
|
||||
mkdir -p %{buildroot}%{_datadir}/%{name}
|
||||
mkdir -p %{buildroot}%{_datadir}/%{name}/bin
|
||||
mkdir -p %{buildroot}%{_datadir}/applications
|
||||
mkdir -p %{buildroot}%{_datadir}/appdata
|
||||
mkdir -p %{buildroot}%{_datadir}/mime/packages
|
||||
mkdir -p %{buildroot}%{_datadir}/pixmaps
|
||||
|
||||
install -Dm 0755 resources/linux/bin/%{name}.sh %{buildroot}%{_datadir}/%{name}/bin/%{name}
|
||||
sed -i "s/@@APPNAME@@/code/g" %{buildroot}%{_datadir}/%{name}/bin/%{name}
|
||||
sed -i "s/@@PRODNAME@@/Visual Studio Code/g" %{buildroot}%{_datadir}/%{name}/bin/%{name}
|
||||
sed -i "s/@@APPNAME@@/code/g" %{buildroot}%{_datadir}/%{name}/bin/%{name}
|
||||
sed -i "60s/code/code-oss/g" %{buildroot}%{_datadir}/%{name}/bin/%{name}
|
||||
sed -i "60iexport VSCODE_CLI=0" %{buildroot}%{_datadir}/%{name}/bin/%{name}
|
||||
sed -i "60iexport VSCODE_DEV=0" %{buildroot}%{_datadir}/%{name}/bin/%{name}
|
||||
|
||||
cp -arf .build/electron/* %{buildroot}%{_datadir}/%{name}/
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/%{name}/resources/app
|
||||
cp -arf extensions %{buildroot}%{_datadir}/%{name}/resources/app/
|
||||
cp -arf node_modules %{buildroot}%{_datadir}/%{name}/resources/app/
|
||||
cp -arf out %{buildroot}%{_datadir}/%{name}/resources/app/
|
||||
cp -arf product.json %{buildroot}%{_datadir}/%{name}/resources/app/
|
||||
cp -arf package.json %{buildroot}%{_datadir}/%{name}/resources/app/
|
||||
cp -arf resources/completions %{buildroot}%{_datadir}/%{name}/resources/
|
||||
sed -i "s/@@APPNAME@@/code/g" %{buildroot}%{_datadir}/%{name}/resources/completions/zsh/_%{name}
|
||||
sed -i "s/@@APPNAME@@/code/g" %{buildroot}%{_datadir}/%{name}/resources/completions/bash/%{name}
|
||||
|
||||
# Support files
|
||||
cp -r resources/linux/%{name}.desktop %{buildroot}%{_datadir}/applications
|
||||
cp -r resources/linux/%{name}-url-handler.desktop %{buildroot}%{_datadir}/applications
|
||||
cp -r resources/linux/%{name}.appdata.xml %{buildroot}%{_datadir}/appdata
|
||||
cp -r resources/linux/%{name}-workspace.xml %{buildroot}%{_datadir}/mime/packages/%{name}-workspace.xml
|
||||
cp -r %{_sourcedir}/%{name}.png %{buildroot}%{_datadir}/pixmaps
|
||||
sed -i "s/@@NAME_LONG@@/Visual Studio Code/g" %{buildroot}%{_datadir}/applications/*
|
||||
sed -i "s/@@EXEC@@/\/usr\/share\/code\/bin\/code/g" %{buildroot}%{_datadir}/applications/*
|
||||
sed -i "s/@@ICON@@/code/g" %{buildroot}%{_datadir}/applications/*
|
||||
sed -i "s/@@URLPROTOCOL@@/vscode/g" %{buildroot}%{_datadir}/applications/*
|
||||
sed -i "s/@@NAME_SHORT@@/Code/g" %{buildroot}%{_datadir}/applications/*
|
||||
sed -i "s/@@NAME@@/code/g" %{buildroot}%{_datadir}/applications/*
|
||||
sed -i "s/@@LICENSE@@/Multiple, see https:\/\/code.visualstudio.com\/license/g" %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
|
||||
sed -i "s/@@NAME_LONG@@/Visual Studio Code/g" %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
|
||||
sed -i "s/@@NAME@@/Visual Studio Code/g" %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
|
||||
sed -i "s/@@NAME_LONG@@/Visual Studio Code/g" %{buildroot}%{_datadir}/mime/packages/%{name}-workspace.xml
|
||||
sed -i "s/@@NAME@@/Visual Studio Code/g" %{buildroot}%{_datadir}/mime/packages/%{name}-workspace.xml
|
||||
popd
|
||||
|
||||
if [ "$(arch)" == "x86_64" ]; then
|
||||
find %{buildroot}%{_datadir}/ -name *-arm64 | xargs rm -rf
|
||||
else
|
||||
find %{buildroot}%{_datadir}/ -name *-x64 | xargs rm -rf
|
||||
fi
|
||||
|
||||
find %{buildroot}%{_datadir}/ -name yarn.lock | xargs rm -rf
|
||||
|
||||
%files
|
||||
%{_datadir}/%{name}/
|
||||
%{_datadir}/applications/%{name}.desktop
|
||||
%{_datadir}/applications/%{name}-url-handler.desktop
|
||||
%{_datadir}/appdata/%{name}.appdata.xml
|
||||
%{_datadir}/mime/packages/%{name}-workspace.xml
|
||||
%{_datadir}/pixmaps/%{name}.png
|
||||
|
||||
%post
|
||||
ln -s %{_datadir}/code/bin/code /usr/bin/code
|
||||
update-desktop-database
|
||||
update-mime-database %{_datadir}/mime
|
||||
|
||||
%postun
|
||||
rm -rf /usr/bin/code
|
||||
update-desktop-database
|
||||
update-mime-database %{_datadir}/mime
|
||||
|
||||
%changelog
|
||||
* Wed Oct 9 2024 wangkui <wangkui35@h-partner.com> - 1.93.1-1
|
||||
- init
|
||||
Loading…
x
Reference in New Issue
Block a user