From 205962bf7509f619456f07b50f5fb85b08a2f4b6 Mon Sep 17 00:00:00 2001 From: Egor00f Date: Fri, 8 Nov 2024 11:31:31 +0000 Subject: [PATCH 1/9] create deb package --- .gitignore | 4 +++- .vscode/settings.json | 3 ++- build-package.sh | 4 ++++ package/DEBIAN/control | 11 +++++++++++ package/DEBIAN/postrm | 2 ++ 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 build-package.sh create mode 100644 package/DEBIAN/control create mode 100755 package/DEBIAN/postrm diff --git a/.gitignore b/.gitignore index d351402..50b5b4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -Output/ \ No newline at end of file +Output/ +package/DEBIAN/postinst +package.deb diff --git a/.vscode/settings.json b/.vscode/settings.json index c0f3e4c..6418f2d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,6 +4,7 @@ "тулчейн", "тулчейна", "msys", - "kolibrios" + "kolibrios", + "Egor" ] } \ No newline at end of file diff --git a/build-package.sh b/build-package.sh new file mode 100755 index 0000000..b95806a --- /dev/null +++ b/build-package.sh @@ -0,0 +1,4 @@ + +cp -f install.sh package/DEBIAN/postinst + +dpkg-deb --build ./package diff --git a/package/DEBIAN/control b/package/DEBIAN/control new file mode 100644 index 0000000..143924f --- /dev/null +++ b/package/DEBIAN/control @@ -0,0 +1,11 @@ +Package: kos32-gcc +Version: 0.1 +Architecture: all +Section: devel +Description: KolibriOS gcc toolchain +Depends: libc6-i386:amd64, libmpc3:amd64 +Pre-Depends: p7zip, wget +Recommends: fasm +Priority: optional +Origin: https://github.com/Egor00f/kolibrios-gcc-toolchain, +Maintainer: Egor00f diff --git a/package/DEBIAN/postrm b/package/DEBIAN/postrm new file mode 100755 index 0000000..b340d69 --- /dev/null +++ b/package/DEBIAN/postrm @@ -0,0 +1,2 @@ + +rm -R /home/autobuild/tools/win32 From 5deba536894c6987fa688f748f3a2e707309495e Mon Sep 17 00:00:00 2001 From: Egor00f Date: Fri, 8 Nov 2024 11:50:40 +0000 Subject: [PATCH 2/9] add test package & set version to 0.1.1 --- .github/workflows/test.yml | 16 ++++++++++++++++ installator.iss | 2 +- package/DEBIAN/control | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a31d2cb..0112f34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,4 +47,20 @@ jobs: kos32-gcc -v shell: cmd + build-package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: build + run: ${{ github.workspace }}/./build-package.sh + + - name: Install package + run: sudo apt install ${{ github.workspace }}/package.deb + + - name: Test run + run: | + kos32-g++ -v + kos32-gcc -v + diff --git a/installator.iss b/installator.iss index 3006aed..bbf0815 100644 --- a/installator.iss +++ b/installator.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "KolibriOS gcc toolchain" -#define MyAppVersion "0.1" +#define MyAppVersion "0.1.1" #define MyAppPublisher "Egor00f" #define MyAppURL "https://github.com/Egor00f/kolibrios-gcc-toolchain" diff --git a/package/DEBIAN/control b/package/DEBIAN/control index 143924f..d6cc1d2 100644 --- a/package/DEBIAN/control +++ b/package/DEBIAN/control @@ -1,5 +1,5 @@ Package: kos32-gcc -Version: 0.1 +Version: 0.1.1 Architecture: all Section: devel Description: KolibriOS gcc toolchain From 45d8910f84dc2ad57fbb4698099b3d23e4e57fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80?= <148970641+Egor00f@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:02:51 +0500 Subject: [PATCH 3/9] fix package test in test.yml --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0112f34..a5900be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,6 +58,10 @@ jobs: - name: Install package run: sudo apt install ${{ github.workspace }}/package.deb + - name: Add toolchain to path + run: echo "/home/autobuild/tools/win32/bin" >> $GITHUB_PATH + + - name: Test run run: | kos32-g++ -v From 83b9582c31478ffcd682e06a844110ef54eff0b7 Mon Sep 17 00:00:00 2001 From: Egor00f Date: Fri, 8 Nov 2024 15:33:38 +0000 Subject: [PATCH 4/9] use cmake for build package --- .github/workflows/test.yml | 31 ++++++++++++++++++------------- .gitignore | 1 + CMakeLists.txt | 19 +++++++++++++++++++ build-package.sh | 4 ---- install.sh | 22 +++++++++++++--------- package/DEBIAN/control | 5 +++-- package/DEBIAN/postrm | 1 + 7 files changed, 55 insertions(+), 28 deletions(-) create mode 100644 CMakeLists.txt delete mode 100755 build-package.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a5900be..9c6cab7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,24 +47,29 @@ jobs: kos32-gcc -v shell: cmd + build-Installer: + runs-on: windowd-latest + steps: + - uses: actions/checkout@v4 + + - name: Build + run: | + cmake -B ${{ github.workspace }}/build + cmake --build ${{ github.workspace }}/build --target Installer + build-package: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: build - run: ${{ github.workspace }}/./build-package.sh - + + - name: Build + run: | + cmake -B ${{ github.workspace }}/build + cmake --build ${{ github.workspace }}/build --target Package + - name: Install package run: sudo apt install ${{ github.workspace }}/package.deb - + - name: Add toolchain to path run: echo "/home/autobuild/tools/win32/bin" >> $GITHUB_PATH - - - - name: Test run - run: | - kos32-g++ -v - kos32-gcc -v - - + diff --git a/.gitignore b/.gitignore index 50b5b4c..5317c62 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ Output/ package/DEBIAN/postinst package.deb +build/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c60ca3c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,19 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.10) + +project( + KolibriOS-gcc-Toolchain-installer + DESCRIPTION "Installer of gcc toolchain for KolibriOS" +) + + +add_custom_target( + Package + COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/install.sh ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/postinst + COMMAND dpkg-deb --build ${CMAKE_CURRENT_SOURCE_DIR}/package ${CMAKE_CURRENT_BINARY_DIR}/package.deb + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) + +add_custom_target( + Installer + COMMAND iscc /O"${CMAKE_CURRENT_BINARY_DIR}" ${CMAKE_CURRENT_SOURCE_DIR}/installator.iss +) diff --git a/build-package.sh b/build-package.sh deleted file mode 100755 index b95806a..0000000 --- a/build-package.sh +++ /dev/null @@ -1,4 +0,0 @@ - -cp -f install.sh package/DEBIAN/postinst - -dpkg-deb --build ./package diff --git a/install.sh b/install.sh index b9b40a6..3b11007 100755 --- a/install.sh +++ b/install.sh @@ -28,6 +28,10 @@ check_utils(){ fi } +pwd + +TOOLCHAIN_DIR="/home/autobuild/tools" + print_msg "Checking utilities..." @@ -40,9 +44,7 @@ check_utils 7z print_msg "Create the /home/autobuild folder..." -sudo rm -rf ~/autobuild /home/autobuild -mkdir -p ~/autobuild/tools -sudo ln -sf ~/autobuild /home/autobuild +mkdir -fp $TOOLCHAIN_DIR print_ok "Successfully!" @@ -50,7 +52,7 @@ print_ok "Successfully!" print_msg "Download the kos32-gcc toolchain..." -wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/x86_64-linux-kos32-5.4.0.7z -q -O ~/autobuild/tools/kos32-toolchain.7z +wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/x86_64-linux-kos32-5.4.0.7z -q -O $TOOLCHAIN_DIR/kos32-toolchain.7z print_ok "Successfully!" @@ -58,7 +60,7 @@ print_ok "Successfully!" print_msg "Extracting files ..." -cd ~/autobuild/tools/ +cd $TOOLCHAIN_DIR 7z x -y kos32-toolchain.7z rm -rf kos32-toolchain.7z @@ -68,7 +70,7 @@ print_ok "Successfully!" print_msg "Downloading libraries..." -cd ~/autobuild/tools/win32/mingw32 +cd $TOOLCHAIN_DIR/win32/mingw32 wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -q -O sdk-28-10-16.7z 7z x -y sdk-28-10-16.7z rm -rf sdk-28-10-16.7z @@ -121,10 +123,12 @@ sudo ln -sf /usr/lib/libmpfr.so.6 /usr/lib/libmpfr.so.4 print_ok "Successfully!" -if ! grep -q 'export PATH=$PATH:/home/autobuild/tools/win32/bin' ~/.bashrc; then +if ! grep -q 'export PATH=$PATH:$TOOLCHAIN_DIR/win32/bin' ~/.bashrc; then export PATH=$PATH:/home/autobuild/tools/win32/bin - print_msg "Adding '/home/autobuild/tools/win32/bin' to '~/.bashrc'" - echo 'export PATH=$PATH:/home/autobuild/tools/win32/bin' >> ~/.bashrc + print_msg "Adding '$TOOLCHAIN_DIR/win32/bin' to '~/.bashrc'" + echo 'export PATH=$PATH:$TOOLCHAIN_DIR/win32/bin' >> ~/.bashrc fi +cd "$OLDPWD" + print_ok "Installation was successful!" diff --git a/package/DEBIAN/control b/package/DEBIAN/control index d6cc1d2..7fe8bba 100644 --- a/package/DEBIAN/control +++ b/package/DEBIAN/control @@ -7,5 +7,6 @@ Depends: libc6-i386:amd64, libmpc3:amd64 Pre-Depends: p7zip, wget Recommends: fasm Priority: optional -Origin: https://github.com/Egor00f/kolibrios-gcc-toolchain, -Maintainer: Egor00f +Origin: https://github.com/Egor00f/kolibrios-gcc-toolchain +Maintainer: Egor00f +Installed-Size: 131708 diff --git a/package/DEBIAN/postrm b/package/DEBIAN/postrm index b340d69..6e9c374 100755 --- a/package/DEBIAN/postrm +++ b/package/DEBIAN/postrm @@ -1,2 +1,3 @@ +#!/bin/bash rm -R /home/autobuild/tools/win32 From ad3261d33223d27a3f5fb95a0d6c41843dd41729 Mon Sep 17 00:00:00 2001 From: Egor00f Date: Fri, 8 Nov 2024 15:36:00 +0000 Subject: [PATCH 5/9] fix install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 3b11007..da02405 100755 --- a/install.sh +++ b/install.sh @@ -44,7 +44,7 @@ check_utils 7z print_msg "Create the /home/autobuild folder..." -mkdir -fp $TOOLCHAIN_DIR +mkdir -p $TOOLCHAIN_DIR print_ok "Successfully!" From 2ff32eb06a12f34af29243976f85a48ca3f7fa81 Mon Sep 17 00:00:00 2001 From: Egor00f Date: Fri, 8 Nov 2024 15:38:24 +0000 Subject: [PATCH 6/9] use sudo --- install.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index da02405..3fe4ead 100755 --- a/install.sh +++ b/install.sh @@ -44,7 +44,7 @@ check_utils 7z print_msg "Create the /home/autobuild folder..." -mkdir -p $TOOLCHAIN_DIR +sudo mkdir -p $TOOLCHAIN_DIR print_ok "Successfully!" @@ -52,7 +52,7 @@ print_ok "Successfully!" print_msg "Download the kos32-gcc toolchain..." -wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/x86_64-linux-kos32-5.4.0.7z -q -O $TOOLCHAIN_DIR/kos32-toolchain.7z +sudo wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/x86_64-linux-kos32-5.4.0.7z -q -O $TOOLCHAIN_DIR/kos32-toolchain.7z print_ok "Successfully!" @@ -61,8 +61,8 @@ print_ok "Successfully!" print_msg "Extracting files ..." cd $TOOLCHAIN_DIR -7z x -y kos32-toolchain.7z -rm -rf kos32-toolchain.7z +sudo 7z x -y kos32-toolchain.7z +sudo rm -rf kos32-toolchain.7z print_ok "Successfully!" @@ -71,9 +71,9 @@ print_ok "Successfully!" print_msg "Downloading libraries..." cd $TOOLCHAIN_DIR/win32/mingw32 -wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -q -O sdk-28-10-16.7z -7z x -y sdk-28-10-16.7z -rm -rf sdk-28-10-16.7z +sudo wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -q -O sdk-28-10-16.7z +sudo 7z x -y sdk-28-10-16.7z +sudo rm -rf sdk-28-10-16.7z print_ok "Successfully!" @@ -82,15 +82,15 @@ print_ok "Successfully!" print_msg "Updating libraries" cd lib -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libdll.a -q -O libdll.a -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libfreetype.a -q -O libfreetype.a -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libc.dll.a -q -O libc.dll.a -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libSDLn.a -q -O libSDLn.a -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libcurses.a -q -O libcurses.a -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libz.dll.a -q -O libz.dll.a -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libogg.a -q -O libogg.a -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libvorbis.a -q -O libvorbis.a -wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libopenjpeg.a -q -O libopenjpeg.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libdll.a -q -O libdll.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libfreetype.a -q -O libfreetype.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libc.dll.a -q -O libc.dll.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libSDLn.a -q -O libSDLn.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libcurses.a -q -O libcurses.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libz.dll.a -q -O libz.dll.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libogg.a -q -O libogg.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libvorbis.a -q -O libvorbis.a +sudo wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libopenjpeg.a -q -O libopenjpeg.a print_ok "Successfully!" From 51ad12be50d0372e36b619eba51828c35703fb3c Mon Sep 17 00:00:00 2001 From: Egor00f Date: Fri, 8 Nov 2024 15:53:33 +0000 Subject: [PATCH 7/9] add description & use dpkg instead apt in package test --- .github/workflows/test.yml | 2 +- .vscode/extensions.json | 3 ++- package/DEBIAN/control | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c6cab7..ca13a3e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,7 +68,7 @@ jobs: cmake --build ${{ github.workspace }}/build --target Package - name: Install package - run: sudo apt install ${{ github.workspace }}/package.deb + run: sudo dpkg -i ${{ github.workspace }}/package.deb - name: Add toolchain to path run: echo "/home/autobuild/tools/win32/bin" >> $GITHUB_PATH diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2a10376..58fb364 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "chouzz.vscode-innosetup", "streetsidesoftware.code-spell-checker", - "streetsidesoftware.code-spell-checker-russian" + "streetsidesoftware.code-spell-checker-russian", + "ms-vscode.cmake-tools" ] } \ No newline at end of file diff --git a/package/DEBIAN/control b/package/DEBIAN/control index 7fe8bba..e289f8f 100644 --- a/package/DEBIAN/control +++ b/package/DEBIAN/control @@ -2,7 +2,6 @@ Package: kos32-gcc Version: 0.1.1 Architecture: all Section: devel -Description: KolibriOS gcc toolchain Depends: libc6-i386:amd64, libmpc3:amd64 Pre-Depends: p7zip, wget Recommends: fasm @@ -10,3 +9,5 @@ Priority: optional Origin: https://github.com/Egor00f/kolibrios-gcc-toolchain Maintainer: Egor00f Installed-Size: 131708 +Description: KolibriOS gcc toolchain installer + This package installing KolibriOS gcc toolchain. \ No newline at end of file From f470a40d3032d96e4e87903dc6d535b73c7ca019 Mon Sep 17 00:00:00 2001 From: Egor00f Date: Fri, 8 Nov 2024 16:01:57 +0000 Subject: [PATCH 8/9] update control --- package/DEBIAN/control | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/DEBIAN/control b/package/DEBIAN/control index e289f8f..1adbf05 100644 --- a/package/DEBIAN/control +++ b/package/DEBIAN/control @@ -6,8 +6,9 @@ Depends: libc6-i386:amd64, libmpc3:amd64 Pre-Depends: p7zip, wget Recommends: fasm Priority: optional -Origin: https://github.com/Egor00f/kolibrios-gcc-toolchain +Homepage: https://github.com/Egor00f/kolibrios-gcc-toolchain +Origin: http://ftp.kolibrios.org/users/Serge/new/Toolchain Maintainer: Egor00f Installed-Size: 131708 Description: KolibriOS gcc toolchain installer - This package installing KolibriOS gcc toolchain. \ No newline at end of file + This package installing KolibriOS gcc toolchain. From dcbf7a3e1fdc347cfa485b723fac780ed904fb16 Mon Sep 17 00:00:00 2001 From: Egor00f Date: Fri, 8 Nov 2024 16:03:05 +0000 Subject: [PATCH 9/9] update.test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ca13a3e..169234b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,7 +68,7 @@ jobs: cmake --build ${{ github.workspace }}/build --target Package - name: Install package - run: sudo dpkg -i ${{ github.workspace }}/package.deb + run: sudo dpkg -i ${{ github.workspace }}/build/package.deb - name: Add toolchain to path run: echo "/home/autobuild/tools/win32/bin" >> $GITHUB_PATH