From 7cd8f37e86c6f270fa36d608d7af73d74629b63d Mon Sep 17 00:00:00 2001 From: Alfred Neumayer Date: Mon, 7 Mar 2022 09:15:14 +0100 Subject: [PATCH] Initial commit --- .gitignore | 7 +++++++ .gitlab-ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 11 ++++++++++ README.md | 10 +++++++++ build.sh | 32 +++++++++++++++++++++++++++++ clickable.json | 22 ++++++++++++++++++++ code.apparmor | 4 ++++ code.desktop | 9 ++++++++ manifest.json | 15 ++++++++++++++ 9 files changed, 166 insertions(+) create mode 100644 .gitignore create mode 100644 .gitlab-ci.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.sh create mode 100644 clickable.json create mode 100644 code.apparmor create mode 100644 code.desktop create mode 100644 manifest.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..180e5fd --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +build +.clickable +out/ +src/ +pkg/ +*.tar.gz +PKGBUILD diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f384235 --- /dev/null +++ b/.gitlab-ci.yml @@ -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 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..71efde1 --- /dev/null +++ b/LICENSE @@ -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. + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..df31214 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Visual Studio Code + +Code Editor by Microsoft + + +## License + +Copyright (C) 2022 Microsoft + +Licensed under the MIT license diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..4ca5e49 --- /dev/null +++ b/build.sh @@ -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 diff --git a/clickable.json b/clickable.json new file mode 100644 index 0000000..a2f0071 --- /dev/null +++ b/clickable.json @@ -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*" + ] +} diff --git a/code.apparmor b/code.apparmor new file mode 100644 index 0000000..7bf9ce3 --- /dev/null +++ b/code.apparmor @@ -0,0 +1,4 @@ +{ + "template": "unconfined", + "policy_version": 16.04 +} diff --git a/code.desktop b/code.desktop new file mode 100644 index 0000000..1a57a5e --- /dev/null +++ b/code.desktop @@ -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 diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..35f96aa --- /dev/null +++ b/manifest.json @@ -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 ", + "framework" : "@CLICK_FRAMEWORK@" +}