Initial commit

This commit is contained in:
Alfred Neumayer 2022-03-07 09:15:14 +01:00
commit 7cd8f37e86
9 changed files with 166 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
build
.clickable
out/
src/
pkg/
*.tar.gz
PKGBUILD

56
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,56 @@
---
###############################################################################
# Define all YAML node anchors
###############################################################################
.node_anchors:
# `stage`
stage_build: &stage_build 'build'
# `image`
image_clickable_amd64: &image_clickable_amd64 'clickable/ci-16.04-amd64'
image_clickable_arm64: &image_clickable_arm64 'clickable/ci-16.04-arm64'
image_clickable_armhf: &image_clickable_armhf 'clickable/ci-16.04-armhf'
# `artifacts.paths`
paths_amd64: &paths_amd64
- 'build/x86_64-linux-gnu/app/*.click'
paths_arm64: &paths_arm64
- 'build/aarch64-linux-gnu/app/*.click'
paths_armhf: &paths_armhf
- 'build/arm-linux-gnueabihf/app/*.click'
###############################################################################
# Define stages
###############################################################################
stages:
- *stage_build
###############################################################################
# Define `build` template
###############################################################################
.build_click:
stage: *stage_build
script:
- 'clickable build'
- 'clickable review'
artifacts:
expire_in: '1 week'
###############################################################################
# `build` stage: build clicks for `armhf`, `arm64` & `amd64`
###############################################################################
xenial_armhf_click:
extends: '.build_click'
image: *image_clickable_armhf
artifacts:
paths: *paths_armhf
xenial_arm64_click:
extends: '.build_click'
image: *image_clickable_arm64
artifacts:
paths: *paths_arm64
xenial_amd64_click:
extends: '.build_click'
image: *image_clickable_amd64
artifacts:
paths: *paths_amd64

11
LICENSE Normal file
View File

@ -0,0 +1,11 @@
MIT License
Copyright (c) 2022, Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

10
README.md Normal file
View File

@ -0,0 +1,10 @@
# Visual Studio Code
Code Editor by Microsoft
## License
Copyright (C) 2022 Microsoft
Licensed under the MIT license

32
build.sh Normal file
View File

@ -0,0 +1,32 @@
#!/bin/bash
sed -e
rm PKGBUILD* || true
rm *.tar.gz
wget https://raw.githubusercontent.com/KaOS-Community-Packages/vscode/master/PKGBUILD
sed -i "s/^arch=('x86_64')//g" PKGBUILD
sed -i "s/ln -s/#ln -s/g" PKGBUILD
sed -i "s/VSCode-linux-x64/VSCode-linux-$1/g" PKGBUILD
source PKGBUILD
srcdir=$ROOT/build/aarch64-linux-gnu/app
pkgdir=$srcdir/install
mkdir -p $srcdir $pkgdir
wget https://az764295.vo.msecnd.net/stable/b5205cc8eb4fbaa726835538cd82372cc0222d43/code-stable-$1-1646219865.tar.gz
tar xvf ./code-stable-$1-1646219865.tar.gz -C $srcdir
package
CLICK_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
CLICK_FRAMEWORK=ubuntu-sdk-16.04.5
cp $ROOT/manifest.json $pkgdir/
sed -i "s/@CLICK_ARCH@/$CLICK_ARCH/g" $pkgdir/manifest.json
sed -i "s/@CLICK_FRAMEWORK@/$CLICK_FRAMEWORK/g" $pkgdir/manifest.json
cp $ROOT/code.apparmor $pkgdir/
cp $ROOT/code.desktop $pkgdir/
exit 0

22
clickable.json Normal file
View File

@ -0,0 +1,22 @@
{
"clickable_minimum_required": "6.24.0",
"builder": "custom",
"default": "clean build click-build",
"kill": "code*",
"build": "bash ${ROOT}/build.sh arm64",
"dependencies_host": [
"libgles2",
"wget"
],
"dependencies_target": [
"libasound2",
"libfreetype6",
"libglib2.0-0",
"libpng16-16",
"libgtk-3-0",
"libdbusmenu-glib4"
],
"install_lib": [
"/usr/lib/${ARCH_TRIPLET}/libgtk-3.so*"
]
}

4
code.apparmor Normal file
View File

@ -0,0 +1,4 @@
{
"template": "unconfined",
"policy_version": 16.04
}

9
code.desktop Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Visual Studio Code
Exec=env GDK_BACKEND=x11 GDK_SCALE=2 ./code --force-device-scale-factor=2 %U
Icon=resources/app/resources/linux/code.png
Terminal=false
Type=Application
X-Ubuntu-Touch=true
X-Ubuntu-Splash-Color=#FFFFFF
X-Ubuntu-XMir-Enable=true

15
manifest.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "code.visualstudio.com",
"description": "Code Editor by Microsoft",
"architecture": "@CLICK_ARCH@",
"title": "Visual Studio Code",
"hooks": {
"code": {
"apparmor": "code.apparmor",
"desktop": "code.desktop"
}
},
"version": "1.64.2",
"maintainer": "Alfred Neumayer <dev.beidl@gmail.com>",
"framework" : "@CLICK_FRAMEWORK@"
}