From a4f82f4eff9645820c13d6b6c5fbcf6ff2222264 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Fri, 18 Feb 2022 13:08:44 -0500 Subject: [PATCH 1/6] download: Fetch LZMA-compressed tarball instad of zip --- qsc/__init__.py | 2 +- qsc/download.py | 2 +- qsc/extract.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qsc/__init__.py b/qsc/__init__.py index 4b38362..577e2f2 100644 --- a/qsc/__init__.py +++ b/qsc/__init__.py @@ -29,7 +29,7 @@ def is_windows(): # Settings REPO_BASE_URL = "https://download.qt.io/" -REPO_SRC_PATH = "{0}/official_releases/qt/{1}/{2}/single/qt-everywhere-src-{2}.zip" +REPO_SRC_PATH = "{0}/official_releases/qt/{1}/{2}/single/qt-everywhere-src-{2}.tar.xz" REPO_JOM_PATH = "{0}/official_releases/jom/jom.zip" USE_CACHE = True diff --git a/qsc/download.py b/qsc/download.py index d006459..273d784 100644 --- a/qsc/download.py +++ b/qsc/download.py @@ -33,7 +33,7 @@ def download_file(url, path): def download_release(release): url = source_url(release) - download_path = os.path.join("archives", "qt-everywhere-src-{}.zip".format(release)) + download_path = os.path.join("archives", "qt-everywhere-src-{}.tar.xz".format(release)) print("Downloading Qt {}...".format(release), end="", flush=True) diff --git a/qsc/extract.py b/qsc/extract.py index 493ce5a..a00ac4a 100644 --- a/qsc/extract.py +++ b/qsc/extract.py @@ -18,14 +18,14 @@ """Extracting archives and stuff""" import os -import zipfile +import tarfile import qsc def extract_release(release): name = "qt-everywhere-src-{}".format(release) - zip_path = os.path.join("archives", name+".zip") + tar_path = os.path.join("archives", name+".tar.xz") print("Extracting...", end="", flush=True) @@ -33,7 +33,7 @@ def extract_release(release): print("Cached") return - with zipfile.ZipFile(zip_path, "r") as zip: - zip.extractall(".") + with tarfile.open(tar_path) as tar: + tar.extractall(".") print("Done") From ae04e45c2df455cc342e4cb2c20414caeb64e402 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Fri, 18 Feb 2022 13:09:28 -0500 Subject: [PATCH 2/6] init: Add is_linux() function --- qsc/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qsc/__init__.py b/qsc/__init__.py index 577e2f2..4ef805e 100644 --- a/qsc/__init__.py +++ b/qsc/__init__.py @@ -21,6 +21,9 @@ def is_windows(): return platform.system() == "Windows" +def is_linux(): + return platform.system() == "Linux" + # Paths BASE_PATH = os.path.dirname(__file__) DATA_PATH = os.path.join(BASE_PATH, "data") From 7f17047bf2f69503e9de04eae23cd8ab819c1d59 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sat, 19 Feb 2022 02:51:06 -0500 Subject: [PATCH 3/6] linbuild: Add Linux build script --- qsc/__init__.py | 1 + qsc/data/linbuild.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 qsc/data/linbuild.sh diff --git a/qsc/__init__.py b/qsc/__init__.py index 4ef805e..6bc7f91 100644 --- a/qsc/__init__.py +++ b/qsc/__init__.py @@ -29,6 +29,7 @@ def is_linux(): DATA_PATH = os.path.join(BASE_PATH, "data") WINBUILD_PATH = os.path.join(DATA_PATH, "winbuild.bat") +LINBUILD_PATH = os.path.join(DATA_PATH, "linbuild.sh") # Settings REPO_BASE_URL = "https://download.qt.io/" diff --git a/qsc/data/linbuild.sh b/qsc/data/linbuild.sh new file mode 100644 index 0000000..5c570d7 --- /dev/null +++ b/qsc/data/linbuild.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# QSC (Qt SDK Creator) - A tool for automatically downloading, building and stripping down Qt +# Copyright (C) 2020 OatmealDome +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set -e + +../qt-everywhere-src-$RELEASE/configure \ + -opensource -confirm-license \ + -nomake examples -nomake tests \ + $QT_CONFIGURE_OPTIONS \ + -prefix $OUTNAME \ + $QT_PLATFORM + +make -j4 + +make install From 9a85edf38b0c631a844e7d01f0d4b2f48534aa03 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sat, 19 Feb 2022 02:51:43 -0500 Subject: [PATCH 4/6] main: Add check for gcc compiler suite --- qsc/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qsc/__main__.py b/qsc/__main__.py index edc8e64..83a973d 100644 --- a/qsc/__main__.py +++ b/qsc/__main__.py @@ -114,6 +114,10 @@ def install_jom(): os.putenv("VS_EDITION", compiler["edition"]) os.putenv("VCVARSALL", compiler.get("vcvarsall", "")) os.putenv("USE_VS", "1") + elif compiler["name"] == "gcc": + if not qsc.is_linux(): + print("Only supported on Linux!") + exit(1) else: print("Unknown compiler '{}'".format(compiler.name)) exit(1) From 9b49da96cdc72fc963c9fb686c0083e5344bd350 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sat, 19 Feb 2022 02:52:01 -0500 Subject: [PATCH 5/6] main: Run linbuild.sh for building --- qsc/__main__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qsc/__main__.py b/qsc/__main__.py index 83a973d..6a2a95d 100644 --- a/qsc/__main__.py +++ b/qsc/__main__.py @@ -176,6 +176,8 @@ def install_jom(): if qsc.is_windows(): os.system(qsc.WINBUILD_PATH) + elif qsc.is_linux(): + os.system(qsc.LINBUILD_PATH) else: print("Not supported yet, sorry :/") exit(1) From ef994c3f0412d5a492a75ae563b3877af252bba6 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sat, 14 May 2022 03:38:14 -0400 Subject: [PATCH 6/6] __init__: Update tarball name for open source releases --- qsc/__init__.py | 4 ++-- qsc/download.py | 2 +- qsc/extract.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qsc/__init__.py b/qsc/__init__.py index 6bc7f91..0897de6 100644 --- a/qsc/__init__.py +++ b/qsc/__init__.py @@ -33,8 +33,8 @@ def is_linux(): # Settings REPO_BASE_URL = "https://download.qt.io/" -REPO_SRC_PATH = "{0}/official_releases/qt/{1}/{2}/single/qt-everywhere-src-{2}.tar.xz" +REPO_SRC_PATH = "{0}/official_releases/qt/{1}/{2}/single/qt-everywhere-opensource-src-{2}.tar.xz" REPO_JOM_PATH = "{0}/official_releases/jom/jom.zip" USE_CACHE = True -USE_JOM = True \ No newline at end of file +USE_JOM = True diff --git a/qsc/download.py b/qsc/download.py index 273d784..53b98c8 100644 --- a/qsc/download.py +++ b/qsc/download.py @@ -33,7 +33,7 @@ def download_file(url, path): def download_release(release): url = source_url(release) - download_path = os.path.join("archives", "qt-everywhere-src-{}.tar.xz".format(release)) + download_path = os.path.join("archives", "qt-everywhere-opensource-src-{}.tar.xz".format(release)) print("Downloading Qt {}...".format(release), end="", flush=True) diff --git a/qsc/extract.py b/qsc/extract.py index a00ac4a..0179a59 100644 --- a/qsc/extract.py +++ b/qsc/extract.py @@ -23,7 +23,7 @@ import qsc def extract_release(release): - name = "qt-everywhere-src-{}".format(release) + name = "qt-everywhere-opensource-src-{}".format(release) tar_path = os.path.join("archives", name+".tar.xz")