mirror of
https://abf.rosa.ru/djam/vscode.git
synced 2025-02-23 13:42:53 +00:00
129 lines
3 KiB
RPMSpec
129 lines
3 KiB
RPMSpec
%define _optdir /opt
|
|
%define debug %nil
|
|
%define debug_package %nil
|
|
%define nodever 16
|
|
|
|
Name: vscode
|
|
Version: 1.96.3
|
|
Release: 1
|
|
Summary: Visual Studio Code
|
|
Group: Development/Tools
|
|
License: MIT
|
|
URL: https://code.visualstudio.com/
|
|
Source0: https://github.com/microsoft/vscode/archive/%{version}/%{name}-%{version}.tar.gz
|
|
Source1000: %{name}.rpmlintrc
|
|
Patch0: %{name}-marketplace.patch
|
|
ExclusiveArch: x86_64
|
|
BuildRequires: nodejs-bootstrap-bin >= %{nodever}
|
|
#BuildRequires: nodejs16
|
|
BuildRequires: yarn
|
|
BuildRequires: pkgconfig(x11)
|
|
BuildRequires: pkgconfig(libsecret-1)
|
|
BuildRequires: pkgconfig(xkbfile)
|
|
BuildRequires: imagemagick
|
|
BuildRequires: git-core
|
|
BuildRequires: openssl-devel
|
|
BuildRequires: sqlite-tools
|
|
BuildRequires: python38-devel
|
|
|
|
%description
|
|
Visual Studio Code is a new choice of tool that
|
|
combines the simplicity of a code editor with
|
|
what developers need for the core edit-build-debug cycle.
|
|
|
|
%prep
|
|
%setup -q
|
|
#patch -p0
|
|
#apply_patches
|
|
|
|
patch --fuzz=2 -s -U -p0 product.json %{PATCH0}
|
|
|
|
%build
|
|
export PATH=$PATH:/opt/nodejs/%{nodever}.*/bin
|
|
export PYTHONPATH=%{python38_sitelib}
|
|
export PYTHON3=/usr/libexec/python3.8
|
|
export PYTHON=/usr/libexec/python3.8
|
|
|
|
yarn config set --home enableTelemetry 0
|
|
|
|
git init
|
|
yarn
|
|
yarn run preinstall
|
|
yarn run gulp
|
|
yarn run download-builtin-extensions
|
|
yarn run gulp compile-extensions
|
|
|
|
%ifarch x86_64
|
|
yarn run gulp vscode-linux-x64
|
|
%else
|
|
yarn run gulp vscode-linux-i32
|
|
%endif
|
|
|
|
%install
|
|
install -d %{buildroot}%{_bindir} \
|
|
%{buildroot}%{_optdir}/%{name} \
|
|
%{buildroot}%{_datadir}/applications \
|
|
%{buildroot}%{_datadir}/pixmaps \
|
|
%{buildroot}%{_iconsdir}
|
|
|
|
%ifarch x86_64
|
|
cp -a ../VSCode-linux-x64/* %{buildroot}%{_optdir}/%{name}
|
|
%else
|
|
cp -a ../VSCode-linux-i32/* %{buildroot}%{_optdir}/%{name}
|
|
%endif
|
|
|
|
# start script
|
|
cat > %{buildroot}%{_bindir}/%{name} << EOF
|
|
#!/bin/bash
|
|
cd /opt/%{name}
|
|
./code-oss
|
|
EOF
|
|
|
|
chmod +x %{buildroot}%{_bindir}/%{name}
|
|
|
|
# menu-entry
|
|
cat >> %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
|
|
[Desktop Entry]
|
|
Name=%{name}
|
|
Comment=Code Editing. Redefined.
|
|
GenericName=%{name}
|
|
Exec=%{name} --no-sandbox \% F
|
|
Icon=%{name}
|
|
Type=Application
|
|
StartupNotify=false
|
|
StartupWMClass=%{name}
|
|
Categories=Utility;TextEditor;Development;IDE;
|
|
MimeType=text/plain;inode/directory;
|
|
Actions=new-empty-window;
|
|
Keywords=vscode;
|
|
|
|
[Desktop Action new-empty-window]
|
|
Name=New Empty Window
|
|
Exec=%{name} --no-sandbox --new-window \% F
|
|
Icon=%{name}
|
|
EOF
|
|
|
|
# icons
|
|
cd resources/linux/rpm
|
|
for x in 16 24 32 48 64 96 128 256 512; do
|
|
install -d %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/
|
|
convert -resize ${x}x${x} code.xpm %{buildroot}%{_iconsdir}/hicolor/${x}x${x}/apps/%{name}.png
|
|
done
|
|
|
|
install -Dm0644 code.xpm %{buildroot}%{_datadir}/pixmaps/%{name}.png
|
|
|
|
# remove suid
|
|
chmod -s %{buildroot}/%{_optdir}/%{name}/chrome-sandbox
|
|
|
|
# fix permissions
|
|
find %{buildroot}%{_optdir} -perm 0666 -type f -exec chmod 0644 {} \;
|
|
|
|
|
|
%files
|
|
%doc LICENSE.txt README.md
|
|
%{_bindir}/%{name}
|
|
%{_optdir}/%{name}
|
|
%{_datadir}/applications/%{name}.desktop
|
|
%{_iconsdir}/hicolor/*/apps/%{name}.png
|
|
%{_datadir}/pixmaps/%{name}.png
|
|
|