vscode/vscode.spec

129 lines
3 KiB
RPMSpec
Raw Normal View History

2020-04-16 21:03:28 +03:00
%define _optdir /opt
%define debug %nil
%define debug_package %nil
Name: vscode
2023-06-17 05:01:32 +00:00
Version: 1.79.2
2021-04-14 07:50:27 +03:00
Release: 1
2020-04-16 21:03:28 +03:00
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
2022-06-10 01:03:10 +03:00
Patch0: %{name}-marketplace-%{version}.patch
2021-04-11 00:27:25 +03:00
ExclusiveArch: x86_64
2023-06-09 08:19:42 +00:00
BuildRequires: nodejs-bootstrap-bin >= 16.17.1
2022-10-09 01:19:01 +03:00
#BuildRequires: nodejs16
2020-04-16 21:03:28 +03:00
BuildRequires: yarn
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(libsecret-1)
2020-04-16 22:12:13 +03:00
BuildRequires: pkgconfig(xkbfile)
2020-04-16 21:03:28 +03:00
BuildRequires: imagemagick
2020-08-30 20:23:47 +03:00
BuildRequires: git-core
2021-03-17 20:50:44 +03:00
BuildRequires: openssl-devel
2022-03-09 10:31:26 +03:00
BuildRequires: sqlite-tools
2022-10-09 01:19:01 +03:00
BuildRequires: python38-devel
2020-04-16 21:03:28 +03:00
%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
2020-12-11 19:28:59 +03:00
#patch -p0
2020-12-11 20:20:26 +03:00
#apply_patches
2020-12-11 19:28:59 +03:00
2020-12-11 21:27:06 +03:00
patch --fuzz=2 -s -U -p0 product.json %{PATCH0}
2020-04-16 21:03:28 +03:00
%build
2022-10-09 01:19:01 +03:00
export PATH=$PATH:/opt/nodejs/16.*/bin
export PYTHONPATH=%{python38_sitelib}
export PYTHON3=/usr/libexec/python3.8
export PYTHON=/usr/libexec/python3.8
2022-08-05 00:51:38 +03:00
yarn config set --home enableTelemetry 0
2021-09-14 23:47:53 +03:00
2020-07-17 20:17:04 +03:00
git init
2020-04-16 21:03:28 +03:00
yarn
2020-07-17 20:17:04 +03:00
yarn run preinstall
yarn run gulp
yarn run download-builtin-extensions
yarn run gulp compile-extensions
2020-04-16 21:03:28 +03:00
%ifarch x86_64
2020-07-17 20:17:04 +03:00
yarn run gulp vscode-linux-x64
2020-04-16 21:03:28 +03:00
%else
2020-07-17 20:17:04 +03:00
yarn run gulp vscode-linux-i32
2020-04-16 21:03:28 +03:00
%endif
%install
install -d %{buildroot}%{_bindir} \
2020-07-17 20:17:04 +03:00
%{buildroot}%{_optdir}/%{name} \
2020-04-16 21:03:28 +03:00
%{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/pixmaps \
2020-07-17 20:17:04 +03:00
%{buildroot}%{_iconsdir}
2020-04-16 21:03:28 +03:00
%ifarch x86_64
2020-07-17 20:17:04 +03:00
cp -a ../VSCode-linux-x64/* %{buildroot}%{_optdir}/%{name}
2020-04-16 21:03:28 +03:00
%else
2020-07-17 20:17:04 +03:00
cp -a ../VSCode-linux-i32/* %{buildroot}%{_optdir}/%{name}
2020-04-16 21:03:28 +03:00
%endif
# start script
cat > %{buildroot}%{_bindir}/%{name} << EOF
#!/bin/bash
cd /opt/%{name}
2020-07-17 21:17:28 +03:00
./code-oss
2020-04-16 21:03:28 +03:00
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
2020-07-17 20:17:04 +03:00
# remove suid
chmod -s %{buildroot}/%{_optdir}/%{name}/chrome-sandbox
2020-04-16 21:03:28 +03:00
2021-05-13 11:09:54 +03:00
# fix permissions
2021-05-15 08:30:28 +03:00
find %{buildroot}%{_optdir} -perm 0666 -type f -exec chmod 0644 {} \;
2021-05-13 11:09:54 +03:00
2020-04-16 21:03:28 +03:00
%files
2020-08-30 21:05:46 +03:00
%doc LICENSE.txt README.md
2020-04-16 21:03:28 +03:00
%{_bindir}/%{name}
%{_optdir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_iconsdir}/hicolor/*/apps/%{name}.png
%{_datadir}/pixmaps/%{name}.png